8 #include <linux/device.h>
10 #include <linux/module.h>
11 #include <linux/errno.h>
12 #include <linux/kernel.h>
15 #include <asm/uaccess.h>
18 #include <linux/types.h>
24 #define DRVNAME "scx200_gpio"
42 .gpio_get = scx200_gpio_get,
43 .gpio_set = scx200_gpio_set,
44 .gpio_change = scx200_gpio_change,
45 .gpio_current = scx200_gpio_current
51 unsigned m = iminor(inode);
59 static int scx200_gpio_release(
struct inode *inode,
struct file *file)
68 .open = scx200_gpio_open,
69 .release = scx200_gpio_release,
73 static struct cdev scx200_gpio_cdev;
75 static int __init scx200_gpio_init(
void)
95 scx200_gpio_ops.
dev = &pdev->
dev;
98 devid =
MKDEV(major, 0);
105 dev_err(&pdev->
dev,
"SCx200 chrdev_region err: %d\n", rc);
106 goto undo_platform_device_add;
109 cdev_init(&scx200_gpio_cdev, &scx200_gpio_fileops);
114 undo_platform_device_add:
122 static void __exit scx200_gpio_cleanup(
void)