aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/scx200_gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/scx200_gpio.c')
-rw-r--r--drivers/char/scx200_gpio.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/char/scx200_gpio.c b/drivers/char/scx200_gpio.c
index e6e52c48697b..a1a56c5c8a84 100644
--- a/drivers/char/scx200_gpio.c
+++ b/drivers/char/scx200_gpio.c
@@ -41,6 +41,7 @@ static ssize_t scx200_gpio_write(struct file *file, const char __user *data,
41{ 41{
42 unsigned m = iminor(file->f_dentry->d_inode); 42 unsigned m = iminor(file->f_dentry->d_inode);
43 size_t i; 43 size_t i;
44 int err = 0;
44 45
45 for (i = 0; i < len; ++i) { 46 for (i = 0; i < len; ++i) {
46 char c; 47 char c;
@@ -77,8 +78,23 @@ static ssize_t scx200_gpio_write(struct file *file, const char __user *data,
77 printk(KERN_INFO NAME ": GPIO%d pull up disabled\n", m); 78 printk(KERN_INFO NAME ": GPIO%d pull up disabled\n", m);
78 scx200_gpio_configure(m, ~4, 0); 79 scx200_gpio_configure(m, ~4, 0);
79 break; 80 break;
81
82 case 'v':
83 /* View Current pin settings */
84 scx200_gpio_dump(m);
85 break;
86 case '\n':
87 /* end of settings string, do nothing */
88 break;
89 default:
90 printk(KERN_ERR NAME
91 ": GPIO-%2d bad setting: chr<0x%2x>\n", m,
92 (int)c);
93 err++;
80 } 94 }
81 } 95 }
96 if (err)
97 return -EINVAL; /* full string handled, report error */
82 98
83 return len; 99 return len;
84} 100}