summaryrefslogtreecommitdiff
path: root/io-module/mts_supercap.h
diff options
context:
space:
mode:
Diffstat (limited to 'io-module/mts_supercap.h')
-rw-r--r--io-module/mts_supercap.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/io-module/mts_supercap.h b/io-module/mts_supercap.h
new file mode 100644
index 0000000..79ea7df
--- /dev/null
+++ b/io-module/mts_supercap.h
@@ -0,0 +1,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_ */