Thread (6 messages) 6 messages, 2 authors, 2009-08-05

Re: [PATCH 2/2] tsc2007: reduced number of I2C transfers

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2009-07-24 18:00:32
Also in: lkml

On Fri, Jul 24, 2009 at 06:14:37PM +0200, Richard Röjfors wrote:
quoted hunk ↗ jump to hunk
Decreases the number of I2C transactions transferred by the driver.
During probe we don't need to ask for the coordinates from the controller.
When polling the controller we don't need to power down and enable IRQ  
if we are going to poll again.

Signed-off-by: Richard Röjfors <redacted>
---
Index: linux-2.6.31-rc2/drivers/input/touchscreen/tsc2007.c
===================================================================
--- linux-2.6.31-rc2/drivers/input/touchscreen/tsc2007.c	(revision 1040)
+++ linux-2.6.31-rc2/drivers/input/touchscreen/tsc2007.c	(revision 1053)
@@ -178,6 +178,12 @@
 		ts->penstate = PEN_STATE_UP;
 }

+static void tsc2007_power_down(struct tsc2007 *tsc)
+{
+	/* power down */
+	tsc2007_xfer(tsc, PWRDOWN);
+}
+
 static int tsc2007_read_values(struct tsc2007 *tsc)
 {
 	/* y- still on; turn on only y+ (and ADC) */
@@ -188,11 +194,8 @@

 	/* turn y+ off, x- on; we'll use formula #1 */
 	tsc->tc.z1 = tsc2007_xfer(tsc, READ_Z1);
-	tsc->tc.z2 = tsc2007_xfer(tsc, READ_Z2);
+	tsc->tc.z2 = tsc2007_xfer(tsc, READ_Z2 | TSC2007_POWER_OFF_IRQ_EN);
I think this leaves the controller powered on and with with PENIRQ
disabled.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help