+ chardev-gpio-for-scx200-pc-8736x-add-v-command.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     chardev: GPIO for SCx200 & PC-8736x: add 'v' command to device-file

has been added to the -mm tree.  Its filename is

     chardev-gpio-for-scx200-pc-8736x-add-v-command.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: chardev: GPIO for SCx200 & PC-8736x: add 'v' command to device-file
From: Jim Cromie <jim.cromie@xxxxxxxxx>


Add a new driver command: 'v' which calls gpio_dump() on the pin.  The output
goes to the log, like all other INFO messages in the original driver.  Giving
the user control over the feedback they 'need' is construed to be a
user-friendly feature, and allows us (later) to dial down many INFO messages
to DEBUG log-level.

Signed-off-by: Jim Cromie <jim.cromie@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/i386/kernel/scx200.c  |    3 +--
 drivers/char/scx200_gpio.c |   16 ++++++++++++++++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff -puN arch/i386/kernel/scx200.c~chardev-gpio-for-scx200-pc-8736x-add-v-command arch/i386/kernel/scx200.c
--- a/arch/i386/kernel/scx200.c~chardev-gpio-for-scx200-pc-8736x-add-v-command
+++ a/arch/i386/kernel/scx200.c
@@ -105,7 +105,6 @@ u32 scx200_gpio_configure(unsigned index
 	return config;
 }
 
-#if 0
 void scx200_gpio_dump(unsigned index)
 {
         u32 config = scx200_gpio_configure(index, ~0, 0);
@@ -120,7 +119,6 @@ void scx200_gpio_dump(unsigned index)
                (config & 32) ? "HI"     : "LO",		/* trigger on rising/falling edge */
                (config & 64) ? "DEBOUNCE" : "");	/* debounce */
 }
-#endif  /*  0  */
 
 static int __init scx200_init(void)
 {
@@ -141,4 +139,5 @@ module_exit(scx200_cleanup);
 EXPORT_SYMBOL(scx200_gpio_base);
 EXPORT_SYMBOL(scx200_gpio_shadow);
 EXPORT_SYMBOL(scx200_gpio_configure);
+EXPORT_SYMBOL(scx200_gpio_dump);
 EXPORT_SYMBOL(scx200_cb_base);
diff -puN drivers/char/scx200_gpio.c~chardev-gpio-for-scx200-pc-8736x-add-v-command drivers/char/scx200_gpio.c
--- a/drivers/char/scx200_gpio.c~chardev-gpio-for-scx200-pc-8736x-add-v-command
+++ a/drivers/char/scx200_gpio.c
@@ -41,6 +41,7 @@ static ssize_t scx200_gpio_write(struct 
 {
 	unsigned m = iminor(file->f_dentry->d_inode);
 	size_t i;
+	int err = 0;
 
 	for (i = 0; i < len; ++i) {
 		char c;
@@ -77,8 +78,23 @@ static ssize_t scx200_gpio_write(struct 
 			printk(KERN_INFO NAME ": GPIO%d pull up disabled\n", m);
 			scx200_gpio_configure(m, ~4, 0);
 			break;
+
+		case 'v':
+			/* View Current pin settings */
+			scx200_gpio_dump(m);
+			break;
+		case '\n':
+			/* end of settings string, do nothing */
+			break;
+		default:
+			printk(KERN_ERR NAME
+			       ": GPIO-%2d bad setting: chr<0x%2x>\n", m,
+			       (int)c);
+			err++;
 		}
 	}
+	if (err)
+		return -EINVAL;	/* full string handled, report error */
 
 	return len;
 }
_

Patches currently in -mm which might be from jim.cromie@xxxxxxxxx are

chardev-gpio-for-scx200-pc-8736x-whitespace.patch
chardev-gpio-for-scx200-pc-8736x-modernize.patch
chardev-gpio-for-scx200-pc-8736x-add-platforn_device.patch
chardev-gpio-for-scx200-pc-8736x-device-minor.patch
chardev-gpio-for-scx200-pc-8736x-put-gpio_dump.patch
chardev-gpio-for-scx200-pc-8736x-add-v-command.patch
chardev-gpio-for-scx200-pc-8736x-refactor-scx200_probe.patch
chardev-gpio-for-scx200-pc-8736x-add-gpio-ops.patch
chardev-gpio-for-scx200-pc-8736x-dispatch.patch
chardev-gpio-for-scx200-pc-8736x-add-empty.patch
chardev-gpio-for-scx200-pc-8736x-migrate-file-ops.patch
chardev-gpio-for-scx200-pc-8736x-migrate-gpio_dump.patch
chardev-gpio-for-scx200-pc-8736x-add-new-pc8736x_gpio.patch
chardev-gpio-for-scx200-pc-8736x-add-platform_device.patch
chardev-gpio-for-scx200-pc-8736x-use-dev_dbg.patch
chardev-gpio-for-scx200-pc-8736x-fix-gpio_current.patch
chardev-gpio-for-scx200-pc-8736x-replace-spinlocks.patch
chardev-gpio-for-scx200-pc-8736x-display-pin.patch
chardev-gpio-for-scx200-pc-8736x-add-proper.patch
chardev-gpio-for-scx200-pc-8736x-add-sysfs-gpio.patch
generic-time-add-macro-to-simplify-hide-mask.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux