[PATCH 1/2] input: adp5588 - add support for gpio names

Subsystems: adp5588 qwerty keypad and io expander driver (adp5588/adp5587), input (keyboard, mouse, joystick, touchscreen) drivers, the rest

STALE5219d REVIEWED: 30 (30M)

1 review trailer (1 from subsystem maintainers).

4 messages, 2 authors, 2012-04-20 · open the first message on its own page

[PATCH 1/2] input: adp5588 - add support for gpio names

From: Jean-François Dagenais <hidden>
Date: 2012-01-09 19:15:36

Signed-off-by: Jean-François Dagenais <redacted>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/input/keyboard/adp5588-keys.c |    1 +
 include/linux/i2c/adp5588.h           |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c
index e34eeb8..6412ced 100644
--- a/drivers/input/keyboard/adp5588-keys.c
+++ b/drivers/input/keyboard/adp5588-keys.c
@@ -197,6 +197,7 @@ static int __devinit adp5588_gpio_add(struct adp5588_kpad *kpad)
 	kpad->gc.base = gpio_data->gpio_start;
 	kpad->gc.label = kpad->client->name;
 	kpad->gc.owner = THIS_MODULE;
+	kpad->gc.names = gpio_data->names;
 
 	mutex_init(&kpad->gpio_lock);
 
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h
index cec17cf..d8341cb 100644
--- a/include/linux/i2c/adp5588.h
+++ b/include/linux/i2c/adp5588.h
@@ -157,6 +157,7 @@ struct i2c_client; /* forward declaration */
 
 struct adp5588_gpio_platform_data {
 	int gpio_start;		/* GPIO Chip base # */
+	const char *const *names;
 	unsigned irq_base;	/* interrupt base # */
 	unsigned pullup_dis_mask; /* Pull-Up Disable Mask */
 	int	(*setup)(struct i2c_client *client,
-- 
1.7.8.2

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

[PATCH 2/2] gpio: adp5588 - add support for gpio names

From: Jean-François Dagenais <hidden>
Date: 2012-01-09 19:15:37

follows the commit in input, which already modified the
common header for adp5588

Signed-off-by: Jean-François Dagenais <redacted>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/gpio/gpio-adp5588.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/gpio/gpio-adp5588.c b/drivers/gpio/gpio-adp5588.c
index 3525ad9..3122713 100644
--- a/drivers/gpio/gpio-adp5588.c
+++ b/drivers/gpio/gpio-adp5588.c
@@ -384,6 +384,7 @@ static int __devinit adp5588_gpio_probe(struct i2c_client *client,
 	gc->ngpio = ADP5588_MAXGPIO;
 	gc->label = client->name;
 	gc->owner = THIS_MODULE;
+	gc->names = pdata->names;
 
 	mutex_init(&dev->lock);
 
-- 
1.7.8.2

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

Re: [PATCH 1/2] input: adp5588 - add support for gpio names

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2012-01-09 19:22:32

On Mon, Jan 09, 2012 at 02:15:26PM -0500, Jean-François Dagenais wrote:
quoted hunk
Signed-off-by: Jean-François Dagenais <redacted>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/input/keyboard/adp5588-keys.c |    1 +
 include/linux/i2c/adp5588.h           |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c
index e34eeb8..6412ced 100644
--- a/drivers/input/keyboard/adp5588-keys.c
+++ b/drivers/input/keyboard/adp5588-keys.c
@@ -197,6 +197,7 @@ static int __devinit adp5588_gpio_add(struct adp5588_kpad *kpad)
 	kpad->gc.base = gpio_data->gpio_start;
 	kpad->gc.label = kpad->client->name;
 	kpad->gc.owner = THIS_MODULE;
+	kpad->gc.names = gpio_data->names;
 
 	mutex_init(&kpad->gpio_lock);
 
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h
index cec17cf..d8341cb 100644
--- a/include/linux/i2c/adp5588.h
+++ b/include/linux/i2c/adp5588.h
@@ -157,6 +157,7 @@ struct i2c_client; /* forward declaration */
 
 struct adp5588_gpio_platform_data {
 	int gpio_start;		/* GPIO Chip base # */
+	const char *const *names;
I think it is 1 const too much - you won't be able to use non-statioc
initialization...

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/2] input: adp5588 - add support for gpio names

From: Jean-Francois Dagenais <hidden>
Date: 2012-04-20 14:49:54

On Jan 9, 2012, at 14:22, Dmitry Torokhov wrote:
On Mon, Jan 09, 2012 at 02:15:26PM -0500, Jean-François Dagenais wrote:
quoted
Signed-off-by: Jean-François Dagenais <redacted>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
---
drivers/input/keyboard/adp5588-keys.c |    1 +
include/linux/i2c/adp5588.h           |    1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c
index e34eeb8..6412ced 100644
--- a/drivers/input/keyboard/adp5588-keys.c
+++ b/drivers/input/keyboard/adp5588-keys.c
@@ -197,6 +197,7 @@ static int __devinit adp5588_gpio_add(struct adp5588_kpad *kpad)
	kpad->gc.base = gpio_data->gpio_start;
	kpad->gc.label = kpad->client->name;
	kpad->gc.owner = THIS_MODULE;
+	kpad->gc.names = gpio_data->names;

	mutex_init(&kpad->gpio_lock);
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h
index cec17cf..d8341cb 100644
--- a/include/linux/i2c/adp5588.h
+++ b/include/linux/i2c/adp5588.h
@@ -157,6 +157,7 @@ struct i2c_client; /* forward declaration */
struct adp5588_gpio_platform_data {
	int gpio_start;		/* GPIO Chip base # */
+	const char *const *names;
I think it is 1 const too much - you won't be able to use non-statioc
initialization...
The following code (compiles without warning using gcc version 4.6.1) works as expected
#include <stdio.h>
#include <malloc.h>
struct adp5588_gpio_platform_data {
   const char const*const* names;
};

int main(void)
{
   struct adp5588_gpio_platform_data s;
   char const* str_tbl[2];
   const char str0[10] = "string 0";
   const char str1[10] = "string 1";
   str_tbl[0] = str0;
   str_tbl[1] = str1;
   s.names = str_tbl;
   printf("tbl index 0: \"%s\"\n", s.names[0]);
   printf("tbl index 1: \"%s\"\n", s.names[1]);
   return 0;
}

terminal output:
tbl index 0:string 0
tbl index 1:string 1

Do I need to resend the patches? Do I need to forward to "linux-kernel"?
-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help