[Armadeus-commitlog] armadeus branch, master, updated. release-3.3-213-g227aba3
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2011-01-05 19:08:57
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 227aba3b541c2d6185ba9606462273b340bdd62d (commit)
via eac92d3eb0d7775aa4513c9158970f5f20e7e234 (commit)
via ddb9e01eefe7896fa48eecfdb51fb6898ce7e49a (commit)
from b6df1071e9eb5fbe2ba55594a53517c234bc27e8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 227aba3b541c2d6185ba9606462273b340bdd62d
Merge: eac92d3eb0d7775aa4513c9158970f5f20e7e234 b6df1071e9eb5fbe2ba55594a53517c234bc27e8
Author: Julien Boibessot <jul...@ar...>
Date: Wed Jan 5 20:08:14 2011 +0100
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit eac92d3eb0d7775aa4513c9158970f5f20e7e234
Author: Julien Boibessot <jul...@ar...>
Date: Wed Jan 5 20:07:41 2011 +0100
[LINUX] 2.6.38: activates pressure measurement of wm8311 on APF51
commit ddb9e01eefe7896fa48eecfdb51fb6898ce7e49a
Author: Julien Boibessot <jul...@ar...>
Date: Wed Jan 5 16:34:30 2011 +0100
[LINUX] 2.6.38: Add driver for WM8311 touch feature
-----------------------------------------------------------------------
Summary of changes:
.../2.6.38/400-armadeus-add_apf51_module.patch | 20 +-
...us-wm8311-add_CMOS_IRQ_line_configuration.patch | 18 +
...-Add-driver-for-Wolfson-WM831x-PMIC-touch.patch | 408 ++++++++++++++++++++
...n-Input-wm831x-Handles_pen_down_interrupt.patch | 115 ++++++
...data_interrupt_when_using_external_signal.patch | 118 ++++++
...ng_external_signal_for_pen_down_interrupt.patch | 115 ++++++
...rt_when_pen_down_is_detected_isnt_working.patch | 43 ++
.../417-armadeus-input-wm831x-driver_hacks.patch | 57 +++
8 files changed, 884 insertions(+), 10 deletions(-)
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/411-armadeus-wm8311-add_CMOS_IRQ_line_configuration.patch
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/412-wolfson-Input-wm831x-Add-driver-for-Wolfson-WM831x-PMIC-touch.patch
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/413-wolfson-Input-wm831x-Handles_pen_down_interrupt.patch
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/414-wolfson-Input-wm831x-Ack_data_interrupt_when_using_external_signal.patch
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/415-armadeus-Input-wm831x-Allows_using_external_signal_for_pen_down_interrupt.patch
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/416-armadeus-Input-wm831x-Data_acquisition_start_when_pen_down_is_detected_isnt_working.patch
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/417-armadeus-input-wm831x-driver_hacks.patch
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
index fedb4e2..ecdec98 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
@@ -1,7 +1,7 @@
Index: linux-2.6.38-alpha/arch/arm/mach-mx5/Kconfig
===================================================================
---- linux-2.6.38-alpha.orig/arch/arm/mach-mx5/Kconfig 2010-12-30 21:07:06.000000000 +0100
-+++ linux-2.6.38-alpha/arch/arm/mach-mx5/Kconfig 2011-01-03 15:56:23.000000000 +0100
+--- linux-2.6.38-alpha.orig/arch/arm/mach-mx5/Kconfig 2011-01-05 17:30:58.000000000 +0100
++++ linux-2.6.38-alpha/arch/arm/mach-mx5/Kconfig 2011-01-05 20:04:52.000000000 +0100
@@ -101,4 +101,17 @@
Include support for Genesi Efika MX nettop. This includes specific
configurations for the board and its peripherals.
@@ -22,8 +22,8 @@ Index: linux-2.6.38-alpha/arch/arm/mach-mx5/Kconfig
endif
Index: linux-2.6.38-alpha/arch/arm/mach-mx5/Makefile
===================================================================
---- linux-2.6.38-alpha.orig/arch/arm/mach-mx5/Makefile 2010-12-30 21:06:56.000000000 +0100
-+++ linux-2.6.38-alpha/arch/arm/mach-mx5/Makefile 2011-01-03 15:56:23.000000000 +0100
+--- linux-2.6.38-alpha.orig/arch/arm/mach-mx5/Makefile 2010-12-14 09:55:53.000000000 +0100
++++ linux-2.6.38-alpha/arch/arm/mach-mx5/Makefile 2011-01-05 20:04:52.000000000 +0100
@@ -6,6 +6,7 @@
obj-y := cpu.o mm.o clock-mx51-mx53.o devices.o
@@ -35,7 +35,7 @@ Index: linux-2.6.38-alpha/arch/arm/mach-mx5/Makefile
Index: linux-2.6.38-alpha/arch/arm/mach-mx5/board-apf51.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38-alpha/arch/arm/mach-mx5/board-apf51.c 2011-01-03 12:01:21.000000000 +0100
++++ linux-2.6.38-alpha/arch/arm/mach-mx5/board-apf51.c 2011-01-05 19:38:00.000000000 +0100
@@ -0,0 +1,421 @@
+/*
+ * Support for APF51 System On Module
@@ -382,7 +382,7 @@ Index: linux-2.6.38-alpha/arch/arm/mach-mx5/board-apf51.c
+
+static struct wm831x_touch_pdata apf51_wm8311_touch_pdata = {
+ .fivewire = 0,
-+ .pressure = 0,
++ .pressure = 1,
+ .data_irq = gpio_to_irq(APF51_WM8311_TOUCH_EOC_GPIO),
+ .pd_irq = gpio_to_irq(APF51_WM8311_TOUCH_DETECT_GPIO),
+};
@@ -460,8 +460,8 @@ Index: linux-2.6.38-alpha/arch/arm/mach-mx5/board-apf51.c
+
Index: linux-2.6.38-alpha/arch/arm/plat-mxc/include/mach/uncompress.h
===================================================================
---- linux-2.6.38-alpha.orig/arch/arm/plat-mxc/include/mach/uncompress.h 2010-12-30 21:06:56.000000000 +0100
-+++ linux-2.6.38-alpha/arch/arm/plat-mxc/include/mach/uncompress.h 2010-12-30 21:07:06.000000000 +0100
+--- linux-2.6.38-alpha.orig/arch/arm/plat-mxc/include/mach/uncompress.h 2010-12-14 09:55:53.000000000 +0100
++++ linux-2.6.38-alpha/arch/arm/plat-mxc/include/mach/uncompress.h 2011-01-05 17:30:58.000000000 +0100
@@ -63,6 +63,7 @@
#define MX3X_UART1_BASE_ADDR 0x43F90000
#define MX3X_UART2_BASE_ADDR 0x43F94000
@@ -482,8 +482,8 @@ Index: linux-2.6.38-alpha/arch/arm/plat-mxc/include/mach/uncompress.h
}
Index: linux-2.6.38-alpha/arch/arm/plat-mxc/include/mach/irqs.h
===================================================================
---- linux-2.6.38-alpha.orig/arch/arm/plat-mxc/include/mach/irqs.h 2010-12-30 21:06:56.000000000 +0100
-+++ linux-2.6.38-alpha/arch/arm/plat-mxc/include/mach/irqs.h 2010-12-30 21:07:06.000000000 +0100
+--- linux-2.6.38-alpha.orig/arch/arm/plat-mxc/include/mach/irqs.h 2010-12-14 09:55:53.000000000 +0100
++++ linux-2.6.38-alpha/arch/arm/plat-mxc/include/mach/irqs.h 2011-01-05 17:30:58.000000000 +0100
@@ -47,6 +47,8 @@
#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/411-armadeus-wm8311-add_CMOS_IRQ_line_configuration.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/411-armadeus-wm8311-add_CMOS_IRQ_line_configuration.patch
new file mode 100644
index 0000000..93f2b6b
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/411-armadeus-wm8311-add_CMOS_IRQ_line_configuration.patch
@@ -0,0 +1,18 @@
+Configure "IRQ" line as CMOS.
+
+Signed-off-by: Julien Boibessot <jul...@ar...>
+
+Index: linux-2.6.38-alpha/drivers/mfd/wm831x-core.c
+===================================================================
+--- linux-2.6.38-alpha.orig/drivers/mfd/wm831x-core.c 2010-12-29 10:33:41.000000000 +0100
++++ linux-2.6.38-alpha/drivers/mfd/wm831x-core.c 2010-12-29 10:35:59.000000000 +0100
+@@ -1571,6 +1571,9 @@
+ }
+ }
+
++ /* Configure "IRQ" line as CMOS */
++ wm831x_reg_write(wm831x, WM831X_IRQ_CONFIG, 0);
++
+ ret = wm831x_irq_init(wm831x, irq);
+ if (ret != 0)
+ goto err;
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/412-wolfson-Input-wm831x-Add-driver-for-Wolfson-WM831x-PMIC-touch.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/412-wolfson-Input-wm831x-Add-driver-for-Wolfson-WM831x-PMIC-touch.patch
new file mode 100644
index 0000000..8f28319
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/412-wolfson-Input-wm831x-Add-driver-for-Wolfson-WM831x-PMIC-touch.patch
@@ -0,0 +1,408 @@
+>From 57539f6fc8ebd6c11373b750450d3f0526c8522f Mon Sep 17 00:00:00 2001
+From: Mark Brown <br...@op...>
+Date: Fri, 10 Dec 2010 21:39:33 +0000
+Subject: [PATCH] Input: wm831x - Add driver for Wolfson WM831x PMIC touchscreen controllers
+
+Some of the WM831x series of PMICs from Wolfson Microelectronics include
+a resistive touchscreen controller. Implement support for these controllers
+within the input API.
+
+Platform data is supported to allow configuration of system parameters such
+as selection between four and five wire touchscreens and for specification
+of an optional direct to CPU IRQ to be used to report the availability of
+samples.
+
+THIS DRIVER HAS NOT BEEN TESTED. NO GUARANTEES ARE MADE REGARDING THE
+PERFORMANCE OR STABILITY OF THE DRIVER, IT IS EXPECTED THAT SOME DEBUGGING
+WILL BE REQUIRED IN ORDER TO MAKE THE DRIVER USABLE.
+
+Signed-off-by: Mark Brown <br...@op...>
+---
+ drivers/input/touchscreen/Kconfig | 10 +
+ drivers/input/touchscreen/Makefile | 1 +
+ drivers/input/touchscreen/wm831x-ts.c | 340 +++++++++++++++++++++++++++++++++
+ 3 files changed, 351 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/input/touchscreen/wm831x-ts.c
+
+diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
+index 6675bd7..b3b7596 100644
+--- a/drivers/input/touchscreen/Kconfig
++++ b/drivers/input/touchscreen/Kconfig
+@@ -423,6 +423,16 @@ config TOUCHSCREEN_UCB1400
+ To compile this driver as a module, choose M here: the
+ module will be called ucb1400_ts.
+
++config TOUCHSCREEN_WM831X
++ tristate "Support for WM831x touchscreen controllers"
++ depends on MFD_WM831X
++ help
++ This enables support for the touchscreen controller on the WM831x
++ series of PMICs.
++
++ To compile this driver as a module, choose M here: the
++ module will be called wm831x-touch.
++
+ config TOUCHSCREEN_WM97XX
+ tristate "Support for WM97xx AC97 touchscreen controllers"
+ depends on AC97_BUS
+diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
+index 7cc1b4f..1a00395 100644
+--- a/drivers/input/touchscreen/Makefile
++++ b/drivers/input/touchscreen/Makefile
+@@ -47,6 +47,7 @@ obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN) += touchwin.o
+ obj-$(CONFIG_TOUCHSCREEN_TSC2007) += tsc2007.o
+ obj-$(CONFIG_TOUCHSCREEN_UCB1400) += ucb1400_ts.o
+ obj-$(CONFIG_TOUCHSCREEN_WACOM_W8001) += wacom_w8001.o
++obj-$(CONFIG_TOUCHSCREEN_WM831X) += wm831x-ts.o
+ obj-$(CONFIG_TOUCHSCREEN_WM97XX) += wm97xx-ts.o
+ wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9705) += wm9705.o
+ wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712) += wm9712.o
+diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c
+new file mode 100644
+index 0000000..51d1863
+--- /dev/null
++++ b/drivers/input/touchscreen/wm831x-ts.c
+@@ -0,0 +1,340 @@
++/*
++ * wm831x-ts.c - Touchscreen driver for WM831x PMICs
++ *
++ * Copyright 2010 Wolfson Microelectronics plc.
++ * Author: Mark Brown <br...@op...>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License as published by the
++ * Free Software Foundation; either version 2 of the License, or (at your
++ * option) any later version.
++ */
++
++#include <linux/module.h>
++#include <linux/moduleparam.h>
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/string.h>
++#include <linux/pm.h>
++#include <linux/input.h>
++#include <linux/interrupt.h>
++#include <linux/io.h>
++#include <linux/mfd/wm831x/core.h>
++#include <linux/mfd/wm831x/pdata.h>
++#include <linux/platform_device.h>
++#include <linux/slab.h>
++#include <linux/types.h>
++
++/*
++ * R16424 (0x4028) - Touch Control 1
++ */
++#define WM831X_TCH_ENA 0x8000 /* TCH_ENA */
++#define WM831X_TCH_ENA_MASK 0x8000 /* TCH_ENA */
++#define WM831X_TCH_ENA_SHIFT 15 /* TCH_ENA */
++#define WM831X_TCH_ENA_WIDTH 1 /* TCH_ENA */
++#define WM831X_TCH_CVT_ENA 0x4000 /* TCH_CVT_ENA */
++#define WM831X_TCH_CVT_ENA_MASK 0x4000 /* TCH_CVT_ENA */
++#define WM831X_TCH_CVT_ENA_SHIFT 14 /* TCH_CVT_ENA */
++#define WM831X_TCH_CVT_ENA_WIDTH 1 /* TCH_CVT_ENA */
++#define WM831X_TCH_SLPENA 0x1000 /* TCH_SLPENA */
++#define WM831X_TCH_SLPENA_MASK 0x1000 /* TCH_SLPENA */
++#define WM831X_TCH_SLPENA_SHIFT 12 /* TCH_SLPENA */
++#define WM831X_TCH_SLPENA_WIDTH 1 /* TCH_SLPENA */
++#define WM831X_TCH_Z_ENA 0x0400 /* TCH_Z_ENA */
++#define WM831X_TCH_Z_ENA_MASK 0x0400 /* TCH_Z_ENA */
++#define WM831X_TCH_Z_ENA_SHIFT 10 /* TCH_Z_ENA */
++#define WM831X_TCH_Z_ENA_WIDTH 1 /* TCH_Z_ENA */
++#define WM831X_TCH_Y_ENA 0x0200 /* TCH_Y_ENA */
++#define WM831X_TCH_Y_ENA_MASK 0x0200 /* TCH_Y_ENA */
++#define WM831X_TCH_Y_ENA_SHIFT 9 /* TCH_Y_ENA */
++#define WM831X_TCH_Y_ENA_WIDTH 1 /* TCH_Y_ENA */
++#define WM831X_TCH_X_ENA 0x0100 /* TCH_X_ENA */
++#define WM831X_TCH_X_ENA_MASK 0x0100 /* TCH_X_ENA */
++#define WM831X_TCH_X_ENA_SHIFT 8 /* TCH_X_ENA */
++#define WM831X_TCH_X_ENA_WIDTH 1 /* TCH_X_ENA */
++#define WM831X_TCH_DELAY_MASK 0x00E0 /* TCH_DELAY - [7:5] */
++#define WM831X_TCH_DELAY_SHIFT 5 /* TCH_DELAY - [7:5] */
++#define WM831X_TCH_DELAY_WIDTH 3 /* TCH_DELAY - [7:5] */
++#define WM831X_TCH_RATE_MASK 0x001F /* TCH_RATE - [4:0] */
++#define WM831X_TCH_RATE_SHIFT 0 /* TCH_RATE - [4:0] */
++#define WM831X_TCH_RATE_WIDTH 5 /* TCH_RATE - [4:0] */
++
++/*
++ * R16425 (0x4029) - Touch Control 2
++ */
++#define WM831X_TCH_PD_WK 0x2000 /* TCH_PD_WK */
++#define WM831X_TCH_PD_WK_MASK 0x2000 /* TCH_PD_WK */
++#define WM831X_TCH_PD_WK_SHIFT 13 /* TCH_PD_WK */
++#define WM831X_TCH_PD_WK_WIDTH 1 /* TCH_PD_WK */
++#define WM831X_TCH_5WIRE 0x1000 /* TCH_5WIRE */
++#define WM831X_TCH_5WIRE_MASK 0x1000 /* TCH_5WIRE */
++#define WM831X_TCH_5WIRE_SHIFT 12 /* TCH_5WIRE */
++#define WM831X_TCH_5WIRE_WIDTH 1 /* TCH_5WIRE */
++#define WM831X_TCH_PDONLY 0x0800 /* TCH_PDONLY */
++#define WM831X_TCH_PDONLY_MASK 0x0800 /* TCH_PDONLY */
++#define WM831X_TCH_PDONLY_SHIFT 11 /* TCH_PDONLY */
++#define WM831X_TCH_PDONLY_WIDTH 1 /* TCH_PDONLY */
++#define WM831X_TCH_ISEL 0x0100 /* TCH_ISEL */
++#define WM831X_TCH_ISEL_MASK 0x0100 /* TCH_ISEL */
++#define WM831X_TCH_ISEL_SHIFT 8 /* TCH_ISEL */
++#define WM831X_TCH_ISEL_WIDTH 1 /* TCH_ISEL */
++#define WM831X_TCH_RPU_MASK 0x000F /* TCH_RPU - [3:0] */
++#define WM831X_TCH_RPU_SHIFT 0 /* TCH_RPU - [3:0] */
++#define WM831X_TCH_RPU_WIDTH 4 /* TCH_RPU - [3:0] */
++
++/*
++ * R16426-8 (0x402A-C) - Touch Data X/Y/X
++ */
++#define WM831X_TCH_PD 0x8000 /* TCH_PD1 */
++#define WM831X_TCH_PD_MASK 0x8000 /* TCH_PD1 */
++#define WM831X_TCH_PD_SHIFT 15 /* TCH_PD1 */
++#define WM831X_TCH_PD_WIDTH 1 /* TCH_PD1 */
++#define WM831X_TCH_DATA_MASK 0x0FFF /* TCH_DATA - [11:0] */
++#define WM831X_TCH_DATA_SHIFT 0 /* TCH_DATA - [11:0] */
++#define WM831X_TCH_DATA_WIDTH 12 /* TCH_DATA - [11:0] */
++
++struct wm831x_ts {
++ struct input_dev *input_dev;
++ struct wm831x *wm831x;
++ int data_irq;
++ bool pressure;
++};
++
++static irqreturn_t wm831x_ts_data_irq(int irq, void *irq_data)
++{
++ struct wm831x_ts *wm831x_ts = irq_data;
++ struct wm831x *wm831x = wm831x_ts->wm831x;
++ static int data_types[] = { ABS_X, ABS_Y, ABS_PRESSURE };
++ u16 data[3];
++ bool pen_down = true;
++ int count, i, ret;
++
++ if (wm831x_ts->pressure)
++ count = 3;
++ else
++ count = 2;
++
++ ret = wm831x_bulk_read(wm831x, WM831X_TOUCH_DATA_X, count,
++ data);
++ if (ret != 0) {
++ dev_err(wm831x->dev, "Failed to read touch data: %d\n",
++ ret);
++ return IRQ_NONE;
++ }
++
++ /* We get a pen down reading on every reading, report pen up if any
++ * individual reading does so.
++ */
++ for (i = 0; i < count; i++) {
++ input_report_abs(wm831x_ts->input_dev, data_types[i],
++ data[i] & WM831X_TCH_DATA_MASK);
++ if (!data[i] & WM831X_TCH_PD)
++ pen_down = false;
++ }
++
++ if (pen_down) {
++ input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 1);
++ } else {
++ input_report_abs(wm831x_ts->input_dev, ABS_PRESSURE, 0);
++ input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 0);
++ }
++
++ input_sync(wm831x_ts->input_dev);
++
++ return IRQ_HANDLED;
++}
++
++static int wm831x_ts_input_open(struct input_dev *idev)
++{
++ struct wm831x_ts *wm831x_ts = input_get_drvdata(idev);
++ struct wm831x *wm831x = wm831x_ts->wm831x;
++ u16 ena = 0;
++
++ if (wm831x_ts->pressure)
++ ena |= WM831X_TCH_Z_ENA;
++
++ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
++ WM831X_TCH_ENA | WM831X_TCH_CVT_ENA |
++ WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA |
++ WM831X_TCH_Z_ENA,
++ WM831X_TCH_ENA | WM831X_TCH_CVT_ENA |
++ WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA |
++ ena);
++
++ return 0;
++}
++
++static void wm831x_ts_input_close(struct input_dev *idev)
++{
++ struct wm831x_ts *wm831x_ts = input_get_drvdata(idev);
++ struct wm831x *wm831x = wm831x_ts->wm831x;
++
++ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
++ WM831X_TCH_ENA | WM831X_TCH_CVT_ENA |
++ WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA |
++ WM831X_TCH_Z_ENA, 0);
++}
++
++static int wm831x_ts_probe(struct platform_device *pdev)
++{
++ struct wm831x_ts *wm831x_ts;
++ struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
++ struct wm831x_pdata *core_pdata = dev_get_platdata(pdev->dev.parent);
++ struct wm831x_touch_pdata *pdata;
++ struct input_dev *input_dev;
++ int ret;
++
++ wm831x_ts = kzalloc(sizeof(struct wm831x_ts), GFP_KERNEL);
++ if (!wm831x_ts)
++ return -ENOMEM;
++
++ wm831x_ts->wm831x = wm831x;
++
++ if (core_pdata && core_pdata->touch)
++ pdata = core_pdata->touch;
++ else
++ pdata = NULL;
++
++ /* If we have a direct CPU data IRQ use it, otherwise use
++ * the interrupt through the WM831x IRQ controller.
++ */
++ if (pdata)
++ wm831x_ts->data_irq = pdata->data_irq;
++ else
++ wm831x_ts->data_irq = platform_get_irq_byname(pdev,
++ "TCHDATA");
++
++ if (pdata && pdata->pressure)
++ wm831x_ts->pressure = true;
++ else
++ wm831x_ts->pressure = false;
++
++ /* Five wire touchscreens can't report pressure */
++ if (pdata && pdata->fivewire) {
++ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_2,
++ WM831X_TCH_5WIRE, WM831X_TCH_5WIRE);
++
++ /* Pressure measurments are not possible for five wire mode */
++ WARN_ON(pdata->pressure && pdata->fivewire);
++ wm831x_ts->pressure = false;
++ } else {
++ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_2,
++ WM831X_TCH_5WIRE, 0);
++ }
++
++ if (pdata) {
++ switch (pdata->isel) {
++ default:
++ dev_err(&pdev->dev, "Unsupported ISEL setting: %d\n",
++ pdata->isel);
++ /* Fall through */
++ case 200:
++ case 0:
++ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_2,
++ WM831X_TCH_ISEL, 0);
++ break;
++ case 400:
++ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_2,
++ WM831X_TCH_ISEL, WM831X_TCH_ISEL);
++ break;
++ }
++ }
++
++ /* Convert only when pen down */
++ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_2,
++ WM831X_TCH_PDONLY, WM831X_TCH_PDONLY);
++
++ /* Default to 192 samples/sec */
++ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
++ WM831X_TCH_RATE_MASK, 12);
++
++ ret = request_threaded_irq(wm831x_ts->data_irq, NULL,
++ wm831x_ts_data_irq,
++ IRQF_ONESHOT, /* Trigger */
++ "Touchscreen data", wm831x_ts);
++ if (ret < 0) {
++ dev_err(&pdev->dev, "Failed to request IRQ %d: %d\n",
++ wm831x_ts->data_irq, ret);
++ goto err_alloc;
++ }
++
++ platform_set_drvdata(pdev, wm831x_ts);
++
++ input_dev = input_allocate_device();
++ if (input_dev == NULL) {
++ ret = -ENOMEM;
++ goto err_irq;
++ }
++ wm831x_ts->input_dev = input_dev;
++
++ /* set up touch configuration */
++ input_dev->name = "WM831x touchscreen";
++ input_dev->phys = "wm831x";
++ input_dev->open = wm831x_ts_input_open;
++ input_dev->close = wm831x_ts_input_close;
++
++ __set_bit(EV_ABS, input_dev->evbit);
++ __set_bit(EV_KEY, input_dev->evbit);
++ __set_bit(BTN_TOUCH, input_dev->keybit);
++
++ input_set_abs_params(input_dev, ABS_X, 0, 4095, 5, 0);
++ input_set_abs_params(input_dev, ABS_Y, 0, 4095, 5, 0);
++ if (wm831x_ts->pressure)
++ input_set_abs_params(input_dev, ABS_PRESSURE, 0, 4095, 5, 0);
++
++ input_set_drvdata(input_dev, wm831x_ts);
++ input_dev->dev.parent = &pdev->dev;
++
++ ret = input_register_device(input_dev);
++ if (ret < 0)
++ goto err_dev_alloc;
++
++ return ret;
++
++err_dev_alloc:
++ input_free_device(input_dev);
++err_irq:
++ free_irq(wm831x_ts->data_irq, wm831x_ts);
++err_alloc:
++ kfree(wm831x_ts);
++
++ return ret;
++}
++
++static int wm831x_ts_remove(struct platform_device *pdev)
++{
++ struct wm831x_ts *wm831x_ts = platform_get_drvdata(pdev);
++
++ free_irq(wm831x_ts->data_irq, wm831x_ts);
++ input_unregister_device(wm831x_ts->input_dev);
++ kfree(wm831x_ts);
++
++ return 0;
++}
++
++static struct platform_driver wm831x_ts_driver = {
++ .driver = {
++ .name = "wm831x-touch",
++ .owner = THIS_MODULE,
++ },
++ .probe = wm831x_ts_probe,
++ .remove = __devexit_p(wm831x_ts_remove),
++};
++
++static int __init wm831x_ts_init(void)
++{
++ return platform_driver_register(&wm831x_ts_driver);
++}
++module_init(wm831x_ts_init);
++
++static void __exit wm831x_ts_exit(void)
++{
++ platform_driver_unregister(&wm831x_ts_driver);
++}
++module_exit(wm831x_ts_exit);
++
++/* Module information */
++MODULE_AUTHOR("Mark Brown <br...@op...>");
++MODULE_DESCRIPTION("WM831x PMIC touchscreen driver");
++MODULE_LICENSE("GPL");
++MODULE_ALIAS("platform:wm831x-touch");
+--
+1.7.1
+
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/413-wolfson-Input-wm831x-Handles_pen_down_interrupt.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/413-wolfson-Input-wm831x-Handles_pen_down_interrupt.patch
new file mode 100644
index 0000000..6bf7f26
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/413-wolfson-Input-wm831x-Handles_pen_down_interrupt.patch
@@ -0,0 +1,115 @@
+Handles Pen_Down interrupt.
+
+Signed-off-by: Mark Brown <br...@op...>
+
+diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c
+index 51d1863..3617748 100644
+--- a/drivers/input/touchscreen/wm831x-ts.c
++++ b/drivers/input/touchscreen/wm831x-ts.c
+@@ -126,16 +126,21 @@ static irqreturn_t wm831x_ts_data_irq(int irq, void *irq_data)
+ * individual reading does so.
+ */
+ for (i = 0; i < count; i++) {
++ if (!(data[i] & WM831X_TCH_PD)) {
++ pen_down = false;
++ continue;
++ }
+ input_report_abs(wm831x_ts->input_dev, data_types[i],
+ data[i] & WM831X_TCH_DATA_MASK);
+- if (!data[i] & WM831X_TCH_PD)
+- pen_down = false;
+ }
+
+- if (pen_down) {
+- input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 1);
+- } else {
+- input_report_abs(wm831x_ts->input_dev, ABS_PRESSURE, 0);
++ if (!pen_down) {
++ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
++ WM831X_TCH_CVT_ENA, 0);
++
++ if (wm831x_ts->pressure)
++ input_report_abs(wm831x_ts->input_dev,
++ ABS_PRESSURE, 0);
+ input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 0);
+ }
+
+@@ -144,6 +149,20 @@ static irqreturn_t wm831x_ts_data_irq(int irq, void *irq_data)
+ return IRQ_HANDLED;
+ }
+
++static irqreturn_t wm831x_ts_pen_down_irq(int irq, void *irq_data)
++{
++ struct wm831x_ts *wm831x_ts = irq_data;
++ struct wm831x *wm831x = wm831x_ts->wm831x;
++
++ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
++ WM831X_TCH_CVT_ENA, WM831X_TCH_CVT_ENA);
++
++ input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 1);
++ input_sync(wm831x_ts->input_dev);
++
++ return IRQ_HANDLED;
++}
++
+ static int wm831x_ts_input_open(struct input_dev *idev)
+ {
+ struct wm831x_ts *wm831x_ts = input_get_drvdata(idev);
+@@ -154,11 +173,9 @@ static int wm831x_ts_input_open(struct input_dev *idev)
+ ena |= WM831X_TCH_Z_ENA;
+
+ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
+- WM831X_TCH_ENA | WM831X_TCH_CVT_ENA |
+- WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA |
++ WM831X_TCH_ENA | WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA |
+ WM831X_TCH_Z_ENA,
+- WM831X_TCH_ENA | WM831X_TCH_CVT_ENA |
+- WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA |
++ WM831X_TCH_ENA | WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA |
+ ena);
+
+ return 0;
+@@ -258,12 +275,23 @@ static int wm831x_ts_probe(struct platform_device *pdev)
+ goto err_alloc;
+ }
+
++ ret = request_threaded_irq(platform_get_irq_byname(pdev,
++ "TCHPD"),
++ NULL, wm831x_ts_pen_down_irq,
++ IRQF_ONESHOT, /* Trigger */
++ "Touchscreen pen down", wm831x_ts);
++ if (ret < 0) {
++ dev_err(&pdev->dev, "Failed to request pen down IRQ: %d\n",
++ ret);
++ goto err_data_irq;
++ }
++
+ platform_set_drvdata(pdev, wm831x_ts);
+
+ input_dev = input_allocate_device();
+ if (input_dev == NULL) {
+ ret = -ENOMEM;
+- goto err_irq;
++ goto err_pd_irq;
+ }
+ wm831x_ts->input_dev = input_dev;
+
+@@ -293,7 +321,9 @@ static int wm831x_ts_probe(struct platform_device *pdev)
+
+ err_dev_alloc:
+ input_free_device(input_dev);
+-err_irq:
++err_pd_irq:
++ free_irq(platform_get_irq_byname(pdev, "TCHPD"), wm831x_ts);
++err_data_irq:
+ free_irq(wm831x_ts->data_irq, wm831x_ts);
+ err_alloc:
+ kfree(wm831x_ts);
+@@ -305,6 +335,7 @@ static int wm831x_ts_remove(struct platform_device *pdev)
+ {
+ struct wm831x_ts *wm831x_ts = platform_get_drvdata(pdev);
+
++ free_irq(platform_get_irq_byname(pdev, "TCHPD"), wm831x_ts);
+ free_irq(wm831x_ts->data_irq, wm831x_ts);
+ input_unregister_device(wm831x_ts->input_dev);
+ kfree(wm831x_ts);
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/414-wolfson-Input-wm831x-Ack_data_interrupt_when_using_external_signal.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/414-wolfson-Input-wm831x-Ack_data_interrupt_when_using_external_signal.patch
new file mode 100644
index 0000000..3bed2a7
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/414-wolfson-Input-wm831x-Ack_data_interrupt_when_using_external_signal.patch
@@ -0,0 +1,118 @@
+If we're using a direct signal for the data IRQ we still need to ack the
+interrupt.
+
+Signed-off-by: Mark Brown <br...@op...>
+
+diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c
+index 3617748..833979c 100644
+--- a/drivers/input/touchscreen/wm831x-ts.c
++++ b/drivers/input/touchscreen/wm831x-ts.c
+@@ -20,6 +20,7 @@
+ #include <linux/interrupt.h>
+ #include <linux/io.h>
+ #include <linux/mfd/wm831x/core.h>
++#include <linux/mfd/wm831x/irq.h>
+ #include <linux/mfd/wm831x/pdata.h>
+ #include <linux/platform_device.h>
+ #include <linux/slab.h>
+@@ -146,6 +147,13 @@ static irqreturn_t wm831x_ts_data_irq(int irq, void *irq_data)
+
+ input_sync(wm831x_ts->input_dev);
+
++ /* If we're using a direct signal for the data IRQ we still need
++ * to ack the interrupt.
++ */
++ if (wm831x_ts->data_irq)
++ wm831x_set_bits(wm831x, WM831X_INTERRUPT_STATUS_1,
++ WM831X_TCHDATA_EINT, WM831X_TCHDATA_EINT);
++
+ return IRQ_HANDLED;
+ }
+
+@@ -169,14 +177,15 @@ static int wm831x_ts_input_open(struct input_dev *idev)
+ struct wm831x *wm831x = wm831x_ts->wm831x;
+ u16 ena = 0;
+
++ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
++ WM831X_TCH_ENA, WM831X_TCH_ENA);
++
+ if (wm831x_ts->pressure)
+ ena |= WM831X_TCH_Z_ENA;
+
+ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
+- WM831X_TCH_ENA | WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA |
+- WM831X_TCH_Z_ENA,
+- WM831X_TCH_ENA | WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA |
+- ena);
++ WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA | WM831X_TCH_Z_ENA,
++ WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA | ena);
+
+ return 0;
+ }
+@@ -217,9 +226,6 @@ static int wm831x_ts_probe(struct platform_device *pdev)
+ */
+ if (pdata)
+ wm831x_ts->data_irq = pdata->data_irq;
+- else
+- wm831x_ts->data_irq = platform_get_irq_byname(pdev,
+- "TCHDATA");
+
+ if (pdata && pdata->pressure)
+ wm831x_ts->pressure = true;
+@@ -257,18 +263,24 @@ static int wm831x_ts_probe(struct platform_device *pdev)
+ }
+ }
+
+- /* Convert only when pen down */
+ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_2,
+- WM831X_TCH_PDONLY, WM831X_TCH_PDONLY);
++ WM831X_TCH_PDONLY, 0);
+
+- /* Default to 192 samples/sec */
++ /* Default to 112 samples/sec */
+ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
+- WM831X_TCH_RATE_MASK, 12);
++ WM831X_TCH_RATE_MASK, 6);
+
+- ret = request_threaded_irq(wm831x_ts->data_irq, NULL,
+- wm831x_ts_data_irq,
+- IRQF_ONESHOT, /* Trigger */
+- "Touchscreen data", wm831x_ts);
++ if (wm831x_ts->data_irq)
++ ret = request_threaded_irq(wm831x_ts->data_irq, NULL,
++ wm831x_ts_data_irq,
++ IRQF_ONESHOT, /* Trigger */
++ "Touchscreen data", wm831x_ts);
++ else
++ ret = request_threaded_irq(platform_get_irq_byname(pdev,
++ "TCHDATA"),
++ NULL, wm831x_ts_data_irq,
++ IRQF_ONESHOT, /* Trigger */
++ "Touchscreen data", wm831x_ts);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "Failed to request IRQ %d: %d\n",
+ wm831x_ts->data_irq, ret);
+@@ -324,7 +336,10 @@ err_dev_alloc:
+ err_pd_irq:
+ free_irq(platform_get_irq_byname(pdev, "TCHPD"), wm831x_ts);
+ err_data_irq:
+- free_irq(wm831x_ts->data_irq, wm831x_ts);
++ if (wm831x_ts->data_irq)
++ free_irq(wm831x_ts->data_irq, wm831x_ts);
++ else
++ free_irq(platform_get_irq_byname(pdev, "TCHDATA"), wm831x_ts);
+ err_alloc:
+ kfree(wm831x_ts);
+
+@@ -336,7 +351,10 @@ static int wm831x_ts_remove(struct platform_device *pdev)
+ struct wm831x_ts *wm831x_ts = platform_get_drvdata(pdev);
+
+ free_irq(platform_get_irq_byname(pdev, "TCHPD"), wm831x_ts);
+- free_irq(wm831x_ts->data_irq, wm831x_ts);
++ if (wm831x_ts->data_irq)
++ free_irq(wm831x_ts->data_irq, wm831x_ts);
++ else
++ free_irq(platform_get_irq_byname(pdev, "TCHDATA"), wm831x_ts);
+ input_unregister_device(wm831x_ts->input_dev);
+ kfree(wm831x_ts);
+
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/415-armadeus-Input-wm831x-Allows_using_external_signal_for_pen_down_interrupt.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/415-armadeus-Input-wm831x-Allows_using_external_signal_for_pen_down_interrupt.patch
new file mode 100644
index 0000000..d543d27
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/415-armadeus-Input-wm831x-Allows_using_external_signal_for_pen_down_interrupt.patch
@@ -0,0 +1,115 @@
+Handles pen_down interrupt from a direct signal too.
+
+Signed-off-by: Julien Boibessot <jul...@ar...>
+
+Index: linux-2.6.38-alpha/drivers/input/touchscreen/wm831x-ts.c
+===================================================================
+--- linux-2.6.38-alpha.orig/drivers/input/touchscreen/wm831x-ts.c 2011-01-03 18:02:37.000000000 +0100
++++ linux-2.6.38-alpha/drivers/input/touchscreen/wm831x-ts.c 2011-01-03 20:49:49.000000000 +0100
+@@ -98,6 +98,7 @@
+ struct input_dev *input_dev;
+ struct wm831x *wm831x;
+ int data_irq;
++ int pd_irq;
+ bool pressure;
+ };
+
+@@ -168,6 +169,13 @@
+ input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 1);
+ input_sync(wm831x_ts->input_dev);
+
++ /* If we're using a direct signal for the pen_down IRQ we still need
++ * to ack the interrupt.
++ */
++ if (wm831x_ts->pd_irq)
++ wm831x_set_bits(wm831x, WM831X_INTERRUPT_STATUS_1,
++ WM831X_TCHPD_EINT, WM831X_TCHPD_EINT);
++
+ return IRQ_HANDLED;
+ }
+
+@@ -224,9 +232,12 @@
+ /* If we have a direct CPU data IRQ use it, otherwise use
+ * the interrupt through the WM831x IRQ controller.
+ */
+- if (pdata)
++ if (pdata && pdata->data_irq)
+ wm831x_ts->data_irq = pdata->data_irq;
+
++ if (pdata && pdata->pd_irq)
++ wm831x_ts->pd_irq = pdata->pd_irq;
++
+ if (pdata && pdata->pressure)
+ wm831x_ts->pressure = true;
+ else
+@@ -282,19 +293,26 @@
+ IRQF_ONESHOT, /* Trigger */
+ "Touchscreen data", wm831x_ts);
+ if (ret < 0) {
+- dev_err(&pdev->dev, "Failed to request IRQ %d: %d\n",
++ dev_err(&pdev->dev, "Failed to request data IRQ %d: %d\n",
+ wm831x_ts->data_irq, ret);
+ goto err_alloc;
+ }
+
+- ret = request_threaded_irq(platform_get_irq_byname(pdev,
+- "TCHPD"),
+- NULL, wm831x_ts_pen_down_irq,
+- IRQF_ONESHOT, /* Trigger */
+- "Touchscreen pen down", wm831x_ts);
++ if (wm831x_ts->pd_irq)
++ ret = request_threaded_irq(wm831x_ts->pd_irq, NULL,
++ wm831x_ts_pen_down_irq,
++ IRQF_ONESHOT, /* Trigger */
++ "Touchscreen pen down", wm831x_ts);
++ else
++ ret = request_threaded_irq(platform_get_irq_byname(pdev,
++ "TCHPD"),
++ NULL, wm831x_ts_pen_down_irq,
++ IRQF_ONESHOT, /* Trigger */
++ "Touchscreen pen down", wm831x_ts);
++
+ if (ret < 0) {
+- dev_err(&pdev->dev, "Failed to request pen down IRQ: %d\n",
+- ret);
++ dev_err(&pdev->dev, "Failed to request pen down IRQ: %d %d\n",
++ wm831x_ts->pd_irq, ret);
+ goto err_data_irq;
+ }
+
+@@ -334,7 +352,10 @@
+ err_dev_alloc:
+ input_free_device(input_dev);
+ err_pd_irq:
+- free_irq(platform_get_irq_byname(pdev, "TCHPD"), wm831x_ts);
++ if (wm831x_ts->pd_irq)
++ free_irq(wm831x_ts->pd_irq, wm831x_ts);
++ else
++ free_irq(platform_get_irq_byname(pdev, "TCHPD"), wm831x_ts);
+ err_data_irq:
+ if (wm831x_ts->data_irq)
+ free_irq(wm831x_ts->data_irq, wm831x_ts);
+@@ -350,7 +371,10 @@
+ {
+ struct wm831x_ts *wm831x_ts = platform_get_drvdata(pdev);
+
+- free_irq(platform_get_irq_byname(pdev, "TCHPD"), wm831x_ts);
++ if (wm831x_ts->pd_irq)
++ free_irq(wm831x_ts->pd_irq, wm831x_ts);
++ else
++ free_irq(platform_get_irq_byname(pdev, "TCHPD"), wm831x_ts);
+ if (wm831x_ts->data_irq)
+ free_irq(wm831x_ts->data_irq, wm831x_ts);
+ else
+Index: linux-2.6.38-alpha/include/linux/mfd/wm831x/pdata.h
+===================================================================
+--- linux-2.6.38-alpha.orig/include/linux/mfd/wm831x/pdata.h 2010-12-14 09:55:53.000000000 +0100
++++ linux-2.6.38-alpha/include/linux/mfd/wm831x/pdata.h 2011-01-03 20:49:02.000000000 +0100
+@@ -81,6 +81,7 @@
+ int rpu; /** Pen down sensitivity resistor divider */
+ int pressure; /** Report pressure (boolean) */
+ int data_irq; /** Touch data ready IRQ */
++ int pd_irq; /** Touch pendown detect IRQ */
+ };
+
+ enum wm831x_watchdog_action {
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/416-armadeus-Input-wm831x-Data_acquisition_start_when_pen_down_is_detected_isnt_working.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/416-armadeus-Input-wm831x-Data_acquisition_start_when_pen_down_is_detected_isnt_working.patch
new file mode 100644
index 0000000..df98cf1
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/416-armadeus-Input-wm831x-Data_acquisition_start_when_pen_down_is_detected_isnt_working.patch
@@ -0,0 +1,43 @@
+Feature is not working so don't use it (for the moment).
+
+Signed-off-by: Julien Boibessot <jul...@ar...>
+
+Index: linux-2.6.38-alpha/drivers/input/touchscreen/wm831x-ts.c
+===================================================================
+--- linux-2.6.38-alpha.orig/drivers/input/touchscreen/wm831x-ts.c 2011-01-04 10:06:40.000000000 +0100
++++ linux-2.6.38-alpha/drivers/input/touchscreen/wm831x-ts.c 2011-01-05 15:28:12.000000000 +0100
+@@ -137,9 +137,9 @@
+ }
+
+ if (!pen_down) {
+- wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
++/* wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
+ WM831X_TCH_CVT_ENA, 0);
+-
++*/
+ if (wm831x_ts->pressure)
+ input_report_abs(wm831x_ts->input_dev,
+ ABS_PRESSURE, 0);
+@@ -163,9 +163,9 @@
+ struct wm831x_ts *wm831x_ts = irq_data;
+ struct wm831x *wm831x = wm831x_ts->wm831x;
+
+- wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
++/* wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
+ WM831X_TCH_CVT_ENA, WM831X_TCH_CVT_ENA);
+-
++*/
+ input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 1);
+ input_sync(wm831x_ts->input_dev);
+
+@@ -192,8 +192,8 @@
+ ena |= WM831X_TCH_Z_ENA;
+
+ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
+- WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA | WM831X_TCH_Z_ENA,
+- WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA | ena);
++ WM831X_TCH_CVT_ENA | WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA | WM831X_TCH_Z_ENA,
++ WM831X_TCH_CVT_ENA | WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA | ena);
+
+ return 0;
+ }
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/417-armadeus-input-wm831x-driver_hacks.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/417-armadeus-input-wm831x-driver_hacks.patch
new file mode 100644
index 0000000..205d7ef
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/417-armadeus-input-wm831x-driver_hacks.patch
@@ -0,0 +1,57 @@
+Signed-off-by: Julien Boibessot <jul...@ar...>
+
+Index: linux-2.6.38-alpha/drivers/input/touchscreen/wm831x-ts.c
+===================================================================
+--- linux-2.6.38-alpha.orig/drivers/input/touchscreen/wm831x-ts.c 2011-01-03 21:42:27.000000000 +0100
++++ linux-2.6.38-alpha/drivers/input/touchscreen/wm831x-ts.c 2011-01-03 22:01:20.000000000 +0100
+@@ -218,6 +218,7 @@
+ struct input_dev *input_dev;
+ int ret;
+
++ printk("--- %s (%s %s)\n", __func__, __DATE__, __TIME__);
+ wm831x_ts = kzalloc(sizeof(struct wm831x_ts), GFP_KERNEL);
+ if (!wm831x_ts)
+ return -ENOMEM;
+@@ -248,7 +249,7 @@
+ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_2,
+ WM831X_TCH_5WIRE, WM831X_TCH_5WIRE);
+
+- /* Pressure measurments are not possible for five wire mode */
++ /* Pressure measurements are not possible for five wire mode */
+ WARN_ON(pdata->pressure && pdata->fivewire);
+ wm831x_ts->pressure = false;
+ } else {
+@@ -274,12 +275,13 @@
+ }
+ }
+
++ /* "Convert only when pen down" isn't working (yet) so don't use it */
+ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_2,
+ WM831X_TCH_PDONLY, 0);
+
+- /* Default to 112 samples/sec */
++ /* Default to 64 samples/sec */
+ wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
+- WM831X_TCH_RATE_MASK, 6);
++ WM831X_TCH_RATE_MASK, 4);
+
+ if (wm831x_ts->data_irq)
+ ret = request_threaded_irq(wm831x_ts->data_irq, NULL,
+@@ -318,6 +320,17 @@
+
+ platform_set_drvdata(pdev, wm831x_ts);
+
++ /* GPIO3 -> EOC */
++ wm831x_reg_write(wm831x, 0x4037 + 3, 0x0087);
++ /* GPIO7 -> EOC also (dbg) */
++ wm831x_reg_write(wm831x, 0x404c, 0x0000); /* LED1 off */
++ wm831x_reg_write(wm831x, 0x4037 + 7, 0x0087);
++ /* GPIO2 -> PD DETECT */
++ wm831x_reg_write(wm831x, 0x4037 + 2, 0x0086);
++ /* GPIO6 -> PD DETECT also (dbg) */
++ wm831x_reg_write(wm831x, 0x404d, 0x0000); /* LED2 off */
++ wm831x_reg_write(wm831x, 0x4037 + 6, 0x0086);
++
+ input_dev = input_allocate_device();
+ if (input_dev == NULL) {
+ ret = -ENOMEM;
hooks/post-receive
--
armadeus
|