Skip to contentSkip to conversation

Matrix keypad

PATCH In review Marek Vasut 3 participants 10 messages Jul 9, 2008 – Apr 10, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/3 Matrix keypad

Hi,
this is the gpio driven matrix keypad. Final version. I also CCed it to linux-input since it might interest them.

drivers/input/keyboard/Kconfig +10 -0
index efd70a9..31b91ba 100644
@@ -323,4 +323,14 @@ config KEYBOARD_SH_KEYSC
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called sh_keysc.
+
+config KEYBOARD_MATRIX
+	tristate "GPIO driven matrix keypad support"
+	depends on GENERIC_GPIO
+	help
+	  Enable support for GPIO driven matrix keypad
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called matrix_keypad.
+
 endif
drivers/input/keyboard/Makefile +1 -0
index 0edc8f2..b22bae1 100644
@@ -27,3 +27,4 @@ obj-$(CONFIG_KEYBOARD_HP7XX)		+= jornada720_kbd.o
 obj-$(CONFIG_KEYBOARD_MAPLE)		+= maple_keyb.o
 obj-$(CONFIG_KEYBOARD_BFIN)		+= bf54x-keys.o
 obj-$(CONFIG_KEYBOARD_SH_KEYSC)		+= sh_keysc.o
+obj-$(CONFIG_KEYBOARD_MATRIX)		+= matrix_keypad.o
drivers/input/keyboard/matrix_keypad.c new file +351 -0

351 lines not on this page · raw message

include/linux/matrix_keypad.h new file +35 -0
new file mode 100644
index 0000000..fe72721
@@ -0,0 +1,35 @@
+#ifndef _MATRIX_KEYPAD_H
+#define _MATRIX_KEYPAD_H
+
+#include <linux/input.h>
+
+struct matrix_keypad_platform_data {
+
+	/* code map for the matrix keys */
+	unsigned int	*map;
+	int		map_size;
+
+	unsigned int	*col_gpio;
+	int		col_gpio_size;
+	unsigned int	*row_gpio;
+	int		row_gpio_size;
+
+	/* ALTFN key */
+	int		alt_row;
+	int		alt_col;
+
+	/* line polarities */
+	unsigned int	col_polarity;
+	unsigned int	row_polarity;
+
+	/* key debounce interval */
+	unsigned int	debounce_interval;
+};
+
+#define KEY(row, col, val, alt)	(((row) << 28) | ((col) << 24) | \
+				((alt & 0xfff) << 12) | (val & 0xfff))
+
+/* key not connected */
+#define KEY_NC	0xfff
+
+#endif /* _MATRIX_KEYPAD_H */
#1 lore raw

Hi Marek Vasut,

Quoted 3 lines · Marek Vasut

Hi,
this is the gpio driven matrix keypad. Final version. I also CCed it to linux-input since it might interest them.

Is there any interest for this patch to get mainlined through input subsystem ?

Signature · 3 lines
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni
#2 lore raw
Quoted 9 lines · On Tuesday 07 of April 2009 13:37:50 Trilok Soni wrote:

Hi Marek Vasut,

Quoted 3 lines · Marek Vasut

Hi,
this is the gpio driven matrix keypad. Final version. I also CCed it to linux-input since it might interest them.

Is there any interest for this patch to get mainlined through input subsystem ?

Yes, I'd like to see it mainlined as I need it on some devices. I haven't gotten to rewriting it as Dmitry Torokhov requested me to (see his reply in linux-input) though.

#3 lore raw

Hi Marek,

Quoted 8 lines · Marek Vasut
Quoted 7 lines · On Tuesday 07 of April 2009 13:37:50 Trilok Soni wrote:

Hi Marek Vasut,

Quoted 3 lines · Marek Vasut

Hi,
this is the gpio driven matrix keypad. Final version. I also CCed it to linux-input since it might interest them.

Quoted 7 lines
Quoted 2 lines

Is there any interest for this patch to get mainlined through input subsystem ?

Yes, I'd like to see it mainlined as I need it on some devices. I haven't gotten to rewriting it as Dmitry Torokhov requested me to (see his reply in linux-input) though.

I found only this thread where Dmitry Baryshkov had given some comments.

http://marc.info/?t=121732956800006&r=1&w=2

AFAIK, there is no need to give irqf_sample_random for input drivers interrupts, as it is already done by input subsystem. Could you please point to the exact thread where Dmitry Torokhov commented?

Signature · 3 lines
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni
#4 lore raw
Quoted 7 lines · On Tuesday 07 of April 2009 15:41:05 Trilok Soni wrote:

Hi Marek,

Quoted 4 lines · Marek Vasut
Quoted 3 lines · On Tuesday 07 of April 2009 13:37:50 Trilok Soni wrote:

Hi Marek Vasut,

On Wed, Jul 9, 2008 at 7:11 AM, Marek Vasut <[email protected]>

Quoted 11 lines · wrote:
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines

Hi,
this is the gpio driven matrix keypad. Final version. I also CCed it to linux-input since it might interest them.

Is there any interest for this patch to get mainlined through input subsystem ?

