22 #include <linux/module.h>
24 #include <linux/sched.h>
27 #include <linux/slab.h>
30 #define DRV_NAME "heartbeat"
31 #define DRV_VERSION "0.1.2"
33 static unsigned char default_bit_pos[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
36 unsigned bit,
unsigned int inverted)
62 static void heartbeat_timer(
unsigned long data)
65 static unsigned bit = 0,
up = 1;
70 if ((bit == 0) || (bit == (hd->
nr_bits)-1))
84 dev_err(&pdev->
dev,
"invalid number of resources\n");
94 if (pdev->
dev.platform_data) {
95 hd = pdev->
dev.platform_data;
106 if (!pdev->
dev.platform_data)
118 for (i = 0; i < hd->
nr_bits; i++)
137 platform_set_drvdata(pdev, hd);
149 platform_set_drvdata(pdev,
NULL);
151 if (!pdev->
dev.platform_data)
158 .probe = heartbeat_drv_probe,
159 .remove = heartbeat_drv_remove,
165 static int __init heartbeat_init(
void)
171 static void __exit heartbeat_exit(
void)