Skip to contentSkip to conversation

pxa/hx4700: use gpio arrays for global gpio initialization

PATCH New Philipp Zabel 4 participants 7 messages Apr 20, 2011 – Jul 5, 2011

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

PATCH 1/1 pxa/hx4700: use gpio arrays for global gpio initialization

gpio_request_arrays() is a functional replacement for hx4700_gpio_request(), which is now obsolete.

---
 arch/arm/mach-pxa/hx4700.c |   66 ++++++++++----------------------------------
 1 files changed, 15 insertions(+), 51 deletions(-)
arch/arm/mach-pxa/hx4700.c +15 -51
index 9cdcca5..f8a3a6e 100644
@@ -135,42 +135,6 @@ static unsigned long hx4700_pin_config[] __initdata = {
 	GPIO66_GPIO,	/* nSDIO_IRQ */
 };
 
-#define HX4700_GPIO_IN(num, _desc) \
-	{ .gpio = (num), .dir = 0, .desc = (_desc) }
-#define HX4700_GPIO_OUT(num, _init, _desc) \
-	{ .gpio = (num), .dir = 1, .init = (_init), .desc = (_desc) }
-struct gpio_ress {
-	unsigned gpio : 8;
-	unsigned dir : 1;
-	unsigned init : 1;
-	char *desc;
-};
-
-static int hx4700_gpio_request(struct gpio_ress *gpios, int size)
-{
-	int i, rc = 0;
-	int gpio;
-	int dir;
-
-	for (i = 0; (!rc) && (i < size); i++) {
-		gpio = gpios[i].gpio;
-		dir = gpios[i].dir;
-		rc = gpio_request(gpio, gpios[i].desc);
-		if (rc) {
-			pr_err("Error requesting GPIO %d(%s) : %d\n",
-			       gpio, gpios[i].desc, rc);
-			continue;
-		}
-		if (dir)
-			gpio_direction_output(gpio, gpios[i].init);
-		else
-			gpio_direction_input(gpio);
-	}
-	while ((rc) && (--i >= 0))
-		gpio_free(gpios[i].gpio);
-	return rc;
-}
-
 /*
  * IRDA
  */
@@ -829,26 +793,26 @@ static struct platform_device *devices[] __initdata = {
 	&pcmcia,
 };
 
-static struct gpio_ress global_gpios[] = {
-	HX4700_GPIO_IN(GPIO12_HX4700_ASIC3_IRQ, "ASIC3_IRQ"),
-	HX4700_GPIO_IN(GPIO13_HX4700_W3220_IRQ, "W3220_IRQ"),
-	HX4700_GPIO_IN(GPIO14_HX4700_nWLAN_IRQ, "WLAN_IRQ"),
-	HX4700_GPIO_OUT(GPIO59_HX4700_LCD_PC1,          1, "LCD_PC1"),
-	HX4700_GPIO_OUT(GPIO62_HX4700_LCD_nRESET,       1, "LCD_RESET"),
-	HX4700_GPIO_OUT(GPIO70_HX4700_LCD_SLIN1,        1, "LCD_SLIN1"),
-	HX4700_GPIO_OUT(GPIO84_HX4700_LCD_SQN,          1, "LCD_SQN"),
-	HX4700_GPIO_OUT(GPIO110_HX4700_LCD_LVDD_3V3_ON, 1, "LCD_LVDD"),
-	HX4700_GPIO_OUT(GPIO111_HX4700_LCD_AVDD_3V3_ON, 1, "LCD_AVDD"),
-	HX4700_GPIO_OUT(GPIO32_HX4700_RS232_ON,         1, "RS232_ON"),
-	HX4700_GPIO_OUT(GPIO71_HX4700_ASIC3_nRESET,     1, "ASIC3_nRESET"),
-	HX4700_GPIO_OUT(GPIO82_HX4700_EUART_RESET,      1, "EUART_RESET"),
-	HX4700_GPIO_OUT(GPIO105_HX4700_nIR_ON,          1, "nIR_EN"),
+static struct gpio global_gpios[] = {
+	{ GPIO12_HX4700_ASIC3_IRQ, GPIOF_IN, "ASIC3_IRQ" },
+	{ GPIO13_HX4700_W3220_IRQ, GPIOF_IN, "W3220_IRQ" },
+	{ GPIO14_HX4700_nWLAN_IRQ, GPIOF_IN, "WLAN_IRQ" },
+	{ GPIO59_HX4700_LCD_PC1,          GPIOF_OUT_INIT_HIGH, "LCD_PC1" },
+	{ GPIO62_HX4700_LCD_nRESET,       GPIOF_OUT_INIT_HIGH, "LCD_RESET" },
+	{ GPIO70_HX4700_LCD_SLIN1,        GPIOF_OUT_INIT_HIGH, "LCD_SLIN1" },
+	{ GPIO84_HX4700_LCD_SQN,          GPIOF_OUT_INIT_HIGH, "LCD_SQN" },
+	{ GPIO110_HX4700_LCD_LVDD_3V3_ON, GPIOF_OUT_INIT_HIGH, "LCD_LVDD" },
+	{ GPIO111_HX4700_LCD_AVDD_3V3_ON, GPIOF_OUT_INIT_HIGH, "LCD_AVDD" },
+	{ GPIO32_HX4700_RS232_ON,         GPIOF_OUT_INIT_HIGH, "RS232_ON" },
+	{ GPIO71_HX4700_ASIC3_nRESET,     GPIOF_OUT_INIT_HIGH, "ASIC3_nRESET" },
+	{ GPIO82_HX4700_EUART_RESET,      GPIOF_OUT_INIT_HIGH, "EUART_RESET" },
+	{ GPIO105_HX4700_nIR_ON,          GPIOF_OUT_INIT_HIGH, "nIR_EN" },
 };
 
 static void __init hx4700_init(void)
 {
 	pxa2xx_mfp_config(ARRAY_AND_SIZE(hx4700_pin_config));
-	hx4700_gpio_request(ARRAY_AND_SIZE(global_gpios));
+	gpio_request_array(ARRAY_AND_SIZE(global_gpios));
 
 	pxa_set_ffuart_info(NULL);
 	pxa_set_btuart_info(NULL);
Signature · 1 line
1.7.4.4
#1 lore raw

PATCH 1/1 pxa/hx4700: use gpio arrays for global gpio initialization

Quoted 2 lines · Philipp Zabel

gpio_request_arrays() is a functional replacement for hx4700_gpio_request(), which is now obsolete.

[snip]

arch/arm/mach-pxa/hx4700.c static struct platform_device *devices[] __initdata = { · line 815

Quoted 2 lines
arch/arm/mach-pxa/hx4700.c +1 -1
-	hx4700_gpio_request(ARRAY_AND_SIZE(global_gpios));
+	gpio_request_array(ARRAY_AND_SIZE(global_gpios));

It would be nice to check return value here and print some message on error, as unlike hx4700_gpio_request, gpio_request_array() is completely silent.

Signature · 2 lines
Best regards,
Dmitry "MAD" ArtAMonow
#2 lore raw

PATCH v2 1/1 pxa/hx4700: use gpio arrays for global gpio initialization

gpio_request_array() is a functional replacement for hx4700_gpio_request(), which is now obsolete.

---
 arch/arm/mach-pxa/hx4700.c |   70 ++++++++++++--------------------------------
 1 files changed, 19 insertions(+), 51 deletions(-)
arch/arm/mach-pxa/hx4700.c +19 -51
index 9cdcca5..46b8045 100644
@@ -135,42 +135,6 @@ static unsigned long hx4700_pin_config[] __initdata = {
 	GPIO66_GPIO,	/* nSDIO_IRQ */
 };
 
-#define HX4700_GPIO_IN(num, _desc) \
-	{ .gpio = (num), .dir = 0, .desc = (_desc) }
-#define HX4700_GPIO_OUT(num, _init, _desc) \
-	{ .gpio = (num), .dir = 1, .init = (_init), .desc = (_desc) }
-struct gpio_ress {
-	unsigned gpio : 8;
-	unsigned dir : 1;
-	unsigned init : 1;
-	char *desc;
-};
-
-static int hx4700_gpio_request(struct gpio_ress *gpios, int size)
-{
-	int i, rc = 0;
-	int gpio;
-	int dir;
-
-	for (i = 0; (!rc) && (i < size); i++) {
-		gpio = gpios[i].gpio;
-		dir = gpios[i].dir;
-		rc = gpio_request(gpio, gpios[i].desc);
-		if (rc) {
-			pr_err("Error requesting GPIO %d(%s) : %d\n",
-			       gpio, gpios[i].desc, rc);
-			continue;
-		}
-		if (dir)
-			gpio_direction_output(gpio, gpios[i].init);
-		else
-			gpio_direction_input(gpio);
-	}
-	while ((rc) && (--i >= 0))
-		gpio_free(gpios[i].gpio);
-	return rc;
-}
-
 /*
  * IRDA
  */
@@ -829,26 +793,30 @@ static struct platform_device *devices[] __initdata = {
 	&pcmcia,
 };
 
-static struct gpio_ress global_gpios[] = {
-	HX4700_GPIO_IN(GPIO12_HX4700_ASIC3_IRQ, "ASIC3_IRQ"),
-	HX4700_GPIO_IN(GPIO13_HX4700_W3220_IRQ, "W3220_IRQ"),
-	HX4700_GPIO_IN(GPIO14_HX4700_nWLAN_IRQ, "WLAN_IRQ"),
-	HX4700_GPIO_OUT(GPIO59_HX4700_LCD_PC1,          1, "LCD_PC1"),
-	HX4700_GPIO_OUT(GPIO62_HX4700_LCD_nRESET,       1, "LCD_RESET"),
-	HX4700_GPIO_OUT(GPIO70_HX4700_LCD_SLIN1,        1, "LCD_SLIN1"),
-	HX4700_GPIO_OUT(GPIO84_HX4700_LCD_SQN,          1, "LCD_SQN"),
-	HX4700_GPIO_OUT(GPIO110_HX4700_LCD_LVDD_3V3_ON, 1, "LCD_LVDD"),
-	HX4700_GPIO_OUT(GPIO111_HX4700_LCD_AVDD_3V3_ON, 1, "LCD_AVDD"),
-	HX4700_GPIO_OUT(GPIO32_HX4700_RS232_ON,         1, "RS232_ON"),
-	HX4700_GPIO_OUT(GPIO71_HX4700_ASIC3_nRESET,     1, "ASIC3_nRESET"),
-	HX4700_GPIO_OUT(GPIO82_HX4700_EUART_RESET,      1, "EUART_RESET"),
-	HX4700_GPIO_OUT(GPIO105_HX4700_nIR_ON,          1, "nIR_EN"),
+static struct gpio global_gpios[] = {
+	{ GPIO12_HX4700_ASIC3_IRQ, GPIOF_IN, "ASIC3_IRQ" },
+	{ GPIO13_HX4700_W3220_IRQ, GPIOF_IN, "W3220_IRQ" },
+	{ GPIO14_HX4700_nWLAN_IRQ, GPIOF_IN, "WLAN_IRQ" },
+	{ GPIO59_HX4700_LCD_PC1,          GPIOF_OUT_INIT_HIGH, "LCD_PC1" },
+	{ GPIO62_HX4700_LCD_nRESET,       GPIOF_OUT_INIT_HIGH, "LCD_RESET" },
+	{ GPIO70_HX4700_LCD_SLIN1,        GPIOF_OUT_INIT_HIGH, "LCD_SLIN1" },
+	{ GPIO84_HX4700_LCD_SQN,          GPIOF_OUT_INIT_HIGH, "LCD_SQN" },
+	{ GPIO110_HX4700_LCD_LVDD_3V3_ON, GPIOF_OUT_INIT_HIGH, "LCD_LVDD" },
+	{ GPIO111_HX4700_LCD_AVDD_3V3_ON, GPIOF_OUT_INIT_HIGH, "LCD_AVDD" },
+	{ GPIO32_HX4700_RS232_ON,         GPIOF_OUT_INIT_HIGH, "RS232_ON" },
+	{ GPIO71_HX4700_ASIC3_nRESET,     GPIOF_OUT_INIT_HIGH, "ASIC3_nRESET" },
+	{ GPIO82_HX4700_EUART_RESET,      GPIOF_OUT_INIT_HIGH, "EUART_RESET" },
+	{ GPIO105_HX4700_nIR_ON,          GPIOF_OUT_INIT_HIGH, "nIR_EN" },
 };
 
 static void __init hx4700_init(void)
 {
+	int ret;
+
 	pxa2xx_mfp_config(ARRAY_AND_SIZE(hx4700_pin_config));
-	hx4700_gpio_request(ARRAY_AND_SIZE(global_gpios));
+	ret = gpio_request_array(ARRAY_AND_SIZE(global_gpios));
+	if (ret)
+		pr_err ("hx4700: Failed to request GPIOs.\n");
 
 	pxa_set_ffuart_info(NULL);
 	pxa_set_btuart_info(NULL);
Signature · 1 line
1.7.4.4
#3 lore raw

PATCH v2 1/1 pxa/hx4700: use gpio arrays for global gpio initialization

arch/arm/mach-pxa/hx4700.c static struct platform_device *devices[] __initdata = { · line 819

Quoted 4 lines · Philipp Zabel
arch/arm/mach-pxa/hx4700.c +3 -1
-	hx4700_gpio_request(ARRAY_AND_SIZE(global_gpios));
+	ret = gpio_request_array(ARRAY_AND_SIZE(global_gpios));
+	if (ret)
+		pr_err ("hx4700: Failed to request GPIOs.\n");

No space between pr_err and (.

Does the return code convey useful information as to _why_ it failed? If yes, you really should print its value. Knowing whether it's -EBUSY (eg, already in use) instead of -EINVAL (eg, invalid GPIO number) really helps to debug problems.

#4 lore raw

PATCH v2 1/1 pxa/hx4700: use gpio arrays for global gpio initialization

Quoted 7 lines · Russell King - ARM Linux
Quoted 4 lines · Philipp Zabel

- ? ? hx4700_gpio_request(ARRAY_AND_SIZE(global_gpios));
+ ? ? ret = gpio_request_array(ARRAY_AND_SIZE(global_gpios));
+ ? ? if (ret)
+ ? ? ? ? ? ? pr_err ("hx4700: Failed to request GPIOs.\n");

No space between pr_err and (.

checkpatch issue. Sorry about that.

Quoted 4 lines

Does the return code convey useful information as to _why_ it failed? ?If yes, you really should print its value. ?Knowing whether it's -EBUSY (eg, already in use) instead of -EINVAL (eg, invalid GPIO number) really helps to debug problems.

Yes, it does. It is certainly better to include the error code. Recompiling with DEBUG_GPIO enabled might still be necessary to get information about which GPIO failed, and whether -EINVAL was returned by gpio_request() or gpio_direction_input/output().

regards
Philipp

#5 lore raw

PATCH v3 1/1 pxa/hx4700: use gpio arrays for global gpio initialization

In reply to Russell King - ARM Linux

gpio_request_array() is a functional replacement for hx4700_gpio_request(), which is now obsolete.

---
 arch/arm/mach-pxa/hx4700.c |   70 ++++++++++++--------------------------------
 1 files changed, 19 insertions(+), 51 deletions(-)
arch/arm/mach-pxa/hx4700.c +19 -51
index 9cdcca5..3254a60 100644
@@ -135,42 +135,6 @@ static unsigned long hx4700_pin_config[] __initdata = {
 	GPIO66_GPIO,	/* nSDIO_IRQ */
 };
 
-#define HX4700_GPIO_IN(num, _desc) \
-	{ .gpio = (num), .dir = 0, .desc = (_desc) }
-#define HX4700_GPIO_OUT(num, _init, _desc) \
-	{ .gpio = (num), .dir = 1, .init = (_init), .desc = (_desc) }
-struct gpio_ress {
-	unsigned gpio : 8;
-	unsigned dir : 1;
-	unsigned init : 1;
-	char *desc;
-};
-
-static int hx4700_gpio_request(struct gpio_ress *gpios, int size)
-{
-	int i, rc = 0;
-	int gpio;
-	int dir;
-
-	for (i = 0; (!rc) && (i < size); i++) {
-		gpio = gpios[i].gpio;
-		dir = gpios[i].dir;
-		rc = gpio_request(gpio, gpios[i].desc);
-		if (rc) {
-			pr_err("Error requesting GPIO %d(%s) : %d\n",
-			       gpio, gpios[i].desc, rc);
-			continue;
-		}
-		if (dir)
-			gpio_direction_output(gpio, gpios[i].init);
-		else
-			gpio_direction_input(gpio);
-	}
-	while ((rc) && (--i >= 0))
-		gpio_free(gpios[i].gpio);
-	return rc;
-}
-
 /*
  * IRDA
  */
@@ -829,26 +793,30 @@ static struct platform_device *devices[] __initdata = {
 	&pcmcia,
 };
 
-static struct gpio_ress global_gpios[] = {
-	HX4700_GPIO_IN(GPIO12_HX4700_ASIC3_IRQ, "ASIC3_IRQ"),
-	HX4700_GPIO_IN(GPIO13_HX4700_W3220_IRQ, "W3220_IRQ"),
-	HX4700_GPIO_IN(GPIO14_HX4700_nWLAN_IRQ, "WLAN_IRQ"),
-	HX4700_GPIO_OUT(GPIO59_HX4700_LCD_PC1,          1, "LCD_PC1"),
-	HX4700_GPIO_OUT(GPIO62_HX4700_LCD_nRESET,       1, "LCD_RESET"),
-	HX4700_GPIO_OUT(GPIO70_HX4700_LCD_SLIN1,        1, "LCD_SLIN1"),
-	HX4700_GPIO_OUT(GPIO84_HX4700_LCD_SQN,          1, "LCD_SQN"),
-	HX4700_GPIO_OUT(GPIO110_HX4700_LCD_LVDD_3V3_ON, 1, "LCD_LVDD"),
-	HX4700_GPIO_OUT(GPIO111_HX4700_LCD_AVDD_3V3_ON, 1, "LCD_AVDD"),
-	HX4700_GPIO_OUT(GPIO32_HX4700_RS232_ON,         1, "RS232_ON"),
-	HX4700_GPIO_OUT(GPIO71_HX4700_ASIC3_nRESET,     1, "ASIC3_nRESET"),
-	HX4700_GPIO_OUT(GPIO82_HX4700_EUART_RESET,      1, "EUART_RESET"),
-	HX4700_GPIO_OUT(GPIO105_HX4700_nIR_ON,          1, "nIR_EN"),
+static struct gpio global_gpios[] = {
+	{ GPIO12_HX4700_ASIC3_IRQ, GPIOF_IN, "ASIC3_IRQ" },
+	{ GPIO13_HX4700_W3220_IRQ, GPIOF_IN, "W3220_IRQ" },
+	{ GPIO14_HX4700_nWLAN_IRQ, GPIOF_IN, "WLAN_IRQ" },
+	{ GPIO59_HX4700_LCD_PC1,          GPIOF_OUT_INIT_HIGH, "LCD_PC1" },
+	{ GPIO62_HX4700_LCD_nRESET,       GPIOF_OUT_INIT_HIGH, "LCD_RESET" },
+	{ GPIO70_HX4700_LCD_SLIN1,        GPIOF_OUT_INIT_HIGH, "LCD_SLIN1" },
+	{ GPIO84_HX4700_LCD_SQN,          GPIOF_OUT_INIT_HIGH, "LCD_SQN" },
+	{ GPIO110_HX4700_LCD_LVDD_3V3_ON, GPIOF_OUT_INIT_HIGH, "LCD_LVDD" },
+	{ GPIO111_HX4700_LCD_AVDD_3V3_ON, GPIOF_OUT_INIT_HIGH, "LCD_AVDD" },
+	{ GPIO32_HX4700_RS232_ON,         GPIOF_OUT_INIT_HIGH, "RS232_ON" },
+	{ GPIO71_HX4700_ASIC3_nRESET,     GPIOF_OUT_INIT_HIGH, "ASIC3_nRESET" },
+	{ GPIO82_HX4700_EUART_RESET,      GPIOF_OUT_INIT_HIGH, "EUART_RESET" },
+	{ GPIO105_HX4700_nIR_ON,          GPIOF_OUT_INIT_HIGH, "nIR_EN" },
 };
 
 static void __init hx4700_init(void)
 {
+	int ret;
+
 	pxa2xx_mfp_config(ARRAY_AND_SIZE(hx4700_pin_config));
-	hx4700_gpio_request(ARRAY_AND_SIZE(global_gpios));
+	ret = gpio_request_array(ARRAY_AND_SIZE(global_gpios));
+	if (ret)
+		pr_err("hx4700: Failed to request GPIOs: %d\n", ret);
 
 	pxa_set_ffuart_info(NULL);
 	pxa_set_btuart_info(NULL);
Signature · 1 line
1.7.4.4
Applied
#6 lore raw

PATCH v3 1/1 pxa/hx4700: use gpio arrays for global gpio initialization

Quoted 4 lines · Philipp Zabel

gpio_request_array() is a functional replacement for hx4700_gpio_request(), which is now obsolete.

Applied.

Quoted 102 lines

---
?arch/arm/mach-pxa/hx4700.c | ? 70 ++++++++++++-------------------------------- ?1 files changed, 19 insertions(+), 51 deletions(-)

arch/arm/mach-pxa/hx4700.c +0 -0
index 9cdcca5..3254a60 100644
@@ -135,42 +135,6 @@ static unsigned long hx4700_pin_config[] __initdata = {

? ? ? ?GPIO66_GPIO, ? ?/* nSDIO_IRQ */
?};

arch/arm/mach-pxa/hx4700.c +0 -36
-#define HX4700_GPIO_IN(num, _desc) \
- ? ? ? { .gpio = (num), .dir = 0, .desc = (_desc) }
-#define HX4700_GPIO_OUT(num, _init, _desc) \
- ? ? ? { .gpio = (num), .dir = 1, .init = (_init), .desc = (_desc) }
-struct gpio_ress {
- ? ? ? unsigned gpio : 8;
- ? ? ? unsigned dir : 1;
- ? ? ? unsigned init : 1;
- ? ? ? char *desc;
-};
-
-static int hx4700_gpio_request(struct gpio_ress *gpios, int size)
-{
- ? ? ? int i, rc = 0;
- ? ? ? int gpio;
- ? ? ? int dir;
-
- ? ? ? for (i = 0; (!rc) && (i < size); i++) {
- ? ? ? ? ? ? ? gpio = gpios[i].gpio;
- ? ? ? ? ? ? ? dir = gpios[i].dir;
- ? ? ? ? ? ? ? rc = gpio_request(gpio, gpios[i].desc);
- ? ? ? ? ? ? ? if (rc) {
- ? ? ? ? ? ? ? ? ? ? ? pr_err("Error requesting GPIO %d(%s) : %d\n",
- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?gpio, gpios[i].desc, rc);
- ? ? ? ? ? ? ? ? ? ? ? continue;
- ? ? ? ? ? ? ? }
- ? ? ? ? ? ? ? if (dir)
- ? ? ? ? ? ? ? ? ? ? ? gpio_direction_output(gpio, gpios[i].init);
- ? ? ? ? ? ? ? else
- ? ? ? ? ? ? ? ? ? ? ? gpio_direction_input(gpio);
- ? ? ? }
- ? ? ? while ((rc) && (--i >= 0))
- ? ? ? ? ? ? ? gpio_free(gpios[i].gpio);
- ? ? ? return rc;
-}
-

?/*
?* IRDA
?*/

arch/arm/mach-pxa/hx4700.c +19 -16
@@ -829,26 +793,30 @@ static struct platform_device *devices[] __initdata = {
 ? ? ? ?&pcmcia,
 ?};
 
-static struct gpio_ress global_gpios[] = {
- ? ? ? HX4700_GPIO_IN(GPIO12_HX4700_ASIC3_IRQ, "ASIC3_IRQ"),
- ? ? ? HX4700_GPIO_IN(GPIO13_HX4700_W3220_IRQ, "W3220_IRQ"),
- ? ? ? HX4700_GPIO_IN(GPIO14_HX4700_nWLAN_IRQ, "WLAN_IRQ"),
- ? ? ? HX4700_GPIO_OUT(GPIO59_HX4700_LCD_PC1, ? ? ? ? ?1, "LCD_PC1"),
- ? ? ? HX4700_GPIO_OUT(GPIO62_HX4700_LCD_nRESET, ? ? ? 1, "LCD_RESET"),
- ? ? ? HX4700_GPIO_OUT(GPIO70_HX4700_LCD_SLIN1, ? ? ? ?1, "LCD_SLIN1"),
- ? ? ? HX4700_GPIO_OUT(GPIO84_HX4700_LCD_SQN, ? ? ? ? ?1, "LCD_SQN"),
- ? ? ? HX4700_GPIO_OUT(GPIO110_HX4700_LCD_LVDD_3V3_ON, 1, "LCD_LVDD"),
- ? ? ? HX4700_GPIO_OUT(GPIO111_HX4700_LCD_AVDD_3V3_ON, 1, "LCD_AVDD"),
- ? ? ? HX4700_GPIO_OUT(GPIO32_HX4700_RS232_ON, ? ? ? ? 1, "RS232_ON"),
- ? ? ? HX4700_GPIO_OUT(GPIO71_HX4700_ASIC3_nRESET, ? ? 1, "ASIC3_nRESET"),
- ? ? ? HX4700_GPIO_OUT(GPIO82_HX4700_EUART_RESET, ? ? ?1, "EUART_RESET"),
- ? ? ? HX4700_GPIO_OUT(GPIO105_HX4700_nIR_ON, ? ? ? ? ?1, "nIR_EN"),
+static struct gpio global_gpios[] = {
+ ? ? ? { GPIO12_HX4700_ASIC3_IRQ, GPIOF_IN, "ASIC3_IRQ" },
+ ? ? ? { GPIO13_HX4700_W3220_IRQ, GPIOF_IN, "W3220_IRQ" },
+ ? ? ? { GPIO14_HX4700_nWLAN_IRQ, GPIOF_IN, "WLAN_IRQ" },
+ ? ? ? { GPIO59_HX4700_LCD_PC1, ? ? ? ? ?GPIOF_OUT_INIT_HIGH, "LCD_PC1" },
+ ? ? ? { GPIO62_HX4700_LCD_nRESET, ? ? ? GPIOF_OUT_INIT_HIGH, "LCD_RESET" },
+ ? ? ? { GPIO70_HX4700_LCD_SLIN1, ? ? ? ?GPIOF_OUT_INIT_HIGH, "LCD_SLIN1" },
+ ? ? ? { GPIO84_HX4700_LCD_SQN, ? ? ? ? ?GPIOF_OUT_INIT_HIGH, "LCD_SQN" },
+ ? ? ? { GPIO110_HX4700_LCD_LVDD_3V3_ON, GPIOF_OUT_INIT_HIGH, "LCD_LVDD" },
+ ? ? ? { GPIO111_HX4700_LCD_AVDD_3V3_ON, GPIOF_OUT_INIT_HIGH, "LCD_AVDD" },
+ ? ? ? { GPIO32_HX4700_RS232_ON, ? ? ? ? GPIOF_OUT_INIT_HIGH, "RS232_ON" },
+ ? ? ? { GPIO71_HX4700_ASIC3_nRESET, ? ? GPIOF_OUT_INIT_HIGH, "ASIC3_nRESET" },
+ ? ? ? { GPIO82_HX4700_EUART_RESET, ? ? ?GPIOF_OUT_INIT_HIGH, "EUART_RESET" },
+ ? ? ? { GPIO105_HX4700_nIR_ON, ? ? ? ? ?GPIOF_OUT_INIT_HIGH, "nIR_EN" },
 ?};
 
 ?static void __init hx4700_init(void)
 ?{
+ ? ? ? int ret;
+
 ? ? ? ?pxa2xx_mfp_config(ARRAY_AND_SIZE(hx4700_pin_config));
- ? ? ? hx4700_gpio_request(ARRAY_AND_SIZE(global_gpios));
+ ? ? ? ret = gpio_request_array(ARRAY_AND_SIZE(global_gpios));
+ ? ? ? if (ret)
+ ? ? ? ? ? ? ? pr_err("hx4700: Failed to request GPIOs: %d\n", ret);
 
 ? ? ? ?pxa_set_ffuart_info(NULL);
 ? ? ? ?pxa_set_btuart_info(NULL);
--

1.7.4.4