Yes, I'd like to see it mainlined as I need it on some devices. I haven't gotten to rewriting it as Dmitry Torokhov requested me to (see his reply in linux-input) though.

Quoted 7 lines

I found only this thread where Dmitry Baryshkov had given some comments.

http://marc.info/?t=121732956800006&r=1&w=2

AFAIK, there is no need to give irqf_sample_random for input drivers interrupts, as it is already done by input subsystem. Could you please point to the exact thread where Dmitry Torokhov commented?

http://article.gmane.org/gmane.linux.kernel.input/5551 try here

#5 lore raw
Quoted 23 lines · On Tuesday 07 of April 2009 15:59:59 Marek Vasut wrote:
Quoted 7 lines · On Tuesday 07 of April 2009 15:41:05 Trilok Soni wrote:

Hi Marek,

Quoted 4 lines · Marek Vasut
Quoted 3 lines · On Tuesday 07 of April 2009 13:37:50 Trilok Soni wrote:

Hi Marek Vasut,

On Wed, Jul 9, 2008 at 7:11 AM, Marek Vasut <[email protected]>

Quoted 13 lines · wrote:
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines

Hi,
this is the gpio driven matrix keypad. Final version. I also CCed it to linux-input since it might interest them.

Is there any interest for this patch to get mainlined through input subsystem ?

Yes, I'd like to see it mainlined as I need it on some devices. I haven't gotten to rewriting it as Dmitry Torokhov requested me to (see his reply in linux-input) though.

I found only this thread where Dmitry Baryshkov had given some comments.

Quoted 7 lines
Quoted 5 lines

http://marc.info/?t=121732956800006&r=1&w=2

AFAIK, there is no need to give irqf_sample_random for input drivers interrupts, as it is already done by input subsystem. Could you please point to the exact thread where Dmitry Torokhov commented?

http://article.gmane.org/gmane.linux.kernel.input/5551 try here

just wondering ... do you need that driver or something ? or are you willing to do the final fixes ? :)

#6 lore raw
Quoted 26 lines · Marek Vasut
Quoted 25 lines · On Tuesday 07 of April 2009 15:59:59 Marek Vasut wrote:
Quoted 7 lines · On Tuesday 07 of April 2009 15:41:05 Trilok Soni wrote:

Hi Marek,

Quoted 4 lines · Marek Vasut
Quoted 3 lines · On Tuesday 07 of April 2009 13:37:50 Trilok Soni wrote:

Hi Marek Vasut,

On Wed, Jul 9, 2008 at 7:11 AM, Marek Vasut <[email protected]>

Quoted 15 lines · wrote:
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines

Hi,
this is the gpio driven matrix keypad. Final version. I also CCed it to linux-input since it might interest them.

Is there any interest for this patch to get mainlined through input subsystem ?

Yes, I'd like to see it mainlined as I need it on some devices. I haven't gotten to rewriting it as Dmitry Torokhov requested me to (see his reply in linux-input) though.

I found only this thread where Dmitry Baryshkov had given some comments.

http://marc.info/?t=121732956800006&r=1&w=2

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

AFAIK, there is no need to give irqf_sample_random for input drivers interrupts, as it is already done by input subsystem. Could you please point to the exact thread where Dmitry Torokhov commented?

http://article.gmane.org/gmane.linux.kernel.input/5551 try here

just wondering ... do you need that driver or something ? or are you willing to do the final fixes ? :)

I'll take a look into this. I need this driver to deprecate the original corgi/poodle keyboard driver, which causes a lot of ugly warnings.

#7 lore raw
Quoted 6 lines · On Friday 10 of April 2009 06:19:09 Eric Miao wrote:
Quoted 5 lines · Marek Vasut
Quoted 4 lines · On Tuesday 07 of April 2009 15:59:59 Marek Vasut wrote:
Quoted 3 lines · On Tuesday 07 of April 2009 15:41:05 Trilok Soni wrote:

Hi Marek,

On Tue, Apr 7, 2009 at 6:46 PM, Marek Vasut <[email protected]>

Quoted 26 lines · wrote:
Quoted 26 lines
Quoted 26 lines
Quoted 4 lines
Quoted 4 lines · On Tuesday 07 of April 2009 13:37:50 Trilok Soni wrote:
Quoted 3 lines

Hi Marek Vasut,

On Wed, Jul 9, 2008 at 7:11 AM, Marek Vasut <[email protected]>

Quoted 19 lines · wrote:
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines

Hi,
this is the gpio driven matrix keypad. Final version. I also CCed it to linux-input since it might interest them.

Is there any interest for this patch to get mainlined through input subsystem ?

Yes, I'd like to see it mainlined as I need it on some devices. I haven't gotten to rewriting it as Dmitry Torokhov requested me to (see his reply in linux-input) though.

I found only this thread where Dmitry Baryshkov had given some comments.

http://marc.info/?t=121732956800006&r=1&w=2

AFAIK, there is no need to give irqf_sample_random for input drivers interrupts, as it is already done by input subsystem. Could you please point to the exact thread where Dmitry Torokhov commented?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

