linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch 0/2] ads7846: small improvements
@ 2009-05-18 18:23 Michael Roth
  2009-05-18 18:23 ` [PATCH 1/2] Input: ads7846 - more detailed model name in sysfs Michael Roth
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael Roth @ 2009-05-18 18:23 UTC (permalink / raw)
  To: linux-input; +Cc: dtor, imre.deak, mroth

Hello,

two small improvements for the ads7846 driver:

 a.) a tad more detailed sysfs information
 b.) enable swapping of x and y axes

Please CC me, I'm not on linux-input@vger.kernel.org.


Michael Roth




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

* [PATCH 1/2] Input: ads7846 - more detailed model name in sysfs
  2009-05-18 18:23 [Patch 0/2] ads7846: small improvements Michael Roth
@ 2009-05-18 18:23 ` Michael Roth
  2009-05-18 18:23 ` [PATCH 2/2] Input: ads7846 - support to swap x and y axes Michael Roth
  2009-05-20  2:29 ` [Patch 0/2] ads7846: small improvements Dmitry Torokhov
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Roth @ 2009-05-18 18:23 UTC (permalink / raw)
  To: linux-input; +Cc: dtor, imre.deak, mroth

Signed-off-by: Michael Roth <mroth@nessie.de>
---
 drivers/input/touchscreen/ads7846.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 4f190dc..642f37d 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -83,6 +83,7 @@ struct ads7846_packet {
 struct ads7846 {
 	struct input_dev	*input;
 	char			phys[32];
+	char			name[32];
 
 	struct spi_device	*spi;
 
@@ -958,8 +959,9 @@ static int __devinit ads7846_probe(struct spi_device *spi)
 	ts->wait_for_sync = pdata->wait_for_sync ? : null_wait_for_sync;
 
 	snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(&spi->dev));
+	snprintf(ts->name, sizeof(ts->name), "ADS%d Touchscreen", ts->model);
 
-	input_dev->name = "ADS784x Touchscreen";
+	input_dev->name = ts->name;
 	input_dev->phys = ts->phys;
 	input_dev->dev.parent = &spi->dev;
 
-- 
1.6.0.6


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

* [PATCH 2/2] Input: ads7846 - support to swap x and y axes
  2009-05-18 18:23 [Patch 0/2] ads7846: small improvements Michael Roth
  2009-05-18 18:23 ` [PATCH 1/2] Input: ads7846 - more detailed model name in sysfs Michael Roth
@ 2009-05-18 18:23 ` Michael Roth
  2009-05-20  2:29 ` [Patch 0/2] ads7846: small improvements Dmitry Torokhov
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Roth @ 2009-05-18 18:23 UTC (permalink / raw)
  To: linux-input; +Cc: dtor, imre.deak, mroth

Signed-off-by: Michael Roth <mroth@nessie.de>
---
 drivers/input/touchscreen/ads7846.c |    7 +++++++
 include/linux/spi/ads7846.h         |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 642f37d..95f1f2e 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -98,6 +98,8 @@ struct ads7846 {
 	u16			x_plate_ohms;
 	u16			pressure_max;
 
+	bool			swap_xy;
+
 	struct ads7846_packet	*packet;
 
 	struct spi_transfer	xfer[18];
@@ -600,6 +602,10 @@ static void ads7846_rx(void *ads)
 			dev_dbg(&ts->spi->dev, "DOWN\n");
 #endif
 		}
+
+		if (ts->swap_xy)
+			swap(x, y);
+
 		input_report_abs(input, ABS_X, x);
 		input_report_abs(input, ABS_Y, y);
 		input_report_abs(input, ABS_PRESSURE, Rt);
@@ -918,6 +924,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
 	ts->spi = spi;
 	ts->input = input_dev;
 	ts->vref_mv = pdata->vref_mv;
+	ts->swap_xy = pdata->swap_xy;
 
 	hrtimer_init(&ts->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 	ts->timer.function = ads7846_timer;
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h
index 2ea2032..51948eb 100644
--- a/include/linux/spi/ads7846.h
+++ b/include/linux/spi/ads7846.h
@@ -17,6 +17,7 @@ struct ads7846_platform_data {
 	u16	vref_mv;		/* external vref value, milliVolts */
 	bool	keep_vref_on;		/* set to keep vref on for differential
 					 * measurements as well */
+	bool	swap_xy;		/* swap x and y axes */
 
 	/* Settling time of the analog signals; a function of Vcc and the
 	 * capacitance on the X/Y drivers.  If set to non-zero, two samples
-- 
1.6.0.6


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

* Re: [Patch 0/2] ads7846: small improvements
  2009-05-18 18:23 [Patch 0/2] ads7846: small improvements Michael Roth
  2009-05-18 18:23 ` [PATCH 1/2] Input: ads7846 - more detailed model name in sysfs Michael Roth
  2009-05-18 18:23 ` [PATCH 2/2] Input: ads7846 - support to swap x and y axes Michael Roth
@ 2009-05-20  2:29 ` Dmitry Torokhov
  2 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2009-05-20  2:29 UTC (permalink / raw)
  To: Michael Roth; +Cc: linux-input, imre.deak

On Mon, May 18, 2009 at 08:23:11PM +0200, Michael Roth wrote:
> Hello,
> 
> two small improvements for the ads7846 driver:
> 
>  a.) a tad more detailed sysfs information
>  b.) enable swapping of x and y axes
> 
> Please CC me, I'm not on linux-input@vger.kernel.org.
> 

Applied both to the 'next' branch, thank you Michael.

-- 
Dmitry

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

end of thread, other threads:[~2009-05-20  2:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-18 18:23 [Patch 0/2] ads7846: small improvements Michael Roth
2009-05-18 18:23 ` [PATCH 1/2] Input: ads7846 - more detailed model name in sysfs Michael Roth
2009-05-18 18:23 ` [PATCH 2/2] Input: ads7846 - support to swap x and y axes Michael Roth
2009-05-20  2:29 ` [Patch 0/2] ads7846: small improvements Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).