linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] wm97xx-core: Report a phys for WM97xx touchscreens
@ 2008-05-26 13:42 Mark Brown
  2008-05-26 13:42 ` [PATCH 2/4] wm97xx-core: Fix driver name Mark Brown
  2008-05-27  5:54 ` [PATCH 1/4] wm97xx-core: Report a phys for WM97xx touchscreens Dmitry Torokhov
  0 siblings, 2 replies; 5+ messages in thread
From: Mark Brown @ 2008-05-26 13:42 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Rodolfo Giometti, linux-input, linux-kernel, akpm, Mark Brown

phys is displayed in diagnostic output like that from evbug so ensure
that it is set to something.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/input/touchscreen/wm97xx-core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index e9c7ea4..ba6fb28 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -616,6 +616,7 @@ static int wm97xx_probe(struct device *dev)
 
 	/* set up touch configuration */
 	wm->input_dev->name = "wm97xx touchscreen";
+	wm->input_dev->phys = "wm97xx";
 	wm->input_dev->open = wm97xx_ts_input_open;
 	wm->input_dev->close = wm97xx_ts_input_close;
 	set_bit(EV_ABS, wm->input_dev->evbit);
-- 
1.5.5.1

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

* [PATCH 2/4] wm97xx-core: Fix driver name
  2008-05-26 13:42 [PATCH 1/4] wm97xx-core: Report a phys for WM97xx touchscreens Mark Brown
@ 2008-05-26 13:42 ` Mark Brown
  2008-05-26 13:42   ` [PATCH 3/4] wm97xx-core: Fix race on PHY init Mark Brown
  2008-05-27  5:54 ` [PATCH 1/4] wm97xx-core: Report a phys for WM97xx touchscreens Dmitry Torokhov
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2008-05-26 13:42 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Rodolfo Giometti, linux-input, linux-kernel, akpm, Mark Brown

Fix driver name - thanks to Guennadi Liakhovetski <g.liakhovetski@gmx.de> for
reporting this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/input/touchscreen/wm97xx-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index ba6fb28..8a00918 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -802,7 +802,7 @@ void wm97xx_unregister_mach_ops(struct wm97xx *wm)
 EXPORT_SYMBOL_GPL(wm97xx_unregister_mach_ops);
 
 static struct device_driver wm97xx_driver = {
-	.name =		"ac97",
+	.name =		"wm97xx-ts",
 	.bus =		&ac97_bus_type,
 	.owner =	THIS_MODULE,
 	.probe =	wm97xx_probe,
-- 
1.5.5.1

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

* [PATCH 3/4] wm97xx-core: Fix race on PHY init
  2008-05-26 13:42 ` [PATCH 2/4] wm97xx-core: Fix driver name Mark Brown
@ 2008-05-26 13:42   ` Mark Brown
  2008-05-26 13:42     ` [PATCH 4/4] wm9713: Support five wire panels Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2008-05-26 13:42 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Rodolfo Giometti, linux-input, linux-kernel, akpm, Mark Brown

The chip phy_init() function must be called before the dig_enable() function
but dig_enable() is called when the device is opened and we only call
phy_init() after having reigstered the device, meaning the two can race.
Fix this by doing the phy_init() before we register the input device.

Thanks to Rodolfo Giometti <giometti@enneenne.com> for the report.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/input/touchscreen/wm97xx-core.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index 8a00918..cdc24ad 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -608,6 +608,17 @@ static int wm97xx_probe(struct device *dev)
 		goto alloc_err;
 	}
 
+	/* set up physical characteristics */
+	wm->codec->phy_init(wm);
+
+	/* load gpio cache */
+	wm->gpio[0] = wm97xx_reg_read(wm, AC97_GPIO_CFG);
+	wm->gpio[1] = wm97xx_reg_read(wm, AC97_GPIO_POLARITY);
+	wm->gpio[2] = wm97xx_reg_read(wm, AC97_GPIO_STICKY);
+	wm->gpio[3] = wm97xx_reg_read(wm, AC97_GPIO_WAKEUP);
+	wm->gpio[4] = wm97xx_reg_read(wm, AC97_GPIO_STATUS);
+	wm->gpio[5] = wm97xx_reg_read(wm, AC97_MISC_AFE);
+
 	wm->input_dev = input_allocate_device();
 	if (wm->input_dev == NULL) {
 		ret = -ENOMEM;
@@ -635,17 +646,6 @@ static int wm97xx_probe(struct device *dev)
 	if (ret < 0)
 		goto dev_alloc_err;
 
-	/* set up physical characteristics */
-	wm->codec->phy_init(wm);
-
-	/* load gpio cache */
-	wm->gpio[0] = wm97xx_reg_read(wm, AC97_GPIO_CFG);
-	wm->gpio[1] = wm97xx_reg_read(wm, AC97_GPIO_POLARITY);
-	wm->gpio[2] = wm97xx_reg_read(wm, AC97_GPIO_STICKY);
-	wm->gpio[3] = wm97xx_reg_read(wm, AC97_GPIO_WAKEUP);
-	wm->gpio[4] = wm97xx_reg_read(wm, AC97_GPIO_STATUS);
-	wm->gpio[5] = wm97xx_reg_read(wm, AC97_MISC_AFE);
-
 	/* register our battery device */
 	wm->battery_dev = platform_device_alloc("wm97xx-battery", -1);
 	if (!wm->battery_dev) {
-- 
1.5.5.1


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

* [PATCH 4/4] wm9713: Support five wire panels
  2008-05-26 13:42   ` [PATCH 3/4] wm97xx-core: Fix race on PHY init Mark Brown
@ 2008-05-26 13:42     ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2008-05-26 13:42 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Rodolfo Giometti, linux-input, linux-kernel, akpm, Mark Brown

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/input/touchscreen/wm9713.c |   22 ++++++++++++++++++++++
 include/linux/wm97xx.h             |    1 +
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/wm9713.c b/drivers/input/touchscreen/wm9713.c
index 01278bd..8384587 100644
--- a/drivers/input/touchscreen/wm9713.c
+++ b/drivers/input/touchscreen/wm9713.c
@@ -85,6 +85,15 @@ module_param(delay, int, 0);
 MODULE_PARM_DESC(delay, "Set adc sample delay.");
 
 /*
+ * Set five_wire = 1 to use a 5 wire touchscreen.
+ *
+ * NOTE: Five wire mode does not allow for readback of pressure.
+ */
+static int five_wire;
+module_param(five_wire, int, 0);
+MODULE_PARM_DESC(five_wire, "Set to '1' to use 5-wire touchscreen.");
+
+/*
  * Set adc mask function.
  *
  * Sources of glitch noise, such as signals driving an LCD display, may feed
@@ -162,6 +171,19 @@ static void wm9713_phy_init(struct wm97xx *wm)
 			 64000 / rpu);
 	}
 
+	/* Five wire panel? */
+	if (five_wire) {
+		dig3 |= WM9713_45W;
+		dev_info(wm->dev, "setting 5-wire touchscreen mode.");
+
+		if (pil) {
+			dev_warn(wm->dev,
+				 "Pressure measurement not supported in 5 "
+				 "wire mode, disabling\n");
+			pil = 0;
+		}
+	}
+
 	/* touchpanel pressure */
 	if (pil == 2) {
 		dig3 |= WM9712_PIL;
diff --git a/include/linux/wm97xx.h b/include/linux/wm97xx.h
index 4d13732..6f69968 100644
--- a/include/linux/wm97xx.h
+++ b/include/linux/wm97xx.h
@@ -100,6 +100,7 @@
 #define WM9713_ADCSEL_Y		0x0004	/* Y measurement */
 #define WM9713_ADCSEL_PRES	0x0008	/* Pressure measurement */
 #define WM9713_COO		0x0001	/* enable coordinate mode */
+#define WM9713_45W		0x1000  /* set for 5 wire panel */
 #define WM9713_PDEN		0x0800	/* measure only when pen down */
 #define WM9713_ADCSEL_MASK	0x00fe	/* ADC selection mask */
 #define WM9713_WAIT		0x0200	/* coordinate wait */
-- 
1.5.5.1


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

* Re: [PATCH 1/4] wm97xx-core: Report a phys for WM97xx touchscreens
  2008-05-26 13:42 [PATCH 1/4] wm97xx-core: Report a phys for WM97xx touchscreens Mark Brown
  2008-05-26 13:42 ` [PATCH 2/4] wm97xx-core: Fix driver name Mark Brown
@ 2008-05-27  5:54 ` Dmitry Torokhov
  1 sibling, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2008-05-27  5:54 UTC (permalink / raw)
  To: Mark Brown; +Cc: Rodolfo Giometti, linux-input, linux-kernel, akpm

On Monday 26 May 2008 09:42, Mark Brown wrote:
> phys is displayed in diagnostic output like that from evbug so ensure
> that it is set to something.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Applied all 4 to "for-linus" branch. Thank you Mark.

-- 
Dmitry

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

end of thread, other threads:[~2008-05-27  5:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-26 13:42 [PATCH 1/4] wm97xx-core: Report a phys for WM97xx touchscreens Mark Brown
2008-05-26 13:42 ` [PATCH 2/4] wm97xx-core: Fix driver name Mark Brown
2008-05-26 13:42   ` [PATCH 3/4] wm97xx-core: Fix race on PHY init Mark Brown
2008-05-26 13:42     ` [PATCH 4/4] wm9713: Support five wire panels Mark Brown
2008-05-27  5:54 ` [PATCH 1/4] wm97xx-core: Report a phys for WM97xx touchscreens 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).