From: "Richard Röjfors" <richard.rojfors.ext@mocean-labs.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
kwangwoo.lee@gmail.com,
Thierry Reding <thierry.reding@avionic-design.de>,
Trilok Soni <soni.trilok@gmail.com>
Subject: Re: [PATCH 2/2] tsc2007: reduced number of I2C transfers
Date: Fri, 24 Jul 2009 21:37:27 +0200 [thread overview]
Message-ID: <4A6A0D77.6000600@mocean-labs.com> (raw)
In-Reply-To: <20090724180022.GA6477@dtor-d630.eng.vmware.com>
On 7/24/09 8:00 PM, Dmitry Torokhov wrote:
> On Fri, Jul 24, 2009 at 06:14:37PM +0200, Richard Röjfors wrote:
>> 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<richard.rojfors.ext@mocean-labs.com>
>> ---
>> 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.
>
You are right, I think we should leave the patch like below, just get
rid of the unnecessary read during startup.
--Richard
Input: tsc2007: Do not read coordinated when probing driver
From: Richard Röjfors <richard.rojfors.ext@mocean-labs.com>
Don't read coordinates during probe of the driver, just powering down
the controller and wait for interrupts.
Signed-off-by: Richard Röjfors<richard.rojfors.ext@mocean-labs.com>
---
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 1056)
@@ -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) */
@@ -190,8 +196,7 @@
tsc->tc.z1 = tsc2007_xfer(tsc, READ_Z1);
tsc->tc.z2 = tsc2007_xfer(tsc, READ_Z2);
- /* power down */
- tsc2007_xfer(tsc, PWRDOWN);
+ tsc2007_power_down(tsc);
return 0;
}
@@ -305,7 +310,7 @@
input_set_abs_params(input_dev, ABS_Y, 0, MAX_12BIT, 0, 0);
input_set_abs_params(input_dev, ABS_PRESSURE, 0, MAX_12BIT, 0, 0);
- tsc2007_read_values(ts);
+ tsc2007_power_down(ts);
ts->irq = client->irq;
--
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
WARNING: multiple messages have this Message-ID (diff)
From: "Richard Röjfors" <richard.rojfors.ext@mocean-labs.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
kwangwoo.lee@gmail.com,
Thierry Reding <thierry.reding@avionic-design.de>,
Trilok Soni <soni.trilok@gmail.com>
Subject: Re: [PATCH 2/2] tsc2007: reduced number of I2C transfers
Date: Fri, 24 Jul 2009 21:37:27 +0200 [thread overview]
Message-ID: <4A6A0D77.6000600@mocean-labs.com> (raw)
In-Reply-To: <20090724180022.GA6477@dtor-d630.eng.vmware.com>
On 7/24/09 8:00 PM, Dmitry Torokhov wrote:
> On Fri, Jul 24, 2009 at 06:14:37PM +0200, Richard Röjfors wrote:
>> 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<richard.rojfors.ext@mocean-labs.com>
>> ---
>> 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.
>
You are right, I think we should leave the patch like below, just get
rid of the unnecessary read during startup.
--Richard
Input: tsc2007: Do not read coordinated when probing driver
From: Richard Röjfors <richard.rojfors.ext@mocean-labs.com>
Don't read coordinates during probe of the driver, just powering down
the controller and wait for interrupts.
Signed-off-by: Richard Röjfors<richard.rojfors.ext@mocean-labs.com>
---
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 1056)
@@ -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) */
@@ -190,8 +196,7 @@
tsc->tc.z1 = tsc2007_xfer(tsc, READ_Z1);
tsc->tc.z2 = tsc2007_xfer(tsc, READ_Z2);
- /* power down */
- tsc2007_xfer(tsc, PWRDOWN);
+ tsc2007_power_down(tsc);
return 0;
}
@@ -305,7 +310,7 @@
input_set_abs_params(input_dev, ABS_Y, 0, MAX_12BIT, 0, 0);
input_set_abs_params(input_dev, ABS_PRESSURE, 0, MAX_12BIT, 0, 0);
- tsc2007_read_values(ts);
+ tsc2007_power_down(ts);
ts->irq = client->irq;
next prev parent reply other threads:[~2009-07-24 19:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-24 16:14 [PATCH 2/2] tsc2007: reduced number of I2C transfers Richard Röjfors
2009-07-24 16:14 ` Richard Röjfors
2009-07-24 18:00 ` Dmitry Torokhov
2009-07-24 18:00 ` Dmitry Torokhov
2009-07-24 19:37 ` Richard Röjfors [this message]
2009-07-24 19:37 ` Richard Röjfors
2009-07-26 8:02 ` Dmitry Torokhov
2009-08-04 12:12 ` Richard Röjfors
2009-08-04 12:12 ` Richard Röjfors
2009-08-05 5:04 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A6A0D77.6000600@mocean-labs.com \
--to=richard.rojfors.ext@mocean-labs.com \
--cc=akpm@linux-foundation.org \
--cc=dmitry.torokhov@gmail.com \
--cc=kwangwoo.lee@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=soni.trilok@gmail.com \
--cc=thierry.reding@avionic-design.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.