[Armadeus-commitlog] armadeus branch, master, updated. armadeus-5.3-377-g9a2417f
Brought to you by:
sszy
|
From: Sébastien S. <ss...@us...> - 2014-08-11 08:04:13
|
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 9a2417f75df0427a3701e6760c2b413b423f19d5 (commit)
via da28e2f04effd7ed5a3408f6084d4ece01db04ae (commit)
via f6f1d40586716173a655c1eb96e820c8acf2d37c (commit)
via 525b178e78b99891d84c2f79e3a8052c2c376ae3 (commit)
via 683953633df1f28b7e0e9a153ff73fa5c7d252a0 (commit)
via ff20ee2027bcad13af091d6d2d24152e8564d6a5 (commit)
via e67810ee0d04fa8a6228a2d3f0d00340bc72b710 (commit)
from 98ff779657e244d570fd8cf77ad3c03e0a3cdd70 (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 9a2417f75df0427a3701e6760c2b413b423f19d5
Author: Sébastien Szymanski <seb...@ar...>
Date: Mon Aug 11 00:09:22 2014 +0200
[LINUX] apf51-v2: 3.16: dts: add gpo2 and gpo3
commit da28e2f04effd7ed5a3408f6084d4ece01db04ae
Author: Sébastien Szymanski <seb...@ar...>
Date: Sun Aug 10 19:52:09 2014 +0200
[LINUX] move to kernel 3.16
commit f6f1d40586716173a655c1eb96e820c8acf2d37c
Author: Sébastien Szymanski <seb...@ar...>
Date: Sun Aug 10 19:41:21 2014 +0200
[LINUX] 3.16: apf51: enable MC13892 PMIC drivers
commit 525b178e78b99891d84c2f79e3a8052c2c376ae3
Author: Sébastien Szymanski <seb...@ar...>
Date: Sun Aug 10 19:39:16 2014 +0200
[LINUX] 3.16: apf51: add MC13892 touchscreen support.
The code for MC13892 support and calibration comes from Oskar Schirmer
from here: https://lkml.org/lkml/2012/2/14/98
commit 683953633df1f28b7e0e9a153ff73fa5c7d252a0
Author: Sébastien Szymanski <seb...@ar...>
Date: Sun Aug 10 04:25:00 2014 +0200
[LINUX] 3.16: apf51: dts: rework dts files for apf51 v2 module.
The APF51 V2 module has a MC13892 PMIC.
Patches 400, 401 and 414 have been merged into new patch 0415.
The apf51 device trees files are now:
- imx51-apf51.dtsi
- imx51-apf51-v1.dtsi (includes imx51-apf51.dtsi)
- imx51-apf51-v2.dtsi (includes imx51-apf51.dtsi)
- imx51-apf51dev.dtsi
- imx51-apf51dev-v1.dts (includes imx51-apf51-v1.dtsi)
- imx51-apf51dev-v2.dts (includes imx51-apf51-v2.dtsi)
commit ff20ee2027bcad13af091d6d2d24152e8564d6a5
Author: Sébastien Szymanski <seb...@ar...>
Date: Sat Aug 9 23:17:02 2014 +0200
[LINUX] 3.1{5,6}: apf51: remove patch 0412
This patch adds a uart1 pinctrl node in apf51.dts file. However, since linux
3.15 pinctrl nodes are board specific, see [1]. So the uart1 node
is badly placed. Moreover this node is not used in apf51 dts files.
[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/imx51.dtsi?id=5a2a7d57ee66a1347ba39a4b474dfad08e3a68a3
commit e67810ee0d04fa8a6228a2d3f0d00340bc72b710
Author: Sébastien Szymanski <seb...@ar...>
Date: Sat Aug 9 22:26:21 2014 +0200
[LINUX] 3.16: apf51: enable IPUv3 driver
-----------------------------------------------------------------------
Summary of changes:
buildroot/configs/apf6_defconfig | 2 +-
.../armadeus/apf27/apf27-linux-3.16-rc7.config | 1 -
.../armadeus/apf28/apf28-linux-3.16-rc7.config | 1 -
.../armadeus/apf51/apf51-linux-3.16-rc7.config | 1 -
.../device/armadeus/apf51/apf51-linux-3.16.config | 9 +-
.../armadeus/apf6/apf6-linux-3.16-rc7.config | 1 -
...us-imx51-dts-add-pin-definition-for-uart1.patch | 29 -
patches/linux/3.16-rc7 | 1 -
.../3.16/0400-Add-apf51-basic-dt-support.patch | 105 ---
.../0401-armadeus-add_apf51dev_baseboard.patch | 91 --
...us-imx51-dts-add-pin-definition-for-uart1.patch | 29 -
...dts-apf51dev-add_gpio_key_wakeup_behavior.patch | 16 -
...us-apf51-add_apf51_v1-and_v2_device_trees.patch | 904 ++++++++++++++++++++
...eus-apf51-add_mc13982_touchscreen_support.patch | 540 ++++++++++++
14 files changed, 1453 insertions(+), 277 deletions(-)
delete mode 120000 buildroot/target/device/armadeus/apf27/apf27-linux-3.16-rc7.config
delete mode 120000 buildroot/target/device/armadeus/apf28/apf28-linux-3.16-rc7.config
delete mode 120000 buildroot/target/device/armadeus/apf51/apf51-linux-3.16-rc7.config
delete mode 120000 buildroot/target/device/armadeus/apf6/apf6-linux-3.16-rc7.config
delete mode 100644 patches/linux/3.15/0412-armadeus-imx51-dts-add-pin-definition-for-uart1.patch
delete mode 120000 patches/linux/3.16-rc7
delete mode 100644 patches/linux/3.16/0400-Add-apf51-basic-dt-support.patch
delete mode 100644 patches/linux/3.16/0401-armadeus-add_apf51dev_baseboard.patch
delete mode 100644 patches/linux/3.16/0412-armadeus-imx51-dts-add-pin-definition-for-uart1.patch
delete mode 100644 patches/linux/3.16/0414-armadeus-dts-apf51dev-add_gpio_key_wakeup_behavior.patch
create mode 100644 patches/linux/3.16/0415-armadeus-apf51-add_apf51_v1-and_v2_device_trees.patch
create mode 100644 patches/linux/3.16/0416-armadeus-apf51-add_mc13982_touchscreen_support.patch
diff --git a/buildroot/configs/apf6_defconfig b/buildroot/configs/apf6_defconfig
index b0d013d..0fb2947 100644
--- a/buildroot/configs/apf6_defconfig
+++ b/buildroot/configs/apf6_defconfig
@@ -22,7 +22,7 @@ BR2_TARGET_ARMADEUS_NR_SDRAM="2"
BR2_TARGET_ARMADEUS_SDRAM_SIZE="512"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.16-rc7"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.16"
BR2_LINUX_KERNEL_PATCH="../patches/linux/$(BR2_LINUX_KERNEL_VERSION)"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-linux-$(BR2_LINUX_KERNEL_VERSION).config"
diff --git a/buildroot/target/device/armadeus/apf27/apf27-linux-3.16-rc7.config b/buildroot/target/device/armadeus/apf27/apf27-linux-3.16-rc7.config
deleted file mode 120000
index 946ea8d..0000000
--- a/buildroot/target/device/armadeus/apf27/apf27-linux-3.16-rc7.config
+++ /dev/null
@@ -1 +0,0 @@
-apf27-linux-3.16.config
\ No newline at end of file
diff --git a/buildroot/target/device/armadeus/apf28/apf28-linux-3.16-rc7.config b/buildroot/target/device/armadeus/apf28/apf28-linux-3.16-rc7.config
deleted file mode 120000
index 8af93d4..0000000
--- a/buildroot/target/device/armadeus/apf28/apf28-linux-3.16-rc7.config
+++ /dev/null
@@ -1 +0,0 @@
-apf28-linux-3.16.config
\ No newline at end of file
diff --git a/buildroot/target/device/armadeus/apf51/apf51-linux-3.16-rc7.config b/buildroot/target/device/armadeus/apf51/apf51-linux-3.16-rc7.config
deleted file mode 120000
index 9c57540..0000000
--- a/buildroot/target/device/armadeus/apf51/apf51-linux-3.16-rc7.config
+++ /dev/null
@@ -1 +0,0 @@
-apf51-linux-3.16.config
\ No newline at end of file
diff --git a/buildroot/target/device/armadeus/apf51/apf51-linux-3.16.config b/buildroot/target/device/armadeus/apf51/apf51-linux-3.16.config
index fd2729f..bdf1419 100644
--- a/buildroot/target/device/armadeus/apf51/apf51-linux-3.16.config
+++ b/buildroot/target/device/armadeus/apf51/apf51-linux-3.16.config
@@ -111,7 +111,9 @@ CONFIG_KEYBOARD_GPIO=m
CONFIG_KEYBOARD_IMX=m
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_WM831X=y
+CONFIG_TOUCHSCREEN_MC13XXX=m
CONFIG_INPUT_MISC=y
+CONFIG_INPUT_MC13783_PWRBUTTON=m
CONFIG_INPUT_UINPUT=m
CONFIG_INPUT_WM831X_ON=y
# CONFIG_LEGACY_PTYS is not set
@@ -132,14 +134,18 @@ CONFIG_WM831X_BACKUP=m
CONFIG_WM831X_POWER=m
CONFIG_HWMON=m
CONFIG_SENSORS_AS1531=m
+CONFIG_SENSORS_MC13783_ADC=m
CONFIG_SENSORS_WM831X=m
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_NOWAYOUT=y
CONFIG_WM831X_WATCHDOG=m
CONFIG_IMX2_WDT=y
+CONFIG_MFD_MC13XXX_I2C=y
CONFIG_MFD_WM831X_I2C=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_REGULATOR_MC13892=m
+CONFIG_IMX_IPUV3_CORE=y
CONFIG_DRM=y
CONFIG_MFD_IMX_IPU_V3=y
CONFIG_MEDIA_SUPPORT=m
@@ -229,17 +235,18 @@ CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_WM831X_STATUS=m
+CONFIG_LEDS_MC13783=m
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_MXC=y
CONFIG_RTC_DRV_WM831X=y
+CONFIG_RTC_DRV_MC13XXX=m
CONFIG_STAGING=y
CONFIG_DRM_IMX=y
CONFIG_DRM_IMX_FB_HELPER=y
CONFIG_DRM_IMX_PARALLEL_DISPLAY=y
CONFIG_DRM_IMX_TVE=y
-CONFIG_DRM_IMX_IPUV3_CORE=y
CONFIG_DRM_IMX_IPUV3=y
CONFIG_IIO=m
CONFIG_EXT2_FS=y
diff --git a/buildroot/target/device/armadeus/apf6/apf6-linux-3.16-rc7.config b/buildroot/target/device/armadeus/apf6/apf6-linux-3.16-rc7.config
deleted file mode 120000
index 4f41d2e..0000000
--- a/buildroot/target/device/armadeus/apf6/apf6-linux-3.16-rc7.config
+++ /dev/null
@@ -1 +0,0 @@
-apf6-linux-3.16.config
\ No newline at end of file
diff --git a/patches/linux/3.15/0412-armadeus-imx51-dts-add-pin-definition-for-uart1.patch b/patches/linux/3.15/0412-armadeus-imx51-dts-add-pin-definition-for-uart1.patch
deleted file mode 100644
index 38521dd..0000000
--- a/patches/linux/3.15/0412-armadeus-imx51-dts-add-pin-definition-for-uart1.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 8298da1db865a3789c8a786c95b5def6003e53d1 Mon Sep 17 00:00:00 2001
-From: Philippe Reynes <tr...@ya...>
-Date: Mon, 11 Nov 2013 10:09:41 +0100
-Subject: [PATCH] To use UART1 without CTS/RTS.
-
-Signed-off-by: Julien Boibessot <jul...@ar...>
----
- arch/arm/boot/dts/imx51.dtsi | 6 ++++++
- 1 files changed, 6 insertions(+), 0 deletions(-)
-
-diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
-index 524ac61..c863f6c 100644
---- a/arch/arm/boot/dts/imx51.dtsi
-+++ b/arch/arm/boot/dts/imx51.dtsi
-@@ -760,6 +760,12 @@
- MX51_PAD_UART1_CTS__UART1_CTS 0x1c5
- >;
- };
-+ pinctrl_uart1_2: uart1grp-2 {
-+ fsl,pins = <
-+ MX51_PAD_UART1_RXD__UART1_RXD 0x1c5
-+ MX51_PAD_UART1_TXD__UART1_TXD 0x1c5
-+ >;
-+ };
- };
-
- uart2 {
---
-1.7.4.4
diff --git a/patches/linux/3.16-rc7 b/patches/linux/3.16-rc7
deleted file mode 120000
index 1bc446c..0000000
--- a/patches/linux/3.16-rc7
+++ /dev/null
@@ -1 +0,0 @@
-3.16
\ No newline at end of file
diff --git a/patches/linux/3.16/0400-Add-apf51-basic-dt-support.patch b/patches/linux/3.16/0400-Add-apf51-basic-dt-support.patch
deleted file mode 100644
index d466dac..0000000
--- a/patches/linux/3.16/0400-Add-apf51-basic-dt-support.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-Add apf51 basic support
-
-Signed-off-by: Laurent Cans <lau...@gm...>
-Signed-off-by: Gwenhael Goavec-Merou <gwe...@ar...>
----
-Index: linux-3.13-rc2/arch/arm/boot/dts/imx51-apf51.dts
-===================================================================
---- linux-3.13-rc2.orig/arch/arm/boot/dts/imx51-apf51.dts
-+++ linux-3.13-rc2/arch/arm/boot/dts/imx51-apf51.dts
-@@ -30,6 +30,19 @@
- clock-frequency = <33554432>;
- };
- };
-+
-+ regulators {
-+ compatible = "simple-bus";
-+
-+ reg_usbotg_vbus: usbotg_vbus {
-+ compatible = "regulator-fixed";
-+ regulator-name = "usbotg_vbus";
-+ regulator-min-microvolt = <5000000>;
-+ regulator-max-microvolt = <5000000>;
-+ gpio = <&gpio1 8 0>;
-+ enable-active-high;
-+ };
-+ };
- };
-
- &fec {
-@@ -72,6 +72,43 @@
- MX51_PAD_UART3_TXD__UART3_TXD 0x1c5
- >;
- };
-+ usbh1 {
-+ pinctrl_usbh1_1: usbh1grp-1 {
-+ fsl,pins = <
-+ MX51_PAD_USBH1_DATA0__USBH1_DATA0 0x1e5
-+ MX51_PAD_USBH1_DATA1__USBH1_DATA1 0x1e5
-+ MX51_PAD_USBH1_DATA2__USBH1_DATA2 0x1e5
-+ MX51_PAD_USBH1_DATA3__USBH1_DATA3 0x1e5
-+ MX51_PAD_USBH1_DATA4__USBH1_DATA4 0x1e5
-+ MX51_PAD_USBH1_DATA5__USBH1_DATA5 0x1e5
-+ MX51_PAD_USBH1_DATA6__USBH1_DATA6 0x1e5
-+ MX51_PAD_USBH1_DATA7__USBH1_DATA7 0x1e5
-+ MX51_PAD_USBH1_CLK__USBH1_CLK 0x1e5
-+ MX51_PAD_USBH1_DIR__USBH1_DIR 0x1e5
-+ MX51_PAD_USBH1_NXT__USBH1_NXT 0x1e5
-+ MX51_PAD_USBH1_STP__USBH1_STP 0x1e5
-+ >;
-+ };
-+ };
-+
-+ usbh2 {
-+ pinctrl_usbh2_1: usbh2grp-1 {
-+ fsl,pins = <
-+ MX51_PAD_EIM_D16__USBH2_DATA0 0x1e5
-+ MX51_PAD_EIM_D17__USBH2_DATA1 0x1e5
-+ MX51_PAD_EIM_D18__USBH2_DATA2 0x1e5
-+ MX51_PAD_EIM_D19__USBH2_DATA3 0x1e5
-+ MX51_PAD_EIM_D20__USBH2_DATA4 0x1e5
-+ MX51_PAD_EIM_D21__USBH2_DATA5 0x1e5
-+ MX51_PAD_EIM_D22__USBH2_DATA6 0x1e5
-+ MX51_PAD_EIM_D23__USBH2_DATA7 0x1e5
-+ MX51_PAD_EIM_A24__USBH2_CLK 0x1e5
-+ MX51_PAD_EIM_A25__USBH2_DIR 0x1e5
-+ MX51_PAD_EIM_A27__USBH2_NXT 0x1e5
-+ MX51_PAD_EIM_A26__USBH2_STP 0x1e5
-+ >;
-+ };
-+ };
- };
- };
-
-@@ -87,3 +100,31 @@
- pinctrl-0 = <&pinctrl_uart3>;
- status = "okay";
- };
-+
-+&usbphy1 {
-+ reset-gpios = <&gpio3 1 1>;
-+};
-+
-+&usbh1 {
-+ pinctrl-names = "default";
-+ pinctrl-0 = <&pinctrl_usbh1_1>;
-+ phy_type = "ulpi";
-+ dr_mode = "host";
-+ ext-clk-en;
-+ status = "okay";
-+};
-+
-+&usbh2 {
-+ pinctrl-names = "default";
-+ pinctrl-0 = <&pinctrl_usbh2_1>;
-+ phy_type = "ulpi";
-+ dr_mode = "host";
-+ ext-clk-en;
-+ status = "okay";
-+};
-+
-+&usbotg {
-+ phy_type = "utmi_wide";
-+ vbus-supply = <®_usbotg_vbus>;
-+ status = "okay";
-+};
diff --git a/patches/linux/3.16/0401-armadeus-add_apf51dev_baseboard.patch b/patches/linux/3.16/0401-armadeus-add_apf51dev_baseboard.patch
deleted file mode 100644
index f456c61..0000000
--- a/patches/linux/3.16/0401-armadeus-add_apf51dev_baseboard.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-The APF51Dev is a docking board for an APF51 SOM
-
-Signed-off-by: Gwenhael Goavec-Merou <gwe...@ar...>
-Signed-off-by: Laurent Cans <lau...@gm...>
----
-Index: linux-3.14-rc4/arch/arm/boot/dts/imx51-apf51dev.dts
-===================================================================
---- linux-3.14-rc4.orig/arch/arm/boot/dts/imx51-apf51dev.dts
-+++ linux-3.14-rc4/arch/arm/boot/dts/imx51-apf51dev.dts
-@@ -66,6 +66,12 @@
- gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
- linux,default-trigger = "heartbeat";
- };
-+
-+ backlight {
-+ label = "Backlight";
-+ gpios = <&gpio3 4 0>;
-+ default-state = "on";
-+ };
- };
- };
-
-@@ -85,6 +91,14 @@
- cs-gpios = <&gpio3 28 GPIO_ACTIVE_LOW>,
- <&gpio3 27 GPIO_ACTIVE_LOW>;
- status = "okay";
-+
-+ spidev: spidev@1 {
-+ #address-cells = <1>;
-+ #size-cells = <1>;
-+ compatible = "spidev";
-+ spi-max-frequency = <25000000>;
-+ reg = <1>;
-+ };
- };
-
- &esdhc1 {
-@@ -99,7 +113,6 @@
- pinctrl-names = "default";
- pinctrl-0 = <&pinctrl_esdhc2>;
- bus-width = <4>;
-- non-removable;
- status = "okay";
- };
-
-@@ -102,6 +115,13 @@
- status = "okay";
- };
-
-+&uart2 {
-+ pinctrl-names = "default";
-+ pinctrl-0 = <&pinctrl_uart2_1>;
-+ fsl,uart-has-rtscts;
-+ status = "okay";
-+};
-+
- &iomuxc {
- pinctrl-names = "default";
- pinctrl-0 = <&pinctrl_hog>;
-@@ -116,6 +136,7 @@
- imx51-apf51dev {
- pinctrl_hog: hoggrp {
- fsl,pins = <
-+ MX51_PAD_GPIO1_8__GPIO1_8 0x0C5
- MX51_PAD_EIM_EB2__GPIO2_22 0x0C5
- MX51_PAD_EIM_EB3__GPIO2_23 0x0C5
- MX51_PAD_EIM_CS4__GPIO2_29 0x100
-@@ -125,6 +146,8 @@
- MX51_PAD_CSPI1_SS1__GPIO4_25 0x0C5
- MX51_PAD_GPIO1_2__GPIO1_2 0x0C5
- MX51_PAD_GPIO1_3__GPIO1_3 0x0C5
-+ MX51_PAD_DI1_D1_CS__GPIO3_4 0x0C5
-+ MX51_PAD_EIM_CS3__GPIO2_28 0x0C5
- >;
- };
-
-@@ -203,6 +203,14 @@
- MX51_PAD_DI1_PIN3__DI1_PIN3 0x5
- >;
- };
-+ uart2 {
-+ pinctrl_uart2_1: uart2grp-1 {
-+ fsl,pins = <
-+ MX51_PAD_UART2_RXD__UART2_RXD 0x1c5
-+ MX51_PAD_UART2_TXD__UART2_TXD 0x1c5
-+ >;
-+ };
-+ };
- };
- };
-
diff --git a/patches/linux/3.16/0412-armadeus-imx51-dts-add-pin-definition-for-uart1.patch b/patches/linux/3.16/0412-armadeus-imx51-dts-add-pin-definition-for-uart1.patch
deleted file mode 100644
index 38521dd..0000000
--- a/patches/linux/3.16/0412-armadeus-imx51-dts-add-pin-definition-for-uart1.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 8298da1db865a3789c8a786c95b5def6003e53d1 Mon Sep 17 00:00:00 2001
-From: Philippe Reynes <tr...@ya...>
-Date: Mon, 11 Nov 2013 10:09:41 +0100
-Subject: [PATCH] To use UART1 without CTS/RTS.
-
-Signed-off-by: Julien Boibessot <jul...@ar...>
----
- arch/arm/boot/dts/imx51.dtsi | 6 ++++++
- 1 files changed, 6 insertions(+), 0 deletions(-)
-
-diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
-index 524ac61..c863f6c 100644
---- a/arch/arm/boot/dts/imx51.dtsi
-+++ b/arch/arm/boot/dts/imx51.dtsi
-@@ -760,6 +760,12 @@
- MX51_PAD_UART1_CTS__UART1_CTS 0x1c5
- >;
- };
-+ pinctrl_uart1_2: uart1grp-2 {
-+ fsl,pins = <
-+ MX51_PAD_UART1_RXD__UART1_RXD 0x1c5
-+ MX51_PAD_UART1_TXD__UART1_TXD 0x1c5
-+ >;
-+ };
- };
-
- uart2 {
---
-1.7.4.4
diff --git a/patches/linux/3.16/0414-armadeus-dts-apf51dev-add_gpio_key_wakeup_behavior.patch b/patches/linux/3.16/0414-armadeus-dts-apf51dev-add_gpio_key_wakeup_behavior.patch
deleted file mode 100644
index 48c2c01..0000000
--- a/patches/linux/3.16/0414-armadeus-dts-apf51dev-add_gpio_key_wakeup_behavior.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-add wakeup capabilities to the apf51dev user button
-
-Signed-off-by: Eric Jarrige <eri...@ar...>
-
-Index: linux-3.15-rc1/arch/arm/boot/dts/imx51-apf51dev.dts
-===================================================================
---- linux-3.15-rc1.orig/arch/arm/boot/dts/imx51-apf51dev.dts
-+++ linux-3.15-rc1/arch/arm/boot/dts/imx51-apf51dev.dts
-@@ -55,6 +55,7 @@
- label = "user";
- gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
- linux,code = <256>; /* BTN_0 */
-+ gpio-key,wakeup;
- };
- };
-
diff --git a/patches/linux/3.16/0415-armadeus-apf51-add_apf51_v1-and_v2_device_trees.patch b/patches/linux/3.16/0415-armadeus-apf51-add_apf51_v1-and_v2_device_trees.patch
new file mode 100644
index 0000000..ec76f97
--- /dev/null
+++ b/patches/linux/3.16/0415-armadeus-apf51-add_apf51_v1-and_v2_device_trees.patch
@@ -0,0 +1,904 @@
+Index: linux-3.16/arch/arm/boot/dts/imx51-apf51.dtsi
+===================================================================
+--- /dev/null
++++ linux-3.16/arch/arm/boot/dts/imx51-apf51.dtsi
+@@ -0,0 +1,182 @@
++/*
++ * Copyright 2014 Armadeus Systems - <su...@ar...>
++ * Copyright 2012 Laurent Cans <lau...@gm...>
++ *
++ * Based on mx51-babbage.dts
++ * Copyright 2011 Freescale Semiconductor, Inc.
++ * Copyright 2011 Linaro Ltd.
++ *
++ * The code contained herein is licensed under the GNU General Public
++ * License. You may obtain a copy of the GNU General Public License
++ * Version 2 or later at the following locations:
++ *
++ * http://www.opensource.org/licenses/gpl-license.html
++ * http://www.gnu.org/copyleft/gpl.html
++ */
++
++#include "imx51.dtsi"
++
++/ {
++ memory {
++ reg = <0x90000000 0x20000000>;
++ };
++
++ clocks {
++ osc {
++ clock-frequency = <33554432>;
++ };
++ };
++
++ regulators {
++ compatible = "simple-bus";
++
++ reg_usbotg_vbus: usbotg_vbus {
++ compatible = "regulator-fixed";
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_usbotgreg>;
++ regulator-name = "usbotg_vbus";
++ regulator-min-microvolt = <5000000>;
++ regulator-max-microvolt = <5000000>;
++ gpio = <&gpio1 8 GPIO_ACTIVE_HIGH>;
++ enable-active-high;
++ };
++ };
++};
++
++&fec {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_fec>;
++ phy-mode = "mii";
++ phy-reset-gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
++ phy-reset-duration = <1>;
++ status = "okay";
++};
++
++&i2c2 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_i2c2>;
++ clock-frequency = <400000>;
++ status = "okay";
++};
++
++&nfc {
++ nand-bus-width = <8>;
++ nand-ecc-mode = "hw";
++ nand-on-flash-bbt;
++ status = "okay";
++};
++
++&uart3 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_uart3>;
++ status = "okay";
++};
++
++&usbphy1 {
++ reset-gpios = <&gpio3 1 GPIO_ACTIVE_LOW>;
++};
++
++&usbh1 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_usbh1>;
++ phy_type = "ulpi";
++ dr_mode = "host";
++ ext-clk-en;
++ status = "okay";
++};
++
++&usbh2 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_usbh2>;
++ phy_type = "ulpi";
++ dr_mode = "host";
++ ext-clk-en;
++ status = "okay";
++};
++
++&usbotg {
++ phy_type = "utmi_wide";
++ vbus-supply = <®_usbotg_vbus>;
++ status = "okay";
++};
++
++&iomuxc {
++ imx51-apf51 {
++ pinctrl_fec: fecgrp {
++ fsl,pins = <
++ MX51_PAD_DI_GP3__FEC_TX_ER 0x80000000
++ MX51_PAD_DI2_PIN4__FEC_CRS 0x80000000
++ MX51_PAD_DI2_PIN2__FEC_MDC 0x80000000
++ MX51_PAD_DI2_PIN3__FEC_MDIO 0x80000000
++ MX51_PAD_DI2_DISP_CLK__FEC_RDATA1 0x80000000
++ MX51_PAD_DI_GP4__FEC_RDATA2 0x80000000
++ MX51_PAD_DISP2_DAT0__FEC_RDATA3 0x80000000
++ MX51_PAD_DISP2_DAT1__FEC_RX_ER 0x80000000
++ MX51_PAD_DISP2_DAT6__FEC_TDATA1 0x80000000
++ MX51_PAD_DISP2_DAT7__FEC_TDATA2 0x80000000
++ MX51_PAD_DISP2_DAT8__FEC_TDATA3 0x80000000
++ MX51_PAD_DISP2_DAT9__FEC_TX_EN 0x80000000
++ MX51_PAD_DISP2_DAT10__FEC_COL 0x80000000
++ MX51_PAD_DISP2_DAT11__FEC_RX_CLK 0x80000000
++ MX51_PAD_DISP2_DAT12__FEC_RX_DV 0x80000000
++ MX51_PAD_DISP2_DAT13__FEC_TX_CLK 0x80000000
++ MX51_PAD_DISP2_DAT14__FEC_RDATA0 0x80000000
++ MX51_PAD_DISP2_DAT15__FEC_TDATA0 0x80000000
++ >;
++ };
++
++ pinctrl_i2c2: i2c2grp {
++ fsl,pins = <
++ MX51_PAD_EIM_D27__I2C2_SCL 0x400001ed
++ MX51_PAD_EIM_D24__I2C2_SDA 0x400001ed
++ >;
++ };
++
++ pinctrl_uart3: uart3grp {
++ fsl,pins = <
++ MX51_PAD_UART3_RXD__UART3_RXD 0x1c5
++ MX51_PAD_UART3_TXD__UART3_TXD 0x1c5
++ >;
++ };
++
++ pinctrl_usbh1: usbh1grp {
++ fsl,pins = <
++ MX51_PAD_USBH1_DATA0__USBH1_DATA0 0x1e5
++ MX51_PAD_USBH1_DATA1__USBH1_DATA1 0x1e5
++ MX51_PAD_USBH1_DATA2__USBH1_DATA2 0x1e5
++ MX51_PAD_USBH1_DATA3__USBH1_DATA3 0x1e5
++ MX51_PAD_USBH1_DATA4__USBH1_DATA4 0x1e5
++ MX51_PAD_USBH1_DATA5__USBH1_DATA5 0x1e5
++ MX51_PAD_USBH1_DATA6__USBH1_DATA6 0x1e5
++ MX51_PAD_USBH1_DATA7__USBH1_DATA7 0x1e5
++ MX51_PAD_USBH1_CLK__USBH1_CLK 0x1e5
++ MX51_PAD_USBH1_DIR__USBH1_DIR 0x1e5
++ MX51_PAD_USBH1_NXT__USBH1_NXT 0x1e5
++ MX51_PAD_USBH1_STP__USBH1_STP 0x1e5
++ >;
++ };
++
++ pinctrl_usbh2: usbh2grp {
++ fsl,pins = <
++ MX51_PAD_EIM_D16__USBH2_DATA0 0x1e5
++ MX51_PAD_EIM_D17__USBH2_DATA1 0x1e5
++ MX51_PAD_EIM_D18__USBH2_DATA2 0x1e5
++ MX51_PAD_EIM_D19__USBH2_DATA3 0x1e5
++ MX51_PAD_EIM_D20__USBH2_DATA4 0x1e5
++ MX51_PAD_EIM_D21__USBH2_DATA5 0x1e5
++ MX51_PAD_EIM_D22__USBH2_DATA6 0x1e5
++ MX51_PAD_EIM_D23__USBH2_DATA7 0x1e5
++ MX51_PAD_EIM_A24__USBH2_CLK 0x1e5
++ MX51_PAD_EIM_A25__USBH2_DIR 0x1e5
++ MX51_PAD_EIM_A27__USBH2_NXT 0x1e5
++ MX51_PAD_EIM_A26__USBH2_STP 0x1e5
++ >;
++ };
++
++ pinctrl_usbotgreg: usbotgreggrp {
++ fsl,pins = <
++ MX51_PAD_GPIO1_8__GPIO1_8 0x0c5
++ >;
++ };
++ };
++};
+Index: linux-3.16/arch/arm/boot/dts/imx51-apf51-v1.dtsi
+===================================================================
+--- /dev/null
++++ linux-3.16/arch/arm/boot/dts/imx51-apf51-v1.dtsi
+@@ -0,0 +1,22 @@
++/*
++ * Copyright 2014 Armadeus Systems - <su...@ar...>
++ * Copyright 2012 Laurent Cans <lau...@gm...>
++ *
++ * Based on mx51-babbage.dts
++ * Copyright 2011 Freescale Semiconductor, Inc.
++ * Copyright 2011 Linaro Ltd.
++ *
++ * The code contained herein is licensed under the GNU General Public
++ * License. You may obtain a copy of the GNU General Public License
++ * Version 2 or later at the following locations:
++ *
++ * http://www.opensource.org/licenses/gpl-license.html
++ * http://www.gnu.org/copyleft/gpl.html
++ */
++
++#include "imx51-apf51.dtsi"
++
++/ {
++ model = "Armadeus Systems APF51 V1 module";
++ compatible = "armadeus,imx51-apf51", "fsl,imx51";
++};
+Index: linux-3.16/arch/arm/boot/dts/imx51-apf51-v2.dtsi
+===================================================================
+--- /dev/null
++++ linux-3.16/arch/arm/boot/dts/imx51-apf51-v2.dtsi
+@@ -0,0 +1,69 @@
++/*
++ * Copyright 2014 Armadeus Systems - <su...@ar...>
++ * Copyright 2012 Laurent Cans <lau...@gm...>
++ *
++ * Based on mx51-babbage.dts
++ * Copyright 2011 Freescale Semiconductor, Inc.
++ * Copyright 2011 Linaro Ltd.
++ *
++ * The code contained herein is licensed under the GNU General Public
++ * License. You may obtain a copy of the GNU General Public License
++ * Version 2 or later at the following locations:
++ *
++ * http://www.opensource.org/licenses/gpl-license.html
++ * http://www.gnu.org/copyleft/gpl.html
++ */
++
++#include "imx51-apf51.dtsi"
++
++/ {
++ model = "Armadeus Systems APF51 V2 module";
++ compatible = "armadeus,imx51-apf51", "fsl,imx51";
++};
++
++&i2c2 {
++ pmic: mc13892@09 {
++ compatible = "fsl,mc13892";
++ reg = <0x09>;
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_pmic>;
++ interrupt-parent = <&gpio1>;
++ interrupts = <7 IRQ_TYPE_LEVEL_HIGH>;
++ fsl,mc13xxx-uses-rtc;
++ fsl,mc13xxx-uses-touch;
++ /* adc makes the board reset so let's disable it for now */
++ //fsl,mc13xxx-uses-adc;
++
++ touchscreen {
++ ato = <128>;
++ atox;
++ };
++
++ leds {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ led-control = <0x000 0x000 0x3ff8 0x000>;
++
++ pmic_led2 {
++ reg = <3>;
++ label = "PMIC_LED2";
++ linux,default-trigger = "heartbeat";
++ };
++ };
++
++ regulators {
++ gpo2_reg: gpo2 { };
++ gpo3_reg: gpo3 { };
++ };
++ };
++};
++
++&iomuxc {
++ imx51-apf51-v2 {
++ pinctrl_pmic: pmicgrp {
++ fsl,pins = <
++ MX51_PAD_GPIO1_7__GPIO1_7 0x0c5 /* PMIC_IRQ */
++ >;
++ };
++ };
++};
+Index: linux-3.16/arch/arm/boot/dts/imx51-apf51dev-v1.dts
+===================================================================
+--- /dev/null
++++ linux-3.16/arch/arm/boot/dts/imx51-apf51dev-v1.dts
+@@ -0,0 +1,19 @@
++/*
++ * Copyright 2014 Armadeus Systems - <su...@ar...>
++ *
++ * The code contained herein is licensed under the GNU General Public
++ * License. You may obtain a copy of the GNU General Public License
++ * Version 2 or later at the following locations:
++ *
++ * http://www.opensource.org/licenses/gpl-license.html
++ * http://www.gnu.org/copyleft/gpl.html
++ */
++
++/dts-v1/;
++#include "imx51-apf51-v1.dtsi"
++#include "imx51-apf51dev.dtsi"
++
++/ {
++ model = "Armadeus Systems APF51Dev docking/development board with APF51 V1 SOM";
++ compatible = "armadeus,imx51-apf51dev", "armadeus,imx51-apf51", "fsl,imx51";
++};
+Index: linux-3.16/arch/arm/boot/dts/imx51-apf51dev-v2.dts
+===================================================================
+--- /dev/null
++++ linux-3.16/arch/arm/boot/dts/imx51-apf51dev-v2.dts
+@@ -0,0 +1,19 @@
++/*
++ * Copyright 2014 Armadeus Systems - <su...@ar...>
++ *
++ * The code contained herein is licensed under the GNU General Public
++ * License. You may obtain a copy of the GNU General Public License
++ * Version 2 or later at the following locations:
++ *
++ * http://www.opensource.org/licenses/gpl-license.html
++ * http://www.gnu.org/copyleft/gpl.html
++ */
++
++/dts-v1/;
++#include "imx51-apf51-v2.dtsi"
++#include "imx51-apf51dev.dtsi"
++
++/ {
++ model = "Armadeus Systems APF51Dev docking/development board with APF51 V2 SOM";
++ compatible = "armadeus,imx51-apf51dev", "armadeus,imx51-apf51", "fsl,imx51";
++};
+Index: linux-3.16/arch/arm/boot/dts/imx51-apf51dev.dtsi
+===================================================================
+--- /dev/null
++++ linux-3.16/arch/arm/boot/dts/imx51-apf51dev.dtsi
+@@ -0,0 +1,238 @@
++/*
++ * Copyright 2014 Armadeus Systems - <su...@ar...>
++ *
++ * The code contained herein is licensed under the GNU General Public
++ * License. You may obtain a copy of the GNU General Public License
++ * Version 2 or later at the following locations:
++ *
++ * http://www.opensource.org/licenses/gpl-license.html
++ * http://www.gnu.org/copyleft/gpl.html
++ */
++
++/ {
++ display@di1 {
++ compatible = "fsl,imx-parallel-display";
++ interface-pix-fmt = "bgr666";
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_ipu_disp1>;
++
++ display-timings {
++ native-mode = <&timing0>;
++ timing0: lw700 {
++ clock-frequency = <33000033>;
++ hactive = <800>;
++ vactive = <480>;
++ hback-porch = <96>;
++ hfront-porch = <96>;
++ vback-porch = <20>;
++ vfront-porch = <21>;
++ hsync-len = <64>;
++ vsync-len = <4>;
++ hsync-active = <1>;
++ vsync-active = <1>;
++ de-active = <1>;
++ pixelclk-active = <0>;
++ };
++ };
++
++ port {
++ display_in: endpoint {
++ remote-endpoint = <&ipu_di0_disp0>;
++ };
++ };
++ };
++
++ gpio-keys {
++ compatible = "gpio-keys";
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_gpio_keys>;
++
++ user-key {
++ label = "user";
++ gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
++ linux,code = <256>; /* BTN_0 */
++ gpio-key,wakeup;
++ };
++ };
++
++ leds {
++ compatible = "gpio-leds";
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_gpio_leds>;
++
++ user {
++ label = "Heartbeat";
++ gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
++ linux,default-trigger = "heartbeat";
++ };
++
++ backlight {
++ label = "Backlight";
++ gpios = <&gpio3 4 GPIO_ACTIVE_HIGH>;
++ default-state = "on";
++ };
++ };
++};
++
++&ecspi1 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_ecspi1>;
++ fsl,spi-num-chipselects = <2>;
++ cs-gpios = <&gpio4 24 GPIO_ACTIVE_HIGH>,
++ <&gpio4 25 GPIO_ACTIVE_HIGH>;
++ status = "okay";
++};
++
++&ecspi2 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_ecspi2>;
++ fsl,spi-num-chipselects = <2>;
++ cs-gpios = <&gpio3 28 GPIO_ACTIVE_LOW>,
++ <&gpio3 27 GPIO_ACTIVE_LOW>;
++ status = "okay";
++
++ spidev: spidev@1 {
++ #address-cells = <1>;
++ #size-cells = <1>;
++ compatible = "spidev";
++ spi-max-frequency = <25000000>;
++ reg = <1>;
++ };
++};
++
++&esdhc1 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_esdhc1>;
++ cd-gpios = <&gpio2 29 GPIO_ACTIVE_HIGH>;
++ bus-width = <4>;
++ status = "okay";
++};
++
++&esdhc2 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_esdhc2 &pinctrl_wifi>;
++ bus-width = <4>;
++ status = "okay";
++};
++
++&uart2 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_uart2 &pinctrl_bluetooth>;
++ fsl,uart-has-rtscts;
++ status = "okay";
++};
++
++&ipu_di0_disp0 {
++ remote-endpoint = <&display_in>;
++};
++
++&iomuxc {
++ imx51-apf51dev {
++ pinctrl_bluetooth: bluetoothgrp {
++ fsl,pins = <
++ MX51_PAD_EIM_CS3__GPIO2_28 0x0c5
++ >;
++ };
++
++ pinctrl_ecspi1: ecspi1grp {
++ fsl,pins = <
++ MX51_PAD_CSPI1_SS0__GPIO4_24 0x0c5
++ MX51_PAD_CSPI1_SS1__GPIO4_25 0x0c5
++ MX51_PAD_CSPI1_MISO__ECSPI1_MISO 0x185
++ MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI 0x185
++ MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK 0x185
++ >;
++ };
++
++ pinctrl_ecspi2: ecspi2grp {
++ fsl,pins = <
++ MX51_PAD_NANDF_D13__GPIO3_27 0x0c5
++ MX51_PAD_NANDF_D12__GPIO3_28 0x0c5
++ MX51_PAD_NANDF_RB3__ECSPI2_MISO 0x185
++ MX51_PAD_NANDF_D15__ECSPI2_MOSI 0x185
++ MX51_PAD_NANDF_RB2__ECSPI2_SCLK 0x185
++ >;
++ };
++
++ pinctrl_esdhc1: esdhc1grp {
++ fsl,pins = <
++ MX51_PAD_EIM_CS4__GPIO2_29 0x100
++ MX51_PAD_SD1_CMD__SD1_CMD 0x400020d5
++ MX51_PAD_SD1_CLK__SD1_CLK 0x20d5
++ MX51_PAD_SD1_DATA0__SD1_DATA0 0x20d5
++ MX51_PAD_SD1_DATA1__SD1_DATA1 0x20d5
++ MX51_PAD_SD1_DATA2__SD1_DATA2 0x20d5
++ MX51_PAD_SD1_DATA3__SD1_DATA3 0x20d5
++ >;
++ };
++
++ pinctrl_esdhc2: esdhc2grp {
++ fsl,pins = <
++ MX51_PAD_SD2_CMD__SD2_CMD 0x400020d5
++ MX51_PAD_SD2_CLK__SD2_CLK 0x20d5
++ MX51_PAD_SD2_DATA0__SD2_DATA0 0x20d5
++ MX51_PAD_SD2_DATA1__SD2_DATA1 0x20d5
++ MX51_PAD_SD2_DATA2__SD2_DATA2 0x20d5
++ MX51_PAD_SD2_DATA3__SD2_DATA3 0x20d5
++ >;
++ };
++
++ pinctrl_gpio_keys: gpiokeysgrp {
++ fsl,pins = <
++ MX51_PAD_GPIO1_3__GPIO1_3 0x0c5
++ >;
++ };
++
++ pinctrl_gpio_leds: gpioledsgrp {
++ fsl,pins = <
++ MX51_PAD_GPIO1_2__GPIO1_2 0x0c5
++ MX51_PAD_DI1_D1_CS__GPIO3_4 0x0c5
++ >;
++ };
++
++ pinctrl_ipu_disp1: ipudisp1grp {
++ fsl,pins = <
++ MX51_PAD_DISP1_DAT0__DISP1_DAT0 0x5
++ MX51_PAD_DISP1_DAT1__DISP1_DAT1 0x5
++ MX51_PAD_DISP1_DAT2__DISP1_DAT2 0x5
++ MX51_PAD_DISP1_DAT3__DISP1_DAT3 0x5
++ MX51_PAD_DISP1_DAT4__DISP1_DAT4 0x5
++ MX51_PAD_DISP1_DAT5__DISP1_DAT5 0x5
++ MX51_PAD_DISP1_DAT6__DISP1_DAT6 0x5
++ MX51_PAD_DISP1_DAT7__DISP1_DAT7 0x5
++ MX51_PAD_DISP1_DAT8__DISP1_DAT8 0x5
++ MX51_PAD_DISP1_DAT9__DISP1_DAT9 0x5
++ MX51_PAD_DISP1_DAT10__DISP1_DAT10 0x5
++ MX51_PAD_DISP1_DAT11__DISP1_DAT11 0x5
++ MX51_PAD_DISP1_DAT12__DISP1_DAT12 0x5
++ MX51_PAD_DISP1_DAT13__DISP1_DAT13 0x5
++ MX51_PAD_DISP1_DAT14__DISP1_DAT14 0x5
++ MX51_PAD_DISP1_DAT15__DISP1_DAT15 0x5
++ MX51_PAD_DISP1_DAT16__DISP1_DAT16 0x5
++ MX51_PAD_DISP1_DAT17__DISP1_DAT17 0x5
++ MX51_PAD_DISP1_DAT18__DISP1_DAT18 0x5
++ MX51_PAD_DISP1_DAT19__DISP1_DAT19 0x5
++ MX51_PAD_DISP1_DAT20__DISP1_DAT20 0x5
++ MX51_PAD_DISP1_DAT21__DISP1_DAT21 0x5
++ MX51_PAD_DISP1_DAT22__DISP1_DAT22 0x5
++ MX51_PAD_DISP1_DAT23__DISP1_DAT23 0x5
++ MX51_PAD_DI1_PIN2__DI1_PIN2 0x5
++ MX51_PAD_DI1_PIN3__DI1_PIN3 0x5
++ >;
++ };
++
++ pinctrl_uart2: uart2grp {
++ fsl,pins = <
++ MX51_PAD_UART2_RXD__UART2_RXD 0x1c5
++ MX51_PAD_UART2_TXD__UART2_TXD 0x1c5
++ >;
++ };
++
++ pinctrl_wifi: wifigrp {
++ fsl,pins = <
++ MX51_PAD_EIM_EB2__GPIO2_22 0x0c5
++ MX51_PAD_EIM_EB3__GPIO2_23 0x0c5
++ >;
++ };
++ };
++};
+Index: linux-3.16/arch/arm/boot/dts/Makefile
+===================================================================
+--- linux-3.16.orig/arch/arm/boot/dts/Makefile
++++ linux-3.16/arch/arm/boot/dts/Makefile
+@@ -168,8 +168,8 @@ dtb-$(CONFIG_ARCH_MXC) += \
+ imx35-eukrea-mbimxsd35-baseboard.dtb \
+ imx35-pdk.dtb \
+ imx50-evk.dtb \
+- imx51-apf51.dtb \
+- imx51-apf51dev.dtb \
++ imx51-apf51dev-v1.dtb \
++ imx51-apf51dev-v2.dtb \
+ imx51-babbage.dtb \
+ imx51-digi-connectcore-jsk.dtb \
+ imx51-eukrea-mbimxsd51-baseboard.dtb \
+Index: linux-3.16/arch/arm/boot/dts/imx51-apf51.dts
+===================================================================
+--- linux-3.16.orig/arch/arm/boot/dts/imx51-apf51.dts
++++ /dev/null
+@@ -1,89 +0,0 @@
+-/*
+- * Copyright 2012 Armadeus Systems - <su...@ar...>
+- * Copyright 2012 Laurent Cans <lau...@gm...>
+- *
+- * Based on mx51-babbage.dts
+- * Copyright 2011 Freescale Semiconductor, Inc.
+- * Copyright 2011 Linaro Ltd.
+- *
+- * The code contained herein is licensed under the GNU General Public
+- * License. You may obtain a copy of the GNU General Public License
+- * Version 2 or later at the following locations:
+- *
+- * http://www.opensource.org/licenses/gpl-license.html
+- * http://www.gnu.org/copyleft/gpl.html
+- */
+-
+-/dts-v1/;
+-#include "imx51.dtsi"
+-
+-/ {
+- model = "Armadeus Systems APF51 module";
+- compatible = "armadeus,imx51-apf51", "fsl,imx51";
+-
+- memory {
+- reg = <0x90000000 0x20000000>;
+- };
+-
+- clocks {
+- osc {
+- clock-frequency = <33554432>;
+- };
+- };
+-};
+-
+-&fec {
+- pinctrl-names = "default";
+- pinctrl-0 = <&pinctrl_fec>;
+- phy-mode = "mii";
+- phy-reset-gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
+- phy-reset-duration = <1>;
+- status = "okay";
+-};
+-
+-&iomuxc {
+- imx51-apf51 {
+- pinctrl_fec: fecgrp {
+- fsl,pins = <
+- MX51_PAD_DI_GP3__FEC_TX_ER 0x80000000
+- MX51_PAD_DI2_PIN4__FEC_CRS 0x80000000
+- MX51_PAD_DI2_PIN2__FEC_MDC 0x80000000
+- MX51_PAD_DI2_PIN3__FEC_MDIO 0x80000000
+- MX51_PAD_DI2_DISP_CLK__FEC_RDATA1 0x80000000
+- MX51_PAD_DI_GP4__FEC_RDATA2 0x80000000
+- MX51_PAD_DISP2_DAT0__FEC_RDATA3 0x80000000
+- MX51_PAD_DISP2_DAT1__FEC_RX_ER 0x80000000
+- MX51_PAD_DISP2_DAT6__FEC_TDATA1 0x80000000
+- MX51_PAD_DISP2_DAT7__FEC_TDATA2 0x80000000
+- MX51_PAD_DISP2_DAT8__FEC_TDATA3 0x80000000
+- MX51_PAD_DISP2_DAT9__FEC_TX_EN 0x80000000
+- MX51_PAD_DISP2_DAT10__FEC_COL 0x80000000
+- MX51_PAD_DISP2_DAT11__FEC_RX_CLK 0x80000000
+- MX51_PAD_DISP2_DAT12__FEC_RX_DV 0x80000000
+- MX51_PAD_DISP2_DAT13__FEC_TX_CLK 0x80000000
+- MX51_PAD_DISP2_DAT14__FEC_RDATA0 0x80000000
+- MX51_PAD_DISP2_DAT15__FEC_TDATA0 0x80000000
+- >;
+- };
+-
+- pinctrl_uart3: uart3grp {
+- fsl,pins = <
+- MX51_PAD_UART3_RXD__UART3_RXD 0x1c5
+- MX51_PAD_UART3_TXD__UART3_TXD 0x1c5
+- >;
+- };
+- };
+-};
+-
+-&nfc {
+- nand-bus-width = <8>;
+- nand-ecc-mode = "hw";
+- nand-on-flash-bbt;
+- status = "okay";
+-};
+-
+-&uart3 {
+- pinctrl-names = "default";
+- pinctrl-0 = <&pinctrl_uart3>;
+- status = "okay";
+-};
+Index: linux-3.16/arch/arm/boot/dts/imx51-apf51dev.dts
+===================================================================
+--- linux-3.16.orig/arch/arm/boot/dts/imx51-apf51dev.dts
++++ /dev/null
+@@ -1,211 +0,0 @@
+-/*
+- * Copyright 2013 Armadeus Systems - <su...@ar...>
+- *
+- * The code contained herein is licensed under the GNU General Public
+- * License. You may obtain a copy of the GNU General Public License
+- * Version 2 or later at the following locations:
+- *
+- * http://www.opensource.org/licenses/gpl-license.html
+- * http://www.gnu.org/copyleft/gpl.html
+- */
+-
+-/* APF51Dev is a docking board for the APF51 SOM */
+-#include "imx51-apf51.dts"
+-
+-/ {
+- model = "Armadeus Systems APF51Dev docking/development board";
+- compatible = "armadeus,imx51-apf51dev", "armadeus,imx51-apf51", "fsl,imx51";
+-
+- display@di1 {
+- compatible = "fsl,imx-parallel-display";
+- interface-pix-fmt = "bgr666";
+- pinctrl-names = "default";
+- pinctrl-0 = <&pinctrl_ipu_disp1>;
+-
+- display-timings {
+- lw700 {
+- native-mode;
+- clock-frequency = <33000033>;
+- hactive = <800>;
+- vactive = <480>;
+- hback-porch = <96>;
+- hfront-porch = <96>;
+- vback-porch = <20>;
+- vfront-porch = <21>;
+- hsync-len = <64>;
+- vsync-len = <4>;
+- hsync-active = <1>;
+- vsync-active = <1>;
+- de-active = <1>;
+- pixelclk-active = <0>;
+- };
+- };
+-
+- port {
+- display_in: endpoint {
+- remote-endpoint = <&ipu_di0_disp0>;
+- };
+- };
+- };
+-
+- gpio-keys {
+- compatible = "gpio-keys";
+-
+- user-key {
+- label = "user";
+- gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
+- linux,code = <256>; /* BTN_0 */
+- };
+- };
+-
+- leds {
+- compatible = "gpio-leds";
+-
+- user {
+- label = "Heartbeat";
+- gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
+- linux,default-trigger = "heartbeat";
+- };
+- };
+-};
+-
+-&ecspi1 {
+- pinctrl-names = "default";
+- pinctrl-0 = <&pinctrl_ecspi1>;
+- fsl,spi-num-chipselects = <2>;
+- cs-gpios = <&gpio4 24 GPIO_ACTIVE_HIGH>,
+- <&gpio4 25 GPIO_ACTIVE_HIGH>;
+- status = "okay";
+-};
+-
+-&ecspi2 {
+- pinctrl-names = "default";
+- pinctrl-0 = <&pinctrl_ecspi2>;
+- fsl,spi-num-chipselects = <2>;
+- cs-gpios = <&gpio3 28 GPIO_ACTIVE_LOW>,
+- <&gpio3 27 GPIO_ACTIVE_LOW>;
+- status = "okay";
+-};
+-
+-&esdhc1 {
+- pinctrl-names = "default";
+- pinctrl-0 = <&pinctrl_esdhc1>;
+- cd-gpios = <&gpio2 29 GPIO_ACTIVE_HIGH>;
+- bus-width = <4>;
+- status = "okay";
+-};
+-
+-&esdhc2 {
+- pinctrl-names = "default";
+- pinctrl-0 = <&pinctrl_esdhc2>;
+- bus-width = <4>;
+- non-removable;
+- status = "okay";
+-};
+-
+-&i2c2 {
+- pinctrl-names = "default";
+- pinctrl-0 = <&pinctrl_i2c2>;
+- status = "okay";
+-};
+-
+-&iomuxc {
+- pinctrl-names = "default";
+- pinctrl-0 = <&pinctrl_hog>;
+-
+- imx51-apf51dev {
+- pinctrl_hog: hoggrp {
+- fsl,pins = <
+- MX51_PAD_EIM_EB2__GPIO2_22 0x0C5
+- MX51_PAD_EIM_EB3__GPIO2_23 0x0C5
+- MX51_PAD_EIM_CS4__GPIO2_29 0x100
+- MX51_PAD_NANDF_D13__GPIO3_27 0x0C5
+- MX51_PAD_NANDF_D12__GPIO3_28 0x0C5
+- MX51_PAD_CSPI1_SS0__GPIO4_24 0x0C5
+- MX51_PAD_CSPI1_SS1__GPIO4_25 0x0C5
+- MX51_PAD_GPIO1_2__GPIO1_2 0x0C5
+- MX51_PAD_GPIO1_3__GPIO1_3 0x0C5
+- >;
+- };
+-
+- pinctrl_ecspi1: ecspi1grp {
+- fsl,pins = <
+- MX51_PAD_CSPI1_MISO__ECSPI1_MISO 0x185
+- MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI 0x185
+- MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK 0x185
+- >;
+- };
+-
+- pinctrl_ecspi2: ecspi2grp {
+- fsl,pins = <
+- MX51_PAD_NANDF_RB3__ECSPI2_MISO 0x185
+- MX51_PAD_NANDF_D15__ECSPI2_MOSI 0x185
+- MX51_PAD_NANDF_RB2__ECSPI2_SCLK 0x185
+- >;
+- };
+-
+- pinctrl_esdhc1: esdhc1grp {
+- fsl,pins = <
+- MX51_PAD_SD1_CMD__SD1_CMD 0x400020d5
+- MX51_PAD_SD1_CLK__SD1_CLK 0x20d5
+- MX51_PAD_SD1_DATA0__SD1_DATA0 0x20d5
+- MX51_PAD_SD1_DATA1__SD1_DATA1 0x20d5
+- MX51_PAD_SD1_DATA2__SD1_DATA2 0x20d5
+- MX51_PAD_SD1_DATA3__SD1_DATA3 0x20d5
+- >;
+- };
+-
+- pinctrl_esdhc2: esdhc2grp {
+- fsl,pins = <
+- MX51_PAD_SD2_CMD__SD2_CMD 0x400020d5
+- MX51_PAD_SD2_CLK__SD2_CLK 0x20d5
+- MX51_PAD_SD2_DATA0__SD2_DATA0 0x20d5
+- MX51_PAD_SD2_DATA1__SD2_DATA1 0x20d5
+- MX51_PAD_SD2_DATA2__SD2_DATA2 0x20d5
+- MX51_PAD_SD2_DATA3__SD2_DATA3 0x20d5
+- >;
+- };
+-
+- pinctrl_i2c2: i2c2grp {
+- fsl,pins = <
+- MX51_PAD_EIM_D27__I2C2_SCL 0x400001ed
+- MX51_PAD_EIM_D24__I2C2_SDA 0x400001ed
+- >;
+- };
+-
+- pinctrl_ipu_disp1: ipudisp1grp {
+- fsl,pins = <
+- MX51_PAD_DISP1_DAT0__DISP1_DAT0 0x5
+- MX51_PAD_DISP1_DAT1__DISP1_DAT1 0x5
+- MX51_PAD_DISP1_DAT2__DISP1_DAT2 0x5
+- MX51_PAD_DISP1_DAT3__DISP1_DAT3 0x5
+- MX51_PAD_DISP1_DAT4__DISP1_DAT4 0x5
+- MX51_PAD_DISP1_DAT5__DISP1_DAT5 0x5
+- MX51_PAD_DISP1_DAT6__DISP1_DAT6 0x5
+- MX51_PAD_DISP1_DAT7__DISP1_DAT7 0x5
+- MX51_PAD_DISP1_DAT8__DISP1_DAT8 0x5
+- MX51_PAD_DISP1_DAT9__DISP1_DAT9 0x5
+- MX51_PAD_DISP1_DAT10__DISP1_DAT10 0x5
+- MX51_PAD_DISP1_DAT11__DISP1_DAT11 0x5
+- MX51_PAD_DISP1_DAT12__DISP1_DAT12 0x5
+- MX51_PAD_DISP1_DAT13__DISP1_DAT13 0x5
+- MX51_PAD_DISP1_DAT14__DISP1_DAT14 0x5
+- MX51_PAD_DISP1_DAT15__DISP1_DAT15 0x5
+- MX51_PAD_DISP1_DAT16__DISP1_DAT16 0x5
+- MX51_PAD_DISP1_DAT17__DISP1_DAT17 0x5
+- MX51_PAD_DISP1_DAT18__DISP1_DAT18 0x5
+- MX51_PAD_DISP1_DAT19__DISP1_DAT19 0x5
+- MX51_PAD_DISP1_DAT20__DISP1_DAT20 0x5
+- MX51_PAD_DISP1_DAT21__DISP1_DAT21 0x5
+- MX51_PAD_DISP1_DAT22__DISP1_DAT22 0x5
+- MX51_PAD_DISP1_DAT23__DISP1_DAT23 0x5
+- MX51_PAD_DI1_PIN2__DI1_PIN2 0x5
+- MX51_PAD_DI1_PIN3__DI1_PIN3 0x5
+- >;
+- };
+- };
+-};
+-
+-&ipu_di0_disp0 {
+- remote-endpoint = <&display_in>;
+-};
diff --git a/patches/linux/3.16/0416-armadeus-apf51-add_mc13982_touchscreen_support.patch b/patches/linux/3.16/0416-armadeus-apf51-add_mc13982_touchscreen_support.patch
new file mode 100644
index 0000000..184ae1c
--- /dev/null
+++ b/patches/linux/3.16/0416-armadeus-apf51-add_mc13982_touchscreen_support.patch
@@ -0,0 +1,540 @@
+Index: linux-3.16/drivers/input/touchscreen/mc13xxx_ts.c
+===================================================================
+--- /dev/null
++++ linux-3.16/drivers/input/touchscreen/mc13xxx_ts.c
+@@ -0,0 +1,468 @@
++/*
++ * Driver for the Freescale Semiconductor MC13783 / MC13892 touchscreen.
++ *
++ * The code for MC13892 support and calibration comes from Oskar Schirmer
++ * from here: https://lkml.org/lkml/2012/2/14/98
++ *
++ * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
++ * Copyright (C) 2009 Sascha Hauer, Pengutronix
++ *
++ * Initial development of this code was funded by
++ * Phytec Messtechnik GmbH, http://www.phytec.de/
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published by
++ * the Free Software Foundation.
++ */
++#include <linux/platform_device.h>
++#include <linux/mfd/mc13xxx.h>
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/input.h>
++#include <linux/of.h>
++#include <linux/sched.h>
++#include <linux/slab.h>
++#include <linux/init.h>
++
++#define DRIVER_NAME "mc13xxx-ts"
++
++#define MC13XXX_ID_MC13783 1
++#define MC13XXX_ID_MC13892 2
++
++#define DEFAULT_SAMPLE_TOLERANCE 300
++
++static unsigned int sample_tolerance = DEFAULT_SAMPLE_TOLERANCE;
++module_param(sample_tolerance, uint, S_IRUGO | S_IWUSR);
++MODULE_PARM_DESC(sample_tolerance,
++ "If the minimal and maximal value read out for one axis (out "
++ "of three) differ by this value (default: "
++ __stringify(DEFAULT_SAMPLE_TOLERANCE) ") or more, the reading "
++ "is supposed to be wrong and is discarded. Set to 0 to "
++ "disable this check.");
++
++#define DEFAULT_PRESSURE_LIMIT 2048
++
++static unsigned int pressure_limit = DEFAULT_PRESSURE_LIMIT;
++module_param(pressure_limit, uint, S_IRUGO | S_IWUSR);
++MODULE_PARM_DESC(pressure_limit,
++ "Pressure values below this value (default: "
++ __stringify(DEFAULT_PRESSURE_LIMIT) ") are taken "
++ "as release event.");
++
++struct mc13xxx_ts_priv {
++ struct input_dev *idev;
++ struct mc13xxx *mc13xxx;
++ struct delayed_work work;
++ struct workqueue_struct *workq;
++ unsigned int sample[4];
++ struct mc13xxx_ts_platform_data *touch;
++ int calibration[7];
++};
++
++static irqreturn_t mc13xxx_ts_handler(int irq, void *data)
++{
++ struct mc13xxx_ts_priv *priv = data;
++
++ mc13xxx_irq_ack(priv->mc13xxx, irq);
++
++ /*
++ * Kick off reading coordinates. Note that if work happens already
++ * be queued for future execution (it rearms itself) it will not
++ * be rescheduled for immediate execution here. However the rearm
++ * delay is HZ / 50 which is acceptable.
++ */
++ queue_delayed_work(priv->workq, &priv->work, 0);
++
++ return IRQ_HANDLED;
++}
++
++#define sort3(a0, a1, a2) ({ \
++ if (a0 > a1) \
++ swap(a0, a1); \
++ if (a1 > a2) \
++ swap(a1, a2); \
++ if (a0 > a1) \
++ swap(a0, a1); \
++ })
++
++static void mc13xxx_report_abs_calibrated(struct mc13xxx_ts_priv *priv,
++ struct input_dev *idev, int x, int y)
++{
++ int *calib = priv->calibration;
++ int xc, yc;
++ if (calib[6]) {
++ xc = (calib[0] * x + calib[1] * y + calib[2]) / calib[6];
++ if (xc < 0)
++ xc = 0;
++ yc = (calib[3] * x + calib[4] * y + calib[5]) / calib[6];
++ if (yc < 0)
++ yc = 0;
++ } else {
++ xc = x;
++ yc = y;
++ }
++ input_report_abs(idev, ABS_X, xc);
++ input_report_abs(idev, ABS_Y, yc);
++}
++
++static void mc13783_ts_report_sample(struct mc13xxx_ts_priv *priv)
++{
++ struct input_dev *idev = priv->idev;
++ int x0, x1, x2, y0, y1, y2;
++ int cr0, cr1;
++
++ /*
++ * the values are 10-bit wide only, but the two least significant
++ * bits are for future 12 bit use and reading yields 0
++ */
++ x0 = priv->sample[0] & 0xfff;
++ x1 = priv->sample[1] & 0xfff;
++ x2 = priv->sample[2] & 0xfff;
++ y0 = priv->sample[3] & 0xfff;
++ y1 = (priv->sample[0] >> 12) & 0xfff;
++ y2 = (priv->sample[1] >> 12) & 0xfff;
++ cr0 = (priv->sample[2] >> 12) & 0xfff;
++ cr1 = (priv->sample[3] >> 12) & 0xfff;
++
++ dev_dbg(&idev->dev,
++ "x: (% 4d,% 4d,% 4d) y: (% 4d, % 4d,% 4d) cr: (% 4d, % 4d)\n",
++ x0, x1, x2, y0, y1, y2, cr0, cr1);
++
++ sort3(x0, x1, x2);
++ sort3(y0, y1, y2);
++
++ cr0 = (cr0 + cr1) / 2;
++
++ if (!cr0 || !sample_tolerance ||
++ (x2 - x0 < sample_tolerance &&
++ y2 - y0 < sample_tolerance)) {
++ /* report the median coordinate and average pressure */
++ if (cr0) {
++ mc13xxx_report_abs_calibrated(priv, idev, x1, y1);
++ dev_dbg(&idev->dev, "report (%d, %d, %d)\n",
++ x1, y1, 0x1000 - cr0);
++ queue_delayed_work(priv->workq, &priv->work, HZ / 50);
++ } else
++ dev_dbg(&idev->dev, "report release\n");
++
++ input_report_abs(idev, ABS_PRESSURE,
++ cr0 ? 0x1000 - cr0 : cr0);
++ input_report_key(idev, BTN_TOUCH, cr0);
++ input_sync(idev);
++ } else
++ dev_dbg(&idev->dev, "discard event\n");
++}
++
++static void mc13892_ts_report_sample(struct mc13xxx_ts_priv *priv)
++{
++ struct input_dev *idev = priv->idev;
++ int x0, x1, y0, y1;
++ int cr0, cr1;
++
++ /*
++ * the values are 10-bit wide only, but the two least significant
++ * bits are for future 12 bit use and reading yields 0
++ */
++ x0 = priv->sample[0] & 0xfff;
++ x1 = priv->sample[1] & 0xfff;
++ y0 = priv->sample[3] & 0xfff;
++ y1 = (priv->sample[0] >> 12) & 0xfff;
++ cr0 = (priv->sample[2] >> 12) & 0xfff;
++ cr1 = (priv->sample[3] >> 12) & 0xfff;
++
++ dev_dbg(&idev->dev,
++ "x: (% 4d,% 4d) y: (% 4d,% 4d) cr: (% 4d, % 4d)\n",
++ x0, x1, y0, y1, cr0, cr1);
++
++ if (x0 > x1)
++ swap(x0, x1);
++ if (y0 > y1)
++ swap(y0, y1);
++
++ cr0 = 0x1000 - ((cr0 + cr1) / 2);
++ if (cr0 < pressure_limit)
++ cr0 = 0;
++
++ if (!cr0 || !sample_tolerance ||
++ (x1 - x0 < sample_tolerance &&
++ y1 - y0 < sample_tolerance)) {
++ /* report the average coordinate and pressure */
++ if (cr0) {
++ x0 = (x0 + x1) / 2;
++ y0 = (y0 + y1) / 2;
++ mc13xxx_report_abs_calibrated(priv, idev, x0, y0);
++ dev_dbg(&idev->dev, "report (%d, %d, %d)\n",
++ x0, y0, cr0);
++ queue_delayed_work(priv->workq, &priv->work, HZ / 50);
++ } else
++ dev_dbg(&idev->dev, "report release\n");
++
++ input_report_abs(idev, ABS_PRESSURE, cr0);
++ input_report_key(idev, BTN_TOUCH, cr0);
++ input_sync(idev);
++ } else
++ dev_dbg(&idev->dev, "discard event\n");
++}
++
++static void mc13783_ts_work(struct work_struct *work)
++{
++ struct mc13xxx_ts_priv *priv =
++ container_of(work, struct mc13xxx_ts_priv, work.work);
++ unsigned int mode = MC13XXX_ADC_MODE_TS;
++ unsigned int channel = 12;
++
++ if (mc13xxx_adc_do_conversion(priv->mc13xxx,
++ mode, channel,
++ priv->touch->ato, priv->touch->atox,
++ priv->sample) == 0)
++ mc13783_ts_report_sample(priv);
++}
++
++static void mc13892_ts_work(struct work_struct *work)
++{
++ struct mc13xxx_ts_priv *priv =
++ container_of(work, struct mc13xxx_ts_priv, work.work);
++ unsigned int mode = MC13XXX_ADC_MODE_TS;
++ unsigned int channel = 12;
++
++ if (mc13xxx_adc_do_conversion(priv->mc13xxx,
++ mode, channel,
++ priv->touch->ato, priv->touch->atox,
++ priv->sample) == 0)
++ mc13892_ts_report_sample(priv);
++}
++
++static int mc13xxx_ts_open(struct input_dev *dev)
++{
++ struct mc13xxx_ts_priv *priv = input_get_drvdata(dev);
++ int ret;
++
++ mc13xxx_lock(priv->mc13xxx);
++
++ mc13xxx_irq_ack(priv->mc13xxx, MC13XXX_IRQ_TS);
++
++ ret = mc13xxx_irq_request(priv->mc13xxx, MC13XXX_IRQ_TS,
++ mc13xxx_ts_handler, DRIVER_NAME, priv);
++ if (ret)
++ goto out;
++
++ ret = mc13xxx_reg_rmw(priv->mc13xxx, MC13XXX_ADC0,
++ MC13XXX_ADC0_TSMOD_MASK, MC13XXX_ADC0_TSMOD0);
++ if (ret)
++ mc13xxx_irq_free(priv->mc13xxx, MC13XXX_IRQ_TS, priv);
++out:
++ mc13xxx_unlock(priv->mc13xxx);
++ return ret;
++}
++
++static void mc13xxx_ts_close(struct input_dev *dev)
++{
++ struct mc13xxx_ts_priv *priv = input_get_drvdata(dev);
++
++ mc13xxx_lock(priv->mc13xxx);
++ mc13xxx_reg_rmw(priv->mc13xxx, MC13XXX_ADC0,
++ MC13XXX_ADC0_TSMOD_MASK, 0);
++ mc13xxx_irq_free(priv->mc13xxx, MC13XXX_IRQ_TS, priv);
++ mc13xxx_unlock(priv->mc13xxx);
++
++ cancel_delayed_work_sync(&priv->work);
++}
++
++static ssize_t mc13xxx_calibration_show(struct device *d,
++ struct device_attribute *attr, char *buf)
++{
++ struct mc13xxx_ts_priv *priv = dev_get_drvdata(d);
++ int i, p, r;
++
++ p = 0;
++ for (i = 0; i < 7; i++) {
++ r = sprintf(&buf[p], i == 6 ? "%d\n" : "%d ",
++ priv->calibration[i]);
++ if (r < 0)
++ return r;
++ p += r;
++ }
++ return p;
++}
++
++static ssize_t mc13xxx_calibration_store(struct device *d,
++ struct device_attribute *attr, const char *buf, size_t count)
++{
++ struct mc13xxx_ts_priv *priv = dev_get_drvdata(d);
++ int i, p, r;
++ int c[7];
++
++ p = 0;
++ for (i = 0; i < 7; i++) {
++ if (sscanf(&buf[p], "%d%n", &c[i], &r) != 1)
++ return -EINVAL;
++ p += r;
++ }
++ memcpy(priv->calibration, c, sizeof(priv->calibration));
++ return count;
++}
++
++static DEVICE_ATTR(calibration, S_IWUSR | S_IRUGO,
++ mc13xxx_calibration_show, mc13xxx_calibration_store);
++
++static int mc13xxx_init_sysfs(struct device *d)
++{
++ return device_create_file(d, &dev_attr_calibration);
++}
++
++static void mc13xxx_free_sysfs(struct device *d)
++{
++ device_remove_file(d, &dev_attr_calibration);
++}
++
++static struct mc13xxx_ts_platform_data __init *mc13xxx_ts_probe_dt(
++ struct platform_device *pdev)
++{
++ struct mc13xxx_ts_platform_data *pdata;
++ struct device_node *parent;
++ struct device *dev = &pdev->dev;
++ int ret = -ENODATA;
++
++ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
++ if (!pdata)
++ return ERR_PTR(-ENOMEM);
++
++ of_node_get(dev->parent->of_node);
++
++ parent = of_find_node_by_name(dev->parent->of_node, "touchscreen");
++ if (!parent)
++ goto out_node_put;
++
++ ret = of_property_read_u8(parent, "ato", &pdata->ato);
++ if (ret)
++ goto out_node_put;
++
++ if (of_property_read_bool(parent, "atox"))
++ pdata->atox = 1;
++ else
++ pdata->atox = 0;
++
++out_node_put:
++ of_node_put(parent);
++
++ return ret ? ERR_PTR(ret) : pdata;
++}
++static int __init mc13xxx_ts_probe(struct platform_device *pdev)
++{
++ struct mc13xxx_ts_priv *priv;
++ struct input_dev *idev;
++ int ret = -ENOMEM;
++
++ priv = kzalloc(sizeof(*priv), GFP_KERNEL);
++ idev = input_allocate_device();
++ if (!priv || !idev)
++ goto err_free_mem;
++
++ switch (platform_get_device_id(pdev)->driver_data) {
++ case MC13XXX_ID_MC13783:
++ INIT_DELAYED_WORK(&priv->work, mc13783_ts_work);
++ break;
++ case MC13XXX_ID_MC13892:
++ INIT_DELAYED_WORK(&priv->work, mc13892_ts_work);
++ break;
++ default:
++ goto err_free_mem;
++ }
++
++ priv->mc13xxx = dev_get_drvdata(pdev->dev.parent);
++ priv->idev = idev;
++ platform_set_drvdata(pdev, priv);
++ priv->touch = mc13xxx_ts_probe_dt(pdev);
++ if (IS_ERR(priv->touch)) {
++ priv->touch = dev_get_platdata(&pdev->dev);
++ if (!priv->touch) {
++ dev_err(&pdev->dev, "missing platform data\n");
++ ret = -ENODEV;
++ goto err_free_mem;
++ }
++ }
++
++ /*
++ * We need separate workqueue because mc13xxx_adc_do_conversion
++ * uses keventd and thus would deadlock.
++ */
++ priv->workq = create_singlethread_workqueue("mc13xxx_ts");
++ if (!priv->workq)
++ goto err_free_mem;
++
++ idev->name = DRIVER_NAME;
++ idev->dev.parent = &pdev->dev;
++
++ idev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
++ idev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
++ input_set_abs_params(idev, ABS_X, 0, 0xfff, 0, 0);
++ input_set_abs_params(idev, ABS_Y, 0, 0xfff, 0, 0);
++ input_set_abs_params(idev, ABS_PRESSURE, 0, 0xfff, 0, 0);
++
++ idev->open = mc13xxx_ts_open;
++ idev->close = mc13xxx_ts_close;
++
++ input_set_drvdata(idev, priv);
++
++ ret = mc13xxx_init_sysfs(&pdev->dev);
++ if (ret) {
++ dev_err(&pdev->dev, "failed to init sysfs.\n");
++ goto err_destroy_wq;
++ }
++
++ ret = input_register_device(priv->idev);
++ if (ret) {
++ dev_err(&pdev->dev,
++ "register input device failed with %d\n", ret);
++ goto err_free_sysfs;
++ }
++
++ return 0;
++
++err_free_sysfs:
++ mc13xxx_free_sysfs(&pdev->dev);
++err_destroy_wq:
++ destroy_workqueue(priv->workq);
++err_free_mem:
++ input_free_device(idev);
++ kfree(priv);
++ return ret;
++}
++
++static int mc13xxx_ts_remove(struct platform_device *pdev)
++{
++ struct mc13xxx_ts_priv *priv = platform_get_drvdata(pdev);
++
++ destroy_workqueue(priv->workq);
++ input_unregister_device(priv->idev);
++ kfree(priv);
++
++ return 0;
++}
++
++const struct platform_device_id mc13xxx_ts_idtable[] = {
++ {
++ .name = "mc13783-ts",
++ .driver_data = MC13XXX_ID_MC13783,
++ }, {
++ .name = "mc13892-ts",
++ .driver_data = MC13XXX_ID_MC13892,
++ },
++ { }
++};
++
++static struct platform_driver mc13xxx_ts_driver = {
++ .id_table = mc13xxx_ts_idtable,
++ .remove = mc13xxx_ts_remove,
++ .driver = {
++ .owner = THIS_MODULE,
++ .name = DRIVER_NAME,
++ },
++};
++
++module_platform_driver_probe(mc13xxx_ts_driver, mc13xxx_ts_probe);
++
++MODULE_DESCRIPTION("MC13xxx input touchscreen driver");
++MODULE_AUTHOR("Sascha Hauer <s....@pe...>");
++MODULE_LICENSE("GPL v2");
++MODULE_ALIAS("platform:" DRIVER_NAME);
+Index: linux-3.16/drivers/input/touchscreen/Makefile
+===================================================================
+--- linux-3.16.orig/drivers/input/touchscreen/Makefile
++++ linux-3.16/drivers/input/touchscreen/Makefile
+@@ -38,7 +38,7 @@ obj-$(CONFIG_TOUCHSCREEN_INEXIO) += inex
+ obj-$(CONFIG_TOUCHSCREEN_INTEL_MID) += intel-mid-touch.o
+ obj-$(CONFIG_TOUCHSCREEN_LPC32XX) += lpc32xx_ts.o
+ obj-$(CONFIG_TOUCHSCREEN_MAX11801) += max11801_ts.o
+-obj-$(CONFIG_TOUCHSCREEN_MC13783) += mc13783_ts.o
++obj-$(CONFIG_TOUCHSCREEN_MC13XXX) += mc13xxx_ts.o
+ obj-$(CONFIG_TOUCHSCREEN_MCS5000) += mcs5000_ts.o
+ obj-$(CONFIG_TOUCHSCREEN_MIGOR) += migor_ts.o
+ obj-$(CONFIG_TOUCHSCREEN_MMS114) += mms114.o
+Index: linux-3.16/drivers/input/touchscreen/Kconfig
+===================================================================
+--- linux-3.16.orig/drivers/input/touchscreen/Kconfig
++++ linux-3.16/drivers/input/touchscreen/Kconfig
+@@ -713,17 +713,18 @@ config TOUCHSCREEN_USB_COMPOSITE
+ To compile this driver as a module, choose M here: the
+ module will be called usbtouchscreen.
+
+-config TOUCHSCREEN_MC13783
+- tristate "Freescale MC13783 touchscreen input driver"
++config TOUCHSCREEN_MC13XXX
++ tristate "Freescale MC13XXX touchscreen input driver"
+ depends on MFD_MC13XXX
++ select SYSFS
+ help
+- Say Y here if you have an Freescale MC13783 PMIC on your
++ Say Y here if you have an Freescale MC13XXX PMIC on your
+ board and want to use its touchscreen
+
+ If unsure, say N.
+
+ To compile this driver as a module, choose M here: the
+- module will be called mc13783_ts.
++ module will be called mc13xxx_ts.
+
+ config TOUCHSCREEN_USB_EGALAX
+ default y
+Index: linux-3.16/Documentation/devicetree/bindings/mfd/mc13xxx.txt
+===================================================================
+--- linux-3.16.orig/Documentation/devicetree/bindings/mfd/mc13xxx.txt
++++ linux-3.16/Documentation/devicetree/bindings/mfd/mc13xxx.txt
+@@ -24,6 +24,10 @@ Sub-nodes:
+ Documentation/devicetree/bindings/leds/common.txt.
+ - regulators : Contain the regulator nodes. The regulators are bound using
+ their names as listed below with their registers and bits for enabling.
++- touchscreen : Contain the touchscreen node.
++ - ato : Delay between Touchscreen polarization and ADC Conversion.
++ It goes from 1 to 256 times the 32 kHz equivalent time base.
++ - atox : If present, use the ATO delay for each conversion.
+
+ MC13783 LED IDs:
+ 0 : Main display
+@@ -139,6 +143,11 @@ ecspi@70010000 { /* ECSPI1 */
+ };
+ };
+
++ touchscreen {
++ ato = <128>;
++ atox;
++ };
++
+ regulators {
+ sw1_reg: mc13892__sw1 {
+ regulator-min-microvolt = <600000>;
hooks/post-receive
--
armadeus
|