All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ads7846: enable usage of internal vref for AD7873
@ 2012-05-29 15:22 Markus Niebel
  2012-05-30 12:45 ` Michael Hennerich
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Niebel @ 2012-05-29 15:22 UTC (permalink / raw)
  To: michael.hennerich; +Cc: dmitry.torokhov, linux-input

Touchscreen samples are taken in differential mode.
Therefore an external reference is not needed.
When working with internal vref disabling vref after
every touchscreen sample leads to settling effects in sampling
and errors in position data.

This patch disables the internal vref only if keep_vref_on us
is not set in platform_data.

Tested on i.MX35 with costum board


Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
---
 drivers/input/touchscreen/ads7846.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index f02028e..b271633 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -1001,15 +1001,14 @@ static void __devinit ads7846_setup_spi_msg(struct ads7846 *ts,
 	struct ads7846_packet *packet = ts->packet;
 	int vref = pdata->keep_vref_on;
 
-	if (ts->model == 7873) {
+	if (ts->model == 7873)
 		/*
 		 * The AD7873 is almost identical to the ADS7846
-		 * keep VREF off during differential/ratiometric
-		 * conversion modes.
+		 * set VREF off during differential/ratiometric
+		 * conversion modes if keep_vref_on is not set.
+		 * TODO: does keep_vref_on collide with usage of external vref?
 		 */
 		ts->model = 7846;
-		vref = 0;
-	}
 
 	ts->msg_count = 1;
 	spi_message_init(m);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ads7846: enable usage of internal vref for AD7873
  2012-05-29 15:22 [PATCH] ads7846: enable usage of internal vref for AD7873 Markus Niebel
@ 2012-05-30 12:45 ` Michael Hennerich
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Hennerich @ 2012-05-30 12:45 UTC (permalink / raw)
  To: Markus Niebel; +Cc: dmitry.torokhov, linux-input

On 05/29/2012 05:22 PM, Markus Niebel wrote:
> Touchscreen samples are taken in differential mode.
> Therefore an external reference is not needed.
> When working with internal vref disabling vref after
> every touchscreen sample leads to settling effects in sampling
> and errors in position data.
>
> This patch disables the internal vref only if keep_vref_on us
> is not set in platform_data.
>
> Tested on i.MX35 with costum board
>
>
> Signed-off-by: Markus Niebel<Markus.Niebel@tqs.de>
> ---
>   drivers/input/touchscreen/ads7846.c |    9 ++++-----
>   1 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
> index f02028e..b271633 100644
> --- a/drivers/input/touchscreen/ads7846.c
> +++ b/drivers/input/touchscreen/ads7846.c
> @@ -1001,15 +1001,14 @@ static void __devinit ads7846_setup_spi_msg(struct ads7846 *ts,
>          struct ads7846_packet *packet = ts->packet;
>          int vref = pdata->keep_vref_on;
>
> -       if (ts->model == 7873) {
> +       if (ts->model == 7873)
>                  /*
>                   * The AD7873 is almost identical to the ADS7846
> -                * keep VREF off during differential/ratiometric
> -                * conversion modes.
> +                * set VREF off during differential/ratiometric
> +                * conversion modes if keep_vref_on is not set.
> +                * TODO: does keep_vref_on collide with usage of external vref?
>                   */
>                  ts->model = 7846;
> -               vref = 0;
> -       }

I would scrap this section from ads7846_setup_spi_msg() completely
and force ts->model to 7846 in ads7846_probe() when 7873 is specified.

>
>          ts->msg_count = 1;
>          spi_message_init(m);
> --
> 1.7.0.4
>


-- 
Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-30 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-29 15:22 [PATCH] ads7846: enable usage of internal vref for AD7873 Markus Niebel
2012-05-30 12:45 ` Michael Hennerich

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.