diff options
author | Jeff Hatch <jhatch@multitech.com> | 2020-11-16 15:56:21 -0600 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2020-11-23 14:22:34 -0600 |
commit | febfbaa141125c24d3a40e17034261c5354a0973 (patch) | |
tree | d16d84058fb005e0e5262b1a0bd16d63cd6c08f1 /io-module/mts_supercap.h | |
parent | e8af5a62cb51f9bca1900c17b021cf5bc240c029 (diff) | |
download | mts-io-febfbaa141125c24d3a40e17034261c5354a0973.tar.gz mts-io-febfbaa141125c24d3a40e17034261c5354a0973.tar.bz2 mts-io-febfbaa141125c24d3a40e17034261c5354a0973.zip |
Add supercap_worker to handle supercap gpio and signal supercap-monitor
Diffstat (limited to 'io-module/mts_supercap.h')
-rw-r--r-- | io-module/mts_supercap.h | 42 |
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_ */ |