http://article.gmane.org/gmane.linux.kernel.input/5551 try here

just wondering ... do you need that driver or something ? or are you willing to do the final fixes ? :)

I'll take a look into this. I need this driver to deprecate the original corgi/poodle keyboard driver, which causes a lot of ugly warnings.

That'd be great, I need it on two devices too. I'm a little frightened about it's speed though as it's iterating over all the GPIOs, but there is a possibility to read a whole bunch of GPIOs at one time now, right ?

#8 lore raw
Quoted 39 lines · Marek Vasut
Quoted 6 lines · On Friday 10 of April 2009 06:19:09 Eric Miao wrote:
Quoted 5 lines · Marek Vasut
Quoted 4 lines · On Tuesday 07 of April 2009 15:59:59 Marek Vasut wrote:
Quoted 3 lines · On Tuesday 07 of April 2009 15:41:05 Trilok Soni wrote:

Hi Marek,

On Tue, Apr 7, 2009 at 6:46 PM, Marek Vasut <[email protected]>

Quoted 31 lines · wrote:
Quoted 30 lines
Quoted 20 lines
Quoted 4 lines
Quoted 4 lines · On Tuesday 07 of April 2009 13:37:50 Trilok Soni wrote:
Quoted 3 lines

Hi Marek Vasut,

On Wed, Jul 9, 2008 at 7:11 AM, Marek Vasut <[email protected]>

Quoted 14 lines · wrote:
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines

Hi,
this is the gpio driven matrix keypad. Final version. I also CCed it to linux-input since it might interest them.

Is there any interest for this patch to get mainlined through input subsystem ?

Yes, I'd like to see it mainlined as I need it on some devices. I haven't gotten to rewriting it as Dmitry Torokhov requested me to (see his reply in linux-input) though.

I found only this thread where Dmitry Baryshkov had given some comments.

Quoted 7 lines
Quoted 5 lines

http://marc.info/?t=121732956800006&r=1&w=2

AFAIK, there is no need to give irqf_sample_random for input drivers interrupts, as it is already done by input subsystem. Could you please point to the exact thread where Dmitry Torokhov commented?

http://article.gmane.org/gmane.linux.kernel.input/5551 try here

just wondering ... do you need that driver or something ? or are you willing to do the final fixes ? :)

Quoted 7 lines
Quoted 2 lines

I'll take a look into this. I need this driver to deprecate the original corgi/poodle keyboard driver, which causes a lot of ugly warnings.

That'd be great, I need it on two devices too. I'm a little frightened about it's speed though as it's iterating over all the GPIOs, but there is a possibility to read a whole bunch of GPIOs at one time now, right ?

I'm not sure if Jaya Kumar's batch gpio patches have been merged or not. Performance should not be that sensitive for keypad :)

Signature · 2 lines
Cheers
- eric
#9 lore raw
In reply to Marek Vasut

Hi Marek,

Quoted 26 lines · Marek Vasut
Quoted 25 lines · On Tuesday 07 of April 2009 15:59:59 Marek Vasut wrote:
Quoted 7 lines · On Tuesday 07 of April 2009 15:41:05 Trilok Soni wrote:

Hi Marek,

Quoted 4 lines · Marek Vasut
Quoted 3 lines · On Tuesday 07 of April 2009 13:37:50 Trilok Soni wrote:

Hi Marek Vasut,

On Wed, Jul 9, 2008 at 7:11 AM, Marek Vasut <[email protected]>

Quoted 15 lines · wrote:
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines

Hi,
this is the gpio driven matrix keypad. Final version. I also CCed it to linux-input since it might interest them.

Is there any interest for this patch to get mainlined through input subsystem ?

Yes, I'd like to see it mainlined as I need it on some devices. I haven't gotten to rewriting it as Dmitry Torokhov requested me to (see his reply in linux-input) though.

I found only this thread where Dmitry Baryshkov had given some comments.

http://marc.info/?t=121732956800006&r=1&w=2

Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

AFAIK, there is no need to give irqf_sample_random for input drivers interrupts, as it is already done by input subsystem. Could you please point to the exact thread where Dmitry Torokhov commented?

http://article.gmane.org/gmane.linux.kernel.input/5551 try here

just wondering ... do you need that driver or something ? or are you willing to do the final fixes ? :)

Actually both as time permits.

1. input_polldev support for gpios which can't be configured for irqs
2. hopefully removing kthread with timer

I was also comparing this driver with one written for matrix gpio keypad in android-msm-kernel. You might want to have look at it.

gpio_matrix.c:

http://android.git.kernel.org/?p=kernel/msm.git;a=blob;f=drivers/input/misc/gpio_matrix.c;h=c1f47651a4937d5c976a9625ca5da389dd7e4a7c;hb=HEAD

gpio_input.c:

http://android.git.kernel.org/?p=kernel/msm.git;a=blob;f=drivers/input/misc/gpio_input.c;h=7e307f267a2a059b64a3fb9c8a379b149016b2f8;hb=HEAD

Signature · 3 lines
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni