+ chardev-gpio-for-scx200-pc-8736x-dispatch.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: dispatch via vtable

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

     chardev-gpio-for-scx200-pc-8736x-dispatch.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: dispatch via vtable
From: Jim Cromie <jim.cromie@xxxxxxxxx>


Now actually call the gpio operations thru the vtable.

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

 drivers/char/scx200_gpio.c |   24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff -puN drivers/char/scx200_gpio.c~chardev-gpio-for-scx200-pc-8736x-dispatch drivers/char/scx200_gpio.c
--- a/drivers/char/scx200_gpio.c~chardev-gpio-for-scx200-pc-8736x-dispatch
+++ a/drivers/char/scx200_gpio.c
@@ -53,6 +53,7 @@ static ssize_t scx200_gpio_write(struct 
 				 size_t len, loff_t *ppos)
 {
 	unsigned m = iminor(file->f_dentry->d_inode);
+	struct nsc_gpio_ops *amp = file->private_data;
 	size_t i;
 	int err = 0;
 
@@ -62,39 +63,39 @@ static ssize_t scx200_gpio_write(struct 
 			return -EFAULT;
 		switch (c) {
 		case '0':
-			scx200_gpio_set(m, 0);
+			amp->gpio_set(m, 0);
 			break;
 		case '1':
-			scx200_gpio_set(m, 1);
+			amp->gpio_set(m, 1);
 			break;
 		case 'O':
 			printk(KERN_INFO NAME ": GPIO%d output enabled\n", m);
-			scx200_gpio_configure(m, ~1, 1);
+			amp->gpio_config(m, ~1, 1);
 			break;
 		case 'o':
 			printk(KERN_INFO NAME ": GPIO%d output disabled\n", m);
-			scx200_gpio_configure(m, ~1, 0);
+			amp->gpio_config(m, ~1, 0);
 			break;
 		case 'T':
 			printk(KERN_INFO NAME ": GPIO%d output is push pull\n", m);
-			scx200_gpio_configure(m, ~2, 2);
+			amp->gpio_config(m, ~2, 2);
 			break;
 		case 't':
 			printk(KERN_INFO NAME ": GPIO%d output is open drain\n", m);
-			scx200_gpio_configure(m, ~2, 0);
+			amp->gpio_config(m, ~2, 0);
 			break;
 		case 'P':
 			printk(KERN_INFO NAME ": GPIO%d pull up enabled\n", m);
-			scx200_gpio_configure(m, ~4, 4);
+			amp->gpio_config(m, ~4, 4);
 			break;
 		case 'p':
 			printk(KERN_INFO NAME ": GPIO%d pull up disabled\n", m);
-			scx200_gpio_configure(m, ~4, 0);
+			amp->gpio_config(m, ~4, 0);
 			break;
 
 		case 'v':
 			/* View Current pin settings */
-			scx200_gpio_dump(m);
+			amp->gpio_dump(m);
 			break;
 		case '\n':
 			/* end of settings string, do nothing */
@@ -117,8 +118,9 @@ static ssize_t scx200_gpio_read(struct f
 {
 	unsigned m = iminor(file->f_dentry->d_inode);
 	int value;
+	struct nsc_gpio_ops *amp = file->private_data;
 
-	value = scx200_gpio_get(m);
+	value = amp->gpio_get(m);
 	if (put_user(value ? '1' : '0', buf))
 		return -EFAULT;
 
@@ -128,6 +130,8 @@ static ssize_t scx200_gpio_read(struct f
 static int scx200_gpio_open(struct inode *inode, struct file *file)
 {
 	unsigned m = iminor(inode);
+	file->private_data = &scx200_access;
+
 	if (m > 63)
 		return -EINVAL;
 	return nonseekable_open(inode, file);
_

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