blob: 79ea7df0af13879cf79a8bfc8d53986b03f272a4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#ifndef IO_MODULE_SUPERCAP_H_
#define IO_MODULE_SUPERCAP_H_
#include <linux/workqueue.h>
#include <linux/pid.h>
#include "mts_io.h"
#include "mts_io_module.h"
#define SUPERCAP_CHECKS_PER_SEC 10
#define SUPERCAP_CHECK_INTERVAL (HZ / SUPERCAP_CHECKS_PER_SEC)
#define SUPERCAP_TOTAL_INTERVALS 50 /* 5s */
typedef struct supercap_info {
char name[32];
char label_monitor[32];
/* PID to notify */
pid_t pid;
/* signal to send */
int signal;
/* internal fields used in worker*/
int pwf_count; /* count of intervals in worker */
int pin_is_one; /* count of number of times pin has been set to one */
} supercap_info_t, *supercap_info_pt;
extern void init_supercap_worker(void);
extern void cleanup_sepercap_worker(void);
extern ssize_t mts_attr_show_supercap_monitor(struct device *dev,
struct device_attribute *attr,
char *buf);
extern ssize_t mts_attr_store_supercap_monitor(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count);
extern struct device_attribute dev_attr_supercap_monitor;
#endif /* IO_MODULE_SUPERCAP_H_ */
|