Skip to contentSkip to conversation

Input: add wm97xx accelerated driver for Atmel microprocessors

PATCH In review Mark Brown 3 participants 4 messages Apr 10, 2009 – Apr 14, 2009

Subsystems (4)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 Input: add wm97xx accelerated driver for Atmel microprocessors

From: Hans-Christian Egtvedt <[email protected]>

This patch adds an accelerated driver for Atmel AVR32 AT32AP700X microprocessors. It uses interrupts on the channel B in the AC97 controller. Thus, offloading the work queue in the wm97xx-ts driver.

The driver has been tested with Atmel AVR32 AT32AP7000 and Wolfson WM9712 codec.

The driver can also be easily modified to support Atmel AT91 devices, as AT91 and AVR32 share the same AC97C module.

[Fixed leak of atmel_wm97xx when probe fails. -- broonie]

---
 drivers/input/touchscreen/Kconfig        |   15 +
 drivers/input/touchscreen/Makefile       |    1 +
 drivers/input/touchscreen/atmel-wm97xx.c |  456 ++++++++++++++++++++++++++++++
 3 files changed, 472 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/touchscreen/atmel-wm97xx.c
drivers/input/touchscreen/Kconfig +15 -0
index b01fd61..82c388e 100644
@@ -341,6 +341,21 @@ config TOUCHSCREEN_WM9713
 	  Say Y here to enable support for the Wolfson Microelectronics
 	  WM9713 touchscreen controller.
 
+config TOUCHSCREEN_WM97XX_ATMEL
+	tristate "WM97xx Atmel accelerated touch"
+	depends on TOUCHSCREEN_WM97XX && (AVR32 || ARCH_AT91)
+	help
+	  Say Y here for support for streaming mode with WM97xx touchscreens
+	  on Atmel AT91 or AVR32 systems with an AC97C module.
+
+	  Be aware that this will use channel B in the controller for
+	  streaming data, this must not conflict with other AC97C drivers.
+
+	  If unsure, say N.
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called atmel-wm97xx.
+
 config TOUCHSCREEN_WM97XX_MAINSTONE
 	tristate "WM97xx Mainstone accelerated touch"
 	depends on TOUCHSCREEN_WM97XX && ARCH_PXA
drivers/input/touchscreen/Makefile +1 -0
index 6700f7b..bef7415 100644
@@ -35,5 +35,6 @@ obj-$(CONFIG_TOUCHSCREEN_DA9034)	+= da9034-ts.o
 wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9705)	+= wm9705.o
 wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712)	+= wm9712.o
 wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9713)	+= wm9713.o
+obj-$(CONFIG_TOUCHSCREEN_WM97XX_ATMEL)	+= atmel-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE)	+= mainstone-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE)	+= zylonite-wm97xx.o
drivers/input/touchscreen/atmel-wm97xx.c new file +456 -0

456 lines not on this page · raw message

Signature · 1 line
1.5.6.3
author
#1 lore raw

PATCH 1/1 Input: Don't use IRQF_SAMPLE_RANDOM in wm97xx driver

The input core will add entropy to the pool without this flag being used.

---
 drivers/input/touchscreen/wm97xx-core.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/input/touchscreen/wm97xx-core.c +1 -2
index cec480b..69af838 100644
@@ -370,8 +370,7 @@ static int wm97xx_init_pen_irq(struct wm97xx *wm)
 	 * provided. */
 	BUG_ON(!wm->mach_ops->irq_enable);
 
-	if (request_irq(wm->pen_irq, wm97xx_pen_interrupt,
-			IRQF_SHARED | IRQF_SAMPLE_RANDOM,
+	if (request_irq(wm->pen_irq, wm97xx_pen_interrupt, IRQF_SHARED,
 			"wm97xx-pen", wm)) {
 		dev_err(wm->dev,
 			"Failed to register pen down interrupt, polling");
Signature · 1 line
1.5.6.3
maintainer
#2 lore raw

Re: [PATCH] Input: Don't use IRQF_SAMPLE_RANDOM in wm97xx driver

Hi Mark,

Quoted 3 lines · Mark Brown

The input core will add entropy to the pool without this flag being used.

Apllied this and the atmel driver one, thank you.

Signature · 1 line
Dmitry
#3 lore raw
In reply to Mark Brown
Quoted 17 lines · On Fri, 10 Apr 2009 10:53:11 +0100 Mark Brown…

From: Hans-Christian Egtvedt <[email protected]>

This patch adds an accelerated driver for Atmel AVR32 AT32AP700X microprocessors. It uses interrupts on the channel B in the AC97 controller. Thus, offloading the work queue in the wm97xx-ts driver.

The driver has been tested with Atmel AVR32 AT32AP7000 and Wolfson WM9712 codec.

The driver can also be easily modified to support Atmel AT91 devices, as AT91 and AVR32 share the same AC97C module.

[Fixed leak of atmel_wm97xx when probe fails. -- broonie]

...

drivers/input/touchscreen/atmel-wm97xx.c line 219

Quoted 8 lines
drivers/input/touchscreen/atmel-wm97xx.c new file +8 -0
+static void atmel_wm97xx_acc_pen_up(struct wm97xx *wm)
+{
+	struct atmel_wm97xx *atmel_wm97xx = platform_get_drvdata(wm->touch_dev);
+	int pen_down = gpio_get_value(atmel_wm97xx->gpio_pen);
+
+	if (pen_down != 0) {
+		mod_timer(&atmel_wm97xx->pen_timer, jiffies
+				+ msecs_to_jiffies(1));

I'd be more comfortable if there was a del_timer_sync() somewhere in this driver?

Quoted 7 lines
drivers/input/touchscreen/atmel-wm97xx.c new file +7 -0
+	} else {
+		input_report_abs(wm->input_dev, ABS_PRESSURE, 0);
+		input_report_key(wm->input_dev, BTN_TOUCH, 0);
+		input_sync(wm->input_dev);
+	}
+}
+