All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2 v2] MX3X: Architecture specific mx3 keypad support
@ 2010-05-19  9:31 Alberto Panizzo
  2010-05-19  9:33 ` [PATCH 1/2 v2] MX3X: Add Keypad device definition for MX3X arch Alberto Panizzo
  2010-05-19 12:23 ` [PATCH 0/2 v2] MX3X: Architecture specific mx3 keypad support MXC Sascha Hauer
  0 siblings, 2 replies; 4+ messages in thread
From: Alberto Panizzo @ 2010-05-19  9:31 UTC (permalink / raw)
  To: linux-arm-kernel

This two patches add the support for the keypad device
over the recent merge of the imx-keypad driver and shows
how to support this device into the machine file.

v2: Pin definition helpers are placed in iomux-mx3.h

Alberto Panizzo (2):
  MX3X: Add Keypad device definition for MX3X arch
  mx31_3ds: Support the keypad situated in the personality board

 arch/arm/mach-mx3/devices.c                |   19 ++++++++++++++++
 arch/arm/mach-mx3/devices.h                |    1 +
 arch/arm/mach-mx3/mach-mx31_3ds.c          |   32 ++++++++++++++++++++++++++++
 arch/arm/plat-mxc/include/mach/iomux-mx3.h |   17 ++++++++++++++
 4 files changed, 69 insertions(+), 0 deletions(-)

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

* [PATCH 1/2 v2] MX3X: Add Keypad device definition for MX3X arch
  2010-05-19  9:31 [PATCH 0/2 v2] MX3X: Architecture specific mx3 keypad support Alberto Panizzo
@ 2010-05-19  9:33 ` Alberto Panizzo
  2010-05-19  9:34   ` [PATCH 2/2 v2] mx31_3ds: Support the keypad situated in the personality board Alberto Panizzo
  2010-05-19 12:23 ` [PATCH 0/2 v2] MX3X: Architecture specific mx3 keypad support MXC Sascha Hauer
  1 sibling, 1 reply; 4+ messages in thread
From: Alberto Panizzo @ 2010-05-19  9:33 UTC (permalink / raw)
  To: linux-arm-kernel


This patch adds also the pin definition helpers in iomux-mx3.h

Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
---

This patch is built against the today mxc-master branch

 arch/arm/mach-mx3/devices.c                |   19 +++++++++++++++++++
 arch/arm/mach-mx3/devices.h                |    1 +
 arch/arm/plat-mxc/include/mach/iomux-mx3.h |   17 +++++++++++++++++
 3 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index 81a1dba..db7acd6 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -607,6 +607,25 @@ struct platform_device imx_rtc_device0 = {
 	.resource       = imx_rtc_resources,
 };
 
+static struct resource imx_kpp_resources[] = {
+	{
+		.start	= MX3x_KPP_BASE_ADDR,
+		.end	= MX3x_KPP_BASE_ADDR + 0xf,
+		.flags	= IORESOURCE_MEM
+	}, {
+		.start	= MX3x_INT_KPP,
+		.end	= MX3x_INT_KPP,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+struct platform_device imx_kpp_device = {
+	.name = "imx-keypad",
+	.id = -1,
+	.num_resources = ARRAY_SIZE(imx_kpp_resources),
+	.resource = imx_kpp_resources,
+};
+
 static int __init mx3_devices_init(void)
 {
 	if (cpu_is_mx31()) {
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h
index b1687ad..2c3c864 100644
--- a/arch/arm/mach-mx3/devices.h
+++ b/arch/arm/mach-mx3/devices.h
@@ -28,3 +28,4 @@ extern struct platform_device imx_ssi_device1;
 extern struct platform_device imx_ssi_device1;
 extern struct platform_device imx_wdt_device0;
 extern struct platform_device imx_rtc_device0;
+extern struct platform_device imx_kpp_device;
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
index e51465d..cbaed29 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
@@ -719,6 +719,23 @@ enum iomux_pins {
 #define MX31_PIN_SRXD5__SRXD5		IOMUX_MODE(MX31_PIN_SRXD5, IOMUX_CONFIG_FUNC)
 #define MX31_PIN_SCK5__SCK5		IOMUX_MODE(MX31_PIN_SCK5, IOMUX_CONFIG_FUNC)
 #define MX31_PIN_SFS5__SFS5		IOMUX_MODE(MX31_PIN_SFS5, IOMUX_CONFIG_FUNC)
+#define MX31_PIN_KEY_ROW0_KEY_ROW0	IOMUX_MODE(MX31_PIN_KEY_ROW0, IOMUX_CONFIG_FUNC)
+#define MX31_PIN_KEY_ROW1_KEY_ROW1	IOMUX_MODE(MX31_PIN_KEY_ROW1, IOMUX_CONFIG_FUNC)
+#define MX31_PIN_KEY_ROW2_KEY_ROW2	IOMUX_MODE(MX31_PIN_KEY_ROW2, IOMUX_CONFIG_FUNC)
+#define MX31_PIN_KEY_ROW3_KEY_ROW3	IOMUX_MODE(MX31_PIN_KEY_ROW3, IOMUX_CONFIG_FUNC)
+#define MX31_PIN_KEY_ROW4_KEY_ROW4	IOMUX_MODE(MX31_PIN_KEY_ROW4, IOMUX_CONFIG_FUNC)
+#define MX31_PIN_KEY_ROW5_KEY_ROW5	IOMUX_MODE(MX31_PIN_KEY_ROW5, IOMUX_CONFIG_FUNC)
+#define MX31_PIN_KEY_ROW6_KEY_ROW6	IOMUX_MODE(MX31_PIN_KEY_ROW6, IOMUX_CONFIG_FUNC)
+#define MX31_PIN_KEY_ROW7_KEY_ROW7	IOMUX_MODE(MX31_PIN_KEY_ROW7, IOMUX_CONFIG_FUNC)
+#define MX31_PIN_KEY_COL0_KEY_COL0	IOMUX_MODE(MX31_PIN_KEY_COL0, IOMUX_CONFIG_FUNC)
+#define MX31_PIN_KEY_COL1_KEY_COL1	IOMUX_MODE(MX31_PIN_KEY_COL1, IOMUX_CONFIG_FUNC)
+#define MX31_PIN_KEY_COL2_KEY_COL2	IOMUX_MODE(MX31_PIN_KEY_COL2, IOMUX_CONFIG_FUNC)
+#define MX31_PIN_KEY_COL3_KEY_COL3	IOMUX_MODE(MX31_PIN_KEY_COL3, IOMUX_CONFIG_FUNC)
+#define MX31_PIN_KEY_COL4_KEY_COL4	IOMUX_MODE(MX31_PIN_KEY_COL4, IOMUX_CONFIG_FUNC)
+#define MX31_PIN_KEY_COL5_KEY_COL5	IOMUX_MODE(MX31_PIN_KEY_COL5, IOMUX_CONFIG_FUNC)
+#define MX31_PIN_KEY_COL6_KEY_COL6	IOMUX_MODE(MX31_PIN_KEY_COL6, IOMUX_CONFIG_FUNC)
+#define MX31_PIN_KEY_COL7_KEY_COL7	IOMUX_MODE(MX31_PIN_KEY_COL7, IOMUX_CONFIG_FUNC)
+
 
 /*
  * XXX: The SS0, SS1, SS2, SS3 lines of spi3 are multiplexed with cspi2_ss0,
-- 
1.6.3.3

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

* [PATCH 2/2 v2] mx31_3ds: Support the keypad situated in the personality board
  2010-05-19  9:33 ` [PATCH 1/2 v2] MX3X: Add Keypad device definition for MX3X arch Alberto Panizzo
@ 2010-05-19  9:34   ` Alberto Panizzo
  0 siblings, 0 replies; 4+ messages in thread
From: Alberto Panizzo @ 2010-05-19  9:34 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
---

This patch is built against the today mxc-master branch

 arch/arm/mach-mx3/mach-mx31_3ds.c |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-mx3/mach-mx31_3ds.c b/arch/arm/mach-mx3/mach-mx31_3ds.c
index 55d6117..58e5729 100644
--- a/arch/arm/mach-mx3/mach-mx31_3ds.c
+++ b/arch/arm/mach-mx3/mach-mx31_3ds.c
@@ -28,6 +28,7 @@
 #include <linux/spi/spi.h>
 #include <linux/regulator/machine.h>
 #include <linux/fsl_devices.h>
+#include <linux/input/matrix_keypad.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -82,6 +83,35 @@ static int mx31_3ds_pins[] = {
 	MX31_PIN_USBOTG_DIR__USBOTG_DIR,
 	MX31_PIN_USBOTG_NXT__USBOTG_NXT,
 	MX31_PIN_USBOTG_STP__USBOTG_STP,
+	/*Keyboard*/
+	MX31_PIN_KEY_ROW0_KEY_ROW0,
+	MX31_PIN_KEY_ROW1_KEY_ROW1,
+	MX31_PIN_KEY_ROW2_KEY_ROW2,
+	MX31_PIN_KEY_COL0_KEY_COL0,
+	MX31_PIN_KEY_COL1_KEY_COL1,
+	MX31_PIN_KEY_COL2_KEY_COL2,
+	MX31_PIN_KEY_COL3_KEY_COL3,
+};
+
+/*
+ * Matrix keyboard
+ */
+
+static const uint32_t mx31_3ds_keymap[] = {
+	KEY(0, 0, KEY_UP),
+	KEY(0, 1, KEY_DOWN),
+	KEY(1, 0, KEY_RIGHT),
+	KEY(1, 1, KEY_LEFT),
+	KEY(1, 2, KEY_ENTER),
+	KEY(2, 0, KEY_F6),
+	KEY(2, 1, KEY_F8),
+	KEY(2, 2, KEY_F9),
+	KEY(2, 3, KEY_F10),
+};
+
+static struct matrix_keymap_data mx31_3ds_keymap_data = {
+	.keymap		= mx31_3ds_keymap,
+	.keymap_size	= ARRAY_SIZE(mx31_3ds_keymap),
 };
 
 /* Regulators */
@@ -367,6 +397,8 @@ static void __init mxc_board_init(void)
 	spi_register_board_info(mx31_3ds_spi_devs,
 						ARRAY_SIZE(mx31_3ds_spi_devs));
 
+	mxc_register_device(&imx_kpp_device, &mx31_3ds_keymap_data);
+
 	mx31_3ds_usbotg_init();
 	mxc_register_device(&mxc_otg_udc_device, &usbotg_pdata);
 
-- 
1.6.3.3

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

* [PATCH 0/2 v2] MX3X: Architecture specific mx3 keypad support
  2010-05-19  9:31 [PATCH 0/2 v2] MX3X: Architecture specific mx3 keypad support Alberto Panizzo
  2010-05-19  9:33 ` [PATCH 1/2 v2] MX3X: Add Keypad device definition for MX3X arch Alberto Panizzo
@ 2010-05-19 12:23 ` MXC Sascha Hauer
  1 sibling, 0 replies; 4+ messages in thread
From: MXC Sascha Hauer @ 2010-05-19 12:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, May 19, 2010 at 11:31:52AM +0200, Alberto Panizzo wrote:
> This two patches add the support for the keypad device
> over the recent merge of the imx-keypad driver and shows
> how to support this device into the machine file.
> 
> v2: Pin definition helpers are placed in iomux-mx3.h
> 
> Alberto Panizzo (2):
>   MX3X: Add Keypad device definition for MX3X arch
>   mx31_3ds: Support the keypad situated in the personality board
> 
>  arch/arm/mach-mx3/devices.c                |   19 ++++++++++++++++
>  arch/arm/mach-mx3/devices.h                |    1 +
>  arch/arm/mach-mx3/mach-mx31_3ds.c          |   32 ++++++++++++++++++++++++++++
>  arch/arm/plat-mxc/include/mach/iomux-mx3.h |   17 ++++++++++++++

Ok, applied.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

end of thread, other threads:[~2010-05-19 12:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-19  9:31 [PATCH 0/2 v2] MX3X: Architecture specific mx3 keypad support Alberto Panizzo
2010-05-19  9:33 ` [PATCH 1/2 v2] MX3X: Add Keypad device definition for MX3X arch Alberto Panizzo
2010-05-19  9:34   ` [PATCH 2/2 v2] mx31_3ds: Support the keypad situated in the personality board Alberto Panizzo
2010-05-19 12:23 ` [PATCH 0/2 v2] MX3X: Architecture specific mx3 keypad support MXC Sascha Hauer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.