Go to the documentation of this file.
11 #include <linux/module.h>
12 #include <linux/errno.h>
13 #include <linux/kernel.h>
17 #include <asm/uaccess.h>
20 #define NAME "nsc_gpio"
28 dev_info(amp->
dev,
"io%02u: 0x%04x %s %s %s %s %s %s %s\tio:%d/%d\n",
30 (config & 1) ?
"OE" :
"TS",
31 (config & 2) ?
"PP" :
"OD",
32 (config & 4) ?
"PUE" :
"PUD",
33 (config & 8) ?
"LOCKED" :
"",
34 (config & 16) ?
"LEVEL" :
"EDGE",
35 (config & 32) ?
"HI" :
"LO",
36 (config & 64) ?
"DEBOUNCE" :
"",
42 size_t len, loff_t *ppos)
44 unsigned m = iminor(file->
f_path.dentry->d_inode);
50 for (i = 0; i < len; ++
i) {
62 dev_dbg(dev,
"GPIO%d output enabled\n", m);
66 dev_dbg(dev,
"GPIO%d output disabled\n", m);
70 dev_dbg(dev,
"GPIO%d output is push pull\n", m);
74 dev_dbg(dev,
"GPIO%d output is open drain\n", m);
78 dev_dbg(dev,
"GPIO%d pull up enabled\n", m);
82 dev_dbg(dev,
"GPIO%d pull up disabled\n", m);
93 dev_err(dev,
"io%2d bad setting: chr<0x%2x>\n",
105 size_t len, loff_t * ppos)
107 unsigned m = iminor(file->
f_path.dentry->d_inode);
112 if (
put_user(value ?
'1' :
'0', buf))
123 static int __init nsc_gpio_init(
void)
129 static void __exit nsc_gpio_cleanup(
void)