RE: [UPDATE] [RFC] [PATCH 0/4] OMAP4 Keyboard Controller Support

2010-05-27 Thread Arce, Abraham
Hi Dmitry,

 On Tue, May 18, 2010 at 06:13:48PM -0500, Arce, Abraham wrote:
  Hi,
 
  Here you have the list of changes done so far for OMAP4 Keyboard
  Controller Support v2. I'll appreciate if someone else has more comments
  to share.
 
 
 I finally had a chance to review the patches and I do not think that we
 shoudl be adding new hooks, especially omap-specific platform methods,
 into matrix_keypad_platform_data structure. Also, the structre does not
 really match the device since it does nto use GPIOs. Why don't we
 define a driver-specific platform structure based on matrix_keypad_data
 and use it instead?

Agree, looks clean now...

 
 Please try the patch below and let me know if it works for you.

Yes, it works... I am putting it in a TI internal tree...

 Btw, you should not be allocating platform data in the platform code -
 it meant to be statically allocated and preferrably constant.

I'll take a look at this...

 +
 +#include plat/omap4_keypad.h

One fix to your patch...

#include plat/omap4-keypad.h

[snip]

Best Regards
Abraham
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [UPDATE] [RFC] [PATCH 0/4] OMAP4 Keyboard Controller Support

2010-05-25 Thread Dmitry Torokhov
Hi Abraham,


On Tue, May 18, 2010 at 06:13:48PM -0500, Arce, Abraham wrote:
 Hi,
 
 Here you have the list of changes done so far for OMAP4 Keyboard
 Controller Support v2. I'll appreciate if someone else has more comments
 to share.
 

I finally had a chance to review the patches and I do not think that we
shoudl be adding new hooks, especially omap-specific platform methods,
into matrix_keypad_platform_data structure. Also, the structre does not
really match the device since it does nto use GPIOs. Why don't we
define a driver-specific platform structure based on matrix_keypad_data
and use it instead?

Please try the patch below and let me know if it works for you.

Btw, you should not be allocating platform data in the platform code -
it meant to be statically allocated and preferrably constant.

Thanks.

-- 
Dmitry


Input: add support for OMAP4 keyboard controller

From: Abraham Arce x0066...@ti.com

OMAP4 keyboard controller includes:
  - built-in scanning algorithm
  - debouncing feature

Driver implementation is based on matrix_keypac.c

Signed-off-by: Syed Rafiuddin rafiuddin.s...@ti.com
Signed-off-by: Abraham Arce x0066...@ti.com
Signed-off-by: Dmitry Torokhov dmitry.torok...@gmail.com
---

 arch/arm/plat-omap/include/plat/omap4-keypad.h |   17 +
 drivers/input/keyboard/Kconfig |   10 +
 drivers/input/keyboard/Makefile|1 
 drivers/input/keyboard/omap4-keypad.c  |  287 
 4 files changed, 315 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/omap4-keypad.h
 create mode 100644 drivers/input/keyboard/omap4-keypad.c


diff --git a/arch/arm/plat-omap/include/plat/omap4-keypad.h 
b/arch/arm/plat-omap/include/plat/omap4-keypad.h
new file mode 100644
index 000..a180adf
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap4-keypad.h
@@ -0,0 +1,17 @@
+#ifndef ARCH_ARM_PLAT_OMAP4_KEYPAD_H
+#define ARCH_ARM_PLAT_OMAP4_KEYPAD_H
+
+#include linux/input/matrix_keypad.h
+
+struct omap4_keypad_platform_data {
+   const struct matrix_keymap_data *keymap_data;
+
+   u8 rows;
+   u8 cols;
+
+   u16 irq;
+   void __iomem *base;
+};
+
+#endif
+
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index d8fa5d7..af5ef6e 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -393,6 +393,16 @@ config KEYBOARD_OMAP
  To compile this driver as a module, choose M here: the
  module will be called omap-keypad.
 
+config KEYBOARD_OMAP4
+   tristate TI OMAP4 keypad support
+   depends on ARCH_OMAP4
+   default n
+   help
+ Say Y here if you want to use the OMAP4 keypad.
+
+ To compile this driver as a module, choose M here: the
+ module will be called omap4-keypad.
+
 config KEYBOARD_TWL4030
tristate TI TWL4030/TWL5030/TPS659x0 keypad support
depends on TWL4030_CORE
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 4596d0c..fe48826 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_KEYBOARD_MATRIX) += matrix_keypad.o
 obj-$(CONFIG_KEYBOARD_MAX7359) += max7359_keypad.o
 obj-$(CONFIG_KEYBOARD_NEWTON)  += newtonkbd.o
 obj-$(CONFIG_KEYBOARD_OMAP)+= omap-keypad.o
+obj-$(CONFIG_KEYBOARD_OMAP4)   += omap4-keypad.o
 obj-$(CONFIG_KEYBOARD_OPENCORES)   += opencores-kbd.o
 obj-$(CONFIG_KEYBOARD_PXA27x)  += pxa27x_keypad.o
 obj-$(CONFIG_KEYBOARD_PXA930_ROTARY)   += pxa930_rotary.o
diff --git a/drivers/input/keyboard/omap4-keypad.c 
b/drivers/input/keyboard/omap4-keypad.c
new file mode 100644
index 000..f981174
--- /dev/null
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -0,0 +1,287 @@
+/*
+ * OMAP4 Keypad Driver
+ *
+ * Copyright (C) 2010 Texas Instruments
+ *
+ * Author: Abraham Arce x0066...@ti.com
+ * Initial Code: Syed Rafiuddin rafiuddin.s...@ti.com
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include linux/module.h
+#include linux/init.h
+#include linux/interrupt.h
+#include linux/platform_device.h
+#include linux/errno.h
+#include linux/io.h
+#include linux/input.h
+#include linux/slab.h
+
+#include plat/omap4_keypad.h
+
+/* OMAP4 registers */
+#define