[oe-commits] org.oe.dev linux: SIMpad ucb1x00 switches driver code beautification - close #1920

Bernhard commit openembedded-commits at lists.openembedded.org
Sun Mar 11 14:11:56 UTC 2007


linux: SIMpad ucb1x00 switches driver code beautification - close #1920

Author: Bernhard
Branch: org.openembedded.dev
Revision: ccbbf95d21d99ceeb1ff4499e3e502f86ff66645
ViewMTN: http://monotone.openembedded.org/revision.psp?id=ccbbf95d21d99ceeb1ff4499e3e502f86ff66645
Files:
1
packages/linux/linux/simpad/linux-2.6.20.SIMpad.ucb1x00-switches.patch
packages/linux/linux_2.6.20.bb
Diffs:

#
# mt diff -r825b6b74b3aaf97f2a962ba0c555d34071148b17 -rccbbf95d21d99ceeb1ff4499e3e502f86ff66645
#
# 
# 
# patch "packages/linux/linux/simpad/linux-2.6.20.SIMpad.ucb1x00-switches.patch"
#  from [354927bc0a3cf1ce8b298083d5f3dfb40909daed]
#    to [b12d99236992d2bf92aa7438cad0befb7a5b34d6]
# 
# patch "packages/linux/linux_2.6.20.bb"
#  from [34023522f8dcd14472b634662e581b2958cf7ce4]
#    to [551da0ee4fce7847c969e84bf54b0b0169d3f2f7]
# 
============================================================
--- packages/linux/linux/simpad/linux-2.6.20.SIMpad.ucb1x00-switches.patch	354927bc0a3cf1ce8b298083d5f3dfb40909daed
+++ packages/linux/linux/simpad/linux-2.6.20.SIMpad.ucb1x00-switches.patch	b12d99236992d2bf92aa7438cad0befb7a5b34d6
@@ -1,6 +1,6 @@ diff -uNr linux-2.6.20.vanilla/drivers/m
 diff -uNr linux-2.6.20.vanilla/drivers/mfd/Kconfig linux-2.6.20/drivers/mfd/Kconfig
 --- linux-2.6.20.vanilla/drivers/mfd/Kconfig	2007-02-10 19:01:56.000000000 +0100
-+++ linux-2.6.20/drivers/mfd/Kconfig	2007-02-14 16:30:15.000000000 +0100
++++ linux-2.6.20/drivers/mfd/Kconfig	2007-02-28 16:36:01.000000000 +0100
 @@ -23,4 +23,7 @@
  	tristate "Touchscreen interface support"
  	depends on MCP_UCB1200 && INPUT
@@ -11,7 +11,7 @@ diff -uNr linux-2.6.20.vanilla/drivers/m
  endmenu
 diff -uNr linux-2.6.20.vanilla/drivers/mfd/Makefile linux-2.6.20/drivers/mfd/Makefile
 --- linux-2.6.20.vanilla/drivers/mfd/Makefile	2007-02-10 19:01:56.000000000 +0100
-+++ linux-2.6.20/drivers/mfd/Makefile	2007-02-14 16:30:15.000000000 +0100
++++ linux-2.6.20/drivers/mfd/Makefile	2007-02-28 16:36:01.000000000 +0100
 @@ -6,7 +6,7 @@
  obj-$(CONFIG_MCP_SA11X0)	+= mcp-sa11x0.o
  obj-$(CONFIG_MCP_UCB1200)	+= ucb1x00-core.o
@@ -23,8 +23,8 @@ diff -uNr linux-2.6.20.vanilla/drivers/m
  endif
 diff -uNr linux-2.6.20.vanilla/drivers/mfd/ucb1x00-switches.c linux-2.6.20/drivers/mfd/ucb1x00-switches.c
 --- linux-2.6.20.vanilla/drivers/mfd/ucb1x00-switches.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.20/drivers/mfd/ucb1x00-switches.c	2007-02-14 16:32:57.000000000 +0100
-@@ -0,0 +1,204 @@
++++ linux-2.6.20/drivers/mfd/ucb1x00-switches.c	2007-02-28 16:36:43.000000000 +0100
+@@ -0,0 +1,162 @@
 +/*
 + *  linux/drivers/mfd/ucb1x00-switches.c
 + *
@@ -52,6 +52,8 @@ diff -uNr linux-2.6.20.vanilla/drivers/m
 +
 +#include "ucb1x00.h"
 +
++static int key [6] = { KEY_PROG1,KEY_PROG2,KEY_UP,KEY_DOWN,KEY_LEFT,KEY_RIGHT };
++
 +struct ucb1x00_switches {
 +	struct input_dev	*idev;
 +	struct ucb1x00		*ucb;
@@ -63,6 +65,7 @@ diff -uNr linux-2.6.20.vanilla/drivers/m
 +	unsigned short int this;	
 +	struct ucb1x00_switches *switches = id;
 +	struct input_dev *idev = switches->idev;
++	
 +	ucb1x00_enable(switches->ucb);
 +	
 +	this=~ucb1x00_io_read(switches->ucb);
@@ -71,61 +74,16 @@ diff -uNr linux-2.6.20.vanilla/drivers/m
 +	}
 +
 +	last=this;
-+	switch (idx) {
-+
-+	case 0:
-+
-+		if 
-+			((this & (1<<0)) != 0) input_report_key(idev, KEY_PROG1, 1);
-+		else 
-+			input_report_key(idev, KEY_PROG1, 0);
-+		break;
-+
-+	case 1:
-+
-+		if 
-+			((this & (1<<1)) != 0) input_report_key(idev, KEY_PROG2, 1);
-+		else 
-+			input_report_key(idev, KEY_PROG2, 0);
-+		break;
-+
-+	case 2:
-+
-+		if 
-+			((this & (1<<2)) != 0) input_report_key(idev, KEY_UP, 1); 
-+		else 
-+			input_report_key(idev, KEY_UP, 0); 
-+		break;
-+
-+	case 3:
-+
-+		if 
-+			((this & (1<<3)) != 0) input_report_key(idev, KEY_DOWN, 1); 
-+		else 
-+			input_report_key(idev, KEY_DOWN, 0); 
-+		break;
-+
-+	case 4:
-+
-+		if 
-+			((this & (1<<4)) != 0) input_report_key(idev, KEY_LEFT, 1);
-+		else 
-+			input_report_key(idev, KEY_LEFT, 0);
-+		break;
-+
-+	case 5:
-+
-+		if 
-+			((this & (1<<5)) != 0) input_report_key(idev, KEY_RIGHT, 1);
-+		else 
-+			input_report_key(idev, KEY_RIGHT, 0);
-+		break;
-+
-+	default:
-+
++	
++	if ((idx >=0) && (idx <=5)) {
++		if ((this & (1<<idx)) != 0) input_report_key(idev, key[idx], 1);
++			else input_report_key(idev, key[idx], 0);
++	}
++	else {
 +		printk(KERN_DEBUG "switches-ucb1x00 is BUGGY!!! \n");
-+		
++		return;
 +	}	
++	
 +}
 +
 +static int ucb1x00_switches_add(struct ucb1x00_dev *dev)
============================================================
--- packages/linux/linux_2.6.20.bb	34023522f8dcd14472b634662e581b2958cf7ce4
+++ packages/linux/linux_2.6.20.bb	551da0ee4fce7847c969e84bf54b0b0169d3f2f7
@@ -1,7 +1,7 @@ LICENSE = "GPL"
 DESCRIPTION = "Linux Kernel"
 SECTION = "kernel"
 LICENSE = "GPL"
-PR = "r2"
+PR = "r3"
 
 SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2 \
            file://defconfig"






More information about the Openembedded-commits mailing list