ARM: mx5/babbage: Remove unneeded gpio_set_value call
Subsystems (57)
PATCH 1/2 ARM: mx5/babbage: Remove unneeded gpio_set_value call
gpio_direction_output has already set the port at low logical level, so it is not needed to call gpio_set_value to set the port to 0 again.
--- arch/arm/mach-mx5/board-mx51_babbage.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
arch/arm/mach-mx5/board-mx51_babbage.c +0 -1
@@ -234,7 +234,6 @@ static inline void babbage_fec_reset(void)return ; }gpio_direction_output (BABBAGE_FEC_PHY_RESET ,0 ); -gpio_set_value (BABBAGE_FEC_PHY_RESET ,0 );msleep (1 );gpio_set_value (BABBAGE_FEC_PHY_RESET ,1 ); }
Signature · 1 line
1.6.0.4
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
gpio_direction_output has already set the port at low logical level, so it is not needed to call gpio_set_value to set the port to 0 again.
--- arch/arm/mach-mx5/board-mx53_evk.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
arch/arm/mach-mx5/board-mx53_evk.c +0 -1
@@ -90,7 +90,6 @@ static inline void mx53_evk_fec_reset(void)return ; }gpio_direction_output (SMD_FEC_PHY_RST ,0 ); -gpio_set_value (SMD_FEC_PHY_RST ,0 );msleep (1 );gpio_set_value (SMD_FEC_PHY_RST ,1 ); }
Signature · 1 line
1.6.0.4
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
[added Julia Lawall to Cc:]
Hello Fabio,
ack for both.
Julia: Maybe coccinelle can find more of these?
Best regards
Uwe
Quoted 22 lines · Fabio Estevam
gpio_direction_outputhas already set the port at low logical level, so it is not needed to callgpio_set_valueto set the port to 0 again.Signed-off-by Fabio Estevam <[email protected]>--- arch/arm/mach-mx5/board-mx53_evk.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)arch/arm/mach-mx5/board-mx53_evk.c +0
-1@@ -90,7 +90,6 @@ static inline void mx53_evk_fec_reset(void)return ; }gpio_direction_output (SMD_FEC_PHY_RST ,0 ); -gpio_set_value (SMD_FEC_PHY_RST ,0 );msleep (1 );gpio_set_value (SMD_FEC_PHY_RST ,1 ); }Signature · 1 line
1.6.0.4
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
I tried the following
@@
expression E1,E2;
@@
gpio_direction_output(E1,E2);
...- gpio_set_value(E1,E2);
and found occurrences in 15 files. In some cases there seems to be some delay before the call to gpio_set_value. Does that have any impacton whether it is needed?
julia
Quoted 39 lines · Uwe Kleine-K?nig
[added Julia Lawall to Cc:]
Hello Fabio,
ack for both.
Julia: Maybe coccinelle can find more of these?
Best regards
UweQuoted 22 lines · Fabio Estevam
gpio_direction_outputhas already set the port at low logical level, so it is not needed to callgpio_set_valueto set the port to 0 again.Signed-off-by Fabio Estevam <[email protected]>--- arch/arm/mach-mx5/board-mx53_evk.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)arch/arm/mach-mx5/board-mx53_evk.c +0
-1@@ -90,7 +90,6 @@ static inline void mx53_evk_fec_reset(void)return ; }gpio_direction_output (SMD_FEC_PHY_RST ,0 ); -gpio_set_value (SMD_FEC_PHY_RST ,0 );msleep (1 );gpio_set_value (SMD_FEC_PHY_RST ,1 ); }Signature · 1 line
1.6.0.4Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
Quoted 6 lines · Julia Lawall
I tried the following
@@
expression E1,E2;
@@
Quoted 7 lines
gpio_direction_output(E1,E2); ...-
gpio_set_value(E1,E2);and found occurrences in 15 files. In some cases there seems to be some delay before the call to
gpio_set_value. Does that have any impacton whether it is needed?
gpio_direction_output(E1,E2) implies gpio_set_value(E1,E2), so unless there is a gpio_set_value(E1,!E2) before gpio_set_value(E1,E2) is a noop.
I still don't know how to work with coccinelle, so if you point me to a concrete location I can be more specific.
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
Quoted 14 lines · Uwe Kleine-K?nig
Quoted 6 lines · Julia Lawall
I tried the following
@@
expression E1,E2;
@@Quoted 7 lines
gpio_direction_output(E1,E2); ...-
gpio_set_value(E1,E2);and found occurrences in 15 files. In some cases there seems to be some delay before the call to
gpio_set_value. Does that have any impacton whether it is needed?
Quoted 6 lines
gpio_direction_output(E1,E2)impliesgpio_set_value(E1,E2), so unless there is agpio_set_value(E1,!E2)beforegpio_set_value(E1,E2)is a noop.I still don't know how to work with coccinelle, so if you point me to a concrete location I can be more specific.
OK. I have changed the semantic patch to the following:
@@
expression E1,E2,E3;
@@
gpio_direction_output(E1,E2);
... when != gpio_set_value(E1,E3)- gpio_set_value(E1,E2);
Now it doesn't do all the cases where there is an earlier set ofr some other value. The patch I obtain is below. This only concerns 5 files. I haven't checked the result at all.
julia
arch/arm/mach-mx5/board-mx51_babbage.c 2011-03-15 11:17:03.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx51_babbage.c 2011-02-19 08:28:51.000000000 +0100 +0 -2
@@ -218,7 +218,6 @@ static inline void babbage_usbhub_reset( /* USB HUB RESET - De-assert USB HUB RESET_N */ msleep(1); - gpio_set_value(BABBAGE_USB_HUB_RESET, 0); msleep(1); gpio_set_value(BABBAGE_USB_HUB_RESET, 1); }
@@ -234,7 +233,6 @@ static inline void babbage_fec_reset(voi return; } gpio_direction_output(BABBAGE_FEC_PHY_RESET, 0); - gpio_set_value(BABBAGE_FEC_PHY_RESET, 0); msleep(1); gpio_set_value(BABBAGE_FEC_PHY_RESET, 1); }
arch/arm/mach-mx5/board-mx53_evk.c 2011-03-15 11:17:03.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx53_evk.c 2011-03-14 17:19:13.000000000 +0100 +0 -1
@@ -88,7 +88,6 @@ static inline void mx53_evk_fec_reset(vo return; } gpio_direction_output(SMD_FEC_PHY_RST, 0); - gpio_set_value(SMD_FEC_PHY_RST, 0); msleep(1); gpio_set_value(SMD_FEC_PHY_RST, 1); }
arch/arm/mach-omap2/board-omap3evm.c 2011-03-15 11:17:04.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap3evm.c 2011-03-14 17:19:13.000000000 +0100 +0 -1
@@ -860,7 +860,6 @@ static void __init omap3_evm_init(void) omap_mux_init_gpio(61, OMAP_PIN_INPUT_PULLUP); gpio_request(OMAP3_EVM_EHCI_SELECT, "select EHCI port"); gpio_direction_output(OMAP3_EVM_EHCI_SELECT, 0); - gpio_set_value(OMAP3_EVM_EHCI_SELECT, 0); /* setup EHCI phy reset config */ omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP);
arch/arm/mach-omap2/board-omap4panda.c 2011-03-15 11:17:04.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap4panda.c 2011-03-14 17:19:13.000000000 +0100 +0 -2
@@ -129,7 +129,6 @@ static void __init omap4_ehci_init(void) } gpio_export(GPIO_HUB_POWER, 0); gpio_direction_output(GPIO_HUB_POWER, 0); - gpio_set_value(GPIO_HUB_POWER, 0); /* reset phy+hub */ ret = gpio_request(GPIO_HUB_NRESET, "hub_nreset");
@@ -139,7 +138,6 @@ static void __init omap4_ehci_init(void) } gpio_export(GPIO_HUB_NRESET, 0); gpio_direction_output(GPIO_HUB_NRESET, 0); - gpio_set_value(GPIO_HUB_NRESET, 0); gpio_set_value(GPIO_HUB_NRESET, 1); usbhs_init(&usbhs_bdata);
arch/arm/mach-pxa/am300epd.c 2011-03-15 11:17:04.000000000 +0100 renamed from arch/arm/mach-pxa/am300epd.c 2010-03-18 09:06:45.000000000 +0100 +0 -2
@@ -150,8 +150,6 @@ static int am300_init_gpio_regs(struct b gpio_direction_output(i, 0); /* go into command mode */ - gpio_set_value(CFG_GPIO_PIN, 1); - gpio_set_value(RST_GPIO_PIN, 0); msleep(10); gpio_set_value(RST_GPIO_PIN, 1); msleep(10);
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
Quoted 29 lines · Julia Lawall
Quoted 14 lines · Uwe Kleine-K?nig
Quoted 6 lines · Julia Lawall
I tried the following
@@
expression E1,E2;
@@Quoted 7 lines
gpio_direction_output(E1,E2); ...-
gpio_set_value(E1,E2);and found occurrences in 15 files. In some cases there seems to be some delay before the call to
gpio_set_value. Does that have any impacton whether it is needed?Quoted 6 lines
gpio_direction_output(E1,E2)impliesgpio_set_value(E1,E2), so unless there is agpio_set_value(E1,!E2)beforegpio_set_value(E1,E2)is a noop.I still don't know how to work with coccinelle, so if you point me to a concrete location I can be more specific.
OK. I have changed the semantic patch to the following:
@@
expression E1,E2,E3;
@@
Quoted 7 lines
gpio_direction_output(E1,E2); ... when != gpio_set_value(E1,E3)-
gpio_set_value(E1,E2);Now it doesn't do all the cases where there is an earlier set ofr some other value. The patch I obtain is below. This only concerns 5 files. I haven't checked the result at all.
It should also be checked if gpio_request_one is the better solution.
Signature · 9 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110315/cf54587d/attachment.sig>
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
In reply to Julia Lawall[added some people to Cc:]
Hello Julia,
Quoted 29 lines · Julia Lawall
Quoted 14 lines · Uwe Kleine-K?nig
Quoted 6 lines · Julia Lawall
I tried the following
@@
expression E1,E2;
@@Quoted 7 lines
gpio_direction_output(E1,E2); ...-
gpio_set_value(E1,E2);and found occurrences in 15 files. In some cases there seems to be some delay before the call to
gpio_set_value. Does that have any impacton whether it is needed?Quoted 6 lines
gpio_direction_output(E1,E2)impliesgpio_set_value(E1,E2), so unless there is agpio_set_value(E1,!E2)beforegpio_set_value(E1,E2)is a noop.I still don't know how to work with coccinelle, so if you point me to a concrete location I can be more specific.
OK. I have changed the semantic patch to the following:
@@
expression E1,E2,E3;
@@
Quoted 7 lines
gpio_direction_output(E1,E2); ... when != gpio_set_value(E1,E3)-
gpio_set_value(E1,E2);Now it doesn't do all the cases where there is an earlier set ofr some other value. The patch I obtain is below. This only concerns 5 files. I haven't checked the result at all.
Thanks. So here comes the check.
arch/arm/mach-mx5/board-mx51_babbage.c 2011-03-15 11:17:03.000000000 +0100 static inline void babbage_usbhub_reset( · line 223
Quoted 11 lines
diff -u -p
a/arch/arm/mach-mx5/board-mx51_babbage.cb/arch/arm/mach-mx5/board-mx51_babbage.carch/arm/mach-mx5/board-mx51_babbage.c 2011-03-15 11:17:03.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx51_babbage.c 2011-02-19 08:28:51.000000000 +0100 +0
-1@@ -218,7 +218,6 @@ static inline void babbage_usbhub_reset( /* USB HUB RESET - De-assert USB HUB RESET_N */ msleep(1); - gpio_set_value(BABBAGE_USB_HUB_RESET, 0); msleep(1); gpio_set_value(BABBAGE_USB_HUB_RESET, 1); }
This function is a bit confusing:
/* Bring USB hub out of reset */
ret = gpio_request(BABBAGE_USB_HUB_RESET, "GPIO1_7");
if (ret) {
...
return;
}
gpio_direction_output(BABBAGE_USB_HUB_RESET, 0);
/* USB HUB RESET - De-assert USB HUB RESET_N */
msleep(1);
gpio_set_value(BABBAGE_USB_HUB_RESET, 0);
msleep(1);
gpio_set_value(BABBAGE_USB_HUB_RESET, 1);IMHO the comments are misleading. I'd suggest:
ret = gpio_request_one(BABBAGE_USB_HUB_RESET,
GPIOF_DIR_OUT | GPIOF_INIT_LOW, "USB hub reset#");
if (ret) {
pr_err("failed to request gpio for USB hub reset#: %d\n", ret);
return;
}
msleep(2);
gpio_set_value(BABBAGE_USB_HUB_RESET, 1);Fabio?
arch/arm/mach-mx5/board-mx51_babbage.c 2011-03-15 11:17:03.000000000 +0100 static inline void babbage_fec_reset(voi · line 238
Quoted 8 lines
arch/arm/mach-mx5/board-mx51_babbage.c 2011-03-15 11:17:03.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx51_babbage.c 2011-02-19 08:28:51.000000000 +0100 +0
-1@@ -234,7 +233,6 @@ static inline void babbage_fec_reset(voi return; } gpio_direction_output(BABBAGE_FEC_PHY_RESET, 0); - gpio_set_value(BABBAGE_FEC_PHY_RESET, 0); msleep(1); gpio_set_value(BABBAGE_FEC_PHY_RESET, 1); }
should use
gpio_request_one(BABBAGE_FEC_PHY_RESET, GPIOF_DIR_OUT | GPIOF_INIT_LOW, "fec-phy-reset");
arch/arm/mach-mx5/board-mx53_evk.c 2011-03-15 11:17:03.000000000 +0100 static inline void mx53_evk_fec_reset(vo · line 93
Quoted 11 lines
diff -u -p
a/arch/arm/mach-mx5/board-mx53_evk.cb/arch/arm/mach-mx5/board-mx53_evk.carch/arm/mach-mx5/board-mx53_evk.c 2011-03-15 11:17:03.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx53_evk.c 2011-03-14 17:19:13.000000000 +0100 +0
-1@@ -88,7 +88,6 @@ static inline void mx53_evk_fec_reset(vo return; } gpio_direction_output(SMD_FEC_PHY_RST, 0); - gpio_set_value(SMD_FEC_PHY_RST, 0); msleep(1); gpio_set_value(SMD_FEC_PHY_RST, 1); }
ditto
arch/arm/mach-omap2/board-omap3evm.c 2011-03-15 11:17:04.000000000 +0100 static void __init omap3_evm_init(void) · line 865
Quoted 11 lines
diff -u -p
a/arch/arm/mach-omap2/board-omap3evm.cb/arch/arm/mach-omap2/board-omap3evm.carch/arm/mach-omap2/board-omap3evm.c 2011-03-15 11:17:04.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap3evm.c 2011-03-14 17:19:13.000000000 +0100 +0
-1@@ -860,7 +860,6 @@ static void __init omap3_evm_init(void) omap_mux_init_gpio(61, OMAP_PIN_INPUT_PULLUP); gpio_request(OMAP3_EVM_EHCI_SELECT, "select EHCI port"); gpio_direction_output(OMAP3_EVM_EHCI_SELECT, 0); - gpio_set_value(OMAP3_EVM_EHCI_SELECT, 0); /* setup EHCI phy reset config */ omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP);
ditto
arch/arm/mach-omap2/board-omap4panda.c 2011-03-15 11:17:04.000000000 +0100 static void __init omap4_ehci_init(void) · line 132
Quoted 8 lines
diff -u -p
a/arch/arm/mach-omap2/board-omap4panda.cb/arch/arm/mach-omap2/board-omap4panda.carch/arm/mach-omap2/board-omap4panda.c 2011-03-15 11:17:04.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap4panda.c 2011-03-14 17:19:13.000000000 +0100 +0
-1@@ -129,7 +129,6 @@ static void __init omap4_ehci_init(void) } gpio_export(GPIO_HUB_POWER, 0); gpio_direction_output(GPIO_HUB_POWER, 0); - gpio_set_value(GPIO_HUB_POWER, 0);
Should use gpio_request_one, too. And IMHO gpio_export should only be called after the direction is set (which is an obsolete comment when gpio_request_one is used).
arch/arm/mach-omap2/board-omap4panda.c 2011-03-15 11:17:04.000000000 +0100 static void __init omap4_ehci_init(void) · line 143
Quoted 10 lines
arch/arm/mach-omap2/board-omap4panda.c 2011-03-15 11:17:04.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap4panda.c 2011-03-14 17:19:13.000000000 +0100 +0
-1/* reset phy+hub */ ret = gpio_request(GPIO_HUB_NRESET, "hub_nreset");@@ -139,7 +138,6 @@ static void __init omap4_ehci_init(void) } gpio_export(GPIO_HUB_NRESET, 0); gpio_direction_output(GPIO_HUB_NRESET, 0); - gpio_set_value(GPIO_HUB_NRESET, 0); gpio_set_value(GPIO_HUB_NRESET, 1); usbhs_init(&usbhs_bdata);
ditto
arch/arm/mach-pxa/am300epd.c 2011-03-15 11:17:04.000000000 +0100 static int am300_init_gpio_regs(struct b · line 155
Quoted 12 lines
diff -u -p
a/arch/arm/mach-pxa/am300epd.cb/arch/arm/mach-pxa/am300epd.carch/arm/mach-pxa/am300epd.c 2011-03-15 11:17:04.000000000 +0100 renamed from arch/arm/mach-pxa/am300epd.c 2010-03-18 09:06:45.000000000 +0100 +0
-2@@ -150,8 +150,6 @@ static int am300_init_gpio_regs(struct b gpio_direction_output(i, 0); /* go into command mode */ - gpio_set_value(CFG_GPIO_PIN, 1); - gpio_set_value(RST_GPIO_PIN, 0); msleep(10); gpio_set_value(RST_GPIO_PIN, 1); msleep(10);
This can probably make use of gpio_request_array.
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
I'll see if I can incorporate the use of gpio_request_one in my rule.
julia
Quoted 165 lines · Uwe Kleine-K?nig
[added some people to Cc:]
Hello Julia,
Quoted 29 lines · Julia Lawall
Quoted 14 lines · Uwe Kleine-K?nig
Quoted 6 lines · Julia Lawall
I tried the following
@@
expression E1,E2;
@@Quoted 7 lines
gpio_direction_output(E1,E2); ...-
gpio_set_value(E1,E2);and found occurrences in 15 files. In some cases there seems to be some delay before the call to
gpio_set_value. Does that have any impacton whether it is needed?Quoted 6 lines
gpio_direction_output(E1,E2)impliesgpio_set_value(E1,E2), so unless there is agpio_set_value(E1,!E2)beforegpio_set_value(E1,E2)is a noop.I still don't know how to work with coccinelle, so if you point me to a concrete location I can be more specific.
OK. I have changed the semantic patch to the following:
@@
expression E1,E2,E3;
@@Quoted 7 lines
gpio_direction_output(E1,E2); ... when != gpio_set_value(E1,E3)-
gpio_set_value(E1,E2);Now it doesn't do all the cases where there is an earlier set ofr some other value. The patch I obtain is below. This only concerns 5 files. I haven't checked the result at all.
Thanks. So here comes the check.
arch/arm/mach-mx5/board-mx51_babbage.c 2011-03-15 11:17:03.000000000 +0100 static inline void babbage_usbhub_reset( · line 223
Quoted 11 lines
diff -u -p
a/arch/arm/mach-mx5/board-mx51_babbage.cb/arch/arm/mach-mx5/board-mx51_babbage.carch/arm/mach-mx5/board-mx51_babbage.c 2011-03-15 11:17:03.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx51_babbage.c 2011-02-19 08:28:51.000000000 +0100 +0
-1@@ -218,7 +218,6 @@ static inline void babbage_usbhub_reset( /* USB HUB RESET - De-assert USB HUB RESET_N */ msleep(1); - gpio_set_value(BABBAGE_USB_HUB_RESET, 0); msleep(1); gpio_set_value(BABBAGE_USB_HUB_RESET, 1); }This function is a bit confusing:
/* Bring USB hub out of reset */ ret = gpio_request(BABBAGE_USB_HUB_RESET, "GPIO1_7"); if (ret) { ... return; } gpio_direction_output(BABBAGE_USB_HUB_RESET, 0); /* USB HUB RESET - De-assert USB HUB RESET_N */ msleep(1); gpio_set_value(BABBAGE_USB_HUB_RESET, 0); msleep(1); gpio_set_value(BABBAGE_USB_HUB_RESET, 1);IMHO the comments are misleading. I'd suggest:
ret = gpio_request_one(BABBAGE_USB_HUB_RESET, GPIOF_DIR_OUT | GPIOF_INIT_LOW, "USB hub reset#"); if (ret) { pr_err("failed to request gpio for USB hub reset#: %d\n", ret); return; } msleep(2); gpio_set_value(BABBAGE_USB_HUB_RESET, 1);Fabio?
arch/arm/mach-mx5/board-mx51_babbage.c 2011-03-15 11:17:03.000000000 +0100 static inline void babbage_fec_reset(voi · line 238
Quoted 8 lines
arch/arm/mach-mx5/board-mx51_babbage.c 2011-03-15 11:17:03.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx51_babbage.c 2011-02-19 08:28:51.000000000 +0100 +0
-1@@ -234,7 +233,6 @@ static inline void babbage_fec_reset(voi return; } gpio_direction_output(BABBAGE_FEC_PHY_RESET, 0); - gpio_set_value(BABBAGE_FEC_PHY_RESET, 0); msleep(1); gpio_set_value(BABBAGE_FEC_PHY_RESET, 1); }should use
gpio_request_one(BABBAGE_FEC_PHY_RESET, GPIOF_DIR_OUT | GPIOF_INIT_LOW, "fec-phy-reset");arch/arm/mach-mx5/board-mx53_evk.c 2011-03-15 11:17:03.000000000 +0100 static inline void mx53_evk_fec_reset(vo · line 93
Quoted 11 lines
diff -u -p
a/arch/arm/mach-mx5/board-mx53_evk.cb/arch/arm/mach-mx5/board-mx53_evk.carch/arm/mach-mx5/board-mx53_evk.c 2011-03-15 11:17:03.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx53_evk.c 2011-03-14 17:19:13.000000000 +0100 +0
-1@@ -88,7 +88,6 @@ static inline void mx53_evk_fec_reset(vo return; } gpio_direction_output(SMD_FEC_PHY_RST, 0); - gpio_set_value(SMD_FEC_PHY_RST, 0); msleep(1); gpio_set_value(SMD_FEC_PHY_RST, 1); }ditto
arch/arm/mach-omap2/board-omap3evm.c 2011-03-15 11:17:04.000000000 +0100 static void __init omap3_evm_init(void) · line 865
Quoted 11 lines
diff -u -p
a/arch/arm/mach-omap2/board-omap3evm.cb/arch/arm/mach-omap2/board-omap3evm.carch/arm/mach-omap2/board-omap3evm.c 2011-03-15 11:17:04.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap3evm.c 2011-03-14 17:19:13.000000000 +0100 +0
-1@@ -860,7 +860,6 @@ static void __init omap3_evm_init(void) omap_mux_init_gpio(61, OMAP_PIN_INPUT_PULLUP); gpio_request(OMAP3_EVM_EHCI_SELECT, "select EHCI port"); gpio_direction_output(OMAP3_EVM_EHCI_SELECT, 0); - gpio_set_value(OMAP3_EVM_EHCI_SELECT, 0); /* setup EHCI phy reset config */ omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP);ditto
arch/arm/mach-omap2/board-omap4panda.c 2011-03-15 11:17:04.000000000 +0100 static void __init omap4_ehci_init(void) · line 132
Quoted 8 lines
diff -u -p
a/arch/arm/mach-omap2/board-omap4panda.cb/arch/arm/mach-omap2/board-omap4panda.carch/arm/mach-omap2/board-omap4panda.c 2011-03-15 11:17:04.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap4panda.c 2011-03-14 17:19:13.000000000 +0100 +0
-1@@ -129,7 +129,6 @@ static void __init omap4_ehci_init(void) } gpio_export(GPIO_HUB_POWER, 0); gpio_direction_output(GPIO_HUB_POWER, 0); - gpio_set_value(GPIO_HUB_POWER, 0);Should use
gpio_request_one, too. And IMHOgpio_exportshould only be called after the direction is set (which is an obsolete comment whengpio_request_oneis used).arch/arm/mach-omap2/board-omap4panda.c 2011-03-15 11:17:04.000000000 +0100 static void __init omap4_ehci_init(void) · line 143
Quoted 10 lines
arch/arm/mach-omap2/board-omap4panda.c 2011-03-15 11:17:04.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap4panda.c 2011-03-14 17:19:13.000000000 +0100 +0
-1/* reset phy+hub */ ret = gpio_request(GPIO_HUB_NRESET, "hub_nreset");@@ -139,7 +138,6 @@ static void __init omap4_ehci_init(void) } gpio_export(GPIO_HUB_NRESET, 0); gpio_direction_output(GPIO_HUB_NRESET, 0); - gpio_set_value(GPIO_HUB_NRESET, 0); gpio_set_value(GPIO_HUB_NRESET, 1); usbhs_init(&usbhs_bdata);ditto
arch/arm/mach-pxa/am300epd.c 2011-03-15 11:17:04.000000000 +0100 static int am300_init_gpio_regs(struct b · line 155
Quoted 12 lines
diff -u -p
a/arch/arm/mach-pxa/am300epd.cb/arch/arm/mach-pxa/am300epd.carch/arm/mach-pxa/am300epd.c 2011-03-15 11:17:04.000000000 +0100 renamed from arch/arm/mach-pxa/am300epd.c 2010-03-18 09:06:45.000000000 +0100 +0
-2@@ -150,8 +150,6 @@ static int am300_init_gpio_regs(struct b gpio_direction_output(i, 0); /* go into command mode */ - gpio_set_value(CFG_GPIO_PIN, 1); - gpio_set_value(RST_GPIO_PIN, 0); msleep(10); gpio_set_value(RST_GPIO_PIN, 1); msleep(10);This can probably make use of
gpio_request_array.Best regards
UweSignature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
Fabio Estevam
reviewerPATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
In reply to Uwe Kleine-KönigHi Uwe,
2011/3/16 Uwe Kleine-K?nig <[email protected]>:
...
Quoted 26 lines
This function is a bit confusing:
? ? ? ?/* Bring USB hub out of reset */
? ? ? ?ret =gpio_request(BABBAGE_USB_HUB_RESET, "GPIO1_7"); ? ? ? ?if (ret) {
? ? ? ? ? ? ? ?...
? ? ? ? ? ? ? ?return;
? ? ? ?}
? ? ? ?gpio_direction_output(BABBAGE_USB_HUB_RESET, 0); ? ? ? ?/* USB HUB RESET - De-assert USB HUBRESET_N*/ ? ? ? ?msleep(1);
? ? ? ?gpio_set_value(BABBAGE_USB_HUB_RESET, 0);
? ? ? ?msleep(1);
? ? ? ?gpio_set_value(BABBAGE_USB_HUB_RESET, 1);IMHO the comments are misleading. ?I'd suggest:
? ? ? ?ret = gpio_request_one(BABBAGE_USB_HUB_RESET,
? ? ? ? ? ? ? ? ? ? ? ?GPIOF_DIR_OUT |GPIOF_INIT_LOW, "USB hub reset#"); ? ? ? ?if (ret) {
? ? ? ? ? ? ? ?pr_err("failed to request gpio for USB hub reset#: %d\n", ret); ? ? ? ? ? ? ? ?return;
? ? ? ?}
? ? ? ?msleep(2);
? ? ? ?gpio_set_value(BABBAGE_USB_HUB_RESET, 1);
Quoted 1 line
Fabio?
Ok, I was not the author of this original code, but will send a new patch for fixing it.
Thanks for the review.
Regards,
Fabio Estevam
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
In reply to Uwe Kleine-KönigWhat is the degree of interest in having gpio_request_one be used? Right now, it is very little used. But there seem to be over 900 places where it could be used.
One advantage of gpio_request_one is that it manages error handling. However a number of current calls to gpio_request and gpio_direction_input/output don't save or test the return value. Are there cases where these operations cannot fail?
julia
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
Hi Julia,
Quoted 3 lines
What is the degree of interest in having
gpio_request_onebe used? Right now, it is very little used. But there seem to be over 900 places where it could be used.
I have a very high interest in getting it more known/used.
Quoted 1 line
One advantage of
gpio_request_oneis that it manages error handling.
Yes, that's what I like about it; checks for two errors in one call (especially the latter one is often forgotten in current code).
Quoted 3 lines
However a number of current calls to
gpio_requestand gpio_direction_input/output don't save or test the return value. Are there cases where these operations cannot fail?
It is a mixture of pragmatism and lazyness. For board setup code, mostly CPU-internal GPIOs are used and one can assume that they are always there because they are often set up in the same file. I wouldn't mind the error checks to catch the 0.00001% chance of it failing for whatever reason (most probably a careless update); still, the error checks have to be added by hand, because you need to know something about the board to handle the error correctly (igonre it? stop booting?).
For device drivers, the checks really should be made because one cannot assume anything about the GPIOs passed by platform data. The problem here is that you cannot use gpio_request_one yet because it is not available yet with !GPIOLIB. I have sent a patch [1] to fix it, but Grant needs some more time to review. If he accepts it, I wanted to clean up the drivers as a first step (with coccinelle surely involved ;)).
Regards,
Wolfram
[1] <[email protected]>
Signature · 9 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110320/dc5e6c2e/attachment.sig>
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
I guess that the !GPIOLIB issue is related to a configuration option, that can't very easily be detected from looking at the C file alone?
Ignoring that issue, the following semantic patch addresses the common case where there is no error checking for the input or output call, but there may be error checking for the gpio_request call. This transforms over 500 occurrences.
These rules also require that the first argument to gpio_request should not be used at all before the direction call. This may be too conservative. For example there are some intervening references in drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
in calls to cs5535_gpio_clear and cs5535_gpio_isset.
@@
expression E1,E2;
@@
- gpio_request(E1,E2)
+ gpio_request_one(E1,GPIOF_IN,E2)
... when != E1
- gpio_direction_input(E1);
@@
expression E1,E2;
@@
- gpio_request(E1,E2)
+ gpio_request_one(E1,GPIOF_OUT_INIT_LOW,E2)
... when != E1
- gpio_direction_output(E1,0);
@@
expression E1,E2;
@@
- gpio_request(E1,E2)
+ gpio_request_one(E1,GPIOF_OUT_INIT_HIGH,E2)
... when != E1
- gpio_direction_output(E1,1);
The results are below.
julia
arch/arm/mach-davinci/board-da830-evm.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-davinci/board-da830-evm.c 2011-03-14 17:19:13.000000000 +0100 +6 -12
@@ -163,21 +163,20 @@ static __init void da830_evm_usb_init(vo return; } - ret = gpio_request(ON_BD_USB_DRV, "ON_BD_USB_DRV"); + ret = gpio_request_one(ON_BD_USB_DRV, GPIOF_OUT_INIT_LOW, + "ON_BD_USB_DRV"); if (ret) { printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port " "power control: %d\n", __func__, ret); return; } - gpio_direction_output(ON_BD_USB_DRV, 0); - ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC"); + ret = gpio_request_one(ON_BD_USB_OVC, GPIOF_IN, "ON_BD_USB_OVC"); if (ret) { printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port " "over-current indicator: %d\n", __func__, ret); return; } - gpio_direction_input(ON_BD_USB_OVC); ret = da8xx_register_usb11(&da830_evm_usb11_pdata); if (ret)
@@ -260,21 +259,19 @@ static inline void da830_evm_init_mmc(vo return; } - ret = gpio_request(DA830_MMCSD_WP_PIN, "MMC WP"); + ret = gpio_request_one(DA830_MMCSD_WP_PIN, GPIOF_IN, "MMC WP"); if (ret) { pr_warning("da830_evm_init: can not open GPIO %d\n", DA830_MMCSD_WP_PIN); return; } - gpio_direction_input(DA830_MMCSD_WP_PIN); - ret = gpio_request(DA830_MMCSD_CD_PIN, "MMC CD\n"); + ret = gpio_request_one(DA830_MMCSD_CD_PIN, GPIOF_IN, "MMC CD\n"); if (ret) { pr_warning("da830_evm_init: can not open GPIO %d\n", DA830_MMCSD_CD_PIN); return; } - gpio_direction_input(DA830_MMCSD_CD_PIN); ret = da8xx_register_mmcsd0(&da830_evm_mmc_config); if (ret) {
@@ -463,10 +460,7 @@ static struct at24_platform_data da830_e static int __init da830_evm_ui_expander_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *context) { - gpio_request(gpio + 6, "UI MUX_MODE"); - - /* Drive mux mode low to match the default without UI card */ - gpio_direction_output(gpio + 6, 0); + gpio_request_one(gpio + 6, GPIOF_OUT_INIT_LOW, "UI MUX_MODE"); da830_evm_init_lcdc(gpio + 6);
arch/arm/mach-davinci/board-da850-evm.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-davinci/board-da850-evm.c 2011-03-14 17:19:13.000000000 +0100 +10 -13
@@ -429,29 +429,27 @@ static int da850_evm_ui_expander_setup(s sel_b = gpio + DA850_EVM_UI_EXP_SEL_B; sel_c = gpio + DA850_EVM_UI_EXP_SEL_C; - ret = gpio_request(sel_a, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_A]); + ret = gpio_request_one(sel_a, GPIOF_OUT_INIT_HIGH, + da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_A]); if (ret) { pr_warning("Cannot open UI expander pin %d\n", sel_a); goto exp_setup_sela_fail; } - ret = gpio_request(sel_b, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_B]); + ret = gpio_request_one(sel_b, GPIOF_OUT_INIT_HIGH, + da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_B]); if (ret) { pr_warning("Cannot open UI expander pin %d\n", sel_b); goto exp_setup_selb_fail; } - ret = gpio_request(sel_c, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_C]); + ret = gpio_request_one(sel_c, GPIOF_OUT_INIT_HIGH, + da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_C]); if (ret) { pr_warning("Cannot open UI expander pin %d\n", sel_c); goto exp_setup_selc_fail; } - /* deselect all functionalities */ - gpio_direction_output(sel_a, 1); - gpio_direction_output(sel_b, 1); - gpio_direction_output(sel_c, 1); - da850_evm_ui_keys_init(gpio); ret = platform_device_register(&da850_evm_ui_keys_device); if (ret) {
@@ -774,19 +772,18 @@ static int da850_lcd_hw_init(void) { int status; - status = gpio_request(DA850_LCD_BL_PIN, "lcd bl\n"); + status = gpio_request_one(DA850_LCD_BL_PIN, GPIOF_OUT_INIT_LOW, + "lcd bl\n"); if (status < 0) return status; - status = gpio_request(DA850_LCD_PWR_PIN, "lcd pwr\n"); + status = gpio_request_one(DA850_LCD_PWR_PIN, GPIOF_OUT_INIT_LOW, + "lcd pwr\n"); if (status < 0) { gpio_free(DA850_LCD_BL_PIN); return status; } - gpio_direction_output(DA850_LCD_BL_PIN, 0); - gpio_direction_output(DA850_LCD_PWR_PIN, 0); - /* Switch off panel power and backlight */ da850_panel_power_ctrl(0);
arch/arm/mach-davinci/board-dm355-evm.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-davinci/board-dm355-evm.c 2010-10-23 19:40:31.000000000 +0200 +2 -4
@@ -142,8 +142,7 @@ static void __init evm_init_i2c(void) { davinci_init_i2c(&i2c_pdata); - gpio_request(5, "dm355evm_msp"); - gpio_direction_input(5); + gpio_request_one(5, GPIOF_IN, "dm355evm_msp"); dm355evm_i2c_info[0].irq = gpio_to_irq(5); i2c_register_board_info(1, dm355evm_i2c_info,
@@ -315,8 +314,7 @@ static __init void dm355_evm_init(void) { struct clk *aemif; - gpio_request(1, "dm9000"); - gpio_direction_input(1); + gpio_request_one(1, GPIOF_IN, "dm9000"); dm355evm_dm9000_rsrc[2].start = gpio_to_irq(1); aemif = clk_get(&dm355evm_dm9000.dev, "aemif");
arch/arm/mach-davinci/board-dm355-leopard.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-davinci/board-dm355-leopard.c 2010-10-23 19:40:31.000000000 +0200 +2 -4
@@ -134,8 +134,7 @@ static void __init leopard_init_i2c(void { davinci_init_i2c(&i2c_pdata); - gpio_request(5, "dm355leopard_msp"); - gpio_direction_input(5); + gpio_request_one(5, GPIOF_IN, "dm355leopard_msp"); dm355leopard_i2c_info[0].irq = gpio_to_irq(5); i2c_register_board_info(1, dm355leopard_i2c_info,
@@ -237,8 +236,7 @@ static __init void dm355_leopard_init(vo { struct clk *aemif; - gpio_request(9, "dm9000"); - gpio_direction_input(9); + gpio_request_one(9, GPIOF_IN, "dm9000"); dm355leopard_dm9000_rsrc[2].start = gpio_to_irq(9); aemif = clk_get(&dm355leopard_dm9000.dev, "aemif");
arch/arm/mach-davinci/board-dm644x-evm.c 2011-03-20 21:01:56.000000000 +0100 renamed from arch/arm/mach-davinci/board-dm644x-evm.c 2011-03-20 18:17:22.000000000 +0100 +10 -20
@@ -371,14 +371,11 @@ evm_u18_setup(struct i2c_client *client, sw_gpio = -EINVAL; /* audio PLL: 48 kHz (vs 44.1 or 32), single rate (vs double) */ - gpio_request(gpio + 3, "pll_fs2"); - gpio_direction_output(gpio + 3, 0); + gpio_request_one(gpio + 3, GPIOF_OUT_INIT_LOW, "pll_fs2"); - gpio_request(gpio + 2, "pll_fs1"); - gpio_direction_output(gpio + 2, 0); + gpio_request_one(gpio + 2, GPIOF_OUT_INIT_LOW, "pll_fs1"); - gpio_request(gpio + 1, "pll_sr"); - gpio_direction_output(gpio + 1, 0); + gpio_request_one(gpio + 1, GPIOF_OUT_INIT_LOW, "pll_sr"); return 0; }
@@ -411,34 +408,27 @@ static int evm_u35_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c) { /* p0 = nDRV_VBUS (initial: don't supply it) */ - gpio_request(gpio + 0, "nDRV_VBUS"); - gpio_direction_output(gpio + 0, 1); + gpio_request_one(gpio + 0, GPIOF_OUT_INIT_HIGH, "nDRV_VBUS"); /* p1 = VDDIMX_EN */ - gpio_request(gpio + 1, "VDDIMX_EN"); - gpio_direction_output(gpio + 1, 1); + gpio_request_one(gpio + 1, GPIOF_OUT_INIT_HIGH, "VDDIMX_EN"); /* p2 = VLYNQ_EN */ - gpio_request(gpio + 2, "VLYNQ_EN"); - gpio_direction_output(gpio + 2, 1); + gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH, "VLYNQ_EN"); /* p3 = n3V3_CF_RESET (initial: stay in reset) */ - gpio_request(gpio + 3, "nCF_RESET"); - gpio_direction_output(gpio + 3, 0); + gpio_request_one(gpio + 3, GPIOF_OUT_INIT_LOW, "nCF_RESET"); /* (p4 unused) */ /* p5 = 1V8_WLAN_RESET (initial: stay in reset) */ - gpio_request(gpio + 5, "WLAN_RESET"); - gpio_direction_output(gpio + 5, 1); + gpio_request_one(gpio + 5, GPIOF_OUT_INIT_HIGH, "WLAN_RESET"); /* p6 = nATA_SEL (initial: select) */ - gpio_request(gpio + 6, "nATA_SEL"); - gpio_direction_output(gpio + 6, 0); + gpio_request_one(gpio + 6, GPIOF_OUT_INIT_LOW, "nATA_SEL"); /* p7 = nCF_SEL (initial: deselect) */ - gpio_request(gpio + 7, "nCF_SEL"); - gpio_direction_output(gpio + 7, 1); + gpio_request_one(gpio + 7, GPIOF_OUT_INIT_HIGH, "nCF_SEL"); return 0; }
arch/arm/mach-davinci/board-tnetv107x-evm.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-davinci/board-tnetv107x-evm.c 2011-03-20 18:17:22.000000000 +0100 +1 -2
@@ -44,12 +44,11 @@ static int initialize_gpio(int gpio, cha { int ret; - ret = gpio_request(gpio, desc); + ret = gpio_request_one(gpio, GPIOF_IN, desc); if (ret < 0) { pr_err_ratelimited("cannot open %s gpio\n", desc); return -ENOSYS; } - gpio_direction_input(gpio); return gpio; }
arch/arm/mach-imx/eukrea_mbimx27-baseboard.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-imx/eukrea_mbimx27-baseboard.c 2011-02-11 10:53:31.000000000 +0100 +1 -2
@@ -251,11 +251,10 @@ static const struct imxuart_platform_dat static void __maybe_unused ads7846_dev_init(void) { - if (gpio_request(ADS7846_PENDOWN, "ADS7846 pendown") < 0) { + if (gpio_request_one(ADS7846_PENDOWN, GPIOF_IN, "ADS7846 pendown") < 0) { printk(KERN_ERR "can't get ads746 pen down GPIO\n"); return; } - gpio_direction_input(ADS7846_PENDOWN); } static int ads7846_get_pendown_state(void)
arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c 2010-12-04 18:54:35.000000000 +0100 +3 -6
@@ -277,16 +277,13 @@ void __init eukrea_mbimxsd25_baseboard_i imx25_add_flexcan1(NULL); imx25_add_sdhci_esdhc_imx(0, NULL); - gpio_request(GPIO_LED1, "LED1"); - gpio_direction_output(GPIO_LED1, 1); + gpio_request_one(GPIO_LED1, GPIOF_OUT_INIT_HIGH, "LED1"); gpio_free(GPIO_LED1); - gpio_request(GPIO_SWITCH1, "SWITCH1"); - gpio_direction_input(GPIO_SWITCH1); + gpio_request_one(GPIO_SWITCH1, GPIOF_IN, "SWITCH1"); gpio_free(GPIO_SWITCH1); - gpio_request(GPIO_LCDPWR, "LCDPWR"); - gpio_direction_output(GPIO_LCDPWR, 1); + gpio_request_one(GPIO_LCDPWR, GPIOF_OUT_INIT_HIGH, "LCDPWR"); gpio_free(GPIO_SWITCH1); i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices,
arch/arm/mach-imx/mach-mx25_3ds.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-imx/mach-mx25_3ds.c 2011-03-14 17:19:13.000000000 +0100 +6 -5
@@ -118,11 +118,12 @@ static const struct fec_platform_data mx static void __init mx25pdk_fec_reset(void) { - gpio_request(FEC_ENABLE_GPIO, "FEC PHY enable"); - gpio_request(FEC_RESET_B_GPIO, "FEC PHY reset"); - - gpio_direction_output(FEC_ENABLE_GPIO, 0); /* drop PHY power */ - gpio_direction_output(FEC_RESET_B_GPIO, 0); /* assert reset */ + gpio_request_one(FEC_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, + "FEC PHY enable"); + gpio_request_one(FEC_RESET_B_GPIO, GPIOF_OUT_INIT_LOW, + "FEC PHY reset"); + /* drop PHY power */ + /* assert reset */ udelay(2); /* turn on PHY power and lift reset */
arch/arm/mach-imx/pcm970-baseboard.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-imx/pcm970-baseboard.c 2010-12-04 18:54:35.000000000 +0100 +1 -3
@@ -100,14 +100,12 @@ static int pcm970_sdhc2_init(struct devi if (ret) return ret; - ret = gpio_request(GPIO_PORTC + 28, "imx-mmc-ro"); + ret = gpio_request_one(GPIO_PORTC + 28, GPIOF_IN, "imx-mmc-ro"); if (ret) { free_irq(IRQ_GPIOC(29), data); return ret; } - gpio_direction_input(GPIO_PORTC + 28); - return 0; }
arch/arm/mach-kirkwood/openrd-setup.c 2011-03-20 21:01:55.000000000 +0100 renamed from arch/arm/mach-kirkwood/openrd-setup.c 2011-03-14 17:19:13.000000000 +0100 +1 -5
@@ -115,7 +115,7 @@ static int __init uart1_mpp_config(void) { kirkwood_mpp_conf(openrd_uart1_mpp_config); - if (gpio_request(34, "SD_UART1_SEL")) { + if (gpio_request_one(34, GPIOF_OUT_INIT_LOW, "SD_UART1_SEL")) { printk(KERN_ERR "GPIO request failed for SD/UART1 selection" ", gpio: 34\n"); return -EIO;
@@ -128,10 +128,6 @@ static int __init uart1_mpp_config(void) return -EIO; } - /* Select UART1 - * Pin # 34: 0 => UART1, 1 => SD */ - gpio_direction_output(34, 0); - /* Select RS232 OR RS485 * Pin # 28: 0 => RS232, 1 => RS485 */ if (uart1 == 232)
arch/arm/mach-ks8695/board-acs5k.c 2011-03-20 21:01:55.000000000 +0100 renamed from arch/arm/mach-ks8695/board-acs5k.c 2010-10-23 19:40:31.000000000 +0200 +2 -4
@@ -198,10 +198,8 @@ static void __init acs5k_init_gpio(void) for (i = 8; i < 16; ++i) gpio_request(i, "ACS5K Unused"); - gpio_request(3, "ACS5K CAN Control"); - gpio_request(6, "ACS5K Heartbeat"); - gpio_direction_output(3, 1); /* Default CAN_RESET high */ - gpio_direction_output(6, 0); /* Default KS8695_ACTIVE low */ + gpio_request_one(3, GPIOF_OUT_INIT_HIGH, "ACS5K CAN Control"); + gpio_request_one(6, GPIOF_OUT_INIT_LOW, "ACS5K Heartbeat");/* Default CAN_RESET high *//* Default KS8695_ACTIVE low */ gpio_export(3, 0); /* export CAN_RESET as output only */ gpio_export(6, 0); /* export KS8695_ACTIVE as output only */ }
arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c 2011-03-20 21:01:55.000000000 +0100 renamed from arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c 2011-02-26 13:17:46.000000000 +0100 +3 -6
@@ -291,16 +291,13 @@ void __init eukrea_mbimxsd35_baseboard_i imx35_add_flexcan1(NULL); imx35_add_sdhci_esdhc_imx(0, NULL); - gpio_request(GPIO_LED1, "LED1"); - gpio_direction_output(GPIO_LED1, 1); + gpio_request_one(GPIO_LED1, GPIOF_OUT_INIT_HIGH, "LED1"); gpio_free(GPIO_LED1); - gpio_request(GPIO_SWITCH1, "SWITCH1"); - gpio_direction_input(GPIO_SWITCH1); + gpio_request_one(GPIO_SWITCH1, GPIOF_IN, "SWITCH1"); gpio_free(GPIO_SWITCH1); - gpio_request(GPIO_LCDPWR, "LCDPWR"); - gpio_direction_output(GPIO_LCDPWR, 1); + gpio_request_one(GPIO_LCDPWR, GPIOF_OUT_INIT_HIGH, "LCDPWR"); gpio_free(GPIO_LCDPWR); i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices,
arch/arm/mach-mx3/mach-armadillo5x0.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-mx3/mach-armadillo5x0.c 2011-03-14 17:19:13.000000000 +0100 +2 -6
@@ -412,18 +412,14 @@ static int armadillo5x0_sdhc1_init(struc gpio_det = IOMUX_TO_GPIO(MX31_PIN_ATA_DMACK); gpio_wp = IOMUX_TO_GPIO(MX31_PIN_ATA_RESET_B); - ret = gpio_request(gpio_det, "sdhc-card-detect"); + ret = gpio_request_one(gpio_det, GPIOF_IN, "sdhc-card-detect"); if (ret) return ret; - gpio_direction_input(gpio_det); - - ret = gpio_request(gpio_wp, "sdhc-write-protect"); + ret = gpio_request_one(gpio_wp, GPIOF_IN, "sdhc-write-protect"); if (ret) goto err_gpio_free; - gpio_direction_input(gpio_wp); - /* When supported the trigger type have to be BOTH */ ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_ATA_DMACK), detect_irq, IRQF_DISABLED | IRQF_TRIGGER_FALLING,
arch/arm/mach-mx3/mach-kzm_arm11_01.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-mx3/mach-kzm_arm11_01.c 2011-02-19 08:28:51.000000000 +0100 +4 -4
@@ -113,8 +113,8 @@ static int __init kzm_init_ext_uart(void * GPIO 1-1: external UART interrupt line */ mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO1_1, IOMUX_CONFIG_GPIO)); - gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1), "ext-uart-int"); - gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1)); + gpio_request_one(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1), GPIOF_IN, + "ext-uart-int"); /* * Unmask UART interrupt
@@ -172,8 +172,8 @@ static int __init kzm_init_smsc9118(void * GPIO 1-2: SMSC9118 interrupt line */ mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO1_2, IOMUX_CONFIG_GPIO)); - gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2), "smsc9118-int"); - gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2)); + gpio_request_one(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2), GPIOF_IN, + "smsc9118-int"); return platform_device_register(&kzm_smsc9118_device); }
arch/arm/mach-mx3/mach-mx31lilly.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-mx3/mach-mx31lilly.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -175,8 +175,8 @@ static int usbh2_init(struct platform_de /* chip select */ mxc_iomux_alloc_pin(IOMUX_MODE(MX31_PIN_DTR_DCE1, IOMUX_CONFIG_GPIO), "USBH2_CS"); - gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), "USBH2 CS"); - gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), 0); + gpio_request_one(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), + GPIOF_OUT_INIT_LOW, "USBH2 CS"); mdelay(10);
arch/arm/mach-mx3/mach-mx31lite.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-mx3/mach-mx31lite.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -164,8 +164,8 @@ static int usbh2_init(struct platform_de /* chip select */ mxc_iomux_alloc_pin(IOMUX_MODE(MX31_PIN_DTR_DCE1, IOMUX_CONFIG_GPIO), "USBH2_CS"); - gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), "USBH2 CS"); - gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), 0); + gpio_request_one(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), + GPIOF_OUT_INIT_LOW, "USBH2 CS"); mdelay(10);
arch/arm/mach-mx3/mach-mx31moboard.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-mx3/mach-mx31moboard.c 2011-03-14 17:19:13.000000000 +0100 +8 -13
@@ -311,16 +311,13 @@ static int moboard_sdhc1_init(struct dev { int ret; - ret = gpio_request(SDHC1_CD, "sdhc-detect"); + ret = gpio_request_one(SDHC1_CD, GPIOF_IN, "sdhc-detect"); if (ret) return ret; - gpio_direction_input(SDHC1_CD); - - ret = gpio_request(SDHC1_WP, "sdhc-wp"); + ret = gpio_request_one(SDHC1_WP, GPIOF_IN, "sdhc-wp"); if (ret) goto err_gpio_free; - gpio_direction_input(SDHC1_WP); ret = request_irq(gpio_to_irq(SDHC1_CD), detect_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
@@ -390,13 +387,11 @@ static void usb_xcvr_reset(void) mxc_iomux_set_pad(MX31_PIN_SRXD3, USB_PAD_CFG | PAD_CTL_100K_PD); mxc_iomux_set_pad(MX31_PIN_STXD3, USB_PAD_CFG | PAD_CTL_100K_PD); - gpio_request(OTG_EN_B, "usb-udc-en"); - gpio_direction_output(OTG_EN_B, 0); - gpio_request(USBH2_EN_B, "usbh2-en"); - gpio_direction_output(USBH2_EN_B, 0); + gpio_request_one(OTG_EN_B, GPIOF_OUT_INIT_LOW, "usb-udc-en"); + + gpio_request_one(USBH2_EN_B, GPIOF_OUT_INIT_LOW, "usbh2-en"); - gpio_request(USB_RESET_B, "usb-reset"); - gpio_direction_output(USB_RESET_B, 0); + gpio_request_one(USB_RESET_B, GPIOF_OUT_INIT_LOW, "usb-reset"); mdelay(1); gpio_set_value(USB_RESET_B, 1); mdelay(1);
@@ -522,8 +517,8 @@ static void __init mx31moboard_init(void imx31_add_spi_imx1(&moboard_spi1_pdata); imx31_add_spi_imx2(&moboard_spi2_pdata); - gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq"); - gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); + gpio_request_one(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), GPIOF_IN, + "pmic-irq"); spi_register_board_info(moboard_spi_board_info, ARRAY_SIZE(moboard_spi_board_info));
arch/arm/mach-mx3/mach-pcm037.c 2011-03-20 21:01:49.000000000 +0100 renamed from arch/arm/mach-mx3/mach-pcm037.c 2011-03-14 17:19:13.000000000 +0100 +2 -5
@@ -358,17 +358,14 @@ static int pcm970_sdhc1_init(struct devi { int ret; - ret = gpio_request(SDHC1_GPIO_DET, "sdhc-detect"); + ret = gpio_request_one(SDHC1_GPIO_DET, GPIOF_IN, "sdhc-detect"); if (ret) return ret; - gpio_direction_input(SDHC1_GPIO_DET); - #ifdef PCM970_SDHC_RW_SWITCH - ret = gpio_request(SDHC1_GPIO_WP, "sdhc-wp"); + ret = gpio_request_one(SDHC1_GPIO_WP, GPIOF_IN, "sdhc-wp"); if (ret) goto err_gpio_free; - gpio_direction_input(SDHC1_GPIO_WP); #endif ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_SCK6), detect_irq,
arch/arm/mach-mx3/mach-pcm043.c 2011-03-20 21:01:49.000000000 +0100 renamed from arch/arm/mach-mx3/mach-pcm043.c 2011-03-14 17:19:13.000000000 +0100 +5 -9
@@ -229,7 +229,7 @@ static void pcm043_ac97_warm_reset(struc iomux_v3_cfg_t txfs = MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS; int ret; - ret = gpio_request(AC97_GPIO_TXFS, "SSI"); + ret = gpio_request_one(AC97_GPIO_TXFS, GPIOF_OUT_INIT_HIGH, "SSI"); if (ret) { printk("failed to get GPIO_TXFS: %d\n", ret); return;
@@ -238,7 +238,6 @@ static void pcm043_ac97_warm_reset(struc mxc_iomux_v3_setup_pad(txfs_gpio); /* warm reset */ - gpio_direction_output(AC97_GPIO_TXFS, 1); udelay(2); gpio_set_value(AC97_GPIO_TXFS, 0);
@@ -255,15 +254,15 @@ static void pcm043_ac97_cold_reset(struc iomux_v3_cfg_t reset_gpio = MX35_PAD_SD2_CMD__GPIO2_0; int ret; - ret = gpio_request(AC97_GPIO_TXFS, "SSI"); + ret = gpio_request_one(AC97_GPIO_TXFS, GPIOF_OUT_INIT_LOW, "SSI"); if (ret) goto err1; - ret = gpio_request(AC97_GPIO_TXD, "SSI"); + ret = gpio_request_one(AC97_GPIO_TXD, GPIOF_OUT_INIT_LOW, "SSI"); if (ret) goto err2; - ret = gpio_request(AC97_GPIO_RESET, "SSI"); + ret = gpio_request_one(AC97_GPIO_RESET, GPIOF_OUT_INIT_LOW, "SSI"); if (ret) goto err3;
@@ -271,11 +270,8 @@ static void pcm043_ac97_cold_reset(struc mxc_iomux_v3_setup_pad(txd_gpio); mxc_iomux_v3_setup_pad(reset_gpio); - gpio_direction_output(AC97_GPIO_TXFS, 0); - gpio_direction_output(AC97_GPIO_TXD, 0); - /* cold reset */ - gpio_direction_output(AC97_GPIO_RESET, 0); + udelay(10); gpio_direction_output(AC97_GPIO_RESET, 1);
arch/arm/mach-mx3/mx31lilly-db.c 2011-03-20 21:01:55.000000000 +0100 renamed from arch/arm/mach-mx3/mx31lilly-db.c 2010-12-04 18:54:35.000000000 +0100 +4 -7
@@ -122,17 +122,14 @@ static int mxc_mmc1_init(struct device * mxc_iomux_set_pad(MX31_PIN_SD1_CLK, MMC_PAD_CFG); mxc_iomux_set_pad(MX31_PIN_SD1_CMD, MMC_PAD_CFG); - ret = gpio_request(gpio_det, "MMC detect"); + ret = gpio_request_one(gpio_det, GPIOF_IN, "MMC detect"); if (ret) return ret; - ret = gpio_request(gpio_wp, "MMC w/p"); + ret = gpio_request_one(gpio_wp, GPIOF_IN, "MMC w/p"); if (ret) goto exit_free_det; - gpio_direction_input(gpio_det); - gpio_direction_input(gpio_wp); - ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), detect_irq, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "MMC detect", data);
@@ -197,14 +194,14 @@ static struct mx3fb_platform_data fb_pda static void __init mx31lilly_init_fb(void) { - if (gpio_request(LCD_VCC_EN_GPIO, "LCD enable") != 0) { + if (gpio_request_one(LCD_VCC_EN_GPIO, GPIOF_OUT_INIT_HIGH, + "LCD enable") != 0) { printk(KERN_WARNING "unable to request LCD_VCC_EN pin.\n"); return; } mxc_register_device(&mx3_ipu, &ipu_data); mxc_register_device(&mx3_fb, &fb_pdata); - gpio_direction_output(LCD_VCC_EN_GPIO, 1); } void __init mx31lilly_db_init(void)
arch/arm/mach-mx3/mx31lite-db.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-mx3/mx31lite-db.c 2010-12-04 18:54:35.000000000 +0100 +2 -5
@@ -106,17 +106,14 @@ static int mxc_mmc1_init(struct device * MMC_PAD_CFG | PAD_CTL_PUE_PUD | PAD_CTL_100K_PU); mxc_iomux_set_pad(MX31_PIN_SD1_CLK, MMC_PAD_CFG); - ret = gpio_request(gpio_det, "MMC detect"); + ret = gpio_request_one(gpio_det, GPIOF_IN, "MMC detect"); if (ret) return ret; - ret = gpio_request(gpio_wp, "MMC w/p"); + ret = gpio_request_one(gpio_wp, GPIOF_IN, "MMC w/p"); if (ret) goto exit_free_det; - gpio_direction_input(gpio_det); - gpio_direction_input(gpio_wp); - ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_DCD_DCE1), detect_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "MMC detect", data);
arch/arm/mach-mx3/mx31moboard-devboard.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-mx3/mx31moboard-devboard.c 2011-02-19 08:28:51.000000000 +0100 +6 -10
@@ -67,16 +67,13 @@ static int devboard_sdhc2_init(struct de { int ret; - ret = gpio_request(SDHC2_CD, "sdhc-detect"); + ret = gpio_request_one(SDHC2_CD, GPIOF_IN, "sdhc-detect"); if (ret) return ret; - gpio_direction_input(SDHC2_CD); - - ret = gpio_request(SDHC2_WP, "sdhc-wp"); + ret = gpio_request_one(SDHC2_WP, GPIOF_IN, "sdhc-wp"); if (ret) goto err_gpio_free; - gpio_direction_input(SDHC2_WP); ret = request_irq(gpio_to_irq(SDHC2_CD), detect_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
@@ -161,18 +158,17 @@ static int devboard_usbh1_hw_init(struct static int devboard_isp1105_init(struct otg_transceiver *otg) { - int ret = gpio_request(USBH1_MODE, "usbh1-mode"); + int ret = gpio_request_one(USBH1_MODE, GPIOF_OUT_INIT_LOW, + "usbh1-mode"); if (ret) return ret; - /* single ended */ - gpio_direction_output(USBH1_MODE, 0); - ret = gpio_request(USBH1_VBUSEN_B, "usbh1-vbusen"); + ret = gpio_request_one(USBH1_VBUSEN_B, GPIOF_OUT_INIT_HIGH, + "usbh1-vbusen"); if (ret) { gpio_free(USBH1_MODE); return ret; } - gpio_direction_output(USBH1_VBUSEN_B, 1); return 0; }
arch/arm/mach-mx3/mx31moboard-marxbot.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-mx3/mx31moboard-marxbot.c 2011-02-19 08:28:51.000000000 +0100 +18 -22
@@ -80,16 +80,13 @@ static int marxbot_sdhc2_init(struct dev { int ret; - ret = gpio_request(SDHC2_CD, "sdhc-detect"); + ret = gpio_request_one(SDHC2_CD, GPIOF_IN, "sdhc-detect"); if (ret) return ret; - gpio_direction_input(SDHC2_CD); - - ret = gpio_request(SDHC2_WP, "sdhc-wp"); + ret = gpio_request_one(SDHC2_WP, GPIOF_IN, "sdhc-wp"); if (ret) goto err_gpio_free; - gpio_direction_input(SDHC2_WP); ret = request_irq(gpio_to_irq(SDHC2_CD), detect_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
@@ -195,28 +192,28 @@ static struct platform_device *marxbot_c static int __init marxbot_cam_init(void) { - int ret = gpio_request(CAM_CHOICE, "cam-choice"); + int ret = gpio_request_one(CAM_CHOICE, GPIOF_OUT_INIT_LOW, + "cam-choice"); if (ret) return ret; - gpio_direction_output(CAM_CHOICE, 0); - ret = gpio_request(BASECAM_RST_B, "basecam-reset"); + ret = gpio_request_one(BASECAM_RST_B, GPIOF_OUT_INIT_HIGH, + "basecam-reset"); if (ret) return ret; - gpio_direction_output(BASECAM_RST_B, 1); - ret = gpio_request(BASECAM_POWER, "basecam-standby"); + ret = gpio_request_one(BASECAM_POWER, GPIOF_OUT_INIT_LOW, + "basecam-standby"); if (ret) return ret; - gpio_direction_output(BASECAM_POWER, 0); - ret = gpio_request(TURRETCAM_RST_B, "turretcam-reset"); + ret = gpio_request_one(TURRETCAM_RST_B, GPIOF_OUT_INIT_HIGH, + "turretcam-reset"); if (ret) return ret; - gpio_direction_output(TURRETCAM_RST_B, 1); - ret = gpio_request(TURRETCAM_POWER, "turretcam-standby"); + ret = gpio_request_one(TURRETCAM_POWER, GPIOF_OUT_INIT_LOW, + "turretcam-standby"); if (ret) return ret; - gpio_direction_output(TURRETCAM_POWER, 0); return 0; }
@@ -276,18 +273,17 @@ static int marxbot_usbh1_hw_init(struct static int marxbot_isp1105_init(struct otg_transceiver *otg) { - int ret = gpio_request(USBH1_MODE, "usbh1-mode"); + int ret = gpio_request_one(USBH1_MODE, GPIOF_OUT_INIT_LOW, + "usbh1-mode"); if (ret) return ret; - /* single ended */ - gpio_direction_output(USBH1_MODE, 0); - ret = gpio_request(USBH1_VBUSEN_B, "usbh1-vbusen"); + ret = gpio_request_one(USBH1_VBUSEN_B, GPIOF_OUT_INIT_HIGH, + "usbh1-vbusen"); if (ret) { gpio_free(USBH1_MODE); return ret; } - gpio_direction_output(USBH1_VBUSEN_B, 1); return 0; }
@@ -358,8 +354,8 @@ void __init mx31moboard_marxbot_init(voi platform_add_devices(marxbot_cameras, ARRAY_SIZE(marxbot_cameras)); /* battery present pin */ - gpio_request(IOMUX_TO_GPIO(MX31_PIN_LCS0), "bat-present"); - gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_LCS0)); + gpio_request_one(IOMUX_TO_GPIO(MX31_PIN_LCS0), GPIOF_IN, + "bat-present"); gpio_export(IOMUX_TO_GPIO(MX31_PIN_LCS0), false); imx31_add_fsl_usb2_udc(&usb_pdata);
arch/arm/mach-mx3/mx31moboard-smartbot.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-mx3/mx31moboard-smartbot.c 2011-03-14 17:19:13.000000000 +0100 +3 -4
@@ -104,14 +104,13 @@ static struct platform_device *smartbot_ static int __init smartbot_cam_init(void) { - int ret = gpio_request(CAM_RST_B, "cam-reset"); + int ret = gpio_request_one(CAM_RST_B, GPIOF_OUT_INIT_HIGH, + "cam-reset"); if (ret) return ret; - gpio_direction_output(CAM_RST_B, 1); - ret = gpio_request(CAM_POWER, "cam-standby"); + ret = gpio_request_one(CAM_POWER, GPIOF_OUT_INIT_LOW, "cam-standby"); if (ret) return ret; - gpio_direction_output(CAM_POWER, 0); return 0; }
arch/arm/mach-mx5/board-cpuimx51.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-mx5/board-cpuimx51.c 2011-02-19 08:28:51.000000000 +0100 +4 -8
@@ -253,17 +253,13 @@ static void __init eukrea_cpuimx51_init( imx51_add_imx_uart(0, &uart_pdata); imx51_add_mxc_nand(&eukrea_cpuimx51_nand_board_info); - gpio_request(CPUIMX51_QUARTA_GPIO, "quarta_irq"); - gpio_direction_input(CPUIMX51_QUARTA_GPIO); + gpio_request_one(CPUIMX51_QUARTA_GPIO, GPIOF_IN, "quarta_irq"); gpio_free(CPUIMX51_QUARTA_GPIO); - gpio_request(CPUIMX51_QUARTB_GPIO, "quartb_irq"); - gpio_direction_input(CPUIMX51_QUARTB_GPIO); + gpio_request_one(CPUIMX51_QUARTB_GPIO, GPIOF_IN, "quartb_irq"); gpio_free(CPUIMX51_QUARTB_GPIO); - gpio_request(CPUIMX51_QUARTC_GPIO, "quartc_irq"); - gpio_direction_input(CPUIMX51_QUARTC_GPIO); + gpio_request_one(CPUIMX51_QUARTC_GPIO, GPIOF_IN, "quartc_irq"); gpio_free(CPUIMX51_QUARTC_GPIO); - gpio_request(CPUIMX51_QUARTD_GPIO, "quartd_irq"); - gpio_direction_input(CPUIMX51_QUARTD_GPIO); + gpio_request_one(CPUIMX51_QUARTD_GPIO, GPIOF_IN, "quartd_irq"); gpio_free(CPUIMX51_QUARTD_GPIO); imx51_add_fec(NULL);
arch/arm/mach-mx5/board-cpuimx51sd.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-mx5/board-cpuimx51sd.c 2011-03-14 17:19:13.000000000 +0100 +5 -10
@@ -280,22 +280,18 @@ static void __init eukrea_cpuimx51sd_ini gpio_set_value(ETH_RST, 1); imx51_add_fec(NULL); - gpio_request(CAN_IRQGPIO, "can_irq"); - gpio_direction_input(CAN_IRQGPIO); + gpio_request_one(CAN_IRQGPIO, GPIOF_IN, "can_irq"); gpio_free(CAN_IRQGPIO); - gpio_request(CAN_NCS, "can_ncs"); - gpio_direction_output(CAN_NCS, 1); + gpio_request_one(CAN_NCS, GPIOF_OUT_INIT_HIGH, "can_ncs"); gpio_free(CAN_NCS); - gpio_request(CAN_RST, "can_rst"); - gpio_direction_output(CAN_RST, 0); + gpio_request_one(CAN_RST, GPIOF_OUT_INIT_LOW, "can_rst"); msleep(20); gpio_set_value(CAN_RST, 1); imx51_add_ecspi(0, &cpuimx51sd_ecspi1_pdata); spi_register_board_info(cpuimx51sd_spi_device, ARRAY_SIZE(cpuimx51sd_spi_device)); - gpio_request(TSC2007_IRQGPIO, "tsc2007_irq"); - gpio_direction_input(TSC2007_IRQGPIO); + gpio_request_one(TSC2007_IRQGPIO, GPIOF_IN, "tsc2007_irq"); gpio_free(TSC2007_IRQGPIO); i2c_register_board_info(0, eukrea_cpuimx51sd_i2c_devices,
@@ -309,8 +305,7 @@ static void __init eukrea_cpuimx51sd_ini mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata); } - gpio_request(USBH1_RST, "usb_rst"); - gpio_direction_output(USBH1_RST, 0); + gpio_request_one(USBH1_RST, GPIOF_OUT_INIT_LOW, "usb_rst"); msleep(20); gpio_set_value(USBH1_RST, 1); mxc_register_device(&mxc_usbh1_device, &usbh1_config);
arch/arm/mach-mx5/board-mx50_rdp.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx50_rdp.c 2011-02-11 10:53:31.000000000 +0100 +3 -4
@@ -176,10 +176,9 @@ static const struct fec_platform_data fe static inline void mx50_rdp_fec_reset(void) { - gpio_request(FEC_EN, "fec-en"); - gpio_direction_output(FEC_EN, 0); - gpio_request(FEC_RESET_B, "fec-reset_b"); - gpio_direction_output(FEC_RESET_B, 0); + gpio_request_one(FEC_EN, GPIOF_OUT_INIT_LOW, "fec-en"); + + gpio_request_one(FEC_RESET_B, GPIOF_OUT_INIT_LOW, "fec-reset_b"); msleep(1); gpio_set_value(FEC_RESET_B, 1); }
arch/arm/mach-mx5/board-mx51_babbage.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx51_babbage.c 2011-02-19 08:28:51.000000000 +0100 +8 -8
@@ -181,26 +181,26 @@ static int gpio_usbh1_active(void) /* Set USBH1_STP to GPIO and toggle it */ mxc_iomux_v3_setup_pad(usbh1stp_gpio); - ret = gpio_request(BABBAGE_USBH1_STP, "usbh1_stp"); + ret = gpio_request_one(BABBAGE_USBH1_STP, GPIOF_OUT_INIT_LOW, + "usbh1_stp"); if (ret) { pr_debug("failed to get MX51_PAD_USBH1_STP__GPIO_1_27: %d\n", ret); return ret; } - gpio_direction_output(BABBAGE_USBH1_STP, 0); gpio_set_value(BABBAGE_USBH1_STP, 1); msleep(100); gpio_free(BABBAGE_USBH1_STP); /* De-assert USB PHY RESETB */ mxc_iomux_v3_setup_pad(phyreset_gpio); - ret = gpio_request(BABBAGE_PHY_RESET, "phy_reset"); + ret = gpio_request_one(BABBAGE_PHY_RESET, GPIOF_OUT_INIT_HIGH, + "phy_reset"); if (ret) { pr_debug("failed to get MX51_PAD_EIM_D21__GPIO_2_5: %d\n", ret); return ret; } - gpio_direction_output(BABBAGE_PHY_RESET, 1); return 0; }
@@ -209,12 +209,12 @@ static inline void babbage_usbhub_reset( int ret; /* Bring USB hub out of reset */ - ret = gpio_request(BABBAGE_USB_HUB_RESET, "GPIO1_7"); + ret = gpio_request_one(BABBAGE_USB_HUB_RESET, GPIOF_OUT_INIT_LOW, + "GPIO1_7"); if (ret) { printk(KERN_ERR"failed to get GPIO_USB_HUB_RESET: %d\n", ret); return; } - gpio_direction_output(BABBAGE_USB_HUB_RESET, 0); /* USB HUB RESET - De-assert USB HUB RESET_N */ msleep(1);
@@ -228,12 +228,12 @@ static inline void babbage_fec_reset(voi int ret; /* reset FEC PHY */ - ret = gpio_request(BABBAGE_FEC_PHY_RESET, "fec-phy-reset"); + ret = gpio_request_one(BABBAGE_FEC_PHY_RESET, GPIOF_OUT_INIT_LOW, + "fec-phy-reset"); if (ret) { printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret); return; } - gpio_direction_output(BABBAGE_FEC_PHY_RESET, 0); gpio_set_value(BABBAGE_FEC_PHY_RESET, 0); msleep(1); gpio_set_value(BABBAGE_FEC_PHY_RESET, 1);
arch/arm/mach-mx5/board-mx51_efikamx.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx51_efikamx.c 2011-02-26 13:17:46.000000000 +0100 +10 -14
@@ -104,12 +104,11 @@ static void __init mx51_efikamx_board_id /* things are taking time to settle */ msleep(150); - gpio_request(EFIKAMX_PCBID0, "pcbid0"); - gpio_direction_input(EFIKAMX_PCBID0); - gpio_request(EFIKAMX_PCBID1, "pcbid1"); - gpio_direction_input(EFIKAMX_PCBID1); - gpio_request(EFIKAMX_PCBID2, "pcbid2"); - gpio_direction_input(EFIKAMX_PCBID2); + gpio_request_one(EFIKAMX_PCBID0, GPIOF_IN, "pcbid0"); + + gpio_request_one(EFIKAMX_PCBID1, GPIOF_IN, "pcbid1"); + + gpio_request_one(EFIKAMX_PCBID2, GPIOF_IN, "pcbid2"); id = gpio_get_value(EFIKAMX_PCBID0); id |= gpio_get_value(EFIKAMX_PCBID1) << 1;
@@ -255,11 +254,10 @@ static void __init mx51_efikamx_init(voi imx51_add_gpio_keys(&mx51_efikamx_powerkey_data); if (system_rev == 0x11) { - gpio_request(EFIKAMX_RESET1_1, "reset"); - gpio_direction_output(EFIKAMX_RESET1_1, 1); + gpio_request_one(EFIKAMX_RESET1_1, GPIOF_OUT_INIT_HIGH, + "reset"); } else { - gpio_request(EFIKAMX_RESET, "reset"); - gpio_direction_output(EFIKAMX_RESET, 1); + gpio_request_one(EFIKAMX_RESET, GPIOF_OUT_INIT_HIGH, "reset"); } /*
@@ -267,12 +265,10 @@ static void __init mx51_efikamx_init(voi * sb and mx have same wlan pin but the value to enable it are * different :/ */ - gpio_request(EFIKA_WLAN_EN, "wlan_en"); - gpio_direction_output(EFIKA_WLAN_EN, 0); + gpio_request_one(EFIKA_WLAN_EN, GPIOF_OUT_INIT_LOW, "wlan_en"); msleep(10); - gpio_request(EFIKA_WLAN_RESET, "wlan_rst"); - gpio_direction_output(EFIKA_WLAN_RESET, 0); + gpio_request_one(EFIKA_WLAN_RESET, GPIOF_OUT_INIT_LOW, "wlan_rst"); msleep(10); gpio_set_value(EFIKA_WLAN_RESET, 1); }
arch/arm/mach-mx5/board-mx51_efikasb.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx51_efikasb.c 2011-03-14 17:19:13.000000000 +0100 +4 -6
@@ -108,8 +108,7 @@ static int initialize_usbh2_port(struct iomux_v3_cfg_t usbh2gpio = MX51_PAD_EIM_A26__GPIO2_20; mxc_iomux_v3_setup_pad(usbh2gpio); - gpio_request(EFIKASB_USBH2_STP, "usbh2_stp"); - gpio_direction_output(EFIKASB_USBH2_STP, 0); + gpio_request_one(EFIKASB_USBH2_STP, GPIOF_OUT_INIT_LOW, "usbh2_stp"); msleep(1); gpio_set_value(EFIKASB_USBH2_STP, 1); msleep(1);
@@ -229,10 +228,9 @@ static void __init mx51_efikasb_board_id { int id; - gpio_request(EFIKASB_PCBID0, "pcb id0"); - gpio_direction_input(EFIKASB_PCBID0); - gpio_request(EFIKASB_PCBID1, "pcb id1"); - gpio_direction_input(EFIKASB_PCBID1); + gpio_request_one(EFIKASB_PCBID0, GPIOF_IN, "pcb id0"); + + gpio_request_one(EFIKASB_PCBID1, GPIOF_IN, "pcb id1"); id = gpio_get_value(EFIKASB_PCBID0); id |= gpio_get_value(EFIKASB_PCBID1) << 1;
arch/arm/mach-mx5/board-mx53_evk.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx53_evk.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -82,12 +82,12 @@ static inline void mx53_evk_fec_reset(vo int ret; /* reset FEC PHY */ - ret = gpio_request(SMD_FEC_PHY_RST, "fec-phy-reset"); + ret = gpio_request_one(SMD_FEC_PHY_RST, GPIOF_OUT_INIT_LOW, + "fec-phy-reset"); if (ret) { printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret); return; } - gpio_direction_output(SMD_FEC_PHY_RST, 0); gpio_set_value(SMD_FEC_PHY_RST, 0); msleep(1); gpio_set_value(SMD_FEC_PHY_RST, 1);
arch/arm/mach-mx5/board-mx53_loco.c 2011-03-20 21:01:49.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx53_loco.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -185,12 +185,12 @@ static inline void mx53_loco_fec_reset(v int ret; /* reset FEC PHY */ - ret = gpio_request(LOCO_FEC_PHY_RST, "fec-phy-reset"); + ret = gpio_request_one(LOCO_FEC_PHY_RST, GPIOF_OUT_INIT_LOW, + "fec-phy-reset"); if (ret) { printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret); return; } - gpio_direction_output(LOCO_FEC_PHY_RST, 0); msleep(1); gpio_set_value(LOCO_FEC_PHY_RST, 1); }
arch/arm/mach-mx5/board-mx53_smd.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx53_smd.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -70,12 +70,12 @@ static inline void mx53_smd_fec_reset(vo int ret; /* reset FEC PHY */ - ret = gpio_request(SMD_FEC_PHY_RST, "fec-phy-reset"); + ret = gpio_request_one(SMD_FEC_PHY_RST, GPIOF_OUT_INIT_LOW, + "fec-phy-reset"); if (ret) { printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret); return; } - gpio_direction_output(SMD_FEC_PHY_RST, 0); msleep(1); gpio_set_value(SMD_FEC_PHY_RST, 1); }
arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c 2011-03-20 21:01:49.000000000 +0100 renamed from arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c 2011-01-19 18:51:18.000000000 +0100 +5 -10
@@ -193,25 +193,20 @@ void __init eukrea_mbimx51_baseboard_ini imx51_add_imx_uart(1, NULL); imx51_add_imx_uart(2, &uart_pdata); - gpio_request(MBIMX51_LED0, "LED0"); - gpio_direction_output(MBIMX51_LED0, 1); + gpio_request_one(MBIMX51_LED0, GPIOF_OUT_INIT_HIGH, "LED0"); gpio_free(MBIMX51_LED0); - gpio_request(MBIMX51_LED1, "LED1"); - gpio_direction_output(MBIMX51_LED1, 1); + gpio_request_one(MBIMX51_LED1, GPIOF_OUT_INIT_HIGH, "LED1"); gpio_free(MBIMX51_LED1); - gpio_request(MBIMX51_LED2, "LED2"); - gpio_direction_output(MBIMX51_LED2, 1); + gpio_request_one(MBIMX51_LED2, GPIOF_OUT_INIT_HIGH, "LED2"); gpio_free(MBIMX51_LED2); - gpio_request(MBIMX51_LED3, "LED3"); - gpio_direction_output(MBIMX51_LED3, 1); + gpio_request_one(MBIMX51_LED3, GPIOF_OUT_INIT_HIGH, "LED3"); gpio_free(MBIMX51_LED3); platform_add_devices(devices, ARRAY_SIZE(devices)); imx51_add_imx_keypad(&mbimx51_map_data); - gpio_request(MBIMX51_TSC2007_GPIO, "tsc2007_irq"); - gpio_direction_input(MBIMX51_TSC2007_GPIO); + gpio_request_one(MBIMX51_TSC2007_GPIO, GPIOF_IN, "tsc2007_irq"); set_irq_type(MBIMX51_TSC2007_IRQ, IRQF_TRIGGER_FALLING); i2c_register_board_info(1, mbimx51_i2c_devices, ARRAY_SIZE(mbimx51_i2c_devices));
arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c 2011-01-09 09:32:57.000000000 +0100 +2 -4
@@ -150,12 +150,10 @@ void __init eukrea_mbimxsd51_baseboard_i imx51_add_sdhci_esdhc_imx(0, NULL); - gpio_request(GPIO_LED1, "LED1"); - gpio_direction_output(GPIO_LED1, 1); + gpio_request_one(GPIO_LED1, GPIOF_OUT_INIT_HIGH, "LED1"); gpio_free(GPIO_LED1); - gpio_request(GPIO_SWITCH1, "SWITCH1"); - gpio_direction_input(GPIO_SWITCH1); + gpio_request_one(GPIO_SWITCH1, GPIOF_IN, "SWITCH1"); gpio_free(GPIO_SWITCH1); i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices,
arch/arm/mach-mx5/mx51_efika.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-mx5/mx51_efika.c 2011-03-14 17:19:13.000000000 +0100 +6 -8
@@ -168,8 +168,7 @@ static int initialize_usbh1_port(struct void __iomem *socregs_base; mxc_iomux_v3_setup_pad(usbh1gpio); - gpio_request(EFIKAMX_USBH1_STP, "usbh1_stp"); - gpio_direction_output(EFIKAMX_USBH1_STP, 0); + gpio_request_one(EFIKAMX_USBH1_STP, GPIOF_OUT_INIT_LOW, "usbh1_stp"); msleep(1); gpio_set_value(EFIKAMX_USBH1_STP, 1); msleep(1);
@@ -200,8 +199,8 @@ static struct mxc_usbh_platform_data usb static void mx51_efika_hubreset(void) { - gpio_request(EFIKAMX_USB_HUB_RESET, "usb_hub_rst"); - gpio_direction_output(EFIKAMX_USB_HUB_RESET, 1); + gpio_request_one(EFIKAMX_USB_HUB_RESET, GPIOF_OUT_INIT_HIGH, + "usb_hub_rst"); msleep(1); gpio_set_value(EFIKAMX_USB_HUB_RESET, 0); msleep(1);
@@ -213,8 +212,8 @@ static void __init mx51_efika_usb(void) mx51_efika_hubreset(); /* pulling it low, means no USB at all... */ - gpio_request(EFIKA_USB_PHY_RESET, "usb_phy_reset"); - gpio_direction_output(EFIKA_USB_PHY_RESET, 0); + gpio_request_one(EFIKA_USB_PHY_RESET, GPIOF_OUT_INIT_LOW, + "usb_phy_reset"); msleep(1); gpio_set_value(EFIKA_USB_PHY_RESET, 1);
@@ -623,8 +622,7 @@ void __init efika_board_common_init(void if (machine_is_mx51_efikasb()) vgen1_init.constraints.max_uV = 1200000; - gpio_request(EFIKAMX_PMIC, "pmic irq"); - gpio_direction_input(EFIKAMX_PMIC); + gpio_request_one(EFIKAMX_PMIC, GPIOF_IN, "pmic irq"); spi_register_board_info(mx51_efika_spi_board_info, ARRAY_SIZE(mx51_efika_spi_board_info)); imx51_add_ecspi(0, &mx51_efika_spi_pdata);
arch/arm/mach-mxs/mach-mx28evk.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-mxs/mach-mx28evk.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -142,13 +142,13 @@ static void __init mx28evk_fec_reset(voi } /* Reset fec phy */ - ret = gpio_request(MX28EVK_FEC_PHY_RESET, "fec-phy-reset"); + ret = gpio_request_one(MX28EVK_FEC_PHY_RESET, GPIOF_OUT_INIT_LOW, + "fec-phy-reset"); if (ret) { pr_err("Failed to request gpio fec-phy-%s: %d\n", "reset", ret); return; } - gpio_direction_output(MX28EVK_FEC_PHY_RESET, 0); if (ret) { pr_err("Failed to drive gpio fec-phy-%s: %d\n", "reset", ret); return;
arch/arm/mach-omap1/board-ams-delta.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-omap1/board-ams-delta.c 2011-02-11 10:53:31.000000000 +0100 +2 -2
@@ -364,12 +364,12 @@ static int __init ams_delta_modem_init(v ams_delta_modem_ports[0].irq = gpio_to_irq(AMS_DELTA_GPIO_PIN_MODEM_IRQ); - err = gpio_request(AMS_DELTA_GPIO_PIN_MODEM_IRQ, "modem"); + err = gpio_request_one(AMS_DELTA_GPIO_PIN_MODEM_IRQ, GPIOF_IN, + "modem"); if (err) { pr_err("Couldn't request gpio pin for modem\n"); return err; } - gpio_direction_input(AMS_DELTA_GPIO_PIN_MODEM_IRQ); ams_delta_latch2_write( AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC,
arch/arm/mach-omap1/board-fsample.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/arm/mach-omap1/board-fsample.c 2011-02-11 10:53:31.000000000 +0100 +1 -2
@@ -299,9 +299,8 @@ static void __init omap_fsample_init(voi { fsample_init_smc91x(); - if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0) + if (gpio_request_one(FSAMPLE_NAND_RB_GPIO_PIN, GPIOF_IN, "NAND ready") < 0) BUG(); - gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN); omap_cfg_reg(L3_1610_FLASH_CS2B_OE); omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
arch/arm/mach-omap1/board-h2-mmc.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/arm/mach-omap1/board-h2-mmc.c 2010-10-04 07:26:41.000000000 +0200 +2 -3
@@ -32,12 +32,11 @@ static int mmc_set_power(struct device * static int mmc_late_init(struct device *dev) { - int ret = gpio_request(H2_TPS_GPIO_MMC_PWR_EN, "MMC power"); + int ret = gpio_request_one(H2_TPS_GPIO_MMC_PWR_EN, + GPIOF_OUT_INIT_LOW, "MMC power"); if (ret < 0) return ret; - gpio_direction_output(H2_TPS_GPIO_MMC_PWR_EN, 0); - return ret; }
arch/arm/mach-omap1/board-h2.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/arm/mach-omap1/board-h2.c 2011-02-11 10:53:31.000000000 +0100 +1 -2
@@ -420,9 +420,8 @@ static void __init h2_init(void) h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; h2_nand_resource.end += SZ_4K - 1; - if (gpio_request(H2_NAND_RB_GPIO_PIN, "NAND ready") < 0) + if (gpio_request_one(H2_NAND_RB_GPIO_PIN, GPIOF_IN, "NAND ready") < 0) BUG(); - gpio_direction_input(H2_NAND_RB_GPIO_PIN); omap_cfg_reg(L3_1610_FLASH_CS2B_OE); omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
arch/arm/mach-omap1/board-h3-mmc.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/arm/mach-omap1/board-h3-mmc.c 2010-10-04 07:26:41.000000000 +0200 +2 -2
@@ -51,10 +51,10 @@ void __init h3_mmc_init(void) { int ret; - ret = gpio_request(H3_TPS_GPIO_MMC_PWR_EN, "MMC power"); + ret = gpio_request_one(H3_TPS_GPIO_MMC_PWR_EN, GPIOF_OUT_INIT_LOW, + "MMC power"); if (ret < 0) return; - gpio_direction_output(H3_TPS_GPIO_MMC_PWR_EN, 0); mmc_data[0] = &mmc1_data; omap1_init_mmc(mmc_data, OMAP16XX_NR_MMC);
arch/arm/mach-omap1/board-h3.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/arm/mach-omap1/board-h3.c 2011-02-11 10:53:31.000000000 +0100 +1 -2
@@ -403,9 +403,8 @@ static void __init h3_init(void) nand_resource.end = nand_resource.start = OMAP_CS2B_PHYS; nand_resource.end += SZ_4K - 1; - if (gpio_request(H3_NAND_RB_GPIO_PIN, "NAND ready") < 0) + if (gpio_request_one(H3_NAND_RB_GPIO_PIN, GPIOF_IN, "NAND ready") < 0) BUG(); - gpio_direction_input(H3_NAND_RB_GPIO_PIN); /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */ /* GPIO10 pullup/down register, Enable pullup on GPIO10 */
arch/arm/mach-omap1/board-htcherald.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-omap1/board-htcherald.c 2011-02-11 10:53:31.000000000 +0100 +8 -10
@@ -536,31 +536,29 @@ static void __init htcherald_usb_enable( unsigned int value = 0; /* Request the GPIOs we need to control here */ - if (gpio_request(HTCHERALD_GPIO_USB_EN1, "herald_usb") < 0) + if (gpio_request_one(HTCHERALD_GPIO_USB_EN1, GPIOF_OUT_INIT_LOW, + "herald_usb") < 0) goto err1; - if (gpio_request(HTCHERALD_GPIO_USB_EN2, "herald_usb") < 0) + if (gpio_request_one(HTCHERALD_GPIO_USB_EN2, GPIOF_OUT_INIT_LOW, + "herald_usb") < 0) goto err2; - if (gpio_request(HTCHERALD_GPIO_USB_DM, "herald_usb") < 0) + if (gpio_request_one(HTCHERALD_GPIO_USB_DM, GPIOF_IN, "herald_usb") < 0) goto err3; - if (gpio_request(HTCHERALD_GPIO_USB_DP, "herald_usb") < 0) + if (gpio_request_one(HTCHERALD_GPIO_USB_DP, GPIOF_IN, "herald_usb") < 0) goto err4; /* force USB_EN GPIO to 0 */ do { - /* output low */ - gpio_direction_output(HTCHERALD_GPIO_USB_EN1, 0); } while ((value = gpio_get_value(HTCHERALD_GPIO_USB_EN1)) == 1 && --tries); if (value == 1) printk(KERN_WARNING "Unable to reset USB, trying to continue\n"); - - gpio_direction_output(HTCHERALD_GPIO_USB_EN2, 0); /* output low */ - gpio_direction_input(HTCHERALD_GPIO_USB_DM); /* input */ - gpio_direction_input(HTCHERALD_GPIO_USB_DP); /* input */ +/* output low */ /* input */ + /* input */ goto done;
arch/arm/mach-omap1/board-nokia770.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/arm/mach-omap1/board-nokia770.c 2011-02-11 10:53:31.000000000 +0100 +4 -4
@@ -221,17 +221,17 @@ static void __init nokia770_mmc_init(voi { int ret; - ret = gpio_request(NOKIA770_GPIO_MMC_POWER, "MMC power"); + ret = gpio_request_one(NOKIA770_GPIO_MMC_POWER, GPIOF_OUT_INIT_LOW, + "MMC power"); if (ret < 0) return; - gpio_direction_output(NOKIA770_GPIO_MMC_POWER, 0); - ret = gpio_request(NOKIA770_GPIO_MMC_SWITCH, "MMC cover"); + ret = gpio_request_one(NOKIA770_GPIO_MMC_SWITCH, GPIOF_IN, + "MMC cover"); if (ret < 0) { gpio_free(NOKIA770_GPIO_MMC_POWER); return; } - gpio_direction_input(NOKIA770_GPIO_MMC_SWITCH); /* Only the second MMC controller is used */ nokia770_mmc_data[1] = &nokia770_mmc2_data;
arch/arm/mach-omap1/board-osk.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/arm/mach-omap1/board-osk.c 2010-12-28 18:26:02.000000000 +0100 +8 -10
@@ -197,19 +197,19 @@ static int osk_tps_setup(struct i2c_clie /* Set GPIO 1 HIGH to disable VBUS power supply; * OHCI driver powers it up/down as needed. */ - gpio_request(OSK_TPS_GPIO_USB_PWR_EN, "n_vbus_en"); - gpio_direction_output(OSK_TPS_GPIO_USB_PWR_EN, 1); + gpio_request_one(OSK_TPS_GPIO_USB_PWR_EN, GPIOF_OUT_INIT_HIGH, + "n_vbus_en"); /* Set GPIO 2 high so LED D3 is off by default */ tps65010_set_gpio_out_value(GPIO2, HIGH); /* Set GPIO 3 low to take ethernet out of reset */ - gpio_request(OSK_TPS_GPIO_LAN_RESET, "smc_reset"); - gpio_direction_output(OSK_TPS_GPIO_LAN_RESET, 0); + gpio_request_one(OSK_TPS_GPIO_LAN_RESET, GPIOF_OUT_INIT_LOW, + "smc_reset"); /* GPIO4 is VDD_DSP */ - gpio_request(OSK_TPS_GPIO_DSP_PWR_EN, "dsp_power"); - gpio_direction_output(OSK_TPS_GPIO_DSP_PWR_EN, 1); + gpio_request_one(OSK_TPS_GPIO_DSP_PWR_EN, GPIOF_OUT_INIT_HIGH, + "dsp_power"); /* REVISIT if DSP support isn't configured, power it off ... */ /* Let LED1 (D9) blink; leds-gpio may override it */
@@ -476,12 +476,10 @@ static void __init osk_mistral_init(void /* omap_cfg_reg(P19_1610_GPIO6); */ /* BUSY */ - gpio_request(6, "ts_busy"); - gpio_direction_input(6); + gpio_request_one(6, GPIOF_IN, "ts_busy"); omap_cfg_reg(P20_1610_GPIO4); /* PENIRQ */ - gpio_request(4, "ts_int"); - gpio_direction_input(4); + gpio_request_one(4, GPIOF_IN, "ts_int"); set_irq_type(gpio_to_irq(4), IRQ_TYPE_EDGE_FALLING); spi_register_board_info(mistral_boardinfo,
arch/arm/mach-omap1/board-palmte.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/arm/mach-omap1/board-palmte.c 2011-02-11 10:53:31.000000000 +0100 +2 -4
@@ -233,18 +233,16 @@ static struct spi_board_info palmte_spi_ static void __init palmte_misc_gpio_setup(void) { /* Set TSC2102 PINTDAV pin as input (used by TSC2102 driver) */ - if (gpio_request(PALMTE_PINTDAV_GPIO, "TSC2102 PINTDAV") < 0) { + if (gpio_request_one(PALMTE_PINTDAV_GPIO, GPIOF_IN, "TSC2102 PINTDAV") < 0) { printk(KERN_ERR "Could not reserve PINTDAV GPIO!\n"); return; } - gpio_direction_input(PALMTE_PINTDAV_GPIO); /* Set USB-or-DC-IN pin as input (unused) */ - if (gpio_request(PALMTE_USB_OR_DC_GPIO, "USB/DC-IN") < 0) { + if (gpio_request_one(PALMTE_USB_OR_DC_GPIO, GPIOF_IN, "USB/DC-IN") < 0) { printk(KERN_ERR "Could not reserve cable signal GPIO!\n"); return; } - gpio_direction_input(PALMTE_USB_OR_DC_GPIO); } static void __init omap_palmte_init(void)
arch/arm/mach-omap1/board-palmz71.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-omap1/board-palmz71.c 2010-12-28 18:26:02.000000000 +0100 +3 -4
@@ -285,19 +285,18 @@ palmz71_gpio_setup(int early) gpio_direction_output(1, 1); } else { /* Set MMC/SD host WP pin as input */ - if (gpio_request(PALMZ71_MMC_WP_GPIO, "MMC WP") < 0) { + if (gpio_request_one(PALMZ71_MMC_WP_GPIO, GPIOF_IN, "MMC WP") < 0) { printk(KERN_ERR "Could not reserve WP GPIO!\n"); return; } - gpio_direction_input(PALMZ71_MMC_WP_GPIO); /* Monitor the Power-cable-connected signal */ - if (gpio_request(PALMZ71_USBDETECT_GPIO, "USB detect") < 0) { + if (gpio_request_one(PALMZ71_USBDETECT_GPIO, GPIOF_IN, + "USB detect") < 0) { printk(KERN_ERR "Could not reserve cable signal GPIO!\n"); return; } - gpio_direction_input(PALMZ71_USBDETECT_GPIO); if (request_irq(gpio_to_irq(PALMZ71_USBDETECT_GPIO), palmz71_powercable, IRQF_SAMPLE_RANDOM, "palmz71-cable", 0))
arch/arm/mach-omap1/board-perseus2.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-omap1/board-perseus2.c 2010-12-28 18:26:02.000000000 +0100 +1 -2
@@ -267,9 +267,8 @@ static void __init omap_perseus2_init(vo { perseus2_init_smc91x(); - if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0) + if (gpio_request_one(P2_NAND_RB_GPIO_PIN, GPIOF_IN, "NAND ready") < 0) BUG(); - gpio_direction_input(P2_NAND_RB_GPIO_PIN); omap_cfg_reg(L3_1610_FLASH_CS2B_OE); omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
arch/arm/mach-omap1/board-sx1.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/arm/mach-omap1/board-sx1.c 2010-12-28 18:26:02.000000000 +0100 +4 -6
@@ -400,12 +400,10 @@ static void __init omap_sx1_init(void) /* turn on USB power */ /* sx1_setusbpower(1); cant do it here because i2c is not ready */ - gpio_request(1, "A_IRDA_OFF"); - gpio_request(11, "A_SWITCH"); - gpio_request(15, "A_USB_ON"); - gpio_direction_output(1, 1); /*A_IRDA_OFF = 1 */ - gpio_direction_output(11, 0); /*A_SWITCH = 0 */ - gpio_direction_output(15, 0); /*A_USB_ON = 0 */ + gpio_request_one(1, GPIOF_OUT_INIT_HIGH, "A_IRDA_OFF"); + gpio_request_one(11, GPIOF_OUT_INIT_LOW, "A_SWITCH"); + gpio_request_one(15, GPIOF_OUT_INIT_LOW, "A_USB_ON");/*A_IRDA_OFF = 1 */ /*A_SWITCH = 0 */ + /*A_USB_ON = 0 */ } /*----------------------------------------*/ static void __init omap_sx1_init_irq(void)
arch/arm/mach-omap1/board-voiceblue.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-omap1/board-voiceblue.c 2011-02-11 10:53:31.000000000 +0100 +2 -4
@@ -264,16 +264,14 @@ static void __init voiceblue_init(void) /* Watchdog */ gpio_request(0, "Watchdog"); /* smc91x reset */ - gpio_request(7, "SMC91x reset"); - gpio_direction_output(7, 1); + gpio_request_one(7, GPIOF_OUT_INIT_HIGH, "SMC91x reset"); udelay(2); /* wait@least 100ns */ gpio_set_value(7, 0); mdelay(50); /* 50ms until PHY ready */ /* smc91x interrupt pin */ gpio_request(8, "SMC91x irq"); /* 16C554 reset*/ - gpio_request(6, "16C554 reset"); - gpio_direction_output(6, 0); + gpio_request_one(6, GPIOF_OUT_INIT_LOW, "16C554 reset"); /* 16C554 interrupt pins */ gpio_request(12, "16C554 irq"); gpio_request(13, "16C554 irq");
arch/arm/mach-omap1/fpga.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/arm/mach-omap1/fpga.c 2011-01-19 18:51:18.000000000 +0100 +1 -2
@@ -177,12 +177,11 @@ void omap1510_fpga_init_irq(void) * NOTE: For general GPIO/MPUIO access and interrupts, please see * gpio.[ch] */ - res = gpio_request(13, "FPGA irq"); + res = gpio_request_one(13, GPIOF_IN, "FPGA irq"); if (res) { pr_err("%s failed to get gpio\n", __func__); return; } - gpio_direction_input(13); set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING); set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux); }
arch/arm/mach-omap1/serial.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-omap1/serial.c 2010-12-26 10:19:06.000000000 +0100 +1 -2
@@ -220,13 +220,12 @@ static void __init omap_serial_set_port_ { int ret; - ret = gpio_request(gpio_nr, "UART wake"); + ret = gpio_request_one(gpio_nr, GPIOF_IN, "UART wake"); if (ret < 0) { printk(KERN_ERR "Could not request UART wake GPIO: %i\n", gpio_nr); return; } - gpio_direction_input(gpio_nr); ret = request_irq(gpio_to_irq(gpio_nr), &omap_serial_wake_interrupt, IRQF_TRIGGER_RISING, "serial wakeup", NULL); if (ret) {
arch/arm/mach-omap2/board-3430sdp.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/arm/mach-omap2/board-3430sdp.c 2011-03-14 17:19:13.000000000 +0100 +6 -11
@@ -132,12 +132,11 @@ static int ts_gpio; /* Needed for ads784 */ static void ads7846_dev_init(void) { - if (gpio_request(ts_gpio, "ADS7846 pendown") < 0) { + if (gpio_request_one(ts_gpio, GPIOF_IN, "ADS7846 pendown") < 0) { printk(KERN_ERR "can't get ads746 pen down GPIO\n"); return; } - gpio_direction_input(ts_gpio); gpio_set_debounce(ts_gpio, 310); }
@@ -190,21 +189,19 @@ static void __init sdp3430_display_init( enable_gpio = SDP3430_LCD_PANEL_ENABLE_GPIO; backlight_gpio = SDP3430_LCD_PANEL_BACKLIGHT_GPIO; - r = gpio_request(enable_gpio, "LCD reset"); + r = gpio_request_one(enable_gpio, GPIOF_OUT_INIT_LOW, "LCD reset"); if (r) { printk(KERN_ERR "failed to get LCD reset GPIO\n"); goto err0; } - r = gpio_request(backlight_gpio, "LCD Backlight"); + r = gpio_request_one(backlight_gpio, GPIOF_OUT_INIT_LOW, + "LCD Backlight"); if (r) { printk(KERN_ERR "failed to get LCD backlight GPIO\n"); goto err1; } - gpio_direction_output(enable_gpio, 0); - gpio_direction_output(backlight_gpio, 0); - return; err1: gpio_free(enable_gpio);
@@ -360,12 +357,10 @@ static int sdp3430_twl_gpio_setup(struct omap2_hsmmc_init(mmc); /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */ - gpio_request(gpio + 7, "sub_lcd_en_bkl"); - gpio_direction_output(gpio + 7, 0); + gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "sub_lcd_en_bkl"); /* gpio + 15 is "sub_lcd_nRST" (output) */ - gpio_request(gpio + 15, "sub_lcd_nRST"); - gpio_direction_output(gpio + 15, 0); + gpio_request_one(gpio + 15, GPIOF_OUT_INIT_LOW, "sub_lcd_nRST"); return 0; }
arch/arm/mach-omap2/board-am3517evm.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/mach-omap2/board-am3517evm.c 2011-03-14 17:19:13.000000000 +0100 +5 -6
@@ -252,30 +252,29 @@ static void __init am3517_evm_display_in /* * Enable GPIO 182 = LCD Backlight Power */ - r = gpio_request(LCD_PANEL_BKLIGHT_PWR, "lcd_backlight_pwr"); + r = gpio_request_one(LCD_PANEL_BKLIGHT_PWR, GPIOF_OUT_INIT_HIGH, + "lcd_backlight_pwr"); if (r) { printk(KERN_ERR "failed to get lcd_backlight_pwr\n"); return; } - gpio_direction_output(LCD_PANEL_BKLIGHT_PWR, 1); /* * Enable GPIO 181 = LCD Panel PWM */ - r = gpio_request(LCD_PANEL_PWM, "lcd_pwm"); + r = gpio_request_one(LCD_PANEL_PWM, GPIOF_OUT_INIT_HIGH, "lcd_pwm"); if (r) { printk(KERN_ERR "failed to get lcd_pwm\n"); goto err_1; } - gpio_direction_output(LCD_PANEL_PWM, 1); /* * Enable GPIO 176 = LCD Panel Power enable pin */ - r = gpio_request(LCD_PANEL_PWR, "lcd_panel_pwr"); + r = gpio_request_one(LCD_PANEL_PWR, GPIOF_OUT_INIT_HIGH, + "lcd_panel_pwr"); if (r) { printk(KERN_ERR "failed to get lcd_panel_pwr\n"); goto err_2; } - gpio_direction_output(LCD_PANEL_PWR, 1); printk(KERN_INFO "Display initialized successfully\n"); return;
arch/arm/mach-omap2/board-apollon.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-omap2/board-apollon.c 2011-03-14 17:19:13.000000000 +0100 +5 -10
@@ -246,13 +246,12 @@ static inline void __init apollon_init_s udelay(100); omap_mux_init_gpio(74, 0); - if (gpio_request(APOLLON_ETHR_GPIO_IRQ, "SMC91x irq") < 0) { + if (gpio_request_one(APOLLON_ETHR_GPIO_IRQ, GPIOF_IN, "SMC91x irq") < 0) { printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", APOLLON_ETHR_GPIO_IRQ); gpmc_cs_free(APOLLON_ETH_CS); goto out; } - gpio_direction_input(APOLLON_ETHR_GPIO_IRQ); out: clk_disable(gpmc_fck);
@@ -284,16 +283,13 @@ static void __init apollon_led_init(void { /* LED0 - AA10 */ omap_mux_init_signal("vlynq_clk.gpio_13", 0); - gpio_request(LED0_GPIO13, "LED0"); - gpio_direction_output(LED0_GPIO13, 0); + gpio_request_one(LED0_GPIO13, GPIOF_OUT_INIT_LOW, "LED0"); /* LED1 - AA6 */ omap_mux_init_signal("vlynq_rx1.gpio_14", 0); - gpio_request(LED1_GPIO14, "LED1"); - gpio_direction_output(LED1_GPIO14, 0); + gpio_request_one(LED1_GPIO14, GPIOF_OUT_INIT_LOW, "LED1"); /* LED2 - AA4 */ omap_mux_init_signal("vlynq_rx0.gpio_15", 0); - gpio_request(LED2_GPIO15, "LED2"); - gpio_direction_output(LED2_GPIO15, 0); + gpio_request_one(LED2_GPIO15, GPIOF_OUT_INIT_LOW, "LED2"); } static void __init apollon_usb_init(void)
@@ -301,8 +297,7 @@ static void __init apollon_usb_init(void /* USB device */ /* DEVICE_SUSPEND */ omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0); - gpio_request(12, "USB suspend"); - gpio_direction_output(12, 0); + gpio_request_one(12, GPIOF_OUT_INIT_LOW, "USB suspend"); omap2_usbfs_init(&apollon_usb_config); }
arch/arm/mach-omap2/board-cm-t3517.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-omap2/board-cm-t3517.c 2011-03-14 17:19:13.000000000 +0100 +2 -3
@@ -148,14 +148,13 @@ static void __init cm_t3517_init_rtc(voi { int err; - err = gpio_request(RTC_CS_EN_GPIO, "rtc cs en"); + err = gpio_request_one(RTC_CS_EN_GPIO, GPIOF_OUT_INIT_HIGH, + "rtc cs en"); if (err) { pr_err("CM-T3517: rtc cs en gpio request failed: %d\n", err); return; } - gpio_direction_output(RTC_CS_EN_GPIO, 1); - platform_device_register(&cm_t3517_rtc_device); } #else
arch/arm/mach-omap2/board-devkit8000.c 2011-03-20 21:01:55.000000000 +0100 renamed from arch/arm/mach-omap2/board-devkit8000.c 2011-03-14 17:19:13.000000000 +0100 +2 -6
@@ -468,14 +468,12 @@ static void __init devkit8000_ads7846_in int gpio = OMAP3_DEVKIT_TS_GPIO; int ret; - ret = gpio_request(gpio, "ads7846_pen_down"); + ret = gpio_request_one(gpio, GPIOF_IN, "ads7846_pen_down"); if (ret < 0) { printk(KERN_ERR "Failed to request GPIO %d for " "ads7846 pen down IRQ\n", gpio); return; } - - gpio_direction_input(gpio); } static int ads7846_get_pendown_state(void)
@@ -551,14 +549,12 @@ static void __init omap_dm9000_init(void unsigned char *eth_addr = omap_dm9000_platdata.dev_addr; struct omap_die_id odi; - if (gpio_request(OMAP_DM9000_GPIO_IRQ, "dm9000 irq") < 0) { + if (gpio_request_one(OMAP_DM9000_GPIO_IRQ, GPIOF_IN, "dm9000 irq") < 0) { printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n", OMAP_DM9000_GPIO_IRQ); return; } - gpio_direction_input(OMAP_DM9000_GPIO_IRQ); - /* init the mac address using DIE id */ omap_get_die_id(&odi);
arch/arm/mach-omap2/board-ldp.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/mach-omap2/board-ldp.c 2011-03-14 17:19:13.000000000 +0100 +2 -4
@@ -206,12 +206,11 @@ static int ts_gpio; */ static void ads7846_dev_init(void) { - if (gpio_request(ts_gpio, "ads7846 irq") < 0) { + if (gpio_request_one(ts_gpio, GPIOF_IN, "ads7846 irq") < 0) { printk(KERN_ERR "can't get ads746 pen down GPIO\n"); return; } - gpio_direction_input(ts_gpio); gpio_set_debounce(ts_gpio, 310); }
@@ -267,12 +266,11 @@ static inline void __init ldp_init_smsc9 ldp_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio); - if (gpio_request(eth_gpio, "smsc911x irq") < 0) { + if (gpio_request_one(eth_gpio, GPIOF_IN, "smsc911x irq") < 0) { printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", eth_gpio); return; } - gpio_direction_input(eth_gpio); } static struct platform_device ldp_lcd_device = {
arch/arm/mach-omap2/board-n8x0.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-omap2/board-n8x0.c 2011-03-14 17:19:13.000000000 +0100 +8 -9
@@ -106,13 +106,13 @@ static void __init n8x0_usb_init(void) static char announce[] __initdata = KERN_INFO "TUSB 6010\n"; /* PM companion chip power control pin */ - ret = gpio_request(TUSB6010_GPIO_ENABLE, "TUSB6010 enable"); + ret = gpio_request_one(TUSB6010_GPIO_ENABLE, GPIOF_OUT_INIT_LOW, + "TUSB6010 enable"); if (ret != 0) { printk(KERN_ERR "Could not get TUSB power GPIO%i\n", TUSB6010_GPIO_ENABLE); return; } - gpio_direction_output(TUSB6010_GPIO_ENABLE, 0); tusb_set_power(0);
@@ -512,27 +512,26 @@ static void __init n8x0_mmc_init(void) mmc1_data.slots[1].ban_openended = 1; } - err = gpio_request(N8X0_SLOT_SWITCH_GPIO, "MMC slot switch"); + err = gpio_request_one(N8X0_SLOT_SWITCH_GPIO, GPIOF_OUT_INIT_LOW, + "MMC slot switch"); if (err) return; - gpio_direction_output(N8X0_SLOT_SWITCH_GPIO, 0); - if (machine_is_nokia_n810()) { - err = gpio_request(N810_EMMC_VSD_GPIO, "MMC slot 2 Vddf"); + err = gpio_request_one(N810_EMMC_VSD_GPIO, + GPIOF_OUT_INIT_LOW, "MMC slot 2 Vddf"); if (err) { gpio_free(N8X0_SLOT_SWITCH_GPIO); return; } - gpio_direction_output(N810_EMMC_VSD_GPIO, 0); - err = gpio_request(N810_EMMC_VIO_GPIO, "MMC slot 2 Vdd"); + err = gpio_request_one(N810_EMMC_VIO_GPIO, + GPIOF_OUT_INIT_LOW, "MMC slot 2 Vdd"); if (err) { gpio_free(N8X0_SLOT_SWITCH_GPIO); gpio_free(N810_EMMC_VSD_GPIO); return; } - gpio_direction_output(N810_EMMC_VIO_GPIO, 0); } mmc_data[0] = &mmc1_data;
arch/arm/mach-omap2/board-omap3beagle.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap3beagle.c 2011-03-14 17:19:13.000000000 +0100 +5 -10
@@ -88,22 +88,18 @@ static void __init omap3_beagle_init_rev omap_mux_init_gpio(172, OMAP_PIN_INPUT_PULLUP); omap_mux_init_gpio(173, OMAP_PIN_INPUT_PULLUP); - ret = gpio_request(171, "rev_id_0"); + ret = gpio_request_one(171, GPIOF_IN, "rev_id_0"); if (ret < 0) goto fail0; - ret = gpio_request(172, "rev_id_1"); + ret = gpio_request_one(172, GPIOF_IN, "rev_id_1"); if (ret < 0) goto fail1; - ret = gpio_request(173, "rev_id_2"); + ret = gpio_request_one(173, GPIOF_IN, "rev_id_2"); if (ret < 0) goto fail2; - gpio_direction_input(171); - gpio_direction_input(172); - gpio_direction_input(173); - beagle_rev = gpio_get_value(171) | (gpio_get_value(172) << 1) | (gpio_get_value(173) << 2);
@@ -243,13 +239,12 @@ static void __init beagle_display_init(v { int r; - r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset"); + r = gpio_request_one(beagle_dvi_device.reset_gpio, + GPIOF_OUT_INIT_LOW, "DVI reset"); if (r < 0) { printk(KERN_ERR "Unable to get DVI reset GPIO\n"); return; } - - gpio_direction_output(beagle_dvi_device.reset_gpio, 0); } #include "sdram-micron-mt46h32m32lf-6.h"
arch/arm/mach-omap2/board-omap3evm.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap3evm.c 2011-03-14 17:19:13.000000000 +0100 +19 -22
111 lines not on this page · raw message
arch/arm/mach-omap2/board-omap3pandora.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap3pandora.c 2011-03-14 17:19:13.000000000 +0100 +1 -3
@@ -575,14 +575,12 @@ static void __init omap3pandora_ads7846_ int gpio = OMAP3_PANDORA_TS_GPIO; int ret; - ret = gpio_request(gpio, "ads7846_pen_down"); + ret = gpio_request_one(gpio, GPIOF_IN, "ads7846_pen_down"); if (ret < 0) { printk(KERN_ERR "Failed to request GPIO %d for " "ads7846 pen down IRQ\n", gpio); return; } - - gpio_direction_input(gpio); } static int ads7846_get_pendown_state(void)
arch/arm/mach-omap2/board-omap3stalker.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap3stalker.c 2011-03-14 17:19:13.000000000 +0100 +7 -9
@@ -107,15 +107,14 @@ static inline void __init omap3stalker_i rate = clk_get_rate(l3ck); omap_mux_init_gpio(19, OMAP_PIN_INPUT_PULLUP); - if (gpio_request(OMAP3STALKER_ETHR_GPIO_IRQ, "SMC911x irq") < 0) { + if (gpio_request_one(OMAP3STALKER_ETHR_GPIO_IRQ, GPIOF_IN, + "SMC911x irq") < 0) { printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n", OMAP3STALKER_ETHR_GPIO_IRQ); return; } - gpio_direction_input(OMAP3STALKER_ETHR_GPIO_IRQ); - platform_device_register(&omap3stalker_smsc911x_device); }
@@ -365,12 +364,11 @@ omap3stalker_twl_gpio_setup(struct devic */ /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */ - gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL"); - gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); + gpio_request_one(gpio + TWL4030_GPIO_MAX, GPIOF_OUT_INIT_LOW, + "EN_LCD_BKL"); /* gpio + 7 == DVI Enable */ - gpio_request(gpio + 7, "EN_DVI"); - gpio_direction_output(gpio + 7, 0); + gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "EN_DVI"); /* TWL4030_GPIO_MAX + 1 == ledB (out, mmc0) */ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
@@ -534,10 +532,10 @@ static int __init omap3_stalker_i2c_init #define OMAP3_STALKER_TS_GPIO 175 static void ads7846_dev_init(void) { - if (gpio_request(OMAP3_STALKER_TS_GPIO, "ADS7846 pendown") < 0) + if (gpio_request_one(OMAP3_STALKER_TS_GPIO, GPIOF_IN, + "ADS7846 pendown") < 0) printk(KERN_ERR "can't get ads7846 pen down GPIO\n"); - gpio_direction_input(OMAP3_STALKER_TS_GPIO); gpio_set_debounce(OMAP3_STALKER_TS_GPIO, 310); }
arch/arm/mach-omap2/board-omap3touchbook.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap3touchbook.c 2011-03-14 17:19:13.000000000 +0100 +6 -9
@@ -155,12 +155,11 @@ static int touchbook_twl_gpio_setup(stru * power switch and overcurrent detect */ - gpio_request(gpio + 1, "EHCI_nOC"); - gpio_direction_input(gpio + 1); + gpio_request_one(gpio + 1, GPIOF_IN, "EHCI_nOC"); /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */ - gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR"); - gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); + gpio_request_one(gpio + TWL4030_GPIO_MAX, GPIOF_OUT_INIT_LOW, + "nEN_USB_PWR"); /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
@@ -303,13 +302,12 @@ static int __init omap3_touchbook_i2c_in static void __init omap3_ads7846_init(void) { - if (gpio_request(OMAP3_TS_GPIO, "ads7846_pen_down")) { + if (gpio_request_one(OMAP3_TS_GPIO, GPIOF_IN, "ads7846_pen_down")) { printk(KERN_ERR "Failed to request GPIO %d for " "ads7846 pen down IRQ\n", OMAP3_TS_GPIO); return; } - gpio_direction_input(OMAP3_TS_GPIO); gpio_set_debounce(OMAP3_TS_GPIO, 310); }
@@ -483,13 +481,12 @@ static void omap3_touchbook_poweroff(voi { int r; - r = gpio_request(TB_KILL_POWER_GPIO, "DVI reset"); + r = gpio_request_one(TB_KILL_POWER_GPIO, GPIOF_OUT_INIT_LOW, + "DVI reset"); if (r < 0) { printk(KERN_ERR "Unable to get kill power GPIO\n"); return; } - - gpio_direction_output(TB_KILL_POWER_GPIO, 0); } static int __init early_touchbook_revision(char *p)
arch/arm/mach-omap2/board-rx51-peripherals.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-omap2/board-rx51-peripherals.c 2011-03-14 17:19:13.000000000 +0100 +2 -4
@@ -557,10 +557,8 @@ static __init void rx51_init_si4713(void static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) { /* FIXME this gpio setup is just a placeholder for now */ - gpio_request(gpio + 6, "backlight_pwm"); - gpio_direction_output(gpio + 6, 0); - gpio_request(gpio + 7, "speaker_en"); - gpio_direction_output(gpio + 7, 1); + gpio_request_one(gpio + 6, GPIOF_OUT_INIT_LOW, "backlight_pwm"); + gpio_request_one(gpio + 7, GPIOF_OUT_INIT_HIGH, "speaker_en"); return 0; }
arch/arm/mach-omap2/board-rx51-video.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-omap2/board-rx51-video.c 2011-02-19 08:28:51.000000000 +0100 +2 -3
@@ -76,13 +76,12 @@ static int __init rx51_video_init(void) return 0; } - if (gpio_request(RX51_LCD_RESET_GPIO, "LCD ACX565AKM reset")) { + if (gpio_request_one(RX51_LCD_RESET_GPIO, GPIOF_OUT_INIT_HIGH, + "LCD ACX565AKM reset")) { pr_err("%s failed to get LCD Reset GPIO\n", __func__); return 0; } - gpio_direction_output(RX51_LCD_RESET_GPIO, 1); - omap_display_init(&rx51_dss_board_info); return 0; }
arch/arm/mach-omap2/board-zoom-debugboard.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/arm/mach-omap2/board-zoom-debugboard.c 2010-10-14 18:30:03.000000000 +0200 +4 -6
@@ -74,12 +74,11 @@ static inline void __init zoom_init_smsc zoom_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio); - if (gpio_request(eth_gpio, "smsc911x irq") < 0) { + if (gpio_request_one(eth_gpio, GPIOF_IN, "smsc911x irq") < 0) { printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", eth_gpio); return; } - gpio_direction_input(eth_gpio); } static struct plat_serial8250_port serial_platform_data[] = {
@@ -120,12 +119,11 @@ static inline void __init zoom_init_quad quart_gpio = ZOOM_QUADUART_GPIO; - if (gpio_request(quart_gpio, "TL16CP754C GPIO") < 0) { + if (gpio_request_one(quart_gpio, GPIOF_IN, "TL16CP754C GPIO") < 0) { printk(KERN_ERR "Failed to request GPIO%d for TL16CP754C\n", quart_gpio); return; } - gpio_direction_input(quart_gpio); } static inline int omap_zoom_debugboard_detect(void)
@@ -135,12 +133,12 @@ static inline int omap_zoom_debugboard_d debug_board_detect = ZOOM_SMSC911X_GPIO; - if (gpio_request(debug_board_detect, "Zoom debug board detect") < 0) { + if (gpio_request_one(debug_board_detect, GPIOF_IN, + "Zoom debug board detect") < 0) { printk(KERN_ERR "Failed to request GPIO%d for Zoom debug" "board detect\n", debug_board_detect); return 0; } - gpio_direction_input(debug_board_detect); if (!gpio_get_value(debug_board_detect)) { ret = 0;
arch/arm/mach-omap2/board-zoom-display.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/mach-omap2/board-zoom-display.c 2011-02-19 08:28:51.000000000 +0100 +4 -4
@@ -30,21 +30,21 @@ static void zoom_lcd_panel_init(void) LCD_PANEL_RESET_GPIO_PROD : LCD_PANEL_RESET_GPIO_PILOT; - ret = gpio_request(lcd_panel_reset_gpio, "lcd reset"); + ret = gpio_request_one(lcd_panel_reset_gpio, GPIOF_OUT_INIT_HIGH, + "lcd reset"); if (ret) { pr_err("Failed to get LCD reset GPIO (gpio%d).\n", lcd_panel_reset_gpio); return; } - gpio_direction_output(lcd_panel_reset_gpio, 1); - ret = gpio_request(LCD_PANEL_QVGA_GPIO, "lcd qvga"); + ret = gpio_request_one(LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, + "lcd qvga"); if (ret) { pr_err("Failed to get LCD_PANEL_QVGA_GPIO (gpio%d).\n", LCD_PANEL_QVGA_GPIO); goto err0; } - gpio_direction_output(LCD_PANEL_QVGA_GPIO, 1); return; err0:
arch/arm/mach-omap2/board-zoom-peripherals.c 2011-03-20 21:01:55.000000000 +0100 renamed from arch/arm/mach-omap2/board-zoom-peripherals.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -276,13 +276,13 @@ static int zoom_twl_gpio_setup(struct de zoom_vsim_supply.dev = mmc[0].dev; zoom_vmmc2_supply.dev = mmc[1].dev; - ret = gpio_request(LCD_PANEL_ENABLE_GPIO, "lcd enable"); + ret = gpio_request_one(LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, + "lcd enable"); if (ret) { pr_err("Failed to get LCD_PANEL_ENABLE_GPIO (gpio%d).\n", LCD_PANEL_ENABLE_GPIO); return ret; } - gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0); return ret; }
arch/arm/mach-omap2/gpmc-smc91x.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-omap2/gpmc-smc91x.c 2009-12-12 00:23:19.000000000 +0100 +5 -6
@@ -147,25 +147,24 @@ void __init gpmc_smc91x_init(struct omap goto free1; } - if (gpio_request(gpmc_cfg->gpio_irq, "SMC91X irq") < 0) + if (gpio_request_one(gpmc_cfg->gpio_irq, GPIOF_IN, "SMC91X irq") < 0) goto free1; - gpio_direction_input(gpmc_cfg->gpio_irq); gpmc_smc91x_resources[1].start = gpio_to_irq(gpmc_cfg->gpio_irq); if (gpmc_cfg->gpio_pwrdwn) { - ret = gpio_request(gpmc_cfg->gpio_pwrdwn, "SMC91X powerdown"); + ret = gpio_request_one(gpmc_cfg->gpio_pwrdwn, + GPIOF_OUT_INIT_LOW, "SMC91X powerdown"); if (ret) goto free2; - gpio_direction_output(gpmc_cfg->gpio_pwrdwn, 0); } if (gpmc_cfg->gpio_reset) { - ret = gpio_request(gpmc_cfg->gpio_reset, "SMC91X reset"); + ret = gpio_request_one(gpmc_cfg->gpio_reset, + GPIOF_OUT_INIT_LOW, "SMC91X reset"); if (ret) goto free3; - gpio_direction_output(gpmc_cfg->gpio_reset, 0); gpio_set_value(gpmc_cfg->gpio_reset, 1); msleep(100); gpio_set_value(gpmc_cfg->gpio_reset, 0);
arch/arm/mach-omap2/gpmc-smsc911x.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/mach-omap2/gpmc-smsc911x.c 2010-09-30 17:54:14.000000000 +0200 +3 -4
@@ -71,26 +71,25 @@ void __init gpmc_smsc911x_init(struct om gpmc_smsc911x_resources[0].start = cs_mem_base + 0x0; gpmc_smsc911x_resources[0].end = cs_mem_base + 0xff; - if (gpio_request(gpmc_cfg->gpio_irq, "smsc911x irq") < 0) { + if (gpio_request_one(gpmc_cfg->gpio_irq, GPIOF_IN, "smsc911x irq") < 0) { printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", gpmc_cfg->gpio_irq); goto free1; } - gpio_direction_input(gpmc_cfg->gpio_irq); gpmc_smsc911x_resources[1].start = gpio_to_irq(gpmc_cfg->gpio_irq); gpmc_smsc911x_resources[1].flags |= (gpmc_cfg->flags & IRQF_TRIGGER_MASK); if (gpio_is_valid(gpmc_cfg->gpio_reset)) { - ret = gpio_request(gpmc_cfg->gpio_reset, "smsc911x reset"); + ret = gpio_request_one(gpmc_cfg->gpio_reset, + GPIOF_OUT_INIT_HIGH, "smsc911x reset"); if (ret) { printk(KERN_ERR "Failed to request GPIO%d for smsc911x reset\n", gpmc_cfg->gpio_reset); goto free2; } - gpio_direction_output(gpmc_cfg->gpio_reset, 1); gpio_set_value(gpmc_cfg->gpio_reset, 0); msleep(100); gpio_set_value(gpmc_cfg->gpio_reset, 1);
arch/arm/mach-omap2/usb-tusb6010.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/mach-omap2/usb-tusb6010.c 2010-12-28 18:26:02.000000000 +0100 +1 -2
@@ -293,12 +293,11 @@ tusb6010_setup_interface(struct musb_hdr ); /* IRQ */ - status = gpio_request(irq, "TUSB6010 irq"); + status = gpio_request_one(irq, GPIOF_IN, "TUSB6010 irq"); if (status < 0) { printk(error, 3, status); return status; } - gpio_direction_input(irq); tusb_resources[2].start = irq + IH_GPIO_BASE; /* set up memory timings ... can speed them up later */
arch/arm/mach-orion5x/dns323-setup.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/arm/mach-orion5x/dns323-setup.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -642,8 +642,8 @@ static void __init dns323_init(void) * DNS323_GPIO_LED_POWER1 to also be low. */ dns323ab_leds[0].active_low = 1; - gpio_request(DNS323_GPIO_LED_POWER1, "Power Led Enable"); - gpio_direction_output(DNS323_GPIO_LED_POWER1, 0); + gpio_request_one(DNS323_GPIO_LED_POWER1, GPIOF_OUT_INIT_LOW, + "Power Led Enable"); /* Fall through */ case DNS323_REV_B1: i2c_register_board_info(0, dns323ab_i2c_devices,
arch/arm/mach-pxa/cm-x270.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-pxa/cm-x270.c 2010-12-31 15:18:30.000000000 +0100 +1 -2
@@ -208,10 +208,9 @@ static int cmx270_marathon_probe(struct int gpio, err; for (gpio = 58; gpio <= 77; gpio++) { - err = gpio_request(gpio, "LCD"); + err = gpio_request_one(gpio, GPIOF_IN, "LCD"); if (err) return err; - gpio_direction_input(gpio); } pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_marathon_on));
arch/arm/mach-pxa/cm-x300.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-pxa/cm-x300.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -484,14 +484,14 @@ static int cm_x300_ulpi_phy_reset(void) int err; /* reset the PHY */ - err = gpio_request(GPIO_ULPI_PHY_RST, "ulpi reset"); + err = gpio_request_one(GPIO_ULPI_PHY_RST, GPIOF_OUT_INIT_LOW, + "ulpi reset"); if (err) { pr_err("%s: failed to request ULPI reset GPIO: %d\n", __func__, err); return err; } - gpio_direction_output(GPIO_ULPI_PHY_RST, 0); msleep(10); gpio_set_value(GPIO_ULPI_PHY_RST, 1); msleep(10);
arch/arm/mach-pxa/colibri-pxa3xx.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-pxa/colibri-pxa3xx.c 2010-12-28 18:26:02.000000000 +0100 +1 -2
@@ -103,8 +103,7 @@ static struct pxafb_mach_info sharp_lq43 void __init colibri_pxa3xx_init_lcd(int bl_pin) { lcd_bl_pin = bl_pin; - gpio_request(bl_pin, "lcd backlight"); - gpio_direction_output(bl_pin, 0); + gpio_request_one(bl_pin, GPIOF_OUT_INIT_LOW, "lcd backlight"); set_pxa_fb_info(&sharp_lq43_info); } #endif
arch/arm/mach-pxa/em-x270.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-pxa/em-x270.c 2011-03-14 17:19:13.000000000 +0100 +15 -23
@@ -379,23 +379,19 @@ static void __init em_x270_init_nand(voi { int err; - err = gpio_request(GPIO11_NAND_CS, "NAND CS"); + err = gpio_request_one(GPIO11_NAND_CS, GPIOF_OUT_INIT_HIGH, "NAND CS"); if (err) { pr_warning("EM-X270: failed to request NAND CS gpio\n"); return; } - gpio_direction_output(GPIO11_NAND_CS, 1); - - err = gpio_request(nand_rb, "NAND R/B"); + err = gpio_request_one(nand_rb, GPIOF_IN, "NAND R/B"); if (err) { pr_warning("EM-X270: failed to request NAND R/B gpio\n"); gpio_free(GPIO11_NAND_CS); return; } - gpio_direction_input(nand_rb); - platform_device_register(&em_x270_nand); } #else
@@ -469,17 +465,16 @@ static int em_x270_usb_hub_init(void) if (IS_ERR(em_x270_usb_ldo)) return PTR_ERR(em_x270_usb_ldo); - err = gpio_request(GPIO9_USB_VBUS_EN, "vbus en"); + err = gpio_request_one(GPIO9_USB_VBUS_EN, GPIOF_OUT_INIT_LOW, + "vbus en"); if (err) goto err_free_usb_ldo; - err = gpio_request(usb_hub_reset, "hub rst"); + err = gpio_request_one(usb_hub_reset, GPIOF_OUT_INIT_HIGH, "hub rst"); if (err) goto err_free_vbus_gpio; /* USB Hub power-on and reset */ - gpio_direction_output(usb_hub_reset, 1); - gpio_direction_output(GPIO9_USB_VBUS_EN, 0); regulator_enable(em_x270_usb_ldo); gpio_set_value(usb_hub_reset, 0); gpio_set_value(usb_hub_reset, 1);
@@ -568,21 +563,20 @@ static int em_x270_mci_init(struct devic } if (machine_is_em_x270()) { - err = gpio_request(GPIO95_MMC_WP, "MMC WP"); + err = gpio_request_one(GPIO95_MMC_WP, GPIOF_IN, "MMC WP"); if (err) { dev_err(dev, "can't request MMC write protect: %d\n", err); goto err_gpio_wp; } - gpio_direction_input(GPIO95_MMC_WP); } else { - err = gpio_request(GPIO38_SD_PWEN, "sdio power"); + err = gpio_request_one(GPIO38_SD_PWEN, GPIOF_OUT_INIT_HIGH, + "sdio power"); if (err) { dev_err(dev, "can't request MMC power control : %d\n", err); goto err_gpio_wp; } - gpio_direction_output(GPIO38_SD_PWEN, 1); } return 0;
@@ -732,29 +726,29 @@ static unsigned long em_x270_libertas_pi static int em_x270_libertas_setup(struct spi_device *spi) { - int err = gpio_request(GPIO115_WLAN_PWEN, "WLAN PWEN"); + int err = gpio_request_one(GPIO115_WLAN_PWEN, GPIOF_OUT_INIT_LOW, + "WLAN PWEN"); if (err) return err; - err = gpio_request(GPIO19_WLAN_STRAP, "WLAN STRAP"); + err = gpio_request_one(GPIO19_WLAN_STRAP, GPIOF_OUT_INIT_HIGH, + "WLAN STRAP"); if (err) goto err_free_pwen; if (machine_is_exeda()) { - err = gpio_request(GPIO37_WLAN_RST, "WLAN RST"); + err = gpio_request_one(GPIO37_WLAN_RST, GPIOF_OUT_INIT_HIGH, + "WLAN RST"); if (err) goto err_free_strap; - gpio_direction_output(GPIO37_WLAN_RST, 1); msleep(100); } - gpio_direction_output(GPIO19_WLAN_STRAP, 1); msleep(100); pxa2xx_mfp_config(ARRAY_AND_SIZE(em_x270_libertas_pin_config)); - gpio_direction_output(GPIO115_WLAN_PWEN, 0); msleep(100); gpio_set_value(GPIO115_WLAN_PWEN, 1); msleep(100);
@@ -951,12 +945,10 @@ static int em_x270_sensor_init(void) { int ret; - ret = gpio_request(cam_reset, "camera reset"); + ret = gpio_request_one(cam_reset, GPIOF_OUT_INIT_LOW, "camera reset"); if (ret) return ret; - gpio_direction_output(cam_reset, 0); - em_x270_camera_ldo = regulator_get(NULL, "vcc cam"); if (em_x270_camera_ldo == NULL) { gpio_free(cam_reset);
arch/arm/mach-pxa/eseries.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-pxa/eseries.c 2010-12-28 18:26:02.000000000 +0100 +2 -4
@@ -97,10 +97,8 @@ int eseries_tmio_resume(struct platform_ void eseries_get_tmio_gpios(void) { - gpio_request(GPIO_ESERIES_TMIO_SUSPEND, NULL); - gpio_request(GPIO_ESERIES_TMIO_PCLR, NULL); - gpio_direction_output(GPIO_ESERIES_TMIO_SUSPEND, 0); - gpio_direction_output(GPIO_ESERIES_TMIO_PCLR, 0); + gpio_request_one(GPIO_ESERIES_TMIO_SUSPEND, GPIOF_OUT_INIT_LOW, NULL); + gpio_request_one(GPIO_ESERIES_TMIO_PCLR, GPIOF_OUT_INIT_LOW, NULL); } /* TMIO controller uses the same resources on all e-series machines. */
arch/arm/mach-pxa/ezx.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/arm/mach-pxa/ezx.c 2011-03-14 17:19:13.000000000 +0100 +6 -10
@@ -702,21 +702,19 @@ static int a780_camera_init(void) * GPIO50_nCAM_EN is active low * GPIO19_GEN1_CAM_RST is active on rising edge */ - err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN"); + err = gpio_request_one(GPIO50_nCAM_EN, GPIOF_OUT_INIT_HIGH, "nCAM_EN"); if (err) { pr_err("%s: Failed to request nCAM_EN\n", __func__); goto fail; } - err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST"); + err = gpio_request_one(GPIO19_GEN1_CAM_RST, GPIOF_OUT_INIT_LOW, + "CAM_RST"); if (err) { pr_err("%s: Failed to request CAM_RST\n", __func__); goto fail_gpio_cam_rst; } - gpio_direction_output(GPIO50_nCAM_EN, 1); - gpio_direction_output(GPIO19_GEN1_CAM_RST, 0); - return 0; fail_gpio_cam_rst:
@@ -971,21 +969,19 @@ static int a910_camera_init(void) * GPIO50_nCAM_EN is active low * GPIO28_GEN2_CAM_RST is active on rising edge */ - err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN"); + err = gpio_request_one(GPIO50_nCAM_EN, GPIOF_OUT_INIT_HIGH, "nCAM_EN"); if (err) { pr_err("%s: Failed to request nCAM_EN\n", __func__); goto fail; } - err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST"); + err = gpio_request_one(GPIO28_GEN2_CAM_RST, GPIOF_OUT_INIT_LOW, + "CAM_RST"); if (err) { pr_err("%s: Failed to request CAM_RST\n", __func__); goto fail_gpio_cam_rst; } - gpio_direction_output(GPIO50_nCAM_EN, 1); - gpio_direction_output(GPIO28_GEN2_CAM_RST, 0); - return 0; fail_gpio_cam_rst:
arch/arm/mach-pxa/magician.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-pxa/magician.c 2011-03-14 17:19:13.000000000 +0100 +8 -8
@@ -748,15 +748,15 @@ static void __init magician_init(void) lcd_select = board_id & 0x8; pr_info("LCD type: %s\n", lcd_select ? "Samsung" : "Toppoly"); if (lcd_select && (system_rev < 3)) { - gpio_request(GPIO75_MAGICIAN_SAMSUNG_POWER, "SAMSUNG_POWER"); - gpio_direction_output(GPIO75_MAGICIAN_SAMSUNG_POWER, 0); + gpio_request_one(GPIO75_MAGICIAN_SAMSUNG_POWER, + GPIOF_OUT_INIT_LOW, "SAMSUNG_POWER"); } - gpio_request(GPIO104_MAGICIAN_LCD_POWER_1, "LCD_POWER_1"); - gpio_request(GPIO105_MAGICIAN_LCD_POWER_2, "LCD_POWER_2"); - gpio_request(GPIO106_MAGICIAN_LCD_POWER_3, "LCD_POWER_3"); - gpio_direction_output(GPIO104_MAGICIAN_LCD_POWER_1, 0); - gpio_direction_output(GPIO105_MAGICIAN_LCD_POWER_2, 0); - gpio_direction_output(GPIO106_MAGICIAN_LCD_POWER_3, 0); + gpio_request_one(GPIO104_MAGICIAN_LCD_POWER_1, + GPIOF_OUT_INIT_LOW, "LCD_POWER_1"); + gpio_request_one(GPIO105_MAGICIAN_LCD_POWER_2, + GPIOF_OUT_INIT_LOW, "LCD_POWER_2"); + gpio_request_one(GPIO106_MAGICIAN_LCD_POWER_3, + GPIOF_OUT_INIT_LOW, "LCD_POWER_3"); set_pxa_fb_info(lcd_select ? &samsung_info : &toppoly_info); } else pr_err("LCD detection: CPLD mapping failed\n");
arch/arm/mach-pxa/poodle.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-pxa/poodle.c 2011-03-14 17:19:13.000000000 +0100 +4 -5
@@ -234,17 +234,16 @@ static int poodle_mci_init(struct device { int err; - err = gpio_request(POODLE_GPIO_SD_PWR, "SD_PWR"); + err = gpio_request_one(POODLE_GPIO_SD_PWR, GPIOF_OUT_INIT_LOW, + "SD_PWR"); if (err) goto err_free_2; - err = gpio_request(POODLE_GPIO_SD_PWR1, "SD_PWR1"); + err = gpio_request_one(POODLE_GPIO_SD_PWR1, GPIOF_OUT_INIT_LOW, + "SD_PWR1"); if (err) goto err_free_3; - gpio_direction_output(POODLE_GPIO_SD_PWR, 0); - gpio_direction_output(POODLE_GPIO_SD_PWR1, 0); - return 0; err_free_3:
arch/arm/mach-pxa/saar.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/arm/mach-pxa/saar.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -413,13 +413,13 @@ static void ltm022a97a_lcd_power(int on, int err; if (!pin_requested) { - err = gpio_request(GPIO_LCD_RESET, "lcd reset"); + err = gpio_request_one(GPIO_LCD_RESET, GPIOF_OUT_INIT_LOW, + "lcd reset"); if (err) { pr_err("failed to request gpio for LCD reset\n"); return; } - gpio_direction_output(GPIO_LCD_RESET, 0); pin_requested = 1; }
arch/arm/mach-pxa/sharpsl_pm.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-pxa/sharpsl_pm.c 2010-12-28 18:26:03.000000000 +0100 +7 -6
@@ -899,12 +899,13 @@ static int __devinit sharpsl_pm_probe(st sharpsl_pm.machinfo->init(); - gpio_request(sharpsl_pm.machinfo->gpio_acin, "AC IN"); - gpio_direction_input(sharpsl_pm.machinfo->gpio_acin); - gpio_request(sharpsl_pm.machinfo->gpio_batfull, "Battery Full"); - gpio_direction_input(sharpsl_pm.machinfo->gpio_batfull); - gpio_request(sharpsl_pm.machinfo->gpio_batlock, "Battery Lock"); - gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock); + gpio_request_one(sharpsl_pm.machinfo->gpio_acin, GPIOF_IN, "AC IN"); + + gpio_request_one(sharpsl_pm.machinfo->gpio_batfull, GPIOF_IN, + "Battery Full"); + + gpio_request_one(sharpsl_pm.machinfo->gpio_batlock, GPIOF_IN, + "Battery Lock"); /* Register interrupt handlers */ if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) {
arch/arm/mach-pxa/stargate2.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-pxa/stargate2.c 2011-03-14 17:19:13.000000000 +0100 +5 -6
@@ -693,19 +693,18 @@ static int stargate2_mci_init(struct dev { int err; - err = gpio_request(SG2_SD_POWER_ENABLE, "SG2_sd_power_enable"); + err = gpio_request_one(SG2_SD_POWER_ENABLE, GPIOF_OUT_INIT_LOW, + "SG2_sd_power_enable"); if (err) { printk(KERN_ERR "Can't get the gpio for SD power control"); goto return_err; } - gpio_direction_output(SG2_SD_POWER_ENABLE, 0); - err = gpio_request(SG2_GPIO_nSD_DETECT, "SG2_sd_detect"); + err = gpio_request_one(SG2_GPIO_nSD_DETECT, GPIOF_IN, "SG2_sd_detect"); if (err) { printk(KERN_ERR "Can't get the sd detect gpio"); goto free_power_en; } - gpio_direction_input(SG2_GPIO_nSD_DETECT); err = request_irq(IRQ_GPIO(SG2_GPIO_nSD_DETECT), stargate2_detect_int,
@@ -799,12 +798,12 @@ static struct at24_platform_data pca9500 static int stargate2_reset_bluetooth(void) { int err; - err = gpio_request(SG2_BT_RESET, "SG2_BT_RESET"); + err = gpio_request_one(SG2_BT_RESET, GPIOF_OUT_INIT_HIGH, + "SG2_BT_RESET"); if (err) { printk(KERN_ERR "Could not get gpio for bluetooth reset\n"); return err; } - gpio_direction_output(SG2_BT_RESET, 1); mdelay(5); /* now reset it - 5 msec minimum */ gpio_set_value(SG2_BT_RESET, 0);
arch/arm/mach-pxa/zylonite_pxa300.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-pxa/zylonite_pxa300.c 2011-03-14 17:19:13.000000000 +0100 +1 -2
@@ -197,8 +197,7 @@ static void __init zylonite_detect_lcd_p for (i = 0; i < NUM_LCD_DETECT_PINS; i++) { id = id << 1; gpio = mfp_to_gpio(lcd_detect_pins[i]); - gpio_request(gpio, "LCD_ID_PINS"); - gpio_direction_input(gpio); + gpio_request_one(gpio, GPIOF_IN, "LCD_ID_PINS"); if (gpio_get_value(gpio)) id = id | 0x1;
arch/arm/mach-pxa/zylonite_pxa320.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-pxa/zylonite_pxa320.c 2010-01-12 18:05:01.000000000 +0100 +1 -2
@@ -176,8 +176,7 @@ static void __init zylonite_detect_lcd_p for (i = 0; i < NUM_LCD_DETECT_PINS; i++) { id = id << 1; gpio = mfp_to_gpio(lcd_detect_pins[i]); - gpio_request(gpio, "LCD_ID_PINS"); - gpio_direction_input(gpio); + gpio_request_one(gpio, GPIOF_IN, "LCD_ID_PINS"); if (gpio_get_value(gpio)) id = id | 0x1;
arch/arm/mach-s3c2410/mach-h1940.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-s3c2410/mach-h1940.c 2011-03-14 17:19:13.000000000 +0100 +22 -36
83 lines not on this page · raw message
arch/arm/mach-s3c2410/mach-qt2410.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/arm/mach-s3c2410/mach-qt2410.c 2010-10-23 19:40:31.000000000 +0200 +2 -2
@@ -354,8 +354,8 @@ static void __init qt2410_machine_init(v s3c24xx_udc_set_platdata(&qt2410_udc_cfg); s3c_i2c0_set_platdata(NULL); - WARN_ON(gpio_request(S3C2410_GPB(5), "spi cs")); - gpio_direction_output(S3C2410_GPB(5), 1); + WARN_ON(gpio_request_one(S3C2410_GPB(5), GPIOF_OUT_INIT_HIGH, + "spi cs")); platform_add_devices(qt2410_devices, ARRAY_SIZE(qt2410_devices)); s3c_pm_init();
arch/arm/mach-s3c2410/usb-simtec.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-s3c2410/usb-simtec.c 2010-01-20 13:04:05.000000000 +0100 +3 -6
@@ -110,23 +110,20 @@ int usb_simtec_init(void) printk("USB Power Control, Copyright 2004 Simtec Electronics\n"); - ret = gpio_request(S3C2410_GPB(4), "USB power control"); + ret = gpio_request_one(S3C2410_GPB(4), GPIOF_OUT_INIT_HIGH, + "USB power control"); if (ret < 0) { pr_err("%s: failed to get GPB4\n", __func__); return ret; } - ret = gpio_request(S3C2410_GPG(10), "USB overcurrent"); + ret = gpio_request_one(S3C2410_GPG(10), GPIOF_IN, "USB overcurrent"); if (ret < 0) { pr_err("%s: failed to get GPG10\n", __func__); gpio_free(S3C2410_GPB(4)); return ret; } - /* turn power on */ - gpio_direction_output(S3C2410_GPB(4), 1); - gpio_direction_input(S3C2410_GPG(10)); - s3c_ohci_set_platdata(&usb_simtec_info); return 0; }
arch/arm/mach-s3c2412/mach-jive.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-s3c2412/mach-jive.c 2010-10-23 19:40:31.000000000 +0200 +4 -6
@@ -636,11 +636,9 @@ static void __init jive_machine_init(voi /* initialise the spi */ - gpio_request(S3C2410_GPG(13), "lcm reset"); - gpio_direction_output(S3C2410_GPG(13), 0); + gpio_request_one(S3C2410_GPG(13), GPIOF_OUT_INIT_LOW, "lcm reset"); - gpio_request(S3C2410_GPB(7), "jive spi"); - gpio_direction_output(S3C2410_GPB(7), 1); + gpio_request_one(S3C2410_GPB(7), GPIOF_OUT_INIT_HIGH, "jive spi"); s3c2410_gpio_setpin(S3C2410_GPB(6), 0); s3c_gpio_cfgpin(S3C2410_GPB(6), S3C2410_GPIO_OUTPUT);
@@ -650,8 +648,8 @@ static void __init jive_machine_init(voi /* initialise the WM8750 spi */ - gpio_request(S3C2410_GPH(10), "jive wm8750 spi"); - gpio_direction_output(S3C2410_GPH(10), 1); + gpio_request_one(S3C2410_GPH(10), GPIOF_OUT_INIT_HIGH, + "jive wm8750 spi"); /* Turn off suspend on both USB ports, and switch the * selectable USB port to USB device mode. */
arch/arm/mach-s3c2416/mach-smdk2416.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-s3c2416/mach-smdk2416.c 2011-01-09 09:32:57.000000000 +0100 +3 -6
@@ -203,14 +203,11 @@ static void __init smdk2416_machine_init s3c_sdhci0_set_platdata(&smdk2416_hsmmc0_pdata); s3c_sdhci1_set_platdata(&smdk2416_hsmmc1_pdata); - gpio_request(S3C2410_GPB(4), "USBHost Power"); - gpio_direction_output(S3C2410_GPB(4), 1); + gpio_request_one(S3C2410_GPB(4), GPIOF_OUT_INIT_HIGH, "USBHost Power"); - gpio_request(S3C2410_GPB(3), "Display Power"); - gpio_direction_output(S3C2410_GPB(3), 1); + gpio_request_one(S3C2410_GPB(3), GPIOF_OUT_INIT_HIGH, "Display Power"); - gpio_request(S3C2410_GPB(1), "Display Reset"); - gpio_direction_output(S3C2410_GPB(1), 1); + gpio_request_one(S3C2410_GPB(1), GPIOF_OUT_INIT_HIGH, "Display Reset"); platform_add_devices(smdk2416_devices, ARRAY_SIZE(smdk2416_devices)); smdk_machine_init();
arch/arm/mach-s3c2440/mach-mini2440.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-s3c2440/mach-mini2440.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -618,8 +618,8 @@ static void __init mini2440_init(void) s3c_gpio_cfgpin(S3C2410_GPC(0), S3C2410_GPC0_LEND); /* Turn the backlight early on */ - WARN_ON(gpio_request(S3C2410_GPG(4), "backlight")); - gpio_direction_output(S3C2410_GPG(4), 1); + WARN_ON(gpio_request_one(S3C2410_GPG(4), GPIOF_OUT_INIT_HIGH, + "backlight")); /* remove pullup on optional PWM backlight -- unused on 3.5 and 7"s */ s3c_gpio_setpull(S3C2410_GPB(1), S3C_GPIO_PULL_UP);
arch/arm/mach-s3c2440/mach-osiris-dvs.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-s3c2440/mach-osiris-dvs.c 2009-12-08 20:58:27.000000000 +0100 +2 -4
@@ -99,15 +99,13 @@ static int __devinit osiris_dvs_probe(st dev_info(&pdev->dev, "initialising\n"); - ret = gpio_request(OSIRIS_GPIO_DVS, "osiris-dvs"); + ret = gpio_request_one(OSIRIS_GPIO_DVS, GPIOF_OUT_INIT_HIGH, + "osiris-dvs"); if (ret) { dev_err(&pdev->dev, "cannot claim gpio\n"); goto err_nogpio; } - /* start with dvs disabled */ - gpio_direction_output(OSIRIS_GPIO_DVS, 1); - ret = cpufreq_register_notifier(&osiris_dvs_nb, CPUFREQ_TRANSITION_NOTIFIER); if (ret) {
arch/arm/mach-s3c2440/mach-rx1950.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/mach-s3c2440/mach-rx1950.c 2011-03-14 17:19:13.000000000 +0100 +8 -8
@@ -785,8 +785,8 @@ static void __init rx1950_init_machine(v S3C2410_MISCCR_USBSUSPND1, 0x0); /* mmc power is disabled by default */ - WARN_ON(gpio_request(S3C2410_GPJ(1), "MMC power")); - gpio_direction_output(S3C2410_GPJ(1), 0); + WARN_ON(gpio_request_one(S3C2410_GPJ(1), GPIOF_OUT_INIT_LOW, + "MMC power")); for (i = 0; i < 8; i++) WARN_ON(gpio_request(S3C2410_GPC(i), "LCD power"));
@@ -802,12 +802,12 @@ static void __init rx1950_init_machine(v WARN_ON(gpio_request(S3C2410_GPB(1), "LCD power")); - WARN_ON(gpio_request(S3C2410_GPA(3), "Red blink")); - WARN_ON(gpio_request(S3C2410_GPA(4), "Green blink")); - WARN_ON(gpio_request(S3C2410_GPJ(6), "LED blink")); - gpio_direction_output(S3C2410_GPA(3), 0); - gpio_direction_output(S3C2410_GPA(4), 0); - gpio_direction_output(S3C2410_GPJ(6), 0); + WARN_ON(gpio_request_one(S3C2410_GPA(3), GPIOF_OUT_INIT_LOW, + "Red blink")); + WARN_ON(gpio_request_one(S3C2410_GPA(4), GPIOF_OUT_INIT_LOW, + "Green blink")); + WARN_ON(gpio_request_one(S3C2410_GPJ(6), GPIOF_OUT_INIT_LOW, + "LED blink")); platform_add_devices(rx1950_devices, ARRAY_SIZE(rx1950_devices));
arch/arm/mach-s3c64xx/mach-hmt.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-s3c64xx/mach-hmt.c 2010-10-23 19:40:31.000000000 +0200 +6 -8
@@ -251,14 +251,12 @@ static void __init hmt_machine_init(void s3c_fb_set_platdata(&hmt_lcd_pdata); s3c_nand_set_platdata(&hmt_nand_info); - gpio_request(S3C64XX_GPC(7), "usb power"); - gpio_direction_output(S3C64XX_GPC(7), 0); - gpio_request(S3C64XX_GPM(0), "usb power"); - gpio_direction_output(S3C64XX_GPM(0), 1); - gpio_request(S3C64XX_GPK(7), "usb power"); - gpio_direction_output(S3C64XX_GPK(7), 1); - gpio_request(S3C64XX_GPF(13), "usb power"); - gpio_direction_output(S3C64XX_GPF(13), 1); + gpio_request_one(S3C64XX_GPC(7), GPIOF_OUT_INIT_LOW, "usb power"); + gpio_request_one(S3C64XX_GPM(0), GPIOF_OUT_INIT_HIGH, "usb power"); + + gpio_request_one(S3C64XX_GPK(7), GPIOF_OUT_INIT_HIGH, "usb power"); + + gpio_request_one(S3C64XX_GPF(13), GPIOF_OUT_INIT_HIGH, "usb power"); platform_add_devices(hmt_devices, ARRAY_SIZE(hmt_devices)); }
arch/arm/mach-s3c64xx/mach-smartq.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/arm/mach-s3c64xx/mach-smartq.c 2010-09-04 09:22:04.000000000 +0200 +12 -18
@@ -189,13 +189,11 @@ static int __init smartq_lcd_setup_gpio( { int ret; - ret = gpio_request(S3C64XX_GPM(3), "LCD power"); + ret = gpio_request_one(S3C64XX_GPM(3), GPIOF_OUT_INIT_LOW, + "LCD power"); if (ret < 0) return ret; - /* turn power off */ - gpio_direction_output(S3C64XX_GPM(3), 0); - return 0; }
@@ -276,15 +274,13 @@ static int __init smartq_power_off_init( { int ret; - ret = gpio_request(S3C64XX_GPK(15), "Power control"); + ret = gpio_request_one(S3C64XX_GPK(15), GPIOF_OUT_INIT_LOW, + "Power control"); if (ret < 0) { pr_err("%s: failed to get GPK15\n", __func__); return ret; } - /* leave power on */ - gpio_direction_output(S3C64XX_GPK(15), 0); - pm_power_off = smartq_power_off; return ret;
@@ -294,13 +290,15 @@ static int __init smartq_usb_host_init(v { int ret; - ret = gpio_request(S3C64XX_GPL(0), "USB power control"); + ret = gpio_request_one(S3C64XX_GPL(0), GPIOF_OUT_INIT_LOW, + "USB power control"); if (ret < 0) { pr_err("%s: failed to get GPL0\n", __func__); return ret; } - ret = gpio_request(S3C64XX_GPL(1), "USB host power control"); + ret = gpio_request_one(S3C64XX_GPL(1), GPIOF_OUT_INIT_LOW, + "USB host power control"); if (ret < 0) { pr_err("%s: failed to get GPL1\n", __func__); goto err;
@@ -316,8 +314,6 @@ static int __init smartq_usb_host_init(v } /* turn power off */ - gpio_direction_output(S3C64XX_GPL(0), 0); - gpio_direction_output(S3C64XX_GPL(1), 0); if (!machine_is_smartq5()) gpio_direction_input(S3C64XX_GPL(10));
@@ -343,24 +339,22 @@ static int __init smartq_wifi_init(void) { int ret; - ret = gpio_request(S3C64XX_GPK(1), "wifi control"); + ret = gpio_request_one(S3C64XX_GPK(1), GPIOF_OUT_INIT_HIGH, + "wifi control"); if (ret < 0) { pr_err("%s: failed to get GPK1\n", __func__); return ret; } - ret = gpio_request(S3C64XX_GPK(2), "wifi reset"); + ret = gpio_request_one(S3C64XX_GPK(2), GPIOF_OUT_INIT_LOW, + "wifi reset"); if (ret < 0) { pr_err("%s: failed to get GPK2\n", __func__); gpio_free(S3C64XX_GPK(1)); return ret; } - /* turn power on */ - gpio_direction_output(S3C64XX_GPK(1), 1); - /* reset device */ - gpio_direction_output(S3C64XX_GPK(2), 0); mdelay(100); gpio_set_value(S3C64XX_GPK(2), 1); gpio_direction_input(S3C64XX_GPK(2));
arch/arm/mach-s5pv210/mach-aquila.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/mach-s5pv210/mach-aquila.c 2011-03-14 17:19:13.000000000 +0100 +1 -2
@@ -595,8 +595,7 @@ static struct s3c_sdhci_platdata aquila_ static void aquila_setup_sdhci(void) { - gpio_request(AQUILA_EXT_FLASH_EN, "FLASH_EN"); - gpio_direction_output(AQUILA_EXT_FLASH_EN, 1); + gpio_request_one(AQUILA_EXT_FLASH_EN, GPIOF_OUT_INIT_HIGH, "FLASH_EN"); s3c_sdhci0_set_platdata(&aquila_hsmmc0_data); s3c_sdhci1_set_platdata(&aquila_hsmmc1_data);
arch/arm/mach-s5pv210/mach-smdkv210.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-s5pv210/mach-smdkv210.c 2011-03-14 17:19:13.000000000 +0100 +3 -7
@@ -153,15 +153,12 @@ static void smdkv210_lte480wv_set_power( { if (power) { #if !defined(CONFIG_BACKLIGHT_PWM) - gpio_request(S5PV210_GPD0(3), "GPD0"); - gpio_direction_output(S5PV210_GPD0(3), 1); + gpio_request_one(S5PV210_GPD0(3), GPIOF_OUT_INIT_HIGH, "GPD0"); gpio_free(S5PV210_GPD0(3)); #endif /* fire nRESET on power up */ - gpio_request(S5PV210_GPH0(6), "GPH0"); - - gpio_direction_output(S5PV210_GPH0(6), 1); + gpio_request_one(S5PV210_GPH0(6), GPIOF_OUT_INIT_HIGH, "GPH0"); gpio_set_value(S5PV210_GPH0(6), 0); mdelay(10);
@@ -172,8 +169,7 @@ static void smdkv210_lte480wv_set_power( gpio_free(S5PV210_GPH0(6)); } else { #if !defined(CONFIG_BACKLIGHT_PWM) - gpio_request(S5PV210_GPD0(3), "GPD0"); - gpio_direction_output(S5PV210_GPD0(3), 0); + gpio_request_one(S5PV210_GPD0(3), GPIOF_OUT_INIT_LOW, "GPD0"); gpio_free(S5PV210_GPD0(3)); #endif }
arch/arm/mach-shmobile/board-ag5evm.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/mach-shmobile/board-ag5evm.c 2011-02-02 17:27:36.000000000 +0100 +5 -10
@@ -418,14 +418,11 @@ static void __init ag5evm_init(void) gpio_request(GPIO_FN_MMCD0_5, NULL); gpio_request(GPIO_FN_MMCD0_6, NULL); gpio_request(GPIO_FN_MMCD0_7, NULL); - gpio_request(GPIO_PORT208, NULL); /* Reset */ - gpio_direction_output(GPIO_PORT208, 1); + gpio_request_one(GPIO_PORT208, GPIOF_OUT_INIT_HIGH, NULL); /* enable SMSC911X */ - gpio_request(GPIO_PORT144, NULL); /* PINTA2 */ - gpio_direction_input(GPIO_PORT144); - gpio_request(GPIO_PORT145, NULL); /* RESET */ - gpio_direction_output(GPIO_PORT145, 1); + gpio_request_one(GPIO_PORT144, GPIOF_IN, NULL); /* PINTA2 */ + gpio_request_one(GPIO_PORT145, GPIOF_OUT_INIT_HIGH, NULL); /* FSI A */ gpio_request(GPIO_FN_FSIACK, NULL);
@@ -440,15 +437,13 @@ static void __init ag5evm_init(void) gpio_request(GPIO_FN_PORT243_IRDA_FIRSEL, NULL); /* LCD panel */ - gpio_request(GPIO_PORT217, NULL); /* RESET */ - gpio_direction_output(GPIO_PORT217, 0); + gpio_request_one(GPIO_PORT217, GPIOF_OUT_INIT_LOW, NULL); /* RESET */ mdelay(1); gpio_set_value(GPIO_PORT217, 1); mdelay(100); /* LCD backlight controller */ - gpio_request(GPIO_PORT235, NULL); /* RESET */ - gpio_direction_output(GPIO_PORT235, 0); + gpio_request_one(GPIO_PORT235, GPIOF_OUT_INIT_LOW, NULL); /* RESET */ lcd_backlight_reset(); /* MIPI-DSI clock setup */
arch/arm/mach-shmobile/board-ap4evb.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/mach-shmobile/board-ap4evb.c 2011-03-14 17:19:13.000000000 +0100 +9 -19
@@ -1054,9 +1054,7 @@ static int ts_get_pendown_state(void) gpio_free(GPIO_TSC_IRQ); - gpio_request(GPIO_TSC_PORT, NULL); - - gpio_direction_input(GPIO_TSC_PORT); + gpio_request_one(GPIO_TSC_PORT, GPIOF_IN, NULL); val = gpio_get_value(GPIO_TSC_PORT);
@@ -1139,14 +1137,10 @@ static void __init ap4evb_init(void) gpio_request(GPIO_FN_IRQ6_39, NULL); /* enable Debug switch (S6) */ - gpio_request(GPIO_PORT32, NULL); - gpio_request(GPIO_PORT33, NULL); - gpio_request(GPIO_PORT34, NULL); - gpio_request(GPIO_PORT35, NULL); - gpio_direction_input(GPIO_PORT32); - gpio_direction_input(GPIO_PORT33); - gpio_direction_input(GPIO_PORT34); - gpio_direction_input(GPIO_PORT35); + gpio_request_one(GPIO_PORT32, GPIOF_IN, NULL); + gpio_request_one(GPIO_PORT33, GPIOF_IN, NULL); + gpio_request_one(GPIO_PORT34, GPIOF_IN, NULL); + gpio_request_one(GPIO_PORT35, GPIOF_IN, NULL); gpio_export(GPIO_PORT32, 0); gpio_export(GPIO_PORT33, 0); gpio_export(GPIO_PORT34, 0);
@@ -1198,8 +1192,7 @@ static void __init ap4evb_init(void) gpio_request(GPIO_FN_FSIAILR, NULL); gpio_request(GPIO_FN_FSIAISLD, NULL); gpio_request(GPIO_FN_FSIAOSLD, NULL); - gpio_request(GPIO_PORT161, NULL); - gpio_direction_output(GPIO_PORT161, 0); /* slave */ + gpio_request_one(GPIO_PORT161, GPIOF_OUT_INIT_LOW, NULL);/* slave */ gpio_request(GPIO_PORT9, NULL); gpio_request(GPIO_PORT10, NULL);
@@ -1207,8 +1200,7 @@ static void __init ap4evb_init(void) gpio_no_direction(GPIO_PORT10CR); /* FSIAOLR needs no direction */ /* card detect pin for MMC slot (CN7) */ - gpio_request(GPIO_PORT41, NULL); - gpio_direction_input(GPIO_PORT41); + gpio_request_one(GPIO_PORT41, GPIOF_IN, NULL); /* setup FSI2 port B (HDMI) */ gpio_request(GPIO_FN_FSIBCK, NULL);
@@ -1296,11 +1288,9 @@ static void __init ap4evb_init(void) gpio_request(GPIO_FN_LCDDISP, NULL); gpio_request(GPIO_FN_LCDDCK, NULL); - gpio_request(GPIO_PORT189, NULL); /* backlight */ - gpio_direction_output(GPIO_PORT189, 1); + gpio_request_one(GPIO_PORT189, GPIOF_OUT_INIT_HIGH, NULL); - gpio_request(GPIO_PORT151, NULL); /* LCDDON */ - gpio_direction_output(GPIO_PORT151, 1); + gpio_request_one(GPIO_PORT151, GPIOF_OUT_INIT_HIGH, NULL); lcdc_info.clock_source = LCDC_CLK_BUS; lcdc_info.ch[0].interface_type = RGB18;
arch/arm/mach-shmobile/board-g3evm.c 2011-03-20 21:01:55.000000000 +0100 renamed from arch/arm/mach-shmobile/board-g3evm.c 2011-01-19 18:51:18.000000000 +0100 +3 -6
@@ -271,18 +271,15 @@ static void __init g3evm_init(void) sh7367_pinmux_init(); /* Lit DS4 LED */ - gpio_request(GPIO_PORT22, NULL); - gpio_direction_output(GPIO_PORT22, 1); + gpio_request_one(GPIO_PORT22, GPIOF_OUT_INIT_HIGH, NULL); gpio_export(GPIO_PORT22, 0); /* Lit DS8 LED */ - gpio_request(GPIO_PORT23, NULL); - gpio_direction_output(GPIO_PORT23, 1); + gpio_request_one(GPIO_PORT23, GPIOF_OUT_INIT_HIGH, NULL); gpio_export(GPIO_PORT23, 0); /* Lit DS3 LED */ - gpio_request(GPIO_PORT24, NULL); - gpio_direction_output(GPIO_PORT24, 1); + gpio_request_one(GPIO_PORT24, GPIOF_OUT_INIT_HIGH, NULL); gpio_export(GPIO_PORT24, 0); /* SCIFA1 */
arch/arm/mach-shmobile/board-g4evm.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/mach-shmobile/board-g4evm.c 2011-01-19 18:51:18.000000000 +0100 +4 -8
@@ -315,23 +315,19 @@ static void __init g4evm_init(void) sh7377_pinmux_init(); /* Lit DS14 LED */ - gpio_request(GPIO_PORT109, NULL); - gpio_direction_output(GPIO_PORT109, 1); + gpio_request_one(GPIO_PORT109, GPIOF_OUT_INIT_HIGH, NULL); gpio_export(GPIO_PORT109, 1); /* Lit DS15 LED */ - gpio_request(GPIO_PORT110, NULL); - gpio_direction_output(GPIO_PORT110, 1); + gpio_request_one(GPIO_PORT110, GPIOF_OUT_INIT_HIGH, NULL); gpio_export(GPIO_PORT110, 1); /* Lit DS16 LED */ - gpio_request(GPIO_PORT112, NULL); - gpio_direction_output(GPIO_PORT112, 1); + gpio_request_one(GPIO_PORT112, GPIOF_OUT_INIT_HIGH, NULL); gpio_export(GPIO_PORT112, 1); /* Lit DS17 LED */ - gpio_request(GPIO_PORT113, NULL); - gpio_direction_output(GPIO_PORT113, 1); + gpio_request_one(GPIO_PORT113, GPIOF_OUT_INIT_HIGH, NULL); gpio_export(GPIO_PORT113, 1); /* USBHS */
arch/arm/mach-shmobile/board-mackerel.c 2011-03-20 21:01:55.000000000 +0100 renamed from arch/arm/mach-shmobile/board-mackerel.c 2011-03-14 17:19:13.000000000 +0100 +5 -10
@@ -1058,11 +1058,9 @@ static void __init mackerel_init(void) gpio_request(GPIO_FN_LCDDISP, NULL); gpio_request(GPIO_FN_LCDDCK, NULL); - gpio_request(GPIO_PORT31, NULL); /* backlight */ - gpio_direction_output(GPIO_PORT31, 1); + gpio_request_one(GPIO_PORT31, GPIOF_OUT_INIT_HIGH, NULL); - gpio_request(GPIO_PORT151, NULL); /* LCDDON */ - gpio_direction_output(GPIO_PORT151, 1); + gpio_request_one(GPIO_PORT151, GPIOF_OUT_INIT_HIGH, NULL); /* USB enable */ gpio_request(GPIO_FN_VBUS0_1, NULL);
@@ -1080,8 +1078,7 @@ static void __init mackerel_init(void) gpio_request(GPIO_FN_FSIAILR, NULL); gpio_request(GPIO_FN_FSIAISLD, NULL); gpio_request(GPIO_FN_FSIAOSLD, NULL); - gpio_request(GPIO_PORT161, NULL); - gpio_direction_output(GPIO_PORT161, 0); /* slave */ + gpio_request_one(GPIO_PORT161, GPIOF_OUT_INIT_LOW, NULL);/* slave */ gpio_request(GPIO_PORT9, NULL); gpio_request(GPIO_PORT10, NULL);
@@ -1133,8 +1130,7 @@ static void __init mackerel_init(void) gpio_request(GPIO_FN_SDHID1_0, NULL); #endif /* card detect pin for MMC slot (CN7) */ - gpio_request(GPIO_PORT41, NULL); - gpio_direction_input(GPIO_PORT41); + gpio_request_one(GPIO_PORT41, GPIOF_IN, NULL); /* enable SDHI2 */ gpio_request(GPIO_FN_SDHICMD2, NULL);
@@ -1145,8 +1141,7 @@ static void __init mackerel_init(void) gpio_request(GPIO_FN_SDHID2_0, NULL); /* card detect pin for microSD slot (CN23) */ - gpio_request(GPIO_PORT162, NULL); - gpio_direction_input(GPIO_PORT162); + gpio_request_one(GPIO_PORT162, GPIOF_IN, NULL); /* MMCIF */ gpio_request(GPIO_FN_MMCD0_0, NULL);
arch/arm/mach-stmp378x/stmp378x_devb.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/mach-stmp378x/stmp378x_devb.c 2010-10-23 19:40:31.000000000 +0200 +2 -5
@@ -133,18 +133,15 @@ static int stmp3xxxmmc_hw_init_ssp1(void goto out; /* Configure write protect GPIO pin */ - ret = gpio_request(PINID_PWM4, "mmc wp"); + ret = gpio_request_one(PINID_PWM4, GPIOF_IN, "mmc wp"); if (ret) goto out_wp; - gpio_direction_input(PINID_PWM4); - /* Configure POWER pin as gpio to drive power to MMC slot */ - ret = gpio_request(PINID_PWM3, "mmc power"); + ret = gpio_request_one(PINID_PWM3, GPIOF_OUT_INIT_LOW, "mmc power"); if (ret) goto out_power; - gpio_direction_output(PINID_PWM3, 0); mdelay(100); return 0;
arch/arm/mach-tegra/board-harmony-pcie.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/arm/mach-tegra/board-harmony-pcie.c 2011-03-20 18:17:23.000000000 +0100 +2 -3
@@ -38,12 +38,11 @@ static int __init harmony_pcie_init(void if (!machine_is_harmony()) return 0; - err = gpio_request(EN_VDD_1V05_GPIO, "EN_VDD_1V05"); + err = gpio_request_one(EN_VDD_1V05_GPIO, GPIOF_OUT_INIT_HIGH, + "EN_VDD_1V05"); if (err) return err; - gpio_direction_output(EN_VDD_1V05_GPIO, 1); - regulator = regulator_get(NULL, "pex_clk"); if (IS_ERR_OR_NULL(regulator)) goto err_reg;
arch/arm/mach-tegra/board-seaboard.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/mach-tegra/board-seaboard.c 2011-03-20 18:17:23.000000000 +0100 +1 -2
@@ -154,8 +154,7 @@ static struct i2c_board_info __initdata static void __init seaboard_i2c_init(void) { - gpio_request(TEGRA_GPIO_ISL29018_IRQ, "isl29018"); - gpio_direction_input(TEGRA_GPIO_ISL29018_IRQ); + gpio_request_one(TEGRA_GPIO_ISL29018_IRQ, GPIOF_IN, "isl29018"); i2c_register_board_info(0, &isl29018_device, 1);
arch/arm/mach-tegra/usb_phy.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/mach-tegra/usb_phy.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -710,8 +710,8 @@ struct tegra_usb_phy *tegra_usb_phy_open goto err1; } tegra_gpio_enable(ulpi_config->reset_gpio); - gpio_request(ulpi_config->reset_gpio, "ulpi_phy_reset_b"); - gpio_direction_output(ulpi_config->reset_gpio, 0); + gpio_request_one(ulpi_config->reset_gpio, GPIOF_OUT_INIT_LOW, + "ulpi_phy_reset_b"); phy->ulpi = otg_ulpi_create(&ulpi_viewport_access_ops, 0); phy->ulpi->io_priv = regs + ULPI_VIEWPORT; } else {
arch/arm/plat-mxc/3ds_debugboard.c 2011-03-20 21:01:54.000000000 +0100 renamed from arch/arm/plat-mxc/3ds_debugboard.c 2011-01-19 18:51:18.000000000 +0100 +1 -2
@@ -176,8 +176,7 @@ int __init mxc_expio_init(u32 base, u32 /* * Configure INT line as GPIO input */ - gpio_request(MXC_IRQ_TO_GPIO(p_irq), "expio_pirq"); - gpio_direction_input(MXC_IRQ_TO_GPIO(p_irq)); + gpio_request_one(MXC_IRQ_TO_GPIO(p_irq), GPIOF_IN, "expio_pirq"); /* disable the interrupt and clear the status */ __raw_writew(0, brd_io + INTR_MASK_REG);
arch/arm/plat-omap/debug-devices.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/arm/plat-omap/debug-devices.c 2009-12-12 00:23:19.000000000 +0100 +1 -2
@@ -82,12 +82,11 @@ int __init debug_card_init(u32 addr, uns smc91x_resources[1].start = gpio_to_irq(gpio); smc91x_resources[1].end = gpio_to_irq(gpio); - status = gpio_request(gpio, "SMC91x irq"); + status = gpio_request_one(gpio, GPIOF_IN, "SMC91x irq"); if (status < 0) { printk(KERN_ERR "GPIO%d unavailable for smc91x IRQ\n", gpio); return status; } - gpio_direction_input(gpio); led_resources[0].start = addr; led_resources[0].end = addr + SZ_4K - 1;
arch/avr32/boards/atngw100/mrmt.c 2011-03-20 21:01:49.000000000 +0100 renamed from arch/avr32/boards/atngw100/mrmt.c 2009-09-21 18:11:44.000000000 +0200 +6 -12
@@ -314,13 +314,11 @@ static int __init mrmt1_init(void) #endif at32_select_gpio( PIN_LCD_DISP, AT32_GPIOF_OUTPUT ); - gpio_request( PIN_LCD_DISP, "LCD_DISP" ); - gpio_direction_output( PIN_LCD_DISP, 0 ); /* LCD DISP */ + gpio_request_one(PIN_LCD_DISP, GPIOF_OUT_INIT_LOW, "LCD_DISP");/* LCD DISP */ #ifdef CONFIG_BOARD_MRMT_LCD_DISABLE /* Keep Backlight and DISP off */ at32_select_gpio( PIN_LCD_BL, AT32_GPIOF_OUTPUT ); - gpio_request( PIN_LCD_BL, "LCD_BL" ); - gpio_direction_output( PIN_LCD_BL, 0 ); /* Backlight */ + gpio_request_one(PIN_LCD_BL, GPIOF_OUT_INIT_LOW, "LCD_BL");/* Backlight */ #else gpio_set_value( PIN_LCD_DISP, 1 ); /* DISP asserted first */ #ifdef CONFIG_BOARD_MRMT_BL_PWM
@@ -331,20 +329,17 @@ static int __init mrmt1_init(void) /* Backlight always on */ udelay( 1 ); at32_select_gpio( PIN_LCD_BL, AT32_GPIOF_OUTPUT ); - gpio_request( PIN_LCD_BL, "LCD_BL" ); - gpio_direction_output( PIN_LCD_BL, 1 ); + gpio_request_one(PIN_LCD_BL, GPIOF_OUT_INIT_HIGH, "LCD_BL"); #endif #endif /* Make sure BT and Zigbee modules in reset */ at32_select_gpio( PIN_BT_RST, AT32_GPIOF_OUTPUT ); - gpio_request( PIN_BT_RST, "BT_RST" ); - gpio_direction_output( PIN_BT_RST, 1 ); + gpio_request_one(PIN_BT_RST, GPIOF_OUT_INIT_HIGH, "BT_RST"); /* BT Module in Reset */ at32_select_gpio( PIN_ZB_RST_N, AT32_GPIOF_OUTPUT ); - gpio_request( PIN_ZB_RST_N, "ZB_RST_N" ); - gpio_direction_output( PIN_ZB_RST_N, 0 ); + gpio_request_one(PIN_ZB_RST_N, GPIOF_OUT_INIT_LOW, "ZB_RST_N"); /* XBee Module in Reset */
Lines of this file are not shown. View the raw message.
arch/avr32/boards/atngw100/setup.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/avr32/boards/atngw100/setup.c 2011-01-19 18:51:18.000000000 +0100 +2 -4
Lines of this file are not shown. View the raw message.
arch/blackfin/mach-bf533/boards/stamp.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/blackfin/mach-bf533/boards/stamp.c 2011-01-19 18:51:18.000000000 +0100 +1 -2
Lines of this file are not shown. View the raw message.
arch/mips/alchemy/devboards/db1200/platform.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/mips/alchemy/devboards/db1200/platform.c 2010-09-04 09:22:04.000000000 +0200 +1 -2
Lines of this file are not shown. View the raw message.
arch/mips/alchemy/mtx-1/platform.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/mips/alchemy/mtx-1/platform.c 2011-03-20 18:17:23.000000000 +0100 +2 -3
Lines of this file are not shown. View the raw message.
arch/mips/txx9/rbtx4927/setup.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/mips/txx9/rbtx4927/setup.c 2010-02-11 23:53:22.000000000 +0100 +1 -2
Lines of this file are not shown. View the raw message.
arch/mips/txx9/rbtx4938/setup.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/mips/txx9/rbtx4938/setup.c 2010-02-11 23:53:22.000000000 +0100 +6 -8
Lines of this file are not shown. View the raw message.
arch/sh/boards/board-sh7757lcr.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/sh/boards/board-sh7757lcr.c 2011-03-20 18:17:23.000000000 +0100 +12 -16
Lines of this file are not shown. View the raw message.
arch/sh/boards/mach-ap325rxa/setup.c 2011-03-20 21:01:51.000000000 +0100 renamed from arch/sh/boards/mach-ap325rxa/setup.c 2011-01-19 18:51:18.000000000 +0100 +11 -16
Lines of this file are not shown. View the raw message.
arch/sh/boards/mach-ecovec24/setup.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/sh/boards/mach-ecovec24/setup.c 2011-03-20 18:17:23.000000000 +0100 +34 -68
102 lines not on this page · raw message
arch/sh/boards/mach-kfr2r09/setup.c 2011-03-20 21:01:52.000000000 +0100 renamed from arch/sh/boards/mach-kfr2r09/setup.c 2011-01-19 18:51:18.000000000 +0100 +8 -12
Lines of this file are not shown. View the raw message.
arch/sh/boards/mach-migor/setup.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/sh/boards/mach-migor/setup.c 2011-01-19 18:51:18.000000000 +0100 +5 -10
Lines of this file are not shown. View the raw message.
arch/sh/boards/mach-se/7724/setup.c 2011-03-20 21:01:50.000000000 +0100 renamed from arch/sh/boards/mach-se/7724/setup.c 2011-02-02 17:27:37.000000000 +0100 +1 -2
Lines of this file are not shown. View the raw message.
arch/xtensa/platforms/s6105/setup.c 2011-03-20 21:01:53.000000000 +0100 renamed from arch/xtensa/platforms/s6105/setup.c 2009-06-24 21:18:48.000000000 +0200 +1 -2
Lines of this file are not shown. View the raw message.
drivers/block/mg_disk.c 2011-03-20 21:01:53.000000000 +0100 renamed from drivers/block/mg_disk.c 2010-08-25 09:45:50.000000000 +0200 +2 -4
Lines of this file are not shown. View the raw message.
drivers/hwmon/sht15.c 2011-03-20 21:01:53.000000000 +0100 renamed from drivers/hwmon/sht15.c 2011-03-20 18:17:23.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/input/keyboard/matrix_keypad.c 2011-03-20 21:01:51.000000000 +0100 renamed from drivers/input/keyboard/matrix_keypad.c 2010-07-03 18:06:34.000000000 +0200 +2 -3
Lines of this file are not shown. View the raw message.
drivers/input/keyboard/omap-keypad.c 2011-03-20 21:01:50.000000000 +0100 renamed from drivers/input/keyboard/omap-keypad.c 2010-12-28 18:26:03.000000000 +0100 +5 -4
Lines of this file are not shown. View the raw message.
drivers/input/mouse/gpio_mouse.c 2011-03-20 21:01:50.000000000 +0100 renamed from drivers/input/mouse/gpio_mouse.c 2009-07-12 20:48:31.000000000 +0200 +1 -3
Lines of this file are not shown. View the raw message.
drivers/input/serio/ams_delta_serio.c 2011-03-20 21:01:50.000000000 +0100 renamed from drivers/input/serio/ams_delta_serio.c 2010-11-24 07:55:11.000000000 +0100 +4 -4
Lines of this file are not shown. View the raw message.
drivers/leds/leds-bd2802.c 2011-03-20 21:01:50.000000000 +0100 renamed from drivers/leds/leds-bd2802.c 2010-08-06 00:40:23.000000000 +0200 +1 -2
Lines of this file are not shown. View the raw message.
drivers/media/video/via-camera.c 2011-03-20 21:01:50.000000000 +0100 renamed from drivers/media/video/via-camera.c 2011-03-14 17:19:15.000000000 +0100 +4 -4
Lines of this file are not shown. View the raw message.
drivers/mfd/dm355evm_msp.c 2011-03-20 21:01:51.000000000 +0100 renamed from drivers/mfd/dm355evm_msp.c 2009-09-19 08:25:19.000000000 +0200 +1 -2
Lines of this file are not shown. View the raw message.
drivers/mfd/omap-usb-host.c 2011-03-20 21:01:51.000000000 +0100 renamed from drivers/mfd/omap-usb-host.c 2011-03-14 17:19:15.000000000 +0100 +6 -8
Lines of this file are not shown. View the raw message.
drivers/mmc/host/pxamci.c 2011-03-20 21:01:51.000000000 +0100 renamed from drivers/mmc/host/pxamci.c 2010-09-30 17:54:15.000000000 +0200 +3 -4
Lines of this file are not shown. View the raw message.
drivers/mmc/host/s3cmci.c 2011-03-20 21:01:54.000000000 +0100 renamed from drivers/mmc/host/s3cmci.c 2010-09-18 08:59:06.000000000 +0200 +2 -3
Lines of this file are not shown. View the raw message.
drivers/mtd/maps/bfin-async-flash.c 2011-03-20 21:01:54.000000000 +0100 renamed from drivers/mtd/maps/bfin-async-flash.c 2010-03-29 19:27:56.000000000 +0200 +2 -2
Lines of this file are not shown. View the raw message.
drivers/mtd/maps/gpio-addr-flash.c 2011-03-20 21:01:54.000000000 +0100 renamed from drivers/mtd/maps/gpio-addr-flash.c 2010-11-01 20:33:30.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/mtd/nand/cmx270_nand.c 2011-03-20 21:01:54.000000000 +0100 renamed from drivers/mtd/nand/cmx270_nand.c 2010-03-29 19:27:56.000000000 +0200 +2 -6
Lines of this file are not shown. View the raw message.
drivers/mtd/nand/fsl_upm.c 2011-03-20 21:01:54.000000000 +0100 renamed from drivers/mtd/nand/fsl_upm.c 2011-03-14 17:19:15.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/mtd/nand/gpio.c 2011-03-20 21:01:53.000000000 +0100 renamed from drivers/mtd/nand/gpio.c 2010-01-03 21:18:12.000000000 +0100 +9 -10
Lines of this file are not shown. View the raw message.
drivers/mtd/onenand/omap2.c 2011-03-20 21:01:54.000000000 +0100 renamed from drivers/mtd/onenand/omap2.c 2011-03-14 17:19:15.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/net/phy/mdio-gpio.c 2011-03-20 21:01:52.000000000 +0100 renamed from drivers/net/phy/mdio-gpio.c 2011-03-14 17:19:16.000000000 +0100 +1 -3
Lines of this file are not shown. View the raw message.
drivers/net/wireless/p54/p54spi.c 2011-03-20 21:01:52.000000000 +0100 renamed from drivers/net/wireless/p54/p54spi.c 2010-09-18 08:59:06.000000000 +0200 +3 -5
Lines of this file are not shown. View the raw message.
drivers/pcmcia/bfin_cf_pcmcia.c 2011-03-20 21:01:55.000000000 +0100 renamed from drivers/pcmcia/bfin_cf_pcmcia.c 2010-03-29 19:27:57.000000000 +0200 +1 -2
Lines of this file are not shown. View the raw message.
drivers/pcmcia/pxa2xx_cm_x255.c 2011-03-20 21:01:55.000000000 +0100 renamed from drivers/pcmcia/pxa2xx_cm_x255.c 2009-11-08 21:45:05.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/pcmcia/pxa2xx_cm_x270.c 2011-03-20 21:01:55.000000000 +0100 renamed from drivers/pcmcia/pxa2xx_cm_x270.c 2009-11-08 21:45:05.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/pcmcia/pxa2xx_stargate2.c 2011-03-20 21:01:55.000000000 +0100 renamed from drivers/pcmcia/pxa2xx_stargate2.c 2009-12-17 08:30:14.000000000 +0100 +6 -7
Lines of this file are not shown. View the raw message.
drivers/rtc/rtc-v3020.c 2011-03-20 21:01:52.000000000 +0100 renamed from drivers/rtc/rtc-v3020.c 2010-03-29 19:27:57.000000000 +0200 +3 -3
Lines of this file are not shown. View the raw message.
drivers/spi/mpc52xx_spi.c 2011-03-20 21:01:52.000000000 +0100 renamed from drivers/spi/mpc52xx_spi.c 2011-03-14 17:19:16.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/spi/spi_bfin5xx.c 2011-03-20 21:01:50.000000000 +0100 renamed from drivers/spi/spi_bfin5xx.c 2011-02-19 08:28:52.000000000 +0100 +3 -2
Lines of this file are not shown. View the raw message.
drivers/spi/spi_oc_tiny.c 2011-03-20 21:01:51.000000000 +0100 renamed from drivers/spi/spi_oc_tiny.c 2011-02-26 13:17:47.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/spi/spi_s3c24xx.c 2011-03-20 21:01:52.000000000 +0100 renamed from drivers/spi/spi_s3c24xx.c 2010-03-29 19:27:58.000000000 +0200 +2 -2
Lines of this file are not shown. View the raw message.
drivers/staging/iio/adc/ad7816.c 2011-03-20 21:01:52.000000000 +0100 renamed from drivers/staging/iio/adc/ad7816.c 2010-11-13 10:26:39.000000000 +0100 +3 -6
Lines of this file are not shown. View the raw message.
drivers/staging/iio/resolver/ad2s120x.c 2011-03-20 21:01:53.000000000 +0100 renamed from drivers/staging/iio/resolver/ad2s120x.c 2010-11-13 10:26:39.000000000 +0100 +1 -2
Lines of this file are not shown. View the raw message.
drivers/staging/olpc_dcon/olpc_dcon_xo_1.c 2011-03-20 21:01:53.000000000 +0100 renamed from drivers/staging/olpc_dcon/olpc_dcon_xo_1.c 2011-02-26 13:17:47.000000000 +0100 +3 -6
Lines of this file are not shown. View the raw message.
drivers/usb/gadget/at91_udc.c 2011-03-20 21:01:54.000000000 +0100 renamed from drivers/usb/gadget/at91_udc.c 2011-02-19 08:28:52.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/usb/gadget/pxa25x_udc.c 2011-03-20 21:01:55.000000000 +0100 renamed from drivers/usb/gadget/pxa25x_udc.c 2010-09-04 09:22:05.000000000 +0200 +6 -6
Lines of this file are not shown. View the raw message.
drivers/usb/host/ohci-at91.c 2011-03-20 21:01:53.000000000 +0100 renamed from drivers/usb/host/ohci-at91.c 2010-05-08 13:16:00.000000000 +0200 +2 -2
Lines of this file are not shown. View the raw message.
drivers/usb/host/ohci-omap.c 2011-03-20 21:01:53.000000000 +0100 renamed from drivers/usb/host/ohci-omap.c 2009-10-28 12:03:41.000000000 +0100 +1 -2
Lines of this file are not shown. View the raw message.
drivers/usb/musb/blackfin.c 2011-03-20 21:01:54.000000000 +0100 renamed from drivers/usb/musb/blackfin.c 2011-02-11 10:53:32.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/usb/otg/gpio_vbus.c 2011-03-20 21:01:54.000000000 +0100 renamed from drivers/usb/otg/gpio_vbus.c 2010-03-29 19:27:58.000000000 +0200 +1 -2
Lines of this file are not shown. View the raw message.
drivers/video/bf537-lq035.c 2011-03-20 21:01:56.000000000 +0100 renamed from drivers/video/bf537-lq035.c 2011-02-02 17:27:39.000000000 +0100 +3 -8
Lines of this file are not shown. View the raw message.
drivers/video/bf54x-lq043fb.c 2011-03-20 21:01:50.000000000 +0100 renamed from drivers/video/bf54x-lq043fb.c 2010-08-10 09:17:44.000000000 +0200 +1 -3
Lines of this file are not shown. View the raw message.
drivers/video/bfin-lq035q1-fb.c 2011-03-20 21:01:56.000000000 +0100 renamed from drivers/video/bfin-lq035q1-fb.c 2010-05-27 15:47:04.000000000 +0200 +4 -4
Lines of this file are not shown. View the raw message.
drivers/video/bfin_adv7393fb.c 2011-03-20 21:01:55.000000000 +0100 renamed from drivers/video/bfin_adv7393fb.c 2010-12-04 18:54:36.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/video/omap/lcd_2430sdp.c 2011-03-20 21:01:55.000000000 +0100 renamed from drivers/video/omap/lcd_2430sdp.c 2009-12-17 08:30:14.000000000 +0100 +2 -4
Lines of this file are not shown. View the raw message.
drivers/video/omap/lcd_inn1610.c 2011-03-20 21:01:55.000000000 +0100 renamed from drivers/video/omap/lcd_inn1610.c 2009-11-16 12:10:37.000000000 +0100 +2 -4
Lines of this file are not shown. View the raw message.
drivers/video/omap/lcd_ldp.c 2011-03-20 21:01:55.000000000 +0100 renamed from drivers/video/omap/lcd_ldp.c 2009-12-17 08:30:14.000000000 +0100 +7 -9
Lines of this file are not shown. View the raw message.
drivers/video/omap/lcd_omap2evm.c 2011-03-20 21:01:55.000000000 +0100 renamed from drivers/video/omap/lcd_omap2evm.c 2009-12-17 08:30:14.000000000 +0100 +7 -13
Lines of this file are not shown. View the raw message.
drivers/video/omap/lcd_omap3evm.c 2011-03-20 21:01:55.000000000 +0100 renamed from drivers/video/omap/lcd_omap3evm.c 2009-12-17 08:30:14.000000000 +0100 +5 -11
Lines of this file are not shown. View the raw message.
drivers/video/omap2/displays/panel-taal.c 2011-03-20 21:01:55.000000000 +0100 renamed from drivers/video/omap2/displays/panel-taal.c 2011-03-14 17:19:17.000000000 +0100 +1 -3
Lines of this file are not shown. View the raw message.
sound/pci/cs5535audio/cs5535audio_olpc.c 2011-03-20 21:01:54.000000000 +0100 renamed from sound/pci/cs5535audio/cs5535audio_olpc.c 2009-12-17 08:30:15.000000000 +0100 +1 -2
Lines of this file are not shown. View the raw message.
sound/soc/blackfin/bf5xx-ac97.c 2011-03-20 21:01:53.000000000 +0100 renamed from sound/soc/blackfin/bf5xx-ac97.c 2011-01-19 18:51:20.000000000 +0100 +3 -4
Lines of this file are not shown. View the raw message.
sound/soc/blackfin/bf5xx-ad73311.c 2011-03-20 21:01:54.000000000 +0100 renamed from sound/soc/blackfin/bf5xx-ad73311.c 2010-11-24 07:55:12.000000000 +0100 +1 -3
Lines of this file are not shown. View the raw message.
sound/soc/codecs/tlv320aic3x.c 2011-03-20 21:01:52.000000000 +0100 renamed from sound/soc/codecs/tlv320aic3x.c 2010-12-26 10:19:08.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
sound/soc/codecs/tlv320dac33.c 2011-03-20 21:01:51.000000000 +0100 renamed from sound/soc/codecs/tlv320dac33.c 2011-03-14 17:19:19.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
sound/soc/codecs/tpa6130a2.c 2011-03-20 21:01:51.000000000 +0100 renamed from sound/soc/codecs/tpa6130a2.c 2011-01-19 18:51:20.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
sound/soc/jz4740/qi_lb60.c 2011-03-20 21:01:53.000000000 +0100 renamed from sound/soc/jz4740/qi_lb60.c 2010-11-24 07:55:12.000000000 +0100 +2 -5
Lines of this file are not shown. View the raw message.
sound/soc/omap/n810.c 2011-03-20 21:01:51.000000000 +0100 renamed from sound/soc/omap/n810.c 2011-01-09 09:32:58.000000000 +0100 +4 -5
Lines of this file are not shown. View the raw message.
sound/soc/omap/zoom2.c 2011-03-20 21:01:51.000000000 +0100 renamed from sound/soc/omap/zoom2.c 2010-11-24 07:55:12.000000000 +0100 +4 -4
Lines of this file are not shown. View the raw message.
sound/soc/samsung/s3c24xx_simtec.c 2011-03-20 21:01:53.000000000 +0100 renamed from sound/soc/samsung/s3c24xx_simtec.c 2011-01-24 08:53:37.000000000 +0100 +4 -5
Lines of this file are not shown. View the raw message.
sound/soc/samsung/s3c24xx_uda134x.c 2011-03-20 21:01:53.000000000 +0100 renamed from sound/soc/samsung/s3c24xx_uda134x.c 2011-02-02 17:27:40.000000000 +0100 +1 -2
Lines of this file are not shown. View the raw message.
sound/soc/tegra/harmony.c 2011-03-20 21:01:50.000000000 +0100 renamed from sound/soc/tegra/harmony.c 2011-02-19 08:28:53.000000000 +0100 +6 -11
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
Quoted 2 lines · Julia Lawall
I guess that the !GPIOLIB issue is related to a configuration option, that can't very easily be detected from looking at the C file alone?
Yes, that is a configuration option at the moment. It shouldn't be IMO, that's what my patch is addressing.
Quoted 1 line
Ignoring that issue, the following semantic patch addresses the common
Sigh, here goes my chance to play with coccinelle again ;)
Quoted 3 lines
case where there is no error checking for the input or output call, but there may be error checking for the
gpio_requestcall. This transforms over 500 occurrences.
In my book, converting the ones which do not check errors at all is not worth the trouble. Proper error-checking should be the main benefit, not one saved line. So, this is mindwork. If gpio_request is checked, merging seems sensible (but should be audited).
Regards,
Wolfram
Signature · 9 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110320/a9fbf2da/attachment.sig>
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
Quoted 10 lines · Wolfram Sang
Quoted 2 lines · Julia Lawall
I guess that the !GPIOLIB issue is related to a configuration option, that can't very easily be detected from looking at the C file alone?
Yes, that is a configuration option at the moment. It shouldn't be IMO, that's what my patch is addressing.
Quoted 1 line
Ignoring that issue, the following semantic patch addresses the common
Sigh, here goes my chance to play with coccinelle again ;)
Well, there are still 300 or so cases that my rules don't catch :)
Quoted 8 lines
Quoted 3 lines
case where there is no error checking for the input or output call, but there may be error checking for the
gpio_requestcall. This transforms over 500 occurrences.In my book, converting the ones which do not check errors at all is not worth the trouble. Proper error-checking should be the main benefit, not one saved line. So, this is mindwork. If
gpio_requestis checked, merging seems sensible (but should be audited).
OK. One could put rules like:
@@
expression E1,E2;
@@
- gpio_request(E1,E2);
+ BAD_CALL(gpio_request_one(E1,GPIOF_IN,E2));
... when != E1- gpio_direction_input(E1);
to more easily find those cases. There are 265 of them.
julia
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
In reply to Wolfram SangIn this case, I also ignore the !GPIOLIB issue. This semantic patch considers the case where the direction call has some error handling code. In this case, it just deletes that error handling code, so most of these cases are likely to need some manual cleanup, eg to get rid of unreachable error labels or to change the error message.
The semantic patch is as follows. It modifies over 150 occurrences, as shown below.
@@
expression E1,E2,ret,E;
statement S;
@@
- gpio_request(E1,E2)
+ gpio_request_one(E1,GPIOF_IN,E2)
... when != E1
- ret = gpio_direction_input(E1);
... when != ret = E- if (\(ret != 0 \| ret < 0\)) S
@@
expression E1,E2,ret,E;
statement S;
@@
- gpio_request(E1,E2)
+ gpio_request_one(E1,GPIOF_OUT_INIT_LOW,E2)
... when != E1
- ret = gpio_direction_output(E1,0);
... when != ret = E- if (\(ret != 0 \| ret < 0\)) S
@@
expression E1,E2,ret,E;
statement S;
@@
- gpio_request(E1,E2)
+ gpio_request_one(E1,GPIOF_OUT_INIT_HIGH,E2)
... when != E1
- ret = gpio_direction_output(E1,1);
... when != ret = E- if (\(ret != 0 \| ret < 0\)) S
julia
arch/arm/mach-at91/board-gsia18s.c 2011-03-20 22:00:24.000000000 +0100 renamed from arch/arm/mach-at91/board-gsia18s.c 2011-01-19 18:51:18.000000000 +0100 +2 -7
@@ -458,18 +458,13 @@ static int pcf8574x_0x20_setup(struct i2 { int status; - status = gpio_request(gpio + PCF_GPIO_ETH_DETECT, "eth_det"); + status = gpio_request_one(gpio + PCF_GPIO_ETH_DETECT, GPIOF_IN, + "eth_det"); if (status < 0) { pr_err("error: can't request GPIO%d\n", gpio + PCF_GPIO_ETH_DETECT); return status; } - status = gpio_direction_input(gpio + PCF_GPIO_ETH_DETECT); - if (status < 0) { - pr_err("error: can't setup GPIO%d as input\n", - gpio + PCF_GPIO_ETH_DETECT); - return status; - } status = gpio_export(gpio + PCF_GPIO_ETH_DETECT, false); if (status < 0) { pr_err("error: can't export GPIO%d\n",
arch/arm/mach-ep93xx/core.c 2011-03-20 22:00:22.000000000 +0100 renamed from arch/arm/mach-ep93xx/core.c 2011-02-11 10:53:31.000000000 +0100 +3 -5
@@ -598,13 +598,11 @@ int ep93xx_pwm_acquire_gpio(struct platf if (pdev->id == 0) { err = 0; } else if (pdev->id == 1) { - err = gpio_request(EP93XX_GPIO_LINE_EGPIO14, - dev_name(&pdev->dev)); + err = gpio_request_one(EP93XX_GPIO_LINE_EGPIO14, + GPIOF_OUT_INIT_LOW, + dev_name(&pdev->dev)); if (err) return err; - err = gpio_direction_output(EP93XX_GPIO_LINE_EGPIO14, 0); - if (err) - goto fail; /* PWM 1 output on EGPIO[14] */ ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_PONG);
arch/arm/mach-mx3/mach-armadillo5x0.c 2011-03-20 22:00:21.000000000 +0100 renamed from arch/arm/mach-mx3/mach-armadillo5x0.c 2011-03-14 17:19:13.000000000 +0100 +5 -21
@@ -160,18 +160,13 @@ static int usbotg_init(struct platform_d /* Chip already enabled by hardware */ /* OTG phy reset*/ - err = gpio_request(OTG_RESET, "USB-OTG-RESET"); + err = gpio_request_one(OTG_RESET, GPIOF_OUT_INIT_HIGH, + "USB-OTG-RESET"); if (err) { pr_err("Failed to request the usb otg reset gpio\n"); return err; } - err = gpio_direction_output(OTG_RESET, 1/*HIGH*/); - if (err) { - pr_err("Failed to reset the usb otg phy\n"); - goto otg_free_reset; - } - gpio_set_value(OTG_RESET, 0/*LOW*/); mdelay(5); gpio_set_value(OTG_RESET, 1/*HIGH*/);
@@ -206,31 +201,20 @@ static int usbh2_init(struct platform_de /* Enable the chip */ - err = gpio_request(USBH2_CS, "USB-H2-CS"); + err = gpio_request_one(USBH2_CS, GPIOF_OUT_INIT_LOW, "USB-H2-CS"); if (err) { pr_err("Failed to request the usb host 2 CS gpio\n"); return err; } - err = gpio_direction_output(USBH2_CS, 0/*Enabled*/); - if (err) { - pr_err("Failed to drive the usb host 2 CS gpio\n"); - goto h2_free_cs; - } - /* H2 phy reset*/ - err = gpio_request(USBH2_RESET, "USB-H2-RESET"); + err = gpio_request_one(USBH2_RESET, GPIOF_OUT_INIT_HIGH, + "USB-H2-RESET"); if (err) { pr_err("Failed to request the usb host 2 reset gpio\n"); goto h2_free_cs; } - err = gpio_direction_output(USBH2_RESET, 1/*HIGH*/); - if (err) { - pr_err("Failed to reset the usb host 2 phy\n"); - goto h2_free_reset; - } - gpio_set_value(USBH2_RESET, 0/*LOW*/); mdelay(5); gpio_set_value(USBH2_RESET, 1/*HIGH*/);
arch/arm/mach-mx3/mach-mx31_3ds.c 2011-03-20 22:00:21.000000000 +0100 renamed from arch/arm/mach-mx3/mach-mx31_3ds.c 2011-03-14 17:19:13.000000000 +0100 +3 -14
@@ -574,18 +574,13 @@ static int mx31_3ds_usbotg_init(void) mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, USB_PAD_CFG); mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, USB_PAD_CFG); - err = gpio_request(USBOTG_RST_B, "otgusb-reset"); + err = gpio_request_one(USBOTG_RST_B, GPIOF_OUT_INIT_LOW, + "otgusb-reset"); if (err) { pr_err("Failed to request the USB OTG reset gpio\n"); return err; } - err = gpio_direction_output(USBOTG_RST_B, 0); - if (err) { - pr_err("Failed to drive the USB OTG reset gpio\n"); - goto usbotg_free_reset; - } - mdelay(1); gpio_set_value(USBOTG_RST_B, 1); return 0;
@@ -617,18 +612,12 @@ static int mx31_3ds_host2_init(struct pl mxc_iomux_set_pad(MX31_PIN_IOIS16, USB_PAD_CFG); mxc_iomux_set_pad(MX31_PIN_PC_RW_B, USB_PAD_CFG); - err = gpio_request(USBH2_RST_B, "usbh2-reset"); + err = gpio_request_one(USBH2_RST_B, GPIOF_OUT_INIT_LOW, "usbh2-reset"); if (err) { pr_err("Failed to request the USB Host 2 reset gpio\n"); return err; } - err = gpio_direction_output(USBH2_RST_B, 0); - if (err) { - pr_err("Failed to drive the USB Host 2 reset gpio\n"); - goto usbotg_free_reset; - } - mdelay(1); gpio_set_value(USBH2_RST_B, 1);
arch/arm/mach-mx3/mach-mx31moboard.c 2011-03-20 22:00:22.000000000 +0100 renamed from arch/arm/mach-mx3/mach-mx31moboard.c 2011-03-14 17:19:13.000000000 +0100 +2 -5
@@ -123,14 +123,11 @@ static struct platform_device mx31moboar static int moboard_uart0_init(struct platform_device *pdev) { - int ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_CTS1), "uart0-cts-hack"); + int ret = gpio_request_one(IOMUX_TO_GPIO(MX31_PIN_CTS1), + GPIOF_OUT_INIT_LOW, "uart0-cts-hack"); if (ret) return ret; - ret = gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CTS1), 0); - if (ret) - gpio_free(IOMUX_TO_GPIO(MX31_PIN_CTS1)); - return ret; }
arch/arm/mach-mxs/mach-mx28evk.c 2011-03-20 22:00:22.000000000 +0100 renamed from arch/arm/mach-mxs/mach-mx28evk.c 2011-03-14 17:19:13.000000000 +0100 +2 -7
@@ -129,18 +129,13 @@ static void __init mx28evk_fec_reset(voi clk_enable(clk); /* Power up fec phy */ - ret = gpio_request(MX28EVK_FEC_PHY_POWER, "fec-phy-power"); + ret = gpio_request_one(MX28EVK_FEC_PHY_POWER, GPIOF_OUT_INIT_LOW, + "fec-phy-power"); if (ret) { pr_err("Failed to request gpio fec-phy-%s: %d\n", "power", ret); return; } - ret = gpio_direction_output(MX28EVK_FEC_PHY_POWER, 0); - if (ret) { - pr_err("Failed to drive gpio fec-phy-%s: %d\n", "power", ret); - return; - } - /* Reset fec phy */ ret = gpio_request(MX28EVK_FEC_PHY_RESET, "fec-phy-reset"); if (ret) {
arch/arm/mach-mxs/module-tx28.c 2011-03-20 22:00:23.000000000 +0100 renamed from arch/arm/mach-mxs/module-tx28.c 2011-03-14 17:19:13.000000000 +0100 +1 -7
@@ -72,19 +72,13 @@ int __init tx28_add_fec0(void) unsigned int gpio = MXS_GPIO_NR(PAD_BANK(tx28_fec_gpio_pads[i]), PAD_PIN(tx28_fec_gpio_pads[i])); - ret = gpio_request(gpio, "FEC"); + ret = gpio_request_one(gpio, GPIOF_OUT_INIT_LOW, "FEC"); if (ret) { pr_err("Failed to request GPIO_%d_%d: %d\n", PAD_BANK(tx28_fec_gpio_pads[i]), PAD_PIN(tx28_fec_gpio_pads[i]), ret); goto free_gpios; } - ret = gpio_direction_output(gpio, 0); - if (ret) { - pr_err("Failed to set direction of GPIO_%d_%d to output: %d\n", - gpio / 32 + 1, gpio % 32, ret); - goto free_gpios; - } } /* Power up fec phy */
arch/arm/mach-omap2/board-4430sdp.c 2011-03-20 22:00:22.000000000 +0100 renamed from arch/arm/mach-omap2/board-4430sdp.c 2011-03-20 18:17:22.000000000 +0100 +7 -31
@@ -257,44 +257,26 @@ static int omap_ethernet_init(void) /* Request of GPIO lines */ - status = gpio_request(ETH_KS8851_POWER_ON, "eth_power"); + status = gpio_request_one(ETH_KS8851_POWER_ON, GPIOF_OUT_INIT_HIGH, + "eth_power"); if (status) { pr_err("Cannot request GPIO %d\n", ETH_KS8851_POWER_ON); return status; } - status = gpio_request(ETH_KS8851_QUART, "quart"); + status = gpio_request_one(ETH_KS8851_QUART, GPIOF_OUT_INIT_HIGH, + "quart"); if (status) { pr_err("Cannot request GPIO %d\n", ETH_KS8851_QUART); goto error1; } - status = gpio_request(ETH_KS8851_IRQ, "eth_irq"); + status = gpio_request_one(ETH_KS8851_IRQ, GPIOF_IN, "eth_irq"); if (status) { pr_err("Cannot request GPIO %d\n", ETH_KS8851_IRQ); goto error2; } - /* Configuration of requested GPIO lines */ - - status = gpio_direction_output(ETH_KS8851_POWER_ON, 1); - if (status) { - pr_err("Cannot set output GPIO %d\n", ETH_KS8851_IRQ); - goto error3; - } - - status = gpio_direction_output(ETH_KS8851_QUART, 1); - if (status) { - pr_err("Cannot set output GPIO %d\n", ETH_KS8851_QUART); - goto error3; - } - - status = gpio_direction_input(ETH_KS8851_IRQ); - if (status) { - pr_err("Cannot set input GPIO %d\n", ETH_KS8851_IRQ); - goto error3; - } - return 0; error3:
@@ -616,19 +598,13 @@ static void __init omap_sfh7741prox_init { int error; - error = gpio_request(OMAP4_SFH7741_ENABLE_GPIO, "sfh7741"); + error = gpio_request_one(OMAP4_SFH7741_ENABLE_GPIO, + GPIOF_OUT_INIT_LOW, "sfh7741"); if (error < 0) { pr_err("%s:failed to request GPIO %d, error %d\n", __func__, OMAP4_SFH7741_ENABLE_GPIO, error); return; } - - error = gpio_direction_output(OMAP4_SFH7741_ENABLE_GPIO , 0); - if (error < 0) { - pr_err("%s: GPIO configuration failed: GPIO %d,error %d\n", - __func__, OMAP4_SFH7741_ENABLE_GPIO, error); - gpio_free(OMAP4_SFH7741_ENABLE_GPIO); - } } static void sdp4430_hdmi_mux_init(void)
arch/arm/mach-omap2/board-am3517crane.c 2011-03-20 22:00:23.000000000 +0100 renamed from arch/arm/mach-omap2/board-am3517crane.c 2011-03-14 17:19:13.000000000 +0100 +2 -8
@@ -89,19 +89,13 @@ static void __init am3517_crane_init(voi return; } - ret = gpio_request(GPIO_USB_POWER, "usb_ehci_enable"); + ret = gpio_request_one(GPIO_USB_POWER, GPIOF_OUT_INIT_HIGH, + "usb_ehci_enable"); if (ret < 0) { pr_err("Can not request GPIO %d\n", GPIO_USB_POWER); return; } - ret = gpio_direction_output(GPIO_USB_POWER, 1); - if (ret < 0) { - gpio_free(GPIO_USB_POWER); - pr_err("Unable to initialize EHCI power\n"); - return; - } - usbhs_init(&usbhs_bdata); }
arch/arm/mach-omap2/board-am3517evm.c 2011-03-20 22:00:24.000000000 +0100 renamed from arch/arm/mach-omap2/board-am3517evm.c 2011-03-14 17:19:13.000000000 +0100 +1 -8
@@ -174,19 +174,12 @@ static void __init am3517_evm_rtc_init(v int r; omap_mux_init_gpio(GPIO_RTCS35390A_IRQ, OMAP_PIN_INPUT_PULLUP); - r = gpio_request(GPIO_RTCS35390A_IRQ, "rtcs35390a-irq"); + r = gpio_request_one(GPIO_RTCS35390A_IRQ, GPIOF_IN, "rtcs35390a-irq"); if (r < 0) { printk(KERN_WARNING "failed to request GPIO#%d\n", GPIO_RTCS35390A_IRQ); return; } - r = gpio_direction_input(GPIO_RTCS35390A_IRQ); - if (r < 0) { - printk(KERN_WARNING "GPIO#%d cannot be configured as input\n", - GPIO_RTCS35390A_IRQ); - gpio_free(GPIO_RTCS35390A_IRQ); - return; - } am3517evm_i2c1_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ); }
arch/arm/mach-omap2/board-omap3pandora.c 2011-03-20 22:00:23.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap3pandora.c 2011-03-14 17:19:13.000000000 +0100 +2 -12
@@ -305,18 +305,12 @@ static int omap3pandora_twl_gpio_setup(s /* gpio + 13 drives 32kHz buffer for wifi module */ gpio_32khz = gpio + 13; - ret = gpio_request(gpio_32khz, "wifi 32kHz"); + ret = gpio_request_one(gpio_32khz, GPIOF_OUT_INIT_HIGH, "wifi 32kHz"); if (ret < 0) { pr_err("Cannot get GPIO line %d, ret=%d\n", gpio_32khz, ret); goto fail; } - ret = gpio_direction_output(gpio_32khz, 1); - if (ret < 0) { - pr_err("Cannot set GPIO line %d, ret=%d\n", gpio_32khz, ret); - goto fail_direction; - } - return 0; fail_direction:
@@ -639,14 +633,10 @@ static void __init pandora_wl1251_init(v memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata)); - ret = gpio_request(PANDORA_WIFI_IRQ_GPIO, "wl1251 irq"); + ret = gpio_request_one(PANDORA_WIFI_IRQ_GPIO, GPIOF_IN, "wl1251 irq"); if (ret < 0) goto fail; - ret = gpio_direction_input(PANDORA_WIFI_IRQ_GPIO); - if (ret < 0) - goto fail_irq; - pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO); if (pandora_wl1251_pdata.irq < 0) goto fail_irq;
arch/arm/mach-omap2/board-rx51-peripherals.c 2011-03-20 22:00:21.000000000 +0100 renamed from arch/arm/mach-omap2/board-rx51-peripherals.c 2011-03-14 17:19:13.000000000 +0100 +3 -10
@@ -925,22 +925,15 @@ static void __init rx51_init_wl1251(void { int irq, ret; - ret = gpio_request(RX51_WL1251_POWER_GPIO, "wl1251 power"); + ret = gpio_request_one(RX51_WL1251_POWER_GPIO, GPIOF_OUT_INIT_LOW, + "wl1251 power"); if (ret < 0) goto error; - ret = gpio_direction_output(RX51_WL1251_POWER_GPIO, 0); + ret = gpio_request_one(RX51_WL1251_IRQ_GPIO, GPIOF_IN, "wl1251 irq"); if (ret < 0) goto err_power; - ret = gpio_request(RX51_WL1251_IRQ_GPIO, "wl1251 irq"); - if (ret < 0) - goto err_power; - - ret = gpio_direction_input(RX51_WL1251_IRQ_GPIO); - if (ret < 0) - goto err_irq; - irq = gpio_to_irq(RX51_WL1251_IRQ_GPIO); if (irq < 0) goto err_irq;
arch/arm/mach-pxa/balloon3.c 2011-03-20 22:00:21.000000000 +0100 renamed from arch/arm/mach-pxa/balloon3.c 2011-03-14 17:19:13.000000000 +0100 +4 -12
@@ -250,18 +250,13 @@ static void __init balloon3_lcd_init(voi pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_lcd_pin_config)); - ret = gpio_request(BALLOON3_GPIO_RUN_BACKLIGHT, "BKL-ON"); + ret = gpio_request_one(BALLOON3_GPIO_RUN_BACKLIGHT, + GPIOF_OUT_INIT_HIGH, "BKL-ON"); if (ret) { pr_err("Requesting BKL-ON GPIO failed!\n"); goto err; } - ret = gpio_direction_output(BALLOON3_GPIO_RUN_BACKLIGHT, 1); - if (ret) { - pr_err("Setting BKL-ON GPIO direction failed!\n"); - goto err2; - } - balloon3_lcd_screen.pxafb_backlight_power = balloon3_backlight_power; set_pxa_fb_info(&balloon3_lcd_screen); return;
@@ -635,14 +630,11 @@ static int balloon3_nand_probe(struct pl "NAND support might be broken in this version!", ver); /* Power up the NAND chips */ - ret = gpio_request(BALLOON3_GPIO_RUN_NAND, "NAND"); + ret = gpio_request_one(BALLOON3_GPIO_RUN_NAND, GPIOF_OUT_INIT_HIGH, + "NAND"); if (ret) goto err1; - ret = gpio_direction_output(BALLOON3_GPIO_RUN_NAND, 1); - if (ret) - goto err2; - gpio_set_value(BALLOON3_GPIO_RUN_NAND, 1); /* Deassert all nCE lines and write protect line */
arch/arm/mach-pxa/cm-x270.c 2011-03-20 22:00:23.000000000 +0100 renamed from arch/arm/mach-pxa/cm-x270.c 2010-12-31 15:18:30.000000000 +0100 +4 -8
@@ -327,22 +327,18 @@ static unsigned long cm_x270_libertas_pi static int cm_x270_libertas_setup(struct spi_device *spi) { - int err = gpio_request(GPIO19_WLAN_STRAP, "WLAN STRAP"); + int err = gpio_request_one(GPIO19_WLAN_STRAP, GPIOF_OUT_INIT_HIGH, + "WLAN STRAP"); if (err) return err; - err = gpio_request(GPIO102_WLAN_RST, "WLAN RST"); + err = gpio_request_one(GPIO102_WLAN_RST, GPIOF_OUT_INIT_LOW, + "WLAN RST"); if (err) goto err_free_strap; - err = gpio_direction_output(GPIO102_WLAN_RST, 0); - if (err) - goto err_free_strap; msleep(100); - err = gpio_direction_output(GPIO19_WLAN_STRAP, 1); - if (err) - goto err_free_strap; msleep(100); pxa2xx_mfp_config(ARRAY_AND_SIZE(cm_x270_libertas_pin_config));
arch/arm/mach-pxa/gumstix.c 2011-03-20 22:00:24.000000000 +0100 renamed from arch/arm/mach-pxa/gumstix.c 2010-12-28 18:26:02.000000000 +0100 +2 -6
@@ -152,17 +152,13 @@ static void __init gumstix_bluetooth_ini gumstix_setup_bt_clock(); - err = gpio_request(GPIO_GUMSTIX_BTRESET, "BTRST"); + err = gpio_request_one(GPIO_GUMSTIX_BTRESET, GPIOF_OUT_INIT_HIGH, + "BTRST"); if (err) { pr_err("gumstix: failed request gpio for bluetooth reset\n"); return; } - err = gpio_direction_output(GPIO_GUMSTIX_BTRESET, 1); - if (err) { - pr_err("gumstix: can't reset bluetooth\n"); - return; - } gpio_set_value(GPIO_GUMSTIX_BTRESET, 0); udelay(100); gpio_set_value(GPIO_GUMSTIX_BTRESET, 1);
arch/arm/mach-pxa/palm27x.c 2011-03-20 22:00:24.000000000 +0100 renamed from arch/arm/mach-pxa/palm27x.c 2011-03-14 17:19:13.000000000 +0100 +5 -16
@@ -278,20 +278,15 @@ static int palm27x_backlight_init(struct { int ret; - ret = gpio_request(palm_bl_power, "BL POWER"); + ret = gpio_request_one(palm_bl_power, GPIOF_OUT_INIT_LOW, "BL POWER"); if (ret) goto err; - ret = gpio_direction_output(palm_bl_power, 0); - if (ret) - goto err2; if (gpio_is_valid(palm_lcd_power)) { - ret = gpio_request(palm_lcd_power, "LCD POWER"); + ret = gpio_request_one(palm_lcd_power, GPIOF_OUT_INIT_LOW, + "LCD POWER"); if (ret) goto err2; - ret = gpio_direction_output(palm_lcd_power, 0); - if (ret) - goto err3; } return 0;
@@ -355,20 +350,14 @@ static int palm27x_power_supply_init(str { int ret; - ret = gpio_request(palm_ac_state, "AC state"); + ret = gpio_request_one(palm_ac_state, GPIOF_IN, "AC state"); if (ret) goto err1; - ret = gpio_direction_input(palm_ac_state); - if (ret) - goto err2; if (gpio_is_valid(palm_usb_state)) { - ret = gpio_request(palm_usb_state, "USB state"); + ret = gpio_request_one(palm_usb_state, GPIOF_IN, "USB state"); if (ret) goto err2; - ret = gpio_direction_input(palm_usb_state); - if (ret) - goto err3; } return 0;
arch/arm/mach-pxa/palmtc.c 2011-03-20 22:00:23.000000000 +0100 renamed from arch/arm/mach-pxa/palmtc.c 2010-12-28 18:26:02.000000000 +0100 +2 -4
@@ -171,12 +171,10 @@ static int palmtc_backlight_init(struct { int ret; - ret = gpio_request(GPIO_NR_PALMTC_BL_POWER, "BL POWER"); + ret = gpio_request_one(GPIO_NR_PALMTC_BL_POWER, GPIOF_OUT_INIT_HIGH, + "BL POWER"); if (ret) goto err; - ret = gpio_direction_output(GPIO_NR_PALMTC_BL_POWER, 1); - if (ret) - goto err2; return 0;
arch/arm/mach-pxa/palmte2.c 2011-03-20 22:00:22.000000000 +0100 renamed from arch/arm/mach-pxa/palmte2.c 2010-12-28 18:26:02.000000000 +0100 +6 -12
@@ -140,18 +140,14 @@ static int palmte2_backlight_init(struct { int ret; - ret = gpio_request(GPIO_NR_PALMTE2_BL_POWER, "BL POWER"); + ret = gpio_request_one(GPIO_NR_PALMTE2_BL_POWER, GPIOF_OUT_INIT_LOW, + "BL POWER"); if (ret) goto err; - ret = gpio_direction_output(GPIO_NR_PALMTE2_BL_POWER, 0); + ret = gpio_request_one(GPIO_NR_PALMTE2_LCD_POWER, GPIOF_OUT_INIT_LOW, + "LCD POWER"); if (ret) goto err2; - ret = gpio_request(GPIO_NR_PALMTE2_LCD_POWER, "LCD POWER"); - if (ret) - goto err2; - ret = gpio_direction_output(GPIO_NR_PALMTE2_LCD_POWER, 0); - if (ret) - goto err3; return 0; err3:
@@ -225,12 +221,10 @@ static int power_supply_init(struct devi { int ret; - ret = gpio_request(GPIO_NR_PALMTE2_POWER_DETECT, "CABLE_STATE_AC"); + ret = gpio_request_one(GPIO_NR_PALMTE2_POWER_DETECT, GPIOF_IN, + "CABLE_STATE_AC"); if (ret) goto err1; - ret = gpio_direction_input(GPIO_NR_PALMTE2_POWER_DETECT); - if (ret) - goto err2; return 0;
arch/arm/mach-pxa/tosa-bt.c 2011-03-20 22:00:23.000000000 +0100 renamed from arch/arm/mach-pxa/tosa-bt.c 2011-03-14 17:19:13.000000000 +0100 +4 -8
@@ -61,18 +61,14 @@ static int tosa_bt_probe(struct platform struct tosa_bt_data *data = dev->dev.platform_data; - rc = gpio_request(data->gpio_reset, "Bluetooth reset"); + rc = gpio_request_one(data->gpio_reset, GPIOF_OUT_INIT_LOW, + "Bluetooth reset"); if (rc) goto err_reset; - rc = gpio_direction_output(data->gpio_reset, 0); - if (rc) - goto err_reset_dir; - rc = gpio_request(data->gpio_pwr, "Bluetooth power"); + rc = gpio_request_one(data->gpio_pwr, GPIOF_OUT_INIT_LOW, + "Bluetooth power"); if (rc) goto err_pwr; - rc = gpio_direction_output(data->gpio_pwr, 0); - if (rc) - goto err_pwr_dir; rfk = rfkill_alloc("tosa-bt", &dev->dev, RFKILL_TYPE_BLUETOOTH, &tosa_bt_rfkill_ops, data);
arch/arm/mach-pxa/tosa.c 2011-03-20 22:00:23.000000000 +0100 renamed from arch/arm/mach-pxa/tosa.c 2011-03-14 17:19:13.000000000 +0100 +14 -35
101 lines not on this page · raw message
arch/arm/mach-pxa/viper.c 2011-03-20 22:00:22.000000000 +0100 renamed from arch/arm/mach-pxa/viper.c 2011-03-14 17:19:13.000000000 +0100 +3 -10
@@ -353,22 +353,15 @@ static int viper_backlight_init(struct d int ret; /* GPIO9 and 10 control FB backlight. Initialise to off */ - ret = gpio_request(VIPER_BCKLIGHT_EN_GPIO, "Backlight"); + ret = gpio_request_one(VIPER_BCKLIGHT_EN_GPIO, GPIOF_OUT_INIT_LOW, + "Backlight"); if (ret) goto err_request_bckl; - ret = gpio_request(VIPER_LCD_EN_GPIO, "LCD"); + ret = gpio_request_one(VIPER_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW, "LCD"); if (ret) goto err_request_lcd; - ret = gpio_direction_output(VIPER_BCKLIGHT_EN_GPIO, 0); - if (ret) - goto err_dir; - - ret = gpio_direction_output(VIPER_LCD_EN_GPIO, 0); - if (ret) - goto err_dir; - return 0; err_dir:
arch/arm/mach-pxa/vpac270.c 2011-03-20 22:00:23.000000000 +0100 renamed from arch/arm/mach-pxa/vpac270.c 2011-03-14 17:19:13.000000000 +0100 +2 -7
@@ -559,18 +559,13 @@ static void __init vpac270_lcd_init(void { int ret; - ret = gpio_request(GPIO81_VPAC270_BKL_ON, "BKL-ON"); + ret = gpio_request_one(GPIO81_VPAC270_BKL_ON, GPIOF_OUT_INIT_HIGH, + "BKL-ON"); if (ret) { pr_err("Requesting BKL-ON GPIO failed!\n"); goto err; } - ret = gpio_direction_output(GPIO81_VPAC270_BKL_ON, 1); - if (ret) { - pr_err("Setting BKL-ON GPIO direction failed!\n"); - goto err2; - } - vpac270_lcd_screen.pxafb_lcd_power = vpac270_lcd_power; set_pxa_fb_info(&vpac270_lcd_screen); return;
arch/arm/mach-pxa/z2.c 2011-03-20 22:00:22.000000000 +0100 renamed from arch/arm/mach-pxa/z2.c 2011-03-14 17:19:13.000000000 +0100 +4 -10
@@ -497,22 +497,16 @@ static int z2_lbs_spi_setup(struct spi_d { int ret = 0; - ret = gpio_request(GPIO15_ZIPITZ2_WIFI_POWER, "WiFi Power"); + ret = gpio_request_one(GPIO15_ZIPITZ2_WIFI_POWER, + GPIOF_OUT_INIT_HIGH, "WiFi Power"); if (ret) goto err; - ret = gpio_direction_output(GPIO15_ZIPITZ2_WIFI_POWER, 1); + ret = gpio_request_one(GPIO14_ZIPITZ2_WIFI_RESET, GPIOF_OUT_INIT_LOW, + "WiFi Reset"); if (ret) goto err2; - ret = gpio_request(GPIO14_ZIPITZ2_WIFI_RESET, "WiFi Reset"); - if (ret) - goto err2; - - ret = gpio_direction_output(GPIO14_ZIPITZ2_WIFI_RESET, 0); - if (ret) - goto err3; - /* Reset the card */ mdelay(180); gpio_set_value(GPIO14_ZIPITZ2_WIFI_RESET, 1);
arch/arm/mach-pxa/zeus.c 2011-03-20 22:00:23.000000000 +0100 renamed from arch/arm/mach-pxa/zeus.c 2011-03-14 17:19:13.000000000 +0100 +2 -7
@@ -393,16 +393,11 @@ static int zeus_mcp2515_setup(struct spi { int err; - err = gpio_request(ZEUS_CAN_SHDN_GPIO, "CAN shutdown"); + err = gpio_request_one(ZEUS_CAN_SHDN_GPIO, GPIOF_OUT_INIT_HIGH, + "CAN shutdown"); if (err) return err; - err = gpio_direction_output(ZEUS_CAN_SHDN_GPIO, 1); - if (err) { - gpio_free(ZEUS_CAN_SHDN_GPIO); - return err; - } - return 0; }
arch/arm/mach-sa1100/collie.c 2011-03-20 22:00:24.000000000 +0100 renamed from arch/arm/mach-sa1100/collie.c 2011-02-19 08:28:51.000000000 +0100 +3 -10
@@ -95,14 +95,10 @@ static struct mcp_plat_data collie_mcp_d */ static int collie_power_init(struct device *dev) { - int ret = gpio_request(COLLIE_GPIO_AC_IN, "ac in"); + int ret = gpio_request_one(COLLIE_GPIO_AC_IN, GPIOF_IN, "ac in"); if (ret) goto err_gpio_req; - ret = gpio_direction_input(COLLIE_GPIO_AC_IN); - if (ret) - goto err_gpio_in; - return 0; err_gpio_in:
@@ -273,14 +269,11 @@ static struct mtd_partition collie_parti static int collie_flash_init(void) { - int rc = gpio_request(COLLIE_GPIO_VPEN, "flash Vpp enable"); + int rc = gpio_request_one(COLLIE_GPIO_VPEN, GPIOF_OUT_INIT_HIGH, + "flash Vpp enable"); if (rc) return rc; - rc = gpio_direction_output(COLLIE_GPIO_VPEN, 1); - if (rc) - gpio_free(COLLIE_GPIO_VPEN); - return rc; }
arch/arm/mach-sa1100/h3600.c 2011-03-20 22:00:24.000000000 +0100 renamed from arch/arm/mach-sa1100/h3600.c 2010-10-23 19:40:31.000000000 +0200 +4 -8
@@ -79,18 +79,14 @@ static void h3600_irda_set_speed(struct static int h3600_irda_startup(struct device *dev) { - int err = gpio_request(H3600_EGPIO_IR_ON, "IrDA power"); + int err = gpio_request_one(H3600_EGPIO_IR_ON, GPIOF_OUT_INIT_LOW, + "IrDA power"); if (err) goto err1; - err = gpio_direction_output(H3600_EGPIO_IR_ON, 0); + err = gpio_request_one(H3600_EGPIO_IR_FSEL, GPIOF_OUT_INIT_LOW, + "IrDA fsel"); if (err) goto err2; - err = gpio_request(H3600_EGPIO_IR_FSEL, "IrDA fsel"); - if (err) - goto err2; - err = gpio_direction_output(H3600_EGPIO_IR_FSEL, 0); - if (err) - goto err3; return 0; err3: gpio_free(H3600_EGPIO_IR_FSEL);
arch/arm/mach-sa1100/h3xxx.c 2011-03-20 22:00:24.000000000 +0100 renamed from arch/arm/mach-sa1100/h3xxx.c 2009-12-03 14:09:46.000000000 +0100 +2 -5
@@ -82,16 +82,13 @@ static void h3xxx_set_vpp(int vpp) static int h3xxx_flash_init(void) { - int err = gpio_request(H3XXX_EGPIO_VPP_ON, "Flash Vpp"); + int err = gpio_request_one(H3XXX_EGPIO_VPP_ON, GPIOF_OUT_INIT_LOW, + "Flash Vpp"); if (err) { pr_err("%s: can't request H3XXX_EGPIO_VPP_ON\n", __func__); return err; } - err = gpio_direction_output(H3XXX_EGPIO_VPP_ON, 0); - if (err) - gpio_free(H3XXX_EGPIO_VPP_ON); - return err; }
arch/arm/mach-ux500/board-mop500-stuib.c 2011-03-20 22:00:22.000000000 +0100 renamed from arch/arm/mach-ux500/board-mop500-stuib.c 2011-02-19 08:28:51.000000000 +0100 +2 -7
@@ -100,17 +100,12 @@ static int bu21013_gpio_board_init(int r bu21013_devices++; if (bu21013_devices == 1) { - retval = gpio_request(reset_pin, "touchp_reset"); + retval = gpio_request_one(reset_pin, GPIOF_OUT_INIT_HIGH, + "touchp_reset"); if (retval) { printk(KERN_ERR "Unable to request gpio reset_pin"); return retval; } - retval = gpio_direction_output(reset_pin, 1); - if (retval < 0) { - printk(KERN_ERR "%s: gpio direction failed\n", - __func__); - return retval; - } } return retval;
arch/m68knommu/platform/520x/config.c 2011-03-20 22:00:24.000000000 +0100 renamed from arch/m68knommu/platform/520x/config.c 2011-03-14 17:19:13.000000000 +0100 +6 -18
@@ -99,38 +99,26 @@ static int m520x_cs_setup(struct mcfqspi { int status; - status = gpio_request(MCFQSPI_CS0, "MCFQSPI_CS0"); + status = gpio_request_one(MCFQSPI_CS0, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS0"); if (status) { pr_debug("gpio_request for MCFQSPI_CS0 failed\n"); goto fail0; } - status = gpio_direction_output(MCFQSPI_CS0, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS0 failed\n"); - goto fail1; - } - status = gpio_request(MCFQSPI_CS1, "MCFQSPI_CS1"); + status = gpio_request_one(MCFQSPI_CS1, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS1"); if (status) { pr_debug("gpio_request for MCFQSPI_CS1 failed\n"); goto fail1; } - status = gpio_direction_output(MCFQSPI_CS1, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS1 failed\n"); - goto fail2; - } - status = gpio_request(MCFQSPI_CS2, "MCFQSPI_CS2"); + status = gpio_request_one(MCFQSPI_CS2, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS2"); if (status) { pr_debug("gpio_request for MCFQSPI_CS2 failed\n"); goto fail2; } - status = gpio_direction_output(MCFQSPI_CS2, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS2 failed\n"); - goto fail3; - } return 0;
arch/m68knommu/platform/523x/config.c 2011-03-20 22:00:24.000000000 +0100 renamed from arch/m68knommu/platform/523x/config.c 2011-03-14 17:19:13.000000000 +0100 +8 -24
@@ -101,49 +101,33 @@ static int m523x_cs_setup(struct mcfqspi { int status; - status = gpio_request(MCFQSPI_CS0, "MCFQSPI_CS0"); + status = gpio_request_one(MCFQSPI_CS0, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS0"); if (status) { pr_debug("gpio_request for MCFQSPI_CS0 failed\n"); goto fail0; } - status = gpio_direction_output(MCFQSPI_CS0, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS0 failed\n"); - goto fail1; - } - status = gpio_request(MCFQSPI_CS1, "MCFQSPI_CS1"); + status = gpio_request_one(MCFQSPI_CS1, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS1"); if (status) { pr_debug("gpio_request for MCFQSPI_CS1 failed\n"); goto fail1; } - status = gpio_direction_output(MCFQSPI_CS1, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS1 failed\n"); - goto fail2; - } - status = gpio_request(MCFQSPI_CS2, "MCFQSPI_CS2"); + status = gpio_request_one(MCFQSPI_CS2, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS2"); if (status) { pr_debug("gpio_request for MCFQSPI_CS2 failed\n"); goto fail2; } - status = gpio_direction_output(MCFQSPI_CS2, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS2 failed\n"); - goto fail3; - } - status = gpio_request(MCFQSPI_CS3, "MCFQSPI_CS3"); + status = gpio_request_one(MCFQSPI_CS3, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS3"); if (status) { pr_debug("gpio_request for MCFQSPI_CS3 failed\n"); goto fail3; } - status = gpio_direction_output(MCFQSPI_CS3, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS3 failed\n"); - goto fail4; - } return 0;
arch/m68knommu/platform/5249/config.c 2011-03-20 22:00:21.000000000 +0100 renamed from arch/m68knommu/platform/5249/config.c 2010-05-27 15:47:03.000000000 +0200 +8 -24
@@ -87,49 +87,33 @@ static int m5249_cs_setup(struct mcfqspi { int status; - status = gpio_request(MCFQSPI_CS0, "MCFQSPI_CS0"); + status = gpio_request_one(MCFQSPI_CS0, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS0"); if (status) { pr_debug("gpio_request for MCFQSPI_CS0 failed\n"); goto fail0; } - status = gpio_direction_output(MCFQSPI_CS0, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS0 failed\n"); - goto fail1; - } - status = gpio_request(MCFQSPI_CS1, "MCFQSPI_CS1"); + status = gpio_request_one(MCFQSPI_CS1, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS1"); if (status) { pr_debug("gpio_request for MCFQSPI_CS1 failed\n"); goto fail1; } - status = gpio_direction_output(MCFQSPI_CS1, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS1 failed\n"); - goto fail2; - } - status = gpio_request(MCFQSPI_CS2, "MCFQSPI_CS2"); + status = gpio_request_one(MCFQSPI_CS2, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS2"); if (status) { pr_debug("gpio_request for MCFQSPI_CS2 failed\n"); goto fail2; } - status = gpio_direction_output(MCFQSPI_CS2, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS2 failed\n"); - goto fail3; - } - status = gpio_request(MCFQSPI_CS3, "MCFQSPI_CS3"); + status = gpio_request_one(MCFQSPI_CS3, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS3"); if (status) { pr_debug("gpio_request for MCFQSPI_CS3 failed\n"); goto fail3; } - status = gpio_direction_output(MCFQSPI_CS3, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS3 failed\n"); - goto fail4; - } return 0;
arch/m68knommu/platform/527x/config.c 2011-03-20 22:00:21.000000000 +0100 renamed from arch/m68knommu/platform/527x/config.c 2011-03-14 17:19:13.000000000 +0100 +8 -24
@@ -139,49 +139,33 @@ static int m527x_cs_setup(struct mcfqspi { int status; - status = gpio_request(MCFQSPI_CS0, "MCFQSPI_CS0"); + status = gpio_request_one(MCFQSPI_CS0, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS0"); if (status) { pr_debug("gpio_request for MCFQSPI_CS0 failed\n"); goto fail0; } - status = gpio_direction_output(MCFQSPI_CS0, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS0 failed\n"); - goto fail1; - } - status = gpio_request(MCFQSPI_CS1, "MCFQSPI_CS1"); + status = gpio_request_one(MCFQSPI_CS1, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS1"); if (status) { pr_debug("gpio_request for MCFQSPI_CS1 failed\n"); goto fail1; } - status = gpio_direction_output(MCFQSPI_CS1, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS1 failed\n"); - goto fail2; - } - status = gpio_request(MCFQSPI_CS2, "MCFQSPI_CS2"); + status = gpio_request_one(MCFQSPI_CS2, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS2"); if (status) { pr_debug("gpio_request for MCFQSPI_CS2 failed\n"); goto fail2; } - status = gpio_direction_output(MCFQSPI_CS2, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS2 failed\n"); - goto fail3; - } - status = gpio_request(MCFQSPI_CS3, "MCFQSPI_CS3"); + status = gpio_request_one(MCFQSPI_CS3, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS3"); if (status) { pr_debug("gpio_request for MCFQSPI_CS3 failed\n"); goto fail3; } - status = gpio_direction_output(MCFQSPI_CS3, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS3 failed\n"); - goto fail4; - } return 0;
arch/m68knommu/platform/528x/config.c 2011-03-20 22:00:24.000000000 +0100 renamed from arch/m68knommu/platform/528x/config.c 2011-03-14 17:19:13.000000000 +0100 +8 -24
@@ -102,49 +102,33 @@ static int m528x_cs_setup(struct mcfqspi { int status; - status = gpio_request(MCFQSPI_CS0, "MCFQSPI_CS0"); + status = gpio_request_one(MCFQSPI_CS0, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS0"); if (status) { pr_debug("gpio_request for MCFQSPI_CS0 failed\n"); goto fail0; } - status = gpio_direction_output(MCFQSPI_CS0, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS0 failed\n"); - goto fail1; - } - status = gpio_request(MCFQSPI_CS1, "MCFQSPI_CS1"); + status = gpio_request_one(MCFQSPI_CS1, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS1"); if (status) { pr_debug("gpio_request for MCFQSPI_CS1 failed\n"); goto fail1; } - status = gpio_direction_output(MCFQSPI_CS1, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS1 failed\n"); - goto fail2; - } - status = gpio_request(MCFQSPI_CS2, "MCFQSPI_CS2"); + status = gpio_request_one(MCFQSPI_CS2, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS2"); if (status) { pr_debug("gpio_request for MCFQSPI_CS2 failed\n"); goto fail2; } - status = gpio_direction_output(MCFQSPI_CS2, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS2 failed\n"); - goto fail3; - } - status = gpio_request(MCFQSPI_CS3, "MCFQSPI_CS3"); + status = gpio_request_one(MCFQSPI_CS3, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS3"); if (status) { pr_debug("gpio_request for MCFQSPI_CS3 failed\n"); goto fail3; } - status = gpio_direction_output(MCFQSPI_CS3, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS3 failed\n"); - goto fail4; - } return 0;
arch/m68knommu/platform/532x/config.c 2011-03-20 22:00:24.000000000 +0100 renamed from arch/m68knommu/platform/532x/config.c 2010-01-29 18:29:07.000000000 +0100 +6 -18
@@ -107,38 +107,26 @@ static int m532x_cs_setup(struct mcfqspi { int status; - status = gpio_request(MCFQSPI_CS0, "MCFQSPI_CS0"); + status = gpio_request_one(MCFQSPI_CS0, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS0"); if (status) { pr_debug("gpio_request for MCFQSPI_CS0 failed\n"); goto fail0; } - status = gpio_direction_output(MCFQSPI_CS0, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS0 failed\n"); - goto fail1; - } - status = gpio_request(MCFQSPI_CS1, "MCFQSPI_CS1"); + status = gpio_request_one(MCFQSPI_CS1, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS1"); if (status) { pr_debug("gpio_request for MCFQSPI_CS1 failed\n"); goto fail1; } - status = gpio_direction_output(MCFQSPI_CS1, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS1 failed\n"); - goto fail2; - } - status = gpio_request(MCFQSPI_CS2, "MCFQSPI_CS2"); + status = gpio_request_one(MCFQSPI_CS2, GPIOF_OUT_INIT_HIGH, + "MCFQSPI_CS2"); if (status) { pr_debug("gpio_request for MCFQSPI_CS2 failed\n"); goto fail2; } - status = gpio_direction_output(MCFQSPI_CS2, 1); - if (status) { - pr_debug("gpio_direction_output for MCFQSPI_CS2 failed\n"); - goto fail3; - } return 0;
drivers/ata/pata_palmld.c 2011-03-20 22:00:21.000000000 +0100 renamed from drivers/ata/pata_palmld.c 2011-02-19 08:28:51.000000000 +0100 +4 -8
@@ -61,19 +61,15 @@ static __devinit int palmld_pata_probe(s return -ENOMEM; /* request and activate power GPIO, IRQ GPIO */ - ret = gpio_request(GPIO_NR_PALMLD_IDE_PWEN, "HDD PWR"); + ret = gpio_request_one(GPIO_NR_PALMLD_IDE_PWEN, GPIOF_OUT_INIT_HIGH, + "HDD PWR"); if (ret) goto err1; - ret = gpio_direction_output(GPIO_NR_PALMLD_IDE_PWEN, 1); - if (ret) - goto err2; - ret = gpio_request(GPIO_NR_PALMLD_IDE_RESET, "HDD RST"); + ret = gpio_request_one(GPIO_NR_PALMLD_IDE_RESET, GPIOF_OUT_INIT_LOW, + "HDD RST"); if (ret) goto err2; - ret = gpio_direction_output(GPIO_NR_PALMLD_IDE_RESET, 0); - if (ret) - goto err3; /* reset the drive */ gpio_set_value(GPIO_NR_PALMLD_IDE_RESET, 0);
drivers/hwmon/gpio-fan.c 2011-03-20 22:00:23.000000000 +0100 renamed from drivers/hwmon/gpio-fan.c 2010-11-13 10:26:37.000000000 +0100 +1 -5
@@ -95,14 +95,10 @@ static int fan_alarm_init(struct gpio_fa fan_data->alarm = alarm; - err = gpio_request(alarm->gpio, "GPIO fan alarm"); + err = gpio_request_one(alarm->gpio, GPIOF_IN, "GPIO fan alarm"); if (err) return err; - err = gpio_direction_input(alarm->gpio); - if (err) - goto err_free_gpio; - err = device_create_file(&pdev->dev, &dev_attr_fan1_alarm); if (err) goto err_free_gpio;
drivers/input/keyboard/gpio_keys.c 2011-03-20 22:00:23.000000000 +0100 renamed from drivers/input/keyboard/gpio_keys.c 2011-02-02 17:27:38.000000000 +0100 +1 -9
@@ -371,21 +371,13 @@ static int __devinit gpio_keys_setup_key setup_timer(&bdata->timer, gpio_keys_timer, (unsigned long)bdata); INIT_WORK(&bdata->work, gpio_keys_work_func); - error = gpio_request(button->gpio, desc); + error = gpio_request_one(button->gpio, GPIOF_IN, desc); if (error < 0) { dev_err(dev, "failed to request GPIO %d, error %d\n", button->gpio, error); goto fail2; } - error = gpio_direction_input(button->gpio); - if (error < 0) { - dev_err(dev, "failed to configure" - " direction for GPIO %d, error %d\n", - button->gpio, error); - goto fail3; - } - if (button->debounce_interval) { error = gpio_set_debounce(button->gpio, button->debounce_interval * 1000);
drivers/input/keyboard/gpio_keys_polled.c 2011-03-20 22:00:22.000000000 +0100 renamed from drivers/input/keyboard/gpio_keys_polled.c 2010-12-26 10:19:06.000000000 +0100 +2 -10
@@ -158,22 +158,14 @@ static int __devinit gpio_keys_polled_pr goto err_free_gpio; } - error = gpio_request(gpio, - button->desc ? button->desc : DRV_NAME); + error = gpio_request_one(gpio, GPIOF_IN, + button->desc ? button->desc : DRV_NAME); if (error) { dev_err(dev, "unable to claim gpio %u, err=%d\n", gpio, error); goto err_free_gpio; } - error = gpio_direction_input(gpio); - if (error) { - dev_err(dev, - "unable to set direction on gpio %u, err=%d\n", - gpio, error); - goto err_free_gpio; - } - bdata->can_sleep = gpio_cansleep(gpio); bdata->last_state = -1; bdata->threshold = DIV_ROUND_UP(button->debounce_interval,
drivers/input/misc/rotary_encoder.c 2011-03-20 22:00:22.000000000 +0100 renamed from drivers/input/misc/rotary_encoder.c 2011-02-11 10:53:32.000000000 +0100 +2 -16
@@ -146,34 +146,20 @@ static int __devinit rotary_encoder_prob } /* request the GPIOs */ - err = gpio_request(pdata->gpio_a, DRV_NAME); + err = gpio_request_one(pdata->gpio_a, GPIOF_IN, DRV_NAME); if (err) { dev_err(&pdev->dev, "unable to request GPIO %d\n", pdata->gpio_a); goto exit_unregister_input; } - err = gpio_direction_input(pdata->gpio_a); - if (err) { - dev_err(&pdev->dev, "unable to set GPIO %d for input\n", - pdata->gpio_a); - goto exit_unregister_input; - } - - err = gpio_request(pdata->gpio_b, DRV_NAME); + err = gpio_request_one(pdata->gpio_b, GPIOF_IN, DRV_NAME); if (err) { dev_err(&pdev->dev, "unable to request GPIO %d\n", pdata->gpio_b); goto exit_free_gpio_a; } - err = gpio_direction_input(pdata->gpio_b); - if (err) { - dev_err(&pdev->dev, "unable to set GPIO %d for input\n", - pdata->gpio_b); - goto exit_free_gpio_a; - } - /* request the IRQs */ err = request_irq(encoder->irq_a, &rotary_encoder_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
drivers/input/touchscreen/cy8ctmg110_ts.c 2011-03-20 22:00:22.000000000 +0100 renamed from drivers/input/touchscreen/cy8ctmg110_ts.c 2011-01-19 18:51:19.000000000 +0100 +1 -9
@@ -223,7 +223,7 @@ static int __devinit cy8ctmg110_probe(st cy8ctmg110_power(ts, true); cy8ctmg110_set_sleepmode(ts, false); - err = gpio_request(ts->irq_pin, "touch_irq_key"); + err = gpio_request_one(ts->irq_pin, GPIOF_IN, "touch_irq_key"); if (err < 0) { dev_err(&client->dev, "Failed to request GPIO %d, error %d\n",
@@ -231,14 +231,6 @@ static int __devinit cy8ctmg110_probe(st goto err_shutoff_device; } - err = gpio_direction_input(ts->irq_pin); - if (err < 0) { - dev_err(&client->dev, - "Failed to configure input direction for GPIO %d, error %d\n", - ts->irq_pin, err); - goto err_free_irq_gpio; - } - client->irq = gpio_to_irq(ts->irq_pin); if (client->irq < 0) { err = client->irq;
drivers/input/touchscreen/mainstone-wm97xx.c 2011-03-20 22:00:22.000000000 +0100 renamed from drivers/input/touchscreen/mainstone-wm97xx.c 2010-02-03 15:05:01.000000000 +0100 +1 -7
@@ -208,16 +208,10 @@ static int wm97xx_acc_startup(struct wm9 irq = 4; if (irq) { - ret = gpio_request(irq, "Touchscreen IRQ"); + ret = gpio_request_one(irq, GPIOF_IN, "Touchscreen IRQ"); if (ret) goto out; - ret = gpio_direction_input(irq); - if (ret) { - gpio_free(irq); - goto out; - } - wm->pen_irq = gpio_to_irq(irq); set_irq_type(wm->pen_irq, IRQ_TYPE_EDGE_BOTH); } else /* pen irq not supported */
drivers/leds/leds-netxbig.c 2011-03-20 22:00:21.000000000 +0100 renamed from drivers/leds/leds-netxbig.c 2010-10-14 18:30:04.000000000 +0200 +6 -18
@@ -81,35 +81,23 @@ static int __devinit gpio_ext_init(struc /* Configure address GPIOs. */ for (i = 0; i < gpio_ext->num_addr; i++) { - err = gpio_request(gpio_ext->addr[i], "GPIO extension addr"); + err = gpio_request_one(gpio_ext->addr[i], GPIOF_OUT_INIT_LOW, + "GPIO extension addr"); if (err) goto err_free_addr; - err = gpio_direction_output(gpio_ext->addr[i], 0); - if (err) { - gpio_free(gpio_ext->addr[i]); - goto err_free_addr; - } } /* Configure data GPIOs. */ for (i = 0; i < gpio_ext->num_data; i++) { - err = gpio_request(gpio_ext->data[i], "GPIO extension data"); + err = gpio_request_one(gpio_ext->data[i], GPIOF_OUT_INIT_LOW, + "GPIO extension data"); if (err) goto err_free_data; - err = gpio_direction_output(gpio_ext->data[i], 0); - if (err) { - gpio_free(gpio_ext->data[i]); - goto err_free_data; - } } /* Configure "enable select" GPIO. */ - err = gpio_request(gpio_ext->enable, "GPIO extension enable"); + err = gpio_request_one(gpio_ext->enable, GPIOF_OUT_INIT_LOW, + "GPIO extension enable"); if (err) goto err_free_data; - err = gpio_direction_output(gpio_ext->enable, 0); - if (err) { - gpio_free(gpio_ext->enable); - goto err_free_data; - } return 0;
drivers/mmc/host/omap_hsmmc.c 2011-03-20 22:00:24.000000000 +0100 renamed from drivers/mmc/host/omap_hsmmc.c 2011-03-14 17:19:15.000000000 +0100 +4 -8
@@ -506,23 +506,19 @@ static int omap_hsmmc_gpio_init(struct o pdata->slots[0].card_detect = omap_hsmmc_card_detect; pdata->slots[0].card_detect_irq = gpio_to_irq(pdata->slots[0].switch_pin); - ret = gpio_request(pdata->slots[0].switch_pin, "mmc_cd"); + ret = gpio_request_one(pdata->slots[0].switch_pin, GPIOF_IN, + "mmc_cd"); if (ret) return ret; - ret = gpio_direction_input(pdata->slots[0].switch_pin); - if (ret) - goto err_free_sp; } else pdata->slots[0].switch_pin = -EINVAL; if (gpio_is_valid(pdata->slots[0].gpio_wp)) { pdata->slots[0].get_ro = omap_hsmmc_get_wp; - ret = gpio_request(pdata->slots[0].gpio_wp, "mmc_wp"); + ret = gpio_request_one(pdata->slots[0].gpio_wp, GPIOF_IN, + "mmc_wp"); if (ret) goto err_free_cd; - ret = gpio_direction_input(pdata->slots[0].gpio_wp); - if (ret) - goto err_free_wp; } else pdata->slots[0].gpio_wp = -EINVAL;
drivers/mmc/host/sdhci-spear.c 2011-03-20 22:00:23.000000000 +0100 renamed from drivers/mmc/host/sdhci-spear.c 2010-05-29 09:25:20.000000000 +0200 +2 -7
@@ -182,19 +182,14 @@ static int __devinit sdhci_probe(struct } if (sdhci->data->card_int_gpio >= 0) { - ret = gpio_request(sdhci->data->card_int_gpio, "sdhci"); + ret = gpio_request_one(sdhci->data->card_int_gpio, GPIOF_IN, + "sdhci"); if (ret < 0) { dev_dbg(&pdev->dev, "gpio request fail: %d\n", sdhci->data->card_int_gpio); goto err_igpio_request; } - ret = gpio_direction_input(sdhci->data->card_int_gpio); - if (ret) { - dev_dbg(&pdev->dev, "gpio set direction fail: %d\n", - sdhci->data->card_int_gpio); - goto err_igpio_direction; - } ret = request_irq(gpio_to_irq(sdhci->data->card_int_gpio), sdhci_gpio_irq, IRQF_TRIGGER_LOW, mmc_hostname(host->mmc), pdev);
drivers/pcmcia/pxa2xx_colibri.c 2011-03-20 22:00:21.000000000 +0100 renamed from drivers/pcmcia/pxa2xx_colibri.c 2011-03-14 17:19:16.000000000 +0100 +12 -24
@@ -54,47 +54,35 @@ static int colibri_pcmcia_hw_init(struct { int ret; - ret = gpio_request(colibri_pcmcia_gpio.detect_gpio, "DETECT"); + ret = gpio_request_one(colibri_pcmcia_gpio.detect_gpio, GPIOF_IN, + "DETECT"); if (ret) goto err1; - ret = gpio_direction_input(colibri_pcmcia_gpio.detect_gpio); - if (ret) - goto err2; - ret = gpio_request(colibri_pcmcia_gpio.ready_gpio, "READY"); + ret = gpio_request_one(colibri_pcmcia_gpio.ready_gpio, GPIOF_IN, + "READY"); if (ret) goto err2; - ret = gpio_direction_input(colibri_pcmcia_gpio.ready_gpio); - if (ret) - goto err3; - ret = gpio_request(colibri_pcmcia_gpio.bvd1_gpio, "BVD1"); + ret = gpio_request_one(colibri_pcmcia_gpio.bvd1_gpio, GPIOF_IN, + "BVD1"); if (ret) goto err3; - ret = gpio_direction_input(colibri_pcmcia_gpio.bvd1_gpio); - if (ret) - goto err4; - ret = gpio_request(colibri_pcmcia_gpio.bvd2_gpio, "BVD2"); + ret = gpio_request_one(colibri_pcmcia_gpio.bvd2_gpio, GPIOF_IN, + "BVD2"); if (ret) goto err4; - ret = gpio_direction_input(colibri_pcmcia_gpio.bvd2_gpio); - if (ret) - goto err5; - ret = gpio_request(colibri_pcmcia_gpio.ppen_gpio, "PPEN"); + ret = gpio_request_one(colibri_pcmcia_gpio.ppen_gpio, + GPIOF_OUT_INIT_LOW, "PPEN"); if (ret) goto err5; - ret = gpio_direction_output(colibri_pcmcia_gpio.ppen_gpio, 0); - if (ret) - goto err6; - ret = gpio_request(colibri_pcmcia_gpio.reset_gpio, "RESET"); + ret = gpio_request_one(colibri_pcmcia_gpio.reset_gpio, + GPIOF_OUT_INIT_HIGH, "RESET"); if (ret) goto err6; - ret = gpio_direction_output(colibri_pcmcia_gpio.reset_gpio, 1); - if (ret) - goto err7; colibri_irqs[0].irq = gpio_to_irq(colibri_pcmcia_gpio.detect_gpio); skt->socket.pci_irq = gpio_to_irq(colibri_pcmcia_gpio.ready_gpio);
drivers/pcmcia/pxa2xx_palmld.c 2011-03-20 22:00:25.000000000 +0100 renamed from drivers/pcmcia/pxa2xx_palmld.c 2009-11-08 21:45:05.000000000 +0100 +6 -12
@@ -24,26 +24,20 @@ static int palmld_pcmcia_hw_init(struct { int ret; - ret = gpio_request(GPIO_NR_PALMLD_PCMCIA_POWER, "PCMCIA PWR"); + ret = gpio_request_one(GPIO_NR_PALMLD_PCMCIA_POWER, + GPIOF_OUT_INIT_LOW, "PCMCIA PWR"); if (ret) goto err1; - ret = gpio_direction_output(GPIO_NR_PALMLD_PCMCIA_POWER, 0); - if (ret) - goto err2; - ret = gpio_request(GPIO_NR_PALMLD_PCMCIA_RESET, "PCMCIA RST"); + ret = gpio_request_one(GPIO_NR_PALMLD_PCMCIA_RESET, + GPIOF_OUT_INIT_HIGH, "PCMCIA RST"); if (ret) goto err2; - ret = gpio_direction_output(GPIO_NR_PALMLD_PCMCIA_RESET, 1); - if (ret) - goto err3; - ret = gpio_request(GPIO_NR_PALMLD_PCMCIA_READY, "PCMCIA RDY"); + ret = gpio_request_one(GPIO_NR_PALMLD_PCMCIA_READY, GPIOF_IN, + "PCMCIA RDY"); if (ret) goto err3; - ret = gpio_direction_input(GPIO_NR_PALMLD_PCMCIA_READY); - if (ret) - goto err4; skt->socket.pci_irq = IRQ_GPIO(GPIO_NR_PALMLD_PCMCIA_READY); return 0;
drivers/pcmcia/pxa2xx_palmtc.c 2011-03-20 22:00:21.000000000 +0100 renamed from drivers/pcmcia/pxa2xx_palmtc.c 2009-12-17 08:30:14.000000000 +0100 +12 -24
@@ -25,47 +25,35 @@ static int palmtc_pcmcia_hw_init(struct { int ret; - ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_POWER1, "PCMCIA PWR1"); + ret = gpio_request_one(GPIO_NR_PALMTC_PCMCIA_POWER1, + GPIOF_OUT_INIT_LOW, "PCMCIA PWR1"); if (ret) goto err1; - ret = gpio_direction_output(GPIO_NR_PALMTC_PCMCIA_POWER1, 0); - if (ret) - goto err2; - ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_POWER2, "PCMCIA PWR2"); + ret = gpio_request_one(GPIO_NR_PALMTC_PCMCIA_POWER2, + GPIOF_OUT_INIT_LOW, "PCMCIA PWR2"); if (ret) goto err2; - ret = gpio_direction_output(GPIO_NR_PALMTC_PCMCIA_POWER2, 0); - if (ret) - goto err3; - ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_POWER3, "PCMCIA PWR3"); + ret = gpio_request_one(GPIO_NR_PALMTC_PCMCIA_POWER3, + GPIOF_OUT_INIT_LOW, "PCMCIA PWR3"); if (ret) goto err3; - ret = gpio_direction_output(GPIO_NR_PALMTC_PCMCIA_POWER3, 0); - if (ret) - goto err4; - ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_RESET, "PCMCIA RST"); + ret = gpio_request_one(GPIO_NR_PALMTC_PCMCIA_RESET, + GPIOF_OUT_INIT_HIGH, "PCMCIA RST"); if (ret) goto err4; - ret = gpio_direction_output(GPIO_NR_PALMTC_PCMCIA_RESET, 1); - if (ret) - goto err5; - ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_READY, "PCMCIA RDY"); + ret = gpio_request_one(GPIO_NR_PALMTC_PCMCIA_READY, GPIOF_IN, + "PCMCIA RDY"); if (ret) goto err5; - ret = gpio_direction_input(GPIO_NR_PALMTC_PCMCIA_READY); - if (ret) - goto err6; - ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_PWRREADY, "PCMCIA PWRRDY"); + ret = gpio_request_one(GPIO_NR_PALMTC_PCMCIA_PWRREADY, GPIOF_IN, + "PCMCIA PWRRDY"); if (ret) goto err6; - ret = gpio_direction_input(GPIO_NR_PALMTC_PCMCIA_PWRREADY); - if (ret) - goto err7; skt->socket.pci_irq = IRQ_GPIO(GPIO_NR_PALMTC_PCMCIA_READY); return 0;
drivers/pcmcia/pxa2xx_palmtx.c 2011-03-20 22:00:25.000000000 +0100 renamed from drivers/pcmcia/pxa2xx_palmtx.c 2009-11-08 21:45:05.000000000 +0100 +8 -16
@@ -25,33 +25,25 @@ static int palmtx_pcmcia_hw_init(struct { int ret; - ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_POWER1, "PCMCIA PWR1"); + ret = gpio_request_one(GPIO_NR_PALMTX_PCMCIA_POWER1, + GPIOF_OUT_INIT_LOW, "PCMCIA PWR1"); if (ret) goto err1; - ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_POWER1, 0); - if (ret) - goto err2; - ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_POWER2, "PCMCIA PWR2"); + ret = gpio_request_one(GPIO_NR_PALMTX_PCMCIA_POWER2, + GPIOF_OUT_INIT_LOW, "PCMCIA PWR2"); if (ret) goto err2; - ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_POWER2, 0); - if (ret) - goto err3; - ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_RESET, "PCMCIA RST"); + ret = gpio_request_one(GPIO_NR_PALMTX_PCMCIA_RESET, + GPIOF_OUT_INIT_HIGH, "PCMCIA RST"); if (ret) goto err3; - ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_RESET, 1); - if (ret) - goto err4; - ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_READY, "PCMCIA RDY"); + ret = gpio_request_one(GPIO_NR_PALMTX_PCMCIA_READY, GPIOF_IN, + "PCMCIA RDY"); if (ret) goto err4; - ret = gpio_direction_input(GPIO_NR_PALMTX_PCMCIA_READY); - if (ret) - goto err5; skt->socket.pci_irq = gpio_to_irq(GPIO_NR_PALMTX_PCMCIA_READY); return 0;
drivers/pcmcia/pxa2xx_vpac270.c 2011-03-20 22:00:25.000000000 +0100 renamed from drivers/pcmcia/pxa2xx_vpac270.c 2010-05-19 22:36:14.000000000 +0200 +14 -28
73 lines not on this page · raw message
drivers/pcmcia/sa1100_h3600.c 2011-03-20 22:00:25.000000000 +0100 renamed from drivers/pcmcia/sa1100_h3600.c 2010-11-13 10:26:38.000000000 +0100 +17 -32
82 lines not on this page · raw message
drivers/power/bq20z75.c 2011-03-20 22:00:24.000000000 +0100 renamed from drivers/power/bq20z75.c 2011-03-20 18:17:23.000000000 +0100 +2 -9
@@ -578,21 +578,14 @@ static int __devinit bq20z75_probe(struc if (!bq20z75_device->gpio_detect) goto skip_gpio; - rc = gpio_request(pdata->battery_detect, dev_name(&client->dev)); + rc = gpio_request_one(pdata->battery_detect, GPIOF_IN, + dev_name(&client->dev)); if (rc) { dev_warn(&client->dev, "Failed to request gpio: %d\n", rc); bq20z75_device->gpio_detect = false; goto skip_gpio; } - rc = gpio_direction_input(pdata->battery_detect); - if (rc) { - dev_warn(&client->dev, "Failed to get gpio as input: %d\n", rc); - gpio_free(pdata->battery_detect); - bq20z75_device->gpio_detect = false; - goto skip_gpio; - } - irq = gpio_to_irq(pdata->battery_detect); if (irq <= 0) { dev_warn(&client->dev, "Failed to get gpio as irq: %d\n", irq);
drivers/power/gpio-charger.c 2011-03-20 22:00:24.000000000 +0100 renamed from drivers/power/gpio-charger.c 2010-12-28 18:26:04.000000000 +0100 +1 -6
@@ -102,16 +102,11 @@ static int __devinit gpio_charger_probe( charger->supplied_to = pdata->supplied_to; charger->num_supplicants = pdata->num_supplicants; - ret = gpio_request(pdata->gpio, dev_name(&pdev->dev)); + ret = gpio_request_one(pdata->gpio, GPIOF_IN, dev_name(&pdev->dev)); if (ret) { dev_err(&pdev->dev, "Failed to request gpio pin: %d\n", ret); goto err_free; } - ret = gpio_direction_input(pdata->gpio); - if (ret) { - dev_err(&pdev->dev, "Failed to set gpio to input: %d\n", ret); - goto err_gpio_free; - } gpio_charger->pdata = pdata;
drivers/power/jz4740-battery.c 2011-03-20 22:00:24.000000000 +0100 renamed from drivers/power/jz4740-battery.c 2011-03-14 17:19:16.000000000 +0100 +2 -6
@@ -316,16 +316,12 @@ static int __devinit jz_battery_probe(st disable_irq(jz_battery->irq); if (gpio_is_valid(pdata->gpio_charge)) { - ret = gpio_request(pdata->gpio_charge, dev_name(&pdev->dev)); + ret = gpio_request_one(pdata->gpio_charge, GPIOF_IN, + dev_name(&pdev->dev)); if (ret) { dev_err(&pdev->dev, "charger state gpio request failed.\n"); goto err_free_irq; } - ret = gpio_direction_input(pdata->gpio_charge); - if (ret) { - dev_err(&pdev->dev, "charger state gpio set direction failed.\n"); - goto err_free_gpio; - } jz_battery->charge_irq = gpio_to_irq(pdata->gpio_charge);
drivers/power/wm97xx_battery.c 2011-03-20 22:00:25.000000000 +0100 renamed from drivers/power/wm97xx_battery.c 2010-12-28 18:26:04.000000000 +0100 +2 -4
@@ -189,12 +189,10 @@ static int __devinit wm97xx_bat_probe(st } if (gpio_is_valid(pdata->charge_gpio)) { - ret = gpio_request(pdata->charge_gpio, "BATT CHRG"); + ret = gpio_request_one(pdata->charge_gpio, GPIOF_IN, + "BATT CHRG"); if (ret) goto err; - ret = gpio_direction_input(pdata->charge_gpio); - if (ret) - goto err2; ret = request_irq(gpio_to_irq(pdata->charge_gpio), wm97xx_chrg_irq, IRQF_DISABLED, "AC Detect", dev);
drivers/power/z2_battery.c 2011-03-20 22:00:24.000000000 +0100 renamed from drivers/power/z2_battery.c 2011-03-20 18:17:23.000000000 +0100 +2 -5
@@ -207,14 +207,11 @@ static int __devinit z2_batt_probe(struc mutex_init(&charger->work_lock); if (info->charge_gpio >= 0 && gpio_is_valid(info->charge_gpio)) { - ret = gpio_request(info->charge_gpio, "BATT CHRG"); + ret = gpio_request_one(info->charge_gpio, GPIOF_IN, + "BATT CHRG"); if (ret) goto err; - ret = gpio_direction_input(info->charge_gpio); - if (ret) - goto err2; - set_irq_type(gpio_to_irq(info->charge_gpio), IRQ_TYPE_EDGE_BOTH); ret = request_irq(gpio_to_irq(info->charge_gpio),
drivers/staging/cptm1217/clearpad_tm1217.c 2011-03-20 22:00:24.000000000 +0100 renamed from drivers/staging/cptm1217/clearpad_tm1217.c 2010-11-24 07:55:12.000000000 +0100 +1 -10
@@ -378,22 +378,13 @@ static int cp_tm1217_setup_gpio_irq(stru int retval; /* Hook up the irq handler */ - retval = gpio_request(ts->gpio, "cp_tm1217_touch"); + retval = gpio_request_one(ts->gpio, GPIOF_IN, "cp_tm1217_touch"); if (retval < 0) { dev_err(ts->dev, "cp_tm1217: GPIO request failed error %d\n", retval); return retval; } - retval = gpio_direction_input(ts->gpio); - if (retval < 0) { - dev_err(ts->dev, - "cp_tm1217: GPIO direction configuration failed, error %d\n", - retval); - gpio_free(ts->gpio); - return retval; - } - retval = gpio_to_irq(ts->gpio); if (retval < 0) { dev_err(ts->dev, "cp_tm1217: GPIO to IRQ failedi,"
drivers/staging/iio/magnetometer/ak8975.c 2011-03-20 22:00:24.000000000 +0100 renamed from drivers/staging/iio/magnetometer/ak8975.c 2010-09-18 08:59:06.000000000 +0200 +1 -8
@@ -460,20 +460,13 @@ static int ak8975_probe(struct i2c_clien goto exit_free; } - err = gpio_request(data->eoc_gpio, "ak_8975"); + err = gpio_request_one(data->eoc_gpio, GPIOF_IN, "ak_8975"); if (err < 0) { dev_err(&client->dev, "failed to request GPIO %d, error %d\n", data->eoc_gpio, err); goto exit_free; } - err = gpio_direction_input(data->eoc_gpio); - if (err < 0) { - dev_err(&client->dev, "Failed to configure input direction for" - " GPIO %d, error %d\n", data->eoc_gpio, err); - goto exit_gpio; - } - /* Perform some basic start-of-day setup of the device. */ err = ak8975_setup(client); if (err < 0) {
drivers/video/backlight/l4f00242t03.c 2011-03-20 22:00:21.000000000 +0100 renamed from drivers/video/backlight/l4f00242t03.c 2011-01-19 18:51:19.000000000 +0100 +4 -11
@@ -178,29 +178,22 @@ static int __devinit l4f00242t03_probe(s priv->spi = spi; - ret = gpio_request(pdata->reset_gpio, "lcd l4f00242t03 reset"); + ret = gpio_request_one(pdata->reset_gpio, GPIOF_OUT_INIT_HIGH, + "lcd l4f00242t03 reset"); if (ret) { dev_err(&spi->dev, "Unable to get the lcd l4f00242t03 reset gpio.\n"); goto err; } - ret = gpio_direction_output(pdata->reset_gpio, 1); - if (ret) - goto err2; - - ret = gpio_request(pdata->data_enable_gpio, - "lcd l4f00242t03 data enable"); + ret = gpio_request_one(pdata->data_enable_gpio, GPIOF_OUT_INIT_LOW, + "lcd l4f00242t03 data enable"); if (ret) { dev_err(&spi->dev, "Unable to get the lcd l4f00242t03 data en gpio.\n"); goto err2; } - ret = gpio_direction_output(pdata->data_enable_gpio, 0); - if (ret) - goto err3; - if (pdata->io_supply) { priv->io_reg = regulator_get(NULL, pdata->io_supply);
drivers/video/backlight/tosa_bl.c 2011-03-20 22:00:21.000000000 +0100 renamed from drivers/video/backlight/tosa_bl.c 2010-06-04 16:56:16.000000000 +0200 +2 -4
@@ -89,14 +89,12 @@ static int __devinit tosa_bl_probe(struc data->comadj = sharpsl_param.comadj == -1 ? COMADJ_DEFAULT : sharpsl_param.comadj; - ret = gpio_request(TOSA_GPIO_BL_C20MA, "backlight"); + ret = gpio_request_one(TOSA_GPIO_BL_C20MA, GPIOF_OUT_INIT_LOW, + "backlight"); if (ret) { dev_dbg(&data->bl->dev, "Unable to request gpio!\n"); goto err_gpio_bl; } - ret = gpio_direction_output(TOSA_GPIO_BL_C20MA, 0); - if (ret) - goto err_gpio_dir; i2c_set_clientdata(client, data); data->i2c = client;
drivers/video/backlight/tosa_lcd.c 2011-03-20 22:00:21.000000000 +0100 renamed from drivers/video/backlight/tosa_lcd.c 2010-03-29 19:27:58.000000000 +0200 +1 -5
@@ -192,16 +192,12 @@ static int __devinit tosa_lcd_probe(stru data->spi = spi; dev_set_drvdata(&spi->dev, data); - ret = gpio_request(TOSA_GPIO_TG_ON, "tg #pwr"); + ret = gpio_request_one(TOSA_GPIO_TG_ON, GPIOF_OUT_INIT_LOW, "tg #pwr"); if (ret < 0) goto err_gpio_tg; mdelay(60); - ret = gpio_direction_output(TOSA_GPIO_TG_ON, 0); - if (ret < 0) - goto err_gpio_dir; - mdelay(60); tosa_lcd_tg_init(data);
drivers/video/msm/mddi_client_nt35399.c 2011-03-20 22:00:26.000000000 +0100 renamed from drivers/video/msm/mddi_client_nt35399.c 2010-03-29 19:27:59.000000000 +0200 +1 -5
@@ -155,14 +155,10 @@ static int setup_vsync(struct panel_info ret = 0; goto uninit; } - ret = gpio_request(gpio, "vsync"); + ret = gpio_request_one(gpio, GPIOF_IN, "vsync"); if (ret) goto err_request_gpio_failed; - ret = gpio_direction_input(gpio); - if (ret) - goto err_gpio_direction_input_failed; - ret = irq = gpio_to_irq(gpio); if (ret < 0) goto err_get_irq_num_failed;
drivers/video/msm/mddi_client_toshiba.c 2011-03-20 22:00:26.000000000 +0100 renamed from drivers/video/msm/mddi_client_toshiba.c 2010-03-29 19:27:59.000000000 +0200 +1 -5
@@ -186,14 +186,10 @@ static int setup_vsync(struct panel_info ret = 0; goto uninit; } - ret = gpio_request(gpio, "vsync"); + ret = gpio_request_one(gpio, GPIOF_IN, "vsync"); if (ret) goto err_request_gpio_failed; - ret = gpio_direction_input(gpio); - if (ret) - goto err_gpio_direction_input_failed; - ret = irq = gpio_to_irq(gpio); if (ret < 0) goto err_get_irq_num_failed;
drivers/video/omap2/displays/panel-tpo-td043mtea1.c 2011-03-20 22:00:26.000000000 +0100 renamed from drivers/video/omap2/displays/panel-tpo-td043mtea1.c 2010-10-23 19:40:32.000000000 +0200 +2 -7
@@ -406,17 +406,12 @@ static int tpo_td043_probe(struct omap_d } if (gpio_is_valid(nreset_gpio)) { - ret = gpio_request(nreset_gpio, "lcd reset"); + ret = gpio_request_one(nreset_gpio, GPIOF_OUT_INIT_LOW, + "lcd reset"); if (ret < 0) { dev_err(&dssdev->dev, "couldn't request reset GPIO\n"); goto fail_gpio_req; } - - ret = gpio_direction_output(nreset_gpio, 0); - if (ret < 0) { - dev_err(&dssdev->dev, "couldn't set GPIO direction\n"); - goto fail_gpio_direction; - } } ret = sysfs_create_group(&dssdev->dev.kobj, &tpo_td043_attr_group);
drivers/watchdog/wm831x_wdt.c 2011-03-20 22:00:25.000000000 +0100 renamed from drivers/watchdog/wm831x_wdt.c 2010-03-05 23:55:32.000000000 +0100 +3 -10
@@ -350,8 +350,9 @@ static int __devinit wm831x_wdt_probe(st reg |= pdata->software << WM831X_WDOG_RST_SRC_SHIFT; if (pdata->update_gpio) { - ret = gpio_request(pdata->update_gpio, - "Watchdog update"); + ret = gpio_request_one(pdata->update_gpio, + GPIOF_OUT_INIT_LOW, + "Watchdog update"); if (ret < 0) { dev_err(wm831x->dev, "Failed to request update GPIO: %d\n",
@@ -359,14 +360,6 @@ static int __devinit wm831x_wdt_probe(st goto err; } - ret = gpio_direction_output(pdata->update_gpio, 0); - if (ret != 0) { - dev_err(wm831x->dev, - "gpio_direction_output returned: %d\n", - ret); - goto err_gpio; - } - update_gpio = pdata->update_gpio; /* Make sure the watchdog takes hardware updates */
sound/soc/codecs/twl6040.c 2011-03-20 22:00:23.000000000 +0100 renamed from sound/soc/codecs/twl6040.c 2011-02-02 17:27:40.000000000 +0100 +2 -5
@@ -1641,14 +1641,11 @@ static int twl6040_probe(struct snd_soc_ init_completion(&priv->handsfree.ramp_done); if (gpio_is_valid(audpwron)) { - ret = gpio_request(audpwron, "audpwron"); + ret = gpio_request_one(audpwron, GPIOF_OUT_INIT_LOW, + "audpwron"); if (ret) goto gpio1_err; - ret = gpio_direction_output(audpwron, 0); - if (ret) - goto gpio2_err; - priv->codec_powered = 0; /* enable only codec ready interrupt */
sound/soc/codecs/uda1380.c 2011-03-20 22:00:24.000000000 +0100 renamed from sound/soc/codecs/uda1380.c 2010-12-31 15:18:31.000000000 +0100 +4 -8
@@ -732,21 +732,17 @@ static int uda1380_probe(struct snd_soc_ return -EINVAL; if (gpio_is_valid(pdata->gpio_reset)) { - ret = gpio_request(pdata->gpio_reset, "uda1380 reset"); + ret = gpio_request_one(pdata->gpio_reset, GPIOF_OUT_INIT_LOW, + "uda1380 reset"); if (ret) goto err_out; - ret = gpio_direction_output(pdata->gpio_reset, 0); - if (ret) - goto err_gpio_reset_conf; } if (gpio_is_valid(pdata->gpio_power)) { - ret = gpio_request(pdata->gpio_power, "uda1380 power"); + ret = gpio_request_one(pdata->gpio_power, GPIOF_OUT_INIT_LOW, + "uda1380 power"); if (ret) goto err_gpio; - ret = gpio_direction_output(pdata->gpio_power, 0); - if (ret) - goto err_gpio_power_conf; } else { ret = uda1380_reset(codec); if (ret) {
sound/soc/omap/omap3pandora.c 2011-03-20 22:00:22.000000000 +0100 renamed from sound/soc/omap/omap3pandora.c 2010-12-04 18:54:36.000000000 +0100 +4 -14
@@ -263,30 +263,20 @@ static int __init omap3pandora_soc_init( pr_info("OMAP3 Pandora SoC init\n"); - ret = gpio_request(OMAP3_PANDORA_DAC_POWER_GPIO, "dac_power"); + ret = gpio_request_one(OMAP3_PANDORA_DAC_POWER_GPIO, + GPIOF_OUT_INIT_LOW, "dac_power"); if (ret) { pr_err(PREFIX "Failed to get DAC power GPIO\n"); return ret; } - ret = gpio_direction_output(OMAP3_PANDORA_DAC_POWER_GPIO, 0); - if (ret) { - pr_err(PREFIX "Failed to set DAC power GPIO direction\n"); - goto fail0; - } - - ret = gpio_request(OMAP3_PANDORA_AMP_POWER_GPIO, "amp_power"); + ret = gpio_request_one(OMAP3_PANDORA_AMP_POWER_GPIO, + GPIOF_OUT_INIT_LOW, "amp_power"); if (ret) { pr_err(PREFIX "Failed to get amp power GPIO\n"); goto fail0; } - ret = gpio_direction_output(OMAP3_PANDORA_AMP_POWER_GPIO, 0); - if (ret) { - pr_err(PREFIX "Failed to set amp power GPIO direction\n"); - goto fail1; - } - omap3pandora_snd_device = platform_device_alloc("soc-audio", -1); if (omap3pandora_snd_device == NULL) { pr_err(PREFIX "Platform device allocation failed\n");
sound/soc/pxa/e740_wm9705.c 2011-03-20 22:00:22.000000000 +0100 renamed from sound/soc/pxa/e740_wm9705.c 2011-03-14 17:19:19.000000000 +0100 +6 -14
@@ -148,29 +148,21 @@ static int __init e740_init(void) if (!machine_is_e740()) return -ENODEV; - ret = gpio_request(GPIO_E740_MIC_ON, "Mic amp"); + ret = gpio_request_one(GPIO_E740_MIC_ON, GPIOF_OUT_INIT_LOW, + "Mic amp"); if (ret) return ret; - ret = gpio_request(GPIO_E740_AMP_ON, "Output amp"); + ret = gpio_request_one(GPIO_E740_AMP_ON, GPIOF_OUT_INIT_LOW, + "Output amp"); if (ret) goto free_mic_amp_gpio; - ret = gpio_request(GPIO_E740_WM9705_nAVDD2, "Audio power"); + ret = gpio_request_one(GPIO_E740_WM9705_nAVDD2, GPIOF_OUT_INIT_HIGH, + "Audio power"); if (ret) goto free_op_amp_gpio; - /* Disable audio */ - ret = gpio_direction_output(GPIO_E740_MIC_ON, 0); - if (ret) - goto free_apwr_gpio; - ret = gpio_direction_output(GPIO_E740_AMP_ON, 0); - if (ret) - goto free_apwr_gpio; - ret = gpio_direction_output(GPIO_E740_WM9705_nAVDD2, 1); - if (ret) - goto free_apwr_gpio; - e740_snd_device = platform_device_alloc("soc-audio", -1); if (!e740_snd_device) { ret = -ENOMEM;
sound/soc/pxa/e750_wm9705.c 2011-03-20 22:00:22.000000000 +0100 renamed from sound/soc/pxa/e750_wm9705.c 2011-03-14 17:19:19.000000000 +0100 +4 -10
@@ -131,22 +131,16 @@ static int __init e750_init(void) if (!machine_is_e750()) return -ENODEV; - ret = gpio_request(GPIO_E750_HP_AMP_OFF, "Headphone amp"); + ret = gpio_request_one(GPIO_E750_HP_AMP_OFF, GPIOF_OUT_INIT_HIGH, + "Headphone amp"); if (ret) return ret; - ret = gpio_request(GPIO_E750_SPK_AMP_OFF, "Speaker amp"); + ret = gpio_request_one(GPIO_E750_SPK_AMP_OFF, GPIOF_OUT_INIT_HIGH, + "Speaker amp"); if (ret) goto free_hp_amp_gpio; - ret = gpio_direction_output(GPIO_E750_HP_AMP_OFF, 1); - if (ret) - goto free_spk_amp_gpio; - - ret = gpio_direction_output(GPIO_E750_SPK_AMP_OFF, 1); - if (ret) - goto free_spk_amp_gpio; - e750_snd_device = platform_device_alloc("soc-audio", -1); if (!e750_snd_device) { ret = -ENOMEM;
sound/soc/pxa/e800_wm9712.c 2011-03-20 22:00:22.000000000 +0100 renamed from sound/soc/pxa/e800_wm9712.c 2011-03-14 17:19:19.000000000 +0100 +4 -10
@@ -120,22 +120,16 @@ static int __init e800_init(void) if (!machine_is_e800()) return -ENODEV; - ret = gpio_request(GPIO_E800_HP_AMP_OFF, "Headphone amp"); + ret = gpio_request_one(GPIO_E800_HP_AMP_OFF, GPIOF_OUT_INIT_HIGH, + "Headphone amp"); if (ret) return ret; - ret = gpio_request(GPIO_E800_SPK_AMP_ON, "Speaker amp"); + ret = gpio_request_one(GPIO_E800_SPK_AMP_ON, GPIOF_OUT_INIT_HIGH, + "Speaker amp"); if (ret) goto free_hp_amp_gpio; - ret = gpio_direction_output(GPIO_E800_HP_AMP_OFF, 1); - if (ret) - goto free_spk_amp_gpio; - - ret = gpio_direction_output(GPIO_E800_SPK_AMP_ON, 1); - if (ret) - goto free_spk_amp_gpio; - e800_snd_device = platform_device_alloc("soc-audio", -1); if (!e800_snd_device) return -ENOMEM;
sound/soc/pxa/tosa.c 2011-03-20 22:00:22.000000000 +0100 renamed from sound/soc/pxa/tosa.c 2011-03-14 17:19:19.000000000 +0100 +2 -4
@@ -241,12 +241,10 @@ static int tosa_probe(struct snd_soc_car { int ret; - ret = gpio_request(TOSA_GPIO_L_MUTE, "Headphone Jack"); + ret = gpio_request_one(TOSA_GPIO_L_MUTE, GPIOF_OUT_INIT_LOW, + "Headphone Jack"); if (ret) return ret; - ret = gpio_direction_output(TOSA_GPIO_L_MUTE, 0); - if (ret) - gpio_free(TOSA_GPIO_L_MUTE); return ret; }
sound/soc/samsung/h1940_uda1380.c 2011-03-20 22:00:24.000000000 +0100 renamed from sound/soc/samsung/h1940_uda1380.c 2011-01-24 08:53:37.000000000 +0100 +2 -5
@@ -239,14 +239,11 @@ static int __init h1940_init(void) return -ENODEV; /* configure some gpios */ - ret = gpio_request(H1940_LATCH_AUDIO_POWER, "speaker-power"); + ret = gpio_request_one(H1940_LATCH_AUDIO_POWER, GPIOF_OUT_INIT_LOW, + "speaker-power"); if (ret) goto err_out; - ret = gpio_direction_output(H1940_LATCH_AUDIO_POWER, 0); - if (ret) - goto err_gpio; - s3c24xx_snd_device = platform_device_alloc("soc-audio", -1); if (!s3c24xx_snd_device) { ret = -ENOMEM;
sound/soc/samsung/rx1950_uda1380.c 2011-03-20 22:00:24.000000000 +0100 renamed from sound/soc/samsung/rx1950_uda1380.c 2011-01-24 08:53:37.000000000 +0100 +2 -5
@@ -259,14 +259,11 @@ static int __init rx1950_init(void) return -ENODEV; /* configure some gpios */ - ret = gpio_request(S3C2410_GPA(1), "speaker-power"); + ret = gpio_request_one(S3C2410_GPA(1), GPIOF_OUT_INIT_LOW, + "speaker-power"); if (ret) goto err_gpio; - ret = gpio_direction_output(S3C2410_GPA(1), 0); - if (ret) - goto err_gpio_conf; - s3c24xx_snd_device = platform_device_alloc("soc-audio", -1); if (!s3c24xx_snd_device) { ret = -ENOMEM;
sound/soc/samsung/smartq_wm8987.c 2011-03-20 22:00:24.000000000 +0100 renamed from sound/soc/samsung/smartq_wm8987.c 2011-01-24 08:53:37.000000000 +0100 +2 -8
@@ -243,19 +243,13 @@ static int __init smartq_init(void) } /* Initialise GPIOs used by amplifiers */ - ret = gpio_request(S3C64XX_GPK(12), "amplifiers shutdown"); + ret = gpio_request_one(S3C64XX_GPK(12), GPIOF_OUT_INIT_HIGH, + "amplifiers shutdown"); if (ret) { dev_err(&smartq_snd_device->dev, "Failed to register GPK12\n"); goto err_unregister_device; } - /* Disable amplifiers */ - ret = gpio_direction_output(S3C64XX_GPK(12), 1); - if (ret) { - dev_err(&smartq_snd_device->dev, "Failed to configure GPK12\n"); - goto err_free_gpio_amp_shut; - } - return 0; err_free_gpio_amp_shut:
sound/soc/soc-jack.c 2011-03-20 22:00:25.000000000 +0100 renamed from sound/soc/soc-jack.c 2011-03-14 17:19:19.000000000 +0100 +1 -5
@@ -310,14 +310,10 @@ int snd_soc_jack_add_gpios(struct snd_so goto undo; } - ret = gpio_request(gpios[i].gpio, gpios[i].name); + ret = gpio_request_one(gpios[i].gpio, GPIOF_IN, gpios[i].name); if (ret) goto undo; - ret = gpio_direction_input(gpios[i].gpio); - if (ret) - goto err; - INIT_DELAYED_WORK(&gpios[i].work, gpio_work); gpios[i].jack = jack;
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
Quoted 6 lines · Julia Lawall
In this case, I also ignore the !GPIOLIB issue. ?This semantic patch considers the case where the direction call has some error handling code. In this case, it just deletes that error handling code, so most of these cases are likely to need some manual cleanup, eg to get rid of unreachable error labels or to change the error message.
[...]
Quoted 50 lines
diff -u -p
a/arch/arm/mach-omap2/board-4430sdp.cb/arch/arm/mach-omap2/board-4430sdp.carch/arm/mach-omap2/board-4430sdp.c 2011-03-20 22:00:22.000000000 +0100 renamed from arch/arm/mach-omap2/board-4430sdp.c 2011-03-20 18:17:22.000000000 +0100 +0
-0@@ -257,44 +257,26 @@ static int omap_ethernet_init(void)? ? ? ?/* Request of GPIO lines */
- ? ? ? status =
gpio_request(ETH_KS8851_POWER_ON, "eth_power");
+ ? ? ? status = gpio_request_one(ETH_KS8851_POWER_ON,GPIOF_OUT_INIT_HIGH,
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "eth_power");
? ? ? ?if (status) {
? ? ? ? ? ? ? ?pr_err("Cannot request GPIO %d\n",ETH_KS8851_POWER_ON); ? ? ? ? ? ? ? ?return status;
? ? ? ?}- ? ? ? status =
gpio_request(ETH_KS8851_QUART, "quart");
+ ? ? ? status = gpio_request_one(ETH_KS8851_QUART,GPIOF_OUT_INIT_HIGH,
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "quart");
? ? ? ?if (status) {
? ? ? ? ? ? ? ?pr_err("Cannot request GPIO %d\n",ETH_KS8851_QUART); ? ? ? ? ? ? ? ?goto error1;
? ? ? ?}- ? ? ? status =
gpio_request(ETH_KS8851_IRQ, "eth_irq");
+ ? ? ? status =gpio_request_one(ETH_KS8851_IRQ, GPIOF_IN, "eth_irq"); ? ? ? ?if (status) {
? ? ? ? ? ? ? ?pr_err("Cannot request GPIO %d\n",ETH_KS8851_IRQ); ? ? ? ? ? ? ? ?goto error2;
? ? ? ?}- ? ? ? /* Configuration of requested GPIO lines */
arch/arm/mach-omap2/board-4430sdp.c 2011-03-20 22:00:22.000000000 +0100 renamed from arch/arm/mach-omap2/board-4430sdp.c 2011-03-20 18:17:22.000000000 +0100 +0
-19- - ? ? ? status = gpio_direction_output(ETH_KS8851_POWER_ON, 1); - ? ? ? if (status) { - ? ? ? ? ? ? ? pr_err("Cannot set output GPIO %d\n", ETH_KS8851_IRQ); - ? ? ? ? ? ? ? goto error3; - ? ? ? } - - ? ? ? status = gpio_direction_output(ETH_KS8851_QUART, 1); - ? ? ? if (status) { - ? ? ? ? ? ? ? pr_err("Cannot set output GPIO %d\n", ETH_KS8851_QUART); - ? ? ? ? ? ? ? goto error3; - ? ? ? } - - ? ? ? status = gpio_direction_input(ETH_KS8851_IRQ); - ? ? ? if (status) { - ? ? ? ? ? ? ? pr_err("Cannot set input GPIO %d\n", ETH_KS8851_IRQ); - ? ? ? ? ? ? ? goto error3; - ? ? ? } -
Quoted 1 line
? ? ? ?return 0;
This hunk is probably wrong. If gpio pins are being requested, it is important to verify that all gpios have been requested successfully before actively changing the state on any of them. This hunk changes the behaviour.
Quoted 18 lines
diff -u -p
a/arch/arm/mach-pxa/cm-x270.cb/arch/arm/mach-pxa/cm-x270.carch/arm/mach-pxa/cm-x270.c 2011-03-20 22:00:23.000000000 +0100 renamed from arch/arm/mach-pxa/cm-x270.c 2010-12-31 15:18:30.000000000 +0100 +4
-2@@ -327,22 +327,18 @@ static unsigned long cm_x270_libertas_pi ?static int cm_x270_libertas_setup(struct spi_device *spi) ?{ - ? ? ? int err = gpio_request(GPIO19_WLAN_STRAP, "WLAN STRAP"); + ? ? ? int err = gpio_request_one(GPIO19_WLAN_STRAP, GPIOF_OUT_INIT_HIGH, + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"WLAN STRAP"); ? ? ? ?if (err) ? ? ? ? ? ? ? ?return err; - ? ? ? err = gpio_request(GPIO102_WLAN_RST, "WLAN RST"); + ? ? ? err = gpio_request_one(GPIO102_WLAN_RST, GPIOF_OUT_INIT_LOW, + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"WLAN RST"); ? ? ? ?if (err) ? ? ? ? ? ? ? ?goto err_free_strap;
arch/arm/mach-pxa/cm-x270.c 2011-03-20 22:00:23.000000000 +0100 static unsigned long cm_x270_libertas_pi · line 342
Quoted 10 lines
arch/arm/mach-pxa/cm-x270.c 2011-03-20 22:00:23.000000000 +0100 renamed from arch/arm/mach-pxa/cm-x270.c 2010-12-31 15:18:30.000000000 +0100 +0
-6- ? ? ? err = gpio_direction_output(GPIO102_WLAN_RST, 0); - ? ? ? if (err) - ? ? ? ? ? ? ? goto err_free_strap; ? ? ? ?msleep(100); - ? ? ? err = gpio_direction_output(GPIO19_WLAN_STRAP, 1); - ? ? ? if (err) - ? ? ? ? ? ? ? goto err_free_strap; ? ? ? ?msleep(100);
Ditto here, and it also loses the msleep delays.
Overall, I'm nervious about this change. Most of the *should* be okay, but the original code isn't exactly wrong either. I'd rather just leave them be unless it can be tested. I certainly don't want to change them all wholesale.
g.
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
Quoted 56 lines · Grant Likely
Quoted 6 lines · Julia Lawall
In this case, I also ignore the !GPIOLIB issue. ?This semantic patch considers the case where the direction call has some error handling code. In this case, it just deletes that error handling code, so most of these cases are likely to need some manual cleanup, eg to get rid of unreachable error labels or to change the error message.
[...]
Quoted 48 lines
diff -u -p
a/arch/arm/mach-omap2/board-4430sdp.cb/arch/arm/mach-omap2/board-4430sdp.carch/arm/mach-omap2/board-4430sdp.c 2011-03-20 22:00:22.000000000 +0100 renamed from arch/arm/mach-omap2/board-4430sdp.c 2011-03-20 18:17:22.000000000 +0100 +0
-0@@ -257,44 +257,26 @@ static int omap_ethernet_init(void)? ? ? ?/* Request of GPIO lines */
- ? ? ? status =
gpio_request(ETH_KS8851_POWER_ON, "eth_power");
+ ? ? ? status = gpio_request_one(ETH_KS8851_POWER_ON,GPIOF_OUT_INIT_HIGH,
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "eth_power");
? ? ? ?if (status) {
? ? ? ? ? ? ? ?pr_err("Cannot request GPIO %d\n",ETH_KS8851_POWER_ON); ? ? ? ? ? ? ? ?return status;
? ? ? ?}- ? ? ? status =
gpio_request(ETH_KS8851_QUART, "quart");
+ ? ? ? status = gpio_request_one(ETH_KS8851_QUART,GPIOF_OUT_INIT_HIGH,
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "quart");
? ? ? ?if (status) {
? ? ? ? ? ? ? ?pr_err("Cannot request GPIO %d\n",ETH_KS8851_QUART); ? ? ? ? ? ? ? ?goto error1;
? ? ? ?}- ? ? ? status =
gpio_request(ETH_KS8851_IRQ, "eth_irq");
+ ? ? ? status =gpio_request_one(ETH_KS8851_IRQ, GPIOF_IN, "eth_irq"); ? ? ? ?if (status) {
? ? ? ? ? ? ? ?pr_err("Cannot request GPIO %d\n",ETH_KS8851_IRQ); ? ? ? ? ? ? ? ?goto error2;
? ? ? ?}- ? ? ? /* Configuration of requested GPIO lines */
arch/arm/mach-omap2/board-4430sdp.c 2011-03-20 22:00:22.000000000 +0100 renamed from arch/arm/mach-omap2/board-4430sdp.c 2011-03-20 18:17:22.000000000 +0100 +0
-17- - ? ? ? status = gpio_direction_output(ETH_KS8851_POWER_ON, 1); - ? ? ? if (status) { - ? ? ? ? ? ? ? pr_err("Cannot set output GPIO %d\n", ETH_KS8851_IRQ); - ? ? ? ? ? ? ? goto error3; - ? ? ? } - - ? ? ? status = gpio_direction_output(ETH_KS8851_QUART, 1); - ? ? ? if (status) { - ? ? ? ? ? ? ? pr_err("Cannot set output GPIO %d\n", ETH_KS8851_QUART); - ? ? ? ? ? ? ? goto error3; - ? ? ? } - - ? ? ? status = gpio_direction_input(ETH_KS8851_IRQ); - ? ? ? if (status) { - ? ? ? ? ? ? ? pr_err("Cannot set input GPIO %d\n", ETH_KS8851_IRQ); - ? ? ? ? ? ? ? goto error3;
Quoted 8 lines
Quoted 3 lines
- ? ? ? }
-
? ? ? ?return 0;This hunk is probably wrong. If gpio pins are being requested, it is important to verify that all gpios have been requested successfully before actively changing the state on any of them. This hunk changes the behaviour.
Thanks for the feedback. I can also check that there is no call to gpio_request or either of the direction functions between the call to gpio_request and the call to the direction function to transform. The semantic patch and the result for the case where there is no error handling on the direction function are below.
On the other hand, the constraint that everything should be requested before initialization is not always respected, eg:
arch/arm/mach-mx3/mx31moboard-smartbot.c
Perhaps code like this should be changed to move up the requests?
julia
@@
expression E1,E2;
@@
- gpio_request(E1,E2)
+ gpio_request_one(E1,GPIOF_IN,E2)
... when != E1
when != gpio_request(...)
when != gpio_direction_output(...)
when != gpio_direction_input(...)- gpio_direction_input(E1);
@@
expression E1,E2;
@@
- gpio_request(E1,E2)
+ gpio_request_one(E1,GPIOF_OUT_INIT_LOW,E2)
... when != E1
when != gpio_request(...)
when != gpio_direction_output(...)
when != gpio_direction_input(...)- gpio_direction_output(E1,0);
@@
expression E1,E2;
@@
- gpio_request(E1,E2)
+ gpio_request_one(E1,GPIOF_OUT_INIT_HIGH,E2)
... when != E1
when != gpio_request(...)
when != gpio_direction_output(...)
when != gpio_direction_input(...)- gpio_direction_output(E1,1);
----------------------------------
arch/arm/mach-davinci/board-da830-evm.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-davinci/board-da830-evm.c 2011-03-14 17:19:13.000000000 +0100 +6 -12
@@ -163,21 +163,20 @@ static __init void da830_evm_usb_init(vo return; } - ret = gpio_request(ON_BD_USB_DRV, "ON_BD_USB_DRV"); + ret = gpio_request_one(ON_BD_USB_DRV, GPIOF_OUT_INIT_LOW, + "ON_BD_USB_DRV"); if (ret) { printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port " "power control: %d\n", __func__, ret); return; } - gpio_direction_output(ON_BD_USB_DRV, 0); - ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC"); + ret = gpio_request_one(ON_BD_USB_OVC, GPIOF_IN, "ON_BD_USB_OVC"); if (ret) { printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port " "over-current indicator: %d\n", __func__, ret); return; } - gpio_direction_input(ON_BD_USB_OVC); ret = da8xx_register_usb11(&da830_evm_usb11_pdata); if (ret)
@@ -260,21 +259,19 @@ static inline void da830_evm_init_mmc(vo return; } - ret = gpio_request(DA830_MMCSD_WP_PIN, "MMC WP"); + ret = gpio_request_one(DA830_MMCSD_WP_PIN, GPIOF_IN, "MMC WP"); if (ret) { pr_warning("da830_evm_init: can not open GPIO %d\n", DA830_MMCSD_WP_PIN); return; } - gpio_direction_input(DA830_MMCSD_WP_PIN); - ret = gpio_request(DA830_MMCSD_CD_PIN, "MMC CD\n"); + ret = gpio_request_one(DA830_MMCSD_CD_PIN, GPIOF_IN, "MMC CD\n"); if (ret) { pr_warning("da830_evm_init: can not open GPIO %d\n", DA830_MMCSD_CD_PIN); return; } - gpio_direction_input(DA830_MMCSD_CD_PIN); ret = da8xx_register_mmcsd0(&da830_evm_mmc_config); if (ret) {
@@ -463,10 +460,7 @@ static struct at24_platform_data da830_e static int __init da830_evm_ui_expander_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *context) { - gpio_request(gpio + 6, "UI MUX_MODE"); - - /* Drive mux mode low to match the default without UI card */ - gpio_direction_output(gpio + 6, 0); + gpio_request_one(gpio + 6, GPIOF_OUT_INIT_LOW, "UI MUX_MODE"); da830_evm_init_lcdc(gpio + 6);
arch/arm/mach-davinci/board-dm355-evm.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-davinci/board-dm355-evm.c 2010-10-23 19:40:31.000000000 +0200 +2 -4
@@ -142,8 +142,7 @@ static void __init evm_init_i2c(void) { davinci_init_i2c(&i2c_pdata); - gpio_request(5, "dm355evm_msp"); - gpio_direction_input(5); + gpio_request_one(5, GPIOF_IN, "dm355evm_msp"); dm355evm_i2c_info[0].irq = gpio_to_irq(5); i2c_register_board_info(1, dm355evm_i2c_info,
@@ -315,8 +314,7 @@ static __init void dm355_evm_init(void) { struct clk *aemif; - gpio_request(1, "dm9000"); - gpio_direction_input(1); + gpio_request_one(1, GPIOF_IN, "dm9000"); dm355evm_dm9000_rsrc[2].start = gpio_to_irq(1); aemif = clk_get(&dm355evm_dm9000.dev, "aemif");
arch/arm/mach-davinci/board-dm355-leopard.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-davinci/board-dm355-leopard.c 2010-10-23 19:40:31.000000000 +0200 +2 -4
@@ -134,8 +134,7 @@ static void __init leopard_init_i2c(void { davinci_init_i2c(&i2c_pdata); - gpio_request(5, "dm355leopard_msp"); - gpio_direction_input(5); + gpio_request_one(5, GPIOF_IN, "dm355leopard_msp"); dm355leopard_i2c_info[0].irq = gpio_to_irq(5); i2c_register_board_info(1, dm355leopard_i2c_info,
@@ -237,8 +236,7 @@ static __init void dm355_leopard_init(vo { struct clk *aemif; - gpio_request(9, "dm9000"); - gpio_direction_input(9); + gpio_request_one(9, GPIOF_IN, "dm9000"); dm355leopard_dm9000_rsrc[2].start = gpio_to_irq(9); aemif = clk_get(&dm355leopard_dm9000.dev, "aemif");
arch/arm/mach-davinci/board-dm644x-evm.c 2011-03-21 08:55:27.000000000 +0100 renamed from arch/arm/mach-davinci/board-dm644x-evm.c 2011-03-20 18:17:22.000000000 +0100 +10 -20
@@ -371,14 +371,11 @@ evm_u18_setup(struct i2c_client *client, sw_gpio = -EINVAL; /* audio PLL: 48 kHz (vs 44.1 or 32), single rate (vs double) */ - gpio_request(gpio + 3, "pll_fs2"); - gpio_direction_output(gpio + 3, 0); + gpio_request_one(gpio + 3, GPIOF_OUT_INIT_LOW, "pll_fs2"); - gpio_request(gpio + 2, "pll_fs1"); - gpio_direction_output(gpio + 2, 0); + gpio_request_one(gpio + 2, GPIOF_OUT_INIT_LOW, "pll_fs1"); - gpio_request(gpio + 1, "pll_sr"); - gpio_direction_output(gpio + 1, 0); + gpio_request_one(gpio + 1, GPIOF_OUT_INIT_LOW, "pll_sr"); return 0; }
@@ -411,34 +408,27 @@ static int evm_u35_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c) { /* p0 = nDRV_VBUS (initial: don't supply it) */ - gpio_request(gpio + 0, "nDRV_VBUS"); - gpio_direction_output(gpio + 0, 1); + gpio_request_one(gpio + 0, GPIOF_OUT_INIT_HIGH, "nDRV_VBUS"); /* p1 = VDDIMX_EN */ - gpio_request(gpio + 1, "VDDIMX_EN"); - gpio_direction_output(gpio + 1, 1); + gpio_request_one(gpio + 1, GPIOF_OUT_INIT_HIGH, "VDDIMX_EN"); /* p2 = VLYNQ_EN */ - gpio_request(gpio + 2, "VLYNQ_EN"); - gpio_direction_output(gpio + 2, 1); + gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH, "VLYNQ_EN"); /* p3 = n3V3_CF_RESET (initial: stay in reset) */ - gpio_request(gpio + 3, "nCF_RESET"); - gpio_direction_output(gpio + 3, 0); + gpio_request_one(gpio + 3, GPIOF_OUT_INIT_LOW, "nCF_RESET"); /* (p4 unused) */ /* p5 = 1V8_WLAN_RESET (initial: stay in reset) */ - gpio_request(gpio + 5, "WLAN_RESET"); - gpio_direction_output(gpio + 5, 1); + gpio_request_one(gpio + 5, GPIOF_OUT_INIT_HIGH, "WLAN_RESET"); /* p6 = nATA_SEL (initial: select) */ - gpio_request(gpio + 6, "nATA_SEL"); - gpio_direction_output(gpio + 6, 0); + gpio_request_one(gpio + 6, GPIOF_OUT_INIT_LOW, "nATA_SEL"); /* p7 = nCF_SEL (initial: deselect) */ - gpio_request(gpio + 7, "nCF_SEL"); - gpio_direction_output(gpio + 7, 1); + gpio_request_one(gpio + 7, GPIOF_OUT_INIT_HIGH, "nCF_SEL"); return 0; }
arch/arm/mach-davinci/board-tnetv107x-evm.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-davinci/board-tnetv107x-evm.c 2011-03-20 18:17:22.000000000 +0100 +1 -2
@@ -44,12 +44,11 @@ static int initialize_gpio(int gpio, cha { int ret; - ret = gpio_request(gpio, desc); + ret = gpio_request_one(gpio, GPIOF_IN, desc); if (ret < 0) { pr_err_ratelimited("cannot open %s gpio\n", desc); return -ENOSYS; } - gpio_direction_input(gpio); return gpio; }
arch/arm/mach-imx/eukrea_mbimx27-baseboard.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-imx/eukrea_mbimx27-baseboard.c 2011-02-11 10:53:31.000000000 +0100 +1 -2
@@ -251,11 +251,10 @@ static const struct imxuart_platform_dat static void __maybe_unused ads7846_dev_init(void) { - if (gpio_request(ADS7846_PENDOWN, "ADS7846 pendown") < 0) { + if (gpio_request_one(ADS7846_PENDOWN, GPIOF_IN, "ADS7846 pendown") < 0) { printk(KERN_ERR "can't get ads746 pen down GPIO\n"); return; } - gpio_direction_input(ADS7846_PENDOWN); } static int ads7846_get_pendown_state(void)
arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c 2010-12-04 18:54:35.000000000 +0100 +3 -6
@@ -277,16 +277,13 @@ void __init eukrea_mbimxsd25_baseboard_i imx25_add_flexcan1(NULL); imx25_add_sdhci_esdhc_imx(0, NULL); - gpio_request(GPIO_LED1, "LED1"); - gpio_direction_output(GPIO_LED1, 1); + gpio_request_one(GPIO_LED1, GPIOF_OUT_INIT_HIGH, "LED1"); gpio_free(GPIO_LED1); - gpio_request(GPIO_SWITCH1, "SWITCH1"); - gpio_direction_input(GPIO_SWITCH1); + gpio_request_one(GPIO_SWITCH1, GPIOF_IN, "SWITCH1"); gpio_free(GPIO_SWITCH1); - gpio_request(GPIO_LCDPWR, "LCDPWR"); - gpio_direction_output(GPIO_LCDPWR, 1); + gpio_request_one(GPIO_LCDPWR, GPIOF_OUT_INIT_HIGH, "LCDPWR"); gpio_free(GPIO_SWITCH1); i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices,
arch/arm/mach-imx/pcm970-baseboard.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-imx/pcm970-baseboard.c 2010-12-04 18:54:35.000000000 +0100 +1 -3
@@ -100,14 +100,12 @@ static int pcm970_sdhc2_init(struct devi if (ret) return ret; - ret = gpio_request(GPIO_PORTC + 28, "imx-mmc-ro"); + ret = gpio_request_one(GPIO_PORTC + 28, GPIOF_IN, "imx-mmc-ro"); if (ret) { free_irq(IRQ_GPIOC(29), data); return ret; } - gpio_direction_input(GPIO_PORTC + 28); - return 0; }
arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c 2011-03-21 08:55:26.000000000 +0100 renamed from arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c 2011-02-26 13:17:46.000000000 +0100 +3 -6
@@ -291,16 +291,13 @@ void __init eukrea_mbimxsd35_baseboard_i imx35_add_flexcan1(NULL); imx35_add_sdhci_esdhc_imx(0, NULL); - gpio_request(GPIO_LED1, "LED1"); - gpio_direction_output(GPIO_LED1, 1); + gpio_request_one(GPIO_LED1, GPIOF_OUT_INIT_HIGH, "LED1"); gpio_free(GPIO_LED1); - gpio_request(GPIO_SWITCH1, "SWITCH1"); - gpio_direction_input(GPIO_SWITCH1); + gpio_request_one(GPIO_SWITCH1, GPIOF_IN, "SWITCH1"); gpio_free(GPIO_SWITCH1); - gpio_request(GPIO_LCDPWR, "LCDPWR"); - gpio_direction_output(GPIO_LCDPWR, 1); + gpio_request_one(GPIO_LCDPWR, GPIOF_OUT_INIT_HIGH, "LCDPWR"); gpio_free(GPIO_LCDPWR); i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices,
arch/arm/mach-mx3/mach-armadillo5x0.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-mx3/mach-armadillo5x0.c 2011-03-14 17:19:13.000000000 +0100 +2 -6
@@ -412,18 +412,14 @@ static int armadillo5x0_sdhc1_init(struc gpio_det = IOMUX_TO_GPIO(MX31_PIN_ATA_DMACK); gpio_wp = IOMUX_TO_GPIO(MX31_PIN_ATA_RESET_B); - ret = gpio_request(gpio_det, "sdhc-card-detect"); + ret = gpio_request_one(gpio_det, GPIOF_IN, "sdhc-card-detect"); if (ret) return ret; - gpio_direction_input(gpio_det); - - ret = gpio_request(gpio_wp, "sdhc-write-protect"); + ret = gpio_request_one(gpio_wp, GPIOF_IN, "sdhc-write-protect"); if (ret) goto err_gpio_free; - gpio_direction_input(gpio_wp); - /* When supported the trigger type have to be BOTH */ ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_ATA_DMACK), detect_irq, IRQF_DISABLED | IRQF_TRIGGER_FALLING,
arch/arm/mach-mx3/mach-kzm_arm11_01.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-mx3/mach-kzm_arm11_01.c 2011-02-19 08:28:51.000000000 +0100 +4 -4
@@ -113,8 +113,8 @@ static int __init kzm_init_ext_uart(void * GPIO 1-1: external UART interrupt line */ mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO1_1, IOMUX_CONFIG_GPIO)); - gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1), "ext-uart-int"); - gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1)); + gpio_request_one(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1), GPIOF_IN, + "ext-uart-int"); /* * Unmask UART interrupt
@@ -172,8 +172,8 @@ static int __init kzm_init_smsc9118(void * GPIO 1-2: SMSC9118 interrupt line */ mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO1_2, IOMUX_CONFIG_GPIO)); - gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2), "smsc9118-int"); - gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2)); + gpio_request_one(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2), GPIOF_IN, + "smsc9118-int"); return platform_device_register(&kzm_smsc9118_device); }
arch/arm/mach-mx3/mach-mx31lilly.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-mx3/mach-mx31lilly.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -175,8 +175,8 @@ static int usbh2_init(struct platform_de /* chip select */ mxc_iomux_alloc_pin(IOMUX_MODE(MX31_PIN_DTR_DCE1, IOMUX_CONFIG_GPIO), "USBH2_CS"); - gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), "USBH2 CS"); - gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), 0); + gpio_request_one(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), + GPIOF_OUT_INIT_LOW, "USBH2 CS"); mdelay(10);
arch/arm/mach-mx3/mach-mx31lite.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-mx3/mach-mx31lite.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -164,8 +164,8 @@ static int usbh2_init(struct platform_de /* chip select */ mxc_iomux_alloc_pin(IOMUX_MODE(MX31_PIN_DTR_DCE1, IOMUX_CONFIG_GPIO), "USBH2_CS"); - gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), "USBH2 CS"); - gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), 0); + gpio_request_one(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), + GPIOF_OUT_INIT_LOW, "USBH2 CS"); mdelay(10);
arch/arm/mach-mx3/mach-mx31moboard.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-mx3/mach-mx31moboard.c 2011-03-14 17:19:13.000000000 +0100 +8 -13
@@ -311,16 +311,13 @@ static int moboard_sdhc1_init(struct dev { int ret; - ret = gpio_request(SDHC1_CD, "sdhc-detect"); + ret = gpio_request_one(SDHC1_CD, GPIOF_IN, "sdhc-detect"); if (ret) return ret; - gpio_direction_input(SDHC1_CD); - - ret = gpio_request(SDHC1_WP, "sdhc-wp"); + ret = gpio_request_one(SDHC1_WP, GPIOF_IN, "sdhc-wp"); if (ret) goto err_gpio_free; - gpio_direction_input(SDHC1_WP); ret = request_irq(gpio_to_irq(SDHC1_CD), detect_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
@@ -390,13 +387,11 @@ static void usb_xcvr_reset(void) mxc_iomux_set_pad(MX31_PIN_SRXD3, USB_PAD_CFG | PAD_CTL_100K_PD); mxc_iomux_set_pad(MX31_PIN_STXD3, USB_PAD_CFG | PAD_CTL_100K_PD); - gpio_request(OTG_EN_B, "usb-udc-en"); - gpio_direction_output(OTG_EN_B, 0); - gpio_request(USBH2_EN_B, "usbh2-en"); - gpio_direction_output(USBH2_EN_B, 0); + gpio_request_one(OTG_EN_B, GPIOF_OUT_INIT_LOW, "usb-udc-en"); + + gpio_request_one(USBH2_EN_B, GPIOF_OUT_INIT_LOW, "usbh2-en"); - gpio_request(USB_RESET_B, "usb-reset"); - gpio_direction_output(USB_RESET_B, 0); + gpio_request_one(USB_RESET_B, GPIOF_OUT_INIT_LOW, "usb-reset"); mdelay(1); gpio_set_value(USB_RESET_B, 1); mdelay(1);
@@ -522,8 +517,8 @@ static void __init mx31moboard_init(void imx31_add_spi_imx1(&moboard_spi1_pdata); imx31_add_spi_imx2(&moboard_spi2_pdata); - gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq"); - gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); + gpio_request_one(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), GPIOF_IN, + "pmic-irq"); spi_register_board_info(moboard_spi_board_info, ARRAY_SIZE(moboard_spi_board_info));
arch/arm/mach-mx3/mach-pcm037.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-mx3/mach-pcm037.c 2011-03-14 17:19:13.000000000 +0100 +2 -5
@@ -358,17 +358,14 @@ static int pcm970_sdhc1_init(struct devi { int ret; - ret = gpio_request(SDHC1_GPIO_DET, "sdhc-detect"); + ret = gpio_request_one(SDHC1_GPIO_DET, GPIOF_IN, "sdhc-detect"); if (ret) return ret; - gpio_direction_input(SDHC1_GPIO_DET); - #ifdef PCM970_SDHC_RW_SWITCH - ret = gpio_request(SDHC1_GPIO_WP, "sdhc-wp"); + ret = gpio_request_one(SDHC1_GPIO_WP, GPIOF_IN, "sdhc-wp"); if (ret) goto err_gpio_free; - gpio_direction_input(SDHC1_GPIO_WP); #endif ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_SCK6), detect_irq,
arch/arm/mach-mx3/mach-pcm043.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-mx3/mach-pcm043.c 2011-03-14 17:19:13.000000000 +0100 +1 -2
@@ -229,7 +229,7 @@ static void pcm043_ac97_warm_reset(struc iomux_v3_cfg_t txfs = MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS; int ret; - ret = gpio_request(AC97_GPIO_TXFS, "SSI"); + ret = gpio_request_one(AC97_GPIO_TXFS, GPIOF_OUT_INIT_HIGH, "SSI"); if (ret) { printk("failed to get GPIO_TXFS: %d\n", ret); return;
@@ -238,7 +238,6 @@ static void pcm043_ac97_warm_reset(struc mxc_iomux_v3_setup_pad(txfs_gpio); /* warm reset */ - gpio_direction_output(AC97_GPIO_TXFS, 1); udelay(2); gpio_set_value(AC97_GPIO_TXFS, 0);
arch/arm/mach-mx3/mx31lilly-db.c 2011-03-21 08:55:26.000000000 +0100 renamed from arch/arm/mach-mx3/mx31lilly-db.c 2010-12-04 18:54:35.000000000 +0100 +2 -2
@@ -197,14 +197,14 @@ static struct mx3fb_platform_data fb_pda static void __init mx31lilly_init_fb(void) { - if (gpio_request(LCD_VCC_EN_GPIO, "LCD enable") != 0) { + if (gpio_request_one(LCD_VCC_EN_GPIO, GPIOF_OUT_INIT_HIGH, + "LCD enable") != 0) { printk(KERN_WARNING "unable to request LCD_VCC_EN pin.\n"); return; } mxc_register_device(&mx3_ipu, &ipu_data); mxc_register_device(&mx3_fb, &fb_pdata); - gpio_direction_output(LCD_VCC_EN_GPIO, 1); } void __init mx31lilly_db_init(void)
arch/arm/mach-mx3/mx31moboard-devboard.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-mx3/mx31moboard-devboard.c 2011-02-19 08:28:51.000000000 +0100 +6 -10
@@ -67,16 +67,13 @@ static int devboard_sdhc2_init(struct de { int ret; - ret = gpio_request(SDHC2_CD, "sdhc-detect"); + ret = gpio_request_one(SDHC2_CD, GPIOF_IN, "sdhc-detect"); if (ret) return ret; - gpio_direction_input(SDHC2_CD); - - ret = gpio_request(SDHC2_WP, "sdhc-wp"); + ret = gpio_request_one(SDHC2_WP, GPIOF_IN, "sdhc-wp"); if (ret) goto err_gpio_free; - gpio_direction_input(SDHC2_WP); ret = request_irq(gpio_to_irq(SDHC2_CD), detect_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
@@ -161,18 +158,17 @@ static int devboard_usbh1_hw_init(struct static int devboard_isp1105_init(struct otg_transceiver *otg) { - int ret = gpio_request(USBH1_MODE, "usbh1-mode"); + int ret = gpio_request_one(USBH1_MODE, GPIOF_OUT_INIT_LOW, + "usbh1-mode"); if (ret) return ret; - /* single ended */ - gpio_direction_output(USBH1_MODE, 0); - ret = gpio_request(USBH1_VBUSEN_B, "usbh1-vbusen"); + ret = gpio_request_one(USBH1_VBUSEN_B, GPIOF_OUT_INIT_HIGH, + "usbh1-vbusen"); if (ret) { gpio_free(USBH1_MODE); return ret; } - gpio_direction_output(USBH1_VBUSEN_B, 1); return 0; }
arch/arm/mach-mx3/mx31moboard-marxbot.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-mx3/mx31moboard-marxbot.c 2011-02-19 08:28:51.000000000 +0100 +18 -22
@@ -80,16 +80,13 @@ static int marxbot_sdhc2_init(struct dev { int ret; - ret = gpio_request(SDHC2_CD, "sdhc-detect"); + ret = gpio_request_one(SDHC2_CD, GPIOF_IN, "sdhc-detect"); if (ret) return ret; - gpio_direction_input(SDHC2_CD); - - ret = gpio_request(SDHC2_WP, "sdhc-wp"); + ret = gpio_request_one(SDHC2_WP, GPIOF_IN, "sdhc-wp"); if (ret) goto err_gpio_free; - gpio_direction_input(SDHC2_WP); ret = request_irq(gpio_to_irq(SDHC2_CD), detect_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
@@ -195,28 +192,28 @@ static struct platform_device *marxbot_c static int __init marxbot_cam_init(void) { - int ret = gpio_request(CAM_CHOICE, "cam-choice"); + int ret = gpio_request_one(CAM_CHOICE, GPIOF_OUT_INIT_LOW, + "cam-choice"); if (ret) return ret; - gpio_direction_output(CAM_CHOICE, 0); - ret = gpio_request(BASECAM_RST_B, "basecam-reset"); + ret = gpio_request_one(BASECAM_RST_B, GPIOF_OUT_INIT_HIGH, + "basecam-reset"); if (ret) return ret; - gpio_direction_output(BASECAM_RST_B, 1); - ret = gpio_request(BASECAM_POWER, "basecam-standby"); + ret = gpio_request_one(BASECAM_POWER, GPIOF_OUT_INIT_LOW, + "basecam-standby"); if (ret) return ret; - gpio_direction_output(BASECAM_POWER, 0); - ret = gpio_request(TURRETCAM_RST_B, "turretcam-reset"); + ret = gpio_request_one(TURRETCAM_RST_B, GPIOF_OUT_INIT_HIGH, + "turretcam-reset"); if (ret) return ret; - gpio_direction_output(TURRETCAM_RST_B, 1); - ret = gpio_request(TURRETCAM_POWER, "turretcam-standby"); + ret = gpio_request_one(TURRETCAM_POWER, GPIOF_OUT_INIT_LOW, + "turretcam-standby"); if (ret) return ret; - gpio_direction_output(TURRETCAM_POWER, 0); return 0; }
@@ -276,18 +273,17 @@ static int marxbot_usbh1_hw_init(struct static int marxbot_isp1105_init(struct otg_transceiver *otg) { - int ret = gpio_request(USBH1_MODE, "usbh1-mode"); + int ret = gpio_request_one(USBH1_MODE, GPIOF_OUT_INIT_LOW, + "usbh1-mode"); if (ret) return ret; - /* single ended */ - gpio_direction_output(USBH1_MODE, 0); - ret = gpio_request(USBH1_VBUSEN_B, "usbh1-vbusen"); + ret = gpio_request_one(USBH1_VBUSEN_B, GPIOF_OUT_INIT_HIGH, + "usbh1-vbusen"); if (ret) { gpio_free(USBH1_MODE); return ret; } - gpio_direction_output(USBH1_VBUSEN_B, 1); return 0; }
@@ -358,8 +354,8 @@ void __init mx31moboard_marxbot_init(voi platform_add_devices(marxbot_cameras, ARRAY_SIZE(marxbot_cameras)); /* battery present pin */ - gpio_request(IOMUX_TO_GPIO(MX31_PIN_LCS0), "bat-present"); - gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_LCS0)); + gpio_request_one(IOMUX_TO_GPIO(MX31_PIN_LCS0), GPIOF_IN, + "bat-present"); gpio_export(IOMUX_TO_GPIO(MX31_PIN_LCS0), false); imx31_add_fsl_usb2_udc(&usb_pdata);
arch/arm/mach-mx3/mx31moboard-smartbot.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-mx3/mx31moboard-smartbot.c 2011-03-14 17:19:13.000000000 +0100 +3 -4
@@ -104,14 +104,13 @@ static struct platform_device *smartbot_ static int __init smartbot_cam_init(void) { - int ret = gpio_request(CAM_RST_B, "cam-reset"); + int ret = gpio_request_one(CAM_RST_B, GPIOF_OUT_INIT_HIGH, + "cam-reset"); if (ret) return ret; - gpio_direction_output(CAM_RST_B, 1); - ret = gpio_request(CAM_POWER, "cam-standby"); + ret = gpio_request_one(CAM_POWER, GPIOF_OUT_INIT_LOW, "cam-standby"); if (ret) return ret; - gpio_direction_output(CAM_POWER, 0); return 0; }
arch/arm/mach-mx5/board-cpuimx51.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-mx5/board-cpuimx51.c 2011-02-19 08:28:51.000000000 +0100 +4 -8
@@ -253,17 +253,13 @@ static void __init eukrea_cpuimx51_init( imx51_add_imx_uart(0, &uart_pdata); imx51_add_mxc_nand(&eukrea_cpuimx51_nand_board_info); - gpio_request(CPUIMX51_QUARTA_GPIO, "quarta_irq"); - gpio_direction_input(CPUIMX51_QUARTA_GPIO); + gpio_request_one(CPUIMX51_QUARTA_GPIO, GPIOF_IN, "quarta_irq"); gpio_free(CPUIMX51_QUARTA_GPIO); - gpio_request(CPUIMX51_QUARTB_GPIO, "quartb_irq"); - gpio_direction_input(CPUIMX51_QUARTB_GPIO); + gpio_request_one(CPUIMX51_QUARTB_GPIO, GPIOF_IN, "quartb_irq"); gpio_free(CPUIMX51_QUARTB_GPIO); - gpio_request(CPUIMX51_QUARTC_GPIO, "quartc_irq"); - gpio_direction_input(CPUIMX51_QUARTC_GPIO); + gpio_request_one(CPUIMX51_QUARTC_GPIO, GPIOF_IN, "quartc_irq"); gpio_free(CPUIMX51_QUARTC_GPIO); - gpio_request(CPUIMX51_QUARTD_GPIO, "quartd_irq"); - gpio_direction_input(CPUIMX51_QUARTD_GPIO); + gpio_request_one(CPUIMX51_QUARTD_GPIO, GPIOF_IN, "quartd_irq"); gpio_free(CPUIMX51_QUARTD_GPIO); imx51_add_fec(NULL);
arch/arm/mach-mx5/board-cpuimx51sd.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-mx5/board-cpuimx51sd.c 2011-03-14 17:19:13.000000000 +0100 +5 -10
@@ -280,22 +280,18 @@ static void __init eukrea_cpuimx51sd_ini gpio_set_value(ETH_RST, 1); imx51_add_fec(NULL); - gpio_request(CAN_IRQGPIO, "can_irq"); - gpio_direction_input(CAN_IRQGPIO); + gpio_request_one(CAN_IRQGPIO, GPIOF_IN, "can_irq"); gpio_free(CAN_IRQGPIO); - gpio_request(CAN_NCS, "can_ncs"); - gpio_direction_output(CAN_NCS, 1); + gpio_request_one(CAN_NCS, GPIOF_OUT_INIT_HIGH, "can_ncs"); gpio_free(CAN_NCS); - gpio_request(CAN_RST, "can_rst"); - gpio_direction_output(CAN_RST, 0); + gpio_request_one(CAN_RST, GPIOF_OUT_INIT_LOW, "can_rst"); msleep(20); gpio_set_value(CAN_RST, 1); imx51_add_ecspi(0, &cpuimx51sd_ecspi1_pdata); spi_register_board_info(cpuimx51sd_spi_device, ARRAY_SIZE(cpuimx51sd_spi_device)); - gpio_request(TSC2007_IRQGPIO, "tsc2007_irq"); - gpio_direction_input(TSC2007_IRQGPIO); + gpio_request_one(TSC2007_IRQGPIO, GPIOF_IN, "tsc2007_irq"); gpio_free(TSC2007_IRQGPIO); i2c_register_board_info(0, eukrea_cpuimx51sd_i2c_devices,
@@ -309,8 +305,7 @@ static void __init eukrea_cpuimx51sd_ini mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata); } - gpio_request(USBH1_RST, "usb_rst"); - gpio_direction_output(USBH1_RST, 0); + gpio_request_one(USBH1_RST, GPIOF_OUT_INIT_LOW, "usb_rst"); msleep(20); gpio_set_value(USBH1_RST, 1); mxc_register_device(&mxc_usbh1_device, &usbh1_config);
arch/arm/mach-mx5/board-mx50_rdp.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx50_rdp.c 2011-02-11 10:53:31.000000000 +0100 +3 -4
@@ -176,10 +176,9 @@ static const struct fec_platform_data fe static inline void mx50_rdp_fec_reset(void) { - gpio_request(FEC_EN, "fec-en"); - gpio_direction_output(FEC_EN, 0); - gpio_request(FEC_RESET_B, "fec-reset_b"); - gpio_direction_output(FEC_RESET_B, 0); + gpio_request_one(FEC_EN, GPIOF_OUT_INIT_LOW, "fec-en"); + + gpio_request_one(FEC_RESET_B, GPIOF_OUT_INIT_LOW, "fec-reset_b"); msleep(1); gpio_set_value(FEC_RESET_B, 1); }
arch/arm/mach-mx5/board-mx51_babbage.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx51_babbage.c 2011-02-19 08:28:51.000000000 +0100 +8 -8
@@ -181,26 +181,26 @@ static int gpio_usbh1_active(void) /* Set USBH1_STP to GPIO and toggle it */ mxc_iomux_v3_setup_pad(usbh1stp_gpio); - ret = gpio_request(BABBAGE_USBH1_STP, "usbh1_stp"); + ret = gpio_request_one(BABBAGE_USBH1_STP, GPIOF_OUT_INIT_LOW, + "usbh1_stp"); if (ret) { pr_debug("failed to get MX51_PAD_USBH1_STP__GPIO_1_27: %d\n", ret); return ret; } - gpio_direction_output(BABBAGE_USBH1_STP, 0); gpio_set_value(BABBAGE_USBH1_STP, 1); msleep(100); gpio_free(BABBAGE_USBH1_STP); /* De-assert USB PHY RESETB */ mxc_iomux_v3_setup_pad(phyreset_gpio); - ret = gpio_request(BABBAGE_PHY_RESET, "phy_reset"); + ret = gpio_request_one(BABBAGE_PHY_RESET, GPIOF_OUT_INIT_HIGH, + "phy_reset"); if (ret) { pr_debug("failed to get MX51_PAD_EIM_D21__GPIO_2_5: %d\n", ret); return ret; } - gpio_direction_output(BABBAGE_PHY_RESET, 1); return 0; }
@@ -209,12 +209,12 @@ static inline void babbage_usbhub_reset( int ret; /* Bring USB hub out of reset */ - ret = gpio_request(BABBAGE_USB_HUB_RESET, "GPIO1_7"); + ret = gpio_request_one(BABBAGE_USB_HUB_RESET, GPIOF_OUT_INIT_LOW, + "GPIO1_7"); if (ret) { printk(KERN_ERR"failed to get GPIO_USB_HUB_RESET: %d\n", ret); return; } - gpio_direction_output(BABBAGE_USB_HUB_RESET, 0); /* USB HUB RESET - De-assert USB HUB RESET_N */ msleep(1);
@@ -228,12 +228,12 @@ static inline void babbage_fec_reset(voi int ret; /* reset FEC PHY */ - ret = gpio_request(BABBAGE_FEC_PHY_RESET, "fec-phy-reset"); + ret = gpio_request_one(BABBAGE_FEC_PHY_RESET, GPIOF_OUT_INIT_LOW, + "fec-phy-reset"); if (ret) { printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret); return; } - gpio_direction_output(BABBAGE_FEC_PHY_RESET, 0); gpio_set_value(BABBAGE_FEC_PHY_RESET, 0); msleep(1); gpio_set_value(BABBAGE_FEC_PHY_RESET, 1);
arch/arm/mach-mx5/board-mx51_efikamx.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx51_efikamx.c 2011-02-26 13:17:46.000000000 +0100 +10 -14
@@ -104,12 +104,11 @@ static void __init mx51_efikamx_board_id /* things are taking time to settle */ msleep(150); - gpio_request(EFIKAMX_PCBID0, "pcbid0"); - gpio_direction_input(EFIKAMX_PCBID0); - gpio_request(EFIKAMX_PCBID1, "pcbid1"); - gpio_direction_input(EFIKAMX_PCBID1); - gpio_request(EFIKAMX_PCBID2, "pcbid2"); - gpio_direction_input(EFIKAMX_PCBID2); + gpio_request_one(EFIKAMX_PCBID0, GPIOF_IN, "pcbid0"); + + gpio_request_one(EFIKAMX_PCBID1, GPIOF_IN, "pcbid1"); + + gpio_request_one(EFIKAMX_PCBID2, GPIOF_IN, "pcbid2"); id = gpio_get_value(EFIKAMX_PCBID0); id |= gpio_get_value(EFIKAMX_PCBID1) << 1;
@@ -255,11 +254,10 @@ static void __init mx51_efikamx_init(voi imx51_add_gpio_keys(&mx51_efikamx_powerkey_data); if (system_rev == 0x11) { - gpio_request(EFIKAMX_RESET1_1, "reset"); - gpio_direction_output(EFIKAMX_RESET1_1, 1); + gpio_request_one(EFIKAMX_RESET1_1, GPIOF_OUT_INIT_HIGH, + "reset"); } else { - gpio_request(EFIKAMX_RESET, "reset"); - gpio_direction_output(EFIKAMX_RESET, 1); + gpio_request_one(EFIKAMX_RESET, GPIOF_OUT_INIT_HIGH, "reset"); } /*
@@ -267,12 +265,10 @@ static void __init mx51_efikamx_init(voi * sb and mx have same wlan pin but the value to enable it are * different :/ */ - gpio_request(EFIKA_WLAN_EN, "wlan_en"); - gpio_direction_output(EFIKA_WLAN_EN, 0); + gpio_request_one(EFIKA_WLAN_EN, GPIOF_OUT_INIT_LOW, "wlan_en"); msleep(10); - gpio_request(EFIKA_WLAN_RESET, "wlan_rst"); - gpio_direction_output(EFIKA_WLAN_RESET, 0); + gpio_request_one(EFIKA_WLAN_RESET, GPIOF_OUT_INIT_LOW, "wlan_rst"); msleep(10); gpio_set_value(EFIKA_WLAN_RESET, 1); }
arch/arm/mach-mx5/board-mx51_efikasb.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx51_efikasb.c 2011-03-14 17:19:13.000000000 +0100 +4 -6
@@ -108,8 +108,7 @@ static int initialize_usbh2_port(struct iomux_v3_cfg_t usbh2gpio = MX51_PAD_EIM_A26__GPIO2_20; mxc_iomux_v3_setup_pad(usbh2gpio); - gpio_request(EFIKASB_USBH2_STP, "usbh2_stp"); - gpio_direction_output(EFIKASB_USBH2_STP, 0); + gpio_request_one(EFIKASB_USBH2_STP, GPIOF_OUT_INIT_LOW, "usbh2_stp"); msleep(1); gpio_set_value(EFIKASB_USBH2_STP, 1); msleep(1);
@@ -229,10 +228,9 @@ static void __init mx51_efikasb_board_id { int id; - gpio_request(EFIKASB_PCBID0, "pcb id0"); - gpio_direction_input(EFIKASB_PCBID0); - gpio_request(EFIKASB_PCBID1, "pcb id1"); - gpio_direction_input(EFIKASB_PCBID1); + gpio_request_one(EFIKASB_PCBID0, GPIOF_IN, "pcb id0"); + + gpio_request_one(EFIKASB_PCBID1, GPIOF_IN, "pcb id1"); id = gpio_get_value(EFIKASB_PCBID0); id |= gpio_get_value(EFIKASB_PCBID1) << 1;
arch/arm/mach-mx5/board-mx53_evk.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx53_evk.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -82,12 +82,12 @@ static inline void mx53_evk_fec_reset(vo int ret; /* reset FEC PHY */ - ret = gpio_request(SMD_FEC_PHY_RST, "fec-phy-reset"); + ret = gpio_request_one(SMD_FEC_PHY_RST, GPIOF_OUT_INIT_LOW, + "fec-phy-reset"); if (ret) { printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret); return; } - gpio_direction_output(SMD_FEC_PHY_RST, 0); gpio_set_value(SMD_FEC_PHY_RST, 0); msleep(1); gpio_set_value(SMD_FEC_PHY_RST, 1);
arch/arm/mach-mx5/board-mx53_loco.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx53_loco.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -185,12 +185,12 @@ static inline void mx53_loco_fec_reset(v int ret; /* reset FEC PHY */ - ret = gpio_request(LOCO_FEC_PHY_RST, "fec-phy-reset"); + ret = gpio_request_one(LOCO_FEC_PHY_RST, GPIOF_OUT_INIT_LOW, + "fec-phy-reset"); if (ret) { printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret); return; } - gpio_direction_output(LOCO_FEC_PHY_RST, 0); msleep(1); gpio_set_value(LOCO_FEC_PHY_RST, 1); }
arch/arm/mach-mx5/board-mx53_smd.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-mx5/board-mx53_smd.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -70,12 +70,12 @@ static inline void mx53_smd_fec_reset(vo int ret; /* reset FEC PHY */ - ret = gpio_request(SMD_FEC_PHY_RST, "fec-phy-reset"); + ret = gpio_request_one(SMD_FEC_PHY_RST, GPIOF_OUT_INIT_LOW, + "fec-phy-reset"); if (ret) { printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret); return; } - gpio_direction_output(SMD_FEC_PHY_RST, 0); msleep(1); gpio_set_value(SMD_FEC_PHY_RST, 1); }
arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c 2011-01-19 18:51:18.000000000 +0100 +5 -10
@@ -193,25 +193,20 @@ void __init eukrea_mbimx51_baseboard_ini imx51_add_imx_uart(1, NULL); imx51_add_imx_uart(2, &uart_pdata); - gpio_request(MBIMX51_LED0, "LED0"); - gpio_direction_output(MBIMX51_LED0, 1); + gpio_request_one(MBIMX51_LED0, GPIOF_OUT_INIT_HIGH, "LED0"); gpio_free(MBIMX51_LED0); - gpio_request(MBIMX51_LED1, "LED1"); - gpio_direction_output(MBIMX51_LED1, 1); + gpio_request_one(MBIMX51_LED1, GPIOF_OUT_INIT_HIGH, "LED1"); gpio_free(MBIMX51_LED1); - gpio_request(MBIMX51_LED2, "LED2"); - gpio_direction_output(MBIMX51_LED2, 1); + gpio_request_one(MBIMX51_LED2, GPIOF_OUT_INIT_HIGH, "LED2"); gpio_free(MBIMX51_LED2); - gpio_request(MBIMX51_LED3, "LED3"); - gpio_direction_output(MBIMX51_LED3, 1); + gpio_request_one(MBIMX51_LED3, GPIOF_OUT_INIT_HIGH, "LED3"); gpio_free(MBIMX51_LED3); platform_add_devices(devices, ARRAY_SIZE(devices)); imx51_add_imx_keypad(&mbimx51_map_data); - gpio_request(MBIMX51_TSC2007_GPIO, "tsc2007_irq"); - gpio_direction_input(MBIMX51_TSC2007_GPIO); + gpio_request_one(MBIMX51_TSC2007_GPIO, GPIOF_IN, "tsc2007_irq"); set_irq_type(MBIMX51_TSC2007_IRQ, IRQF_TRIGGER_FALLING); i2c_register_board_info(1, mbimx51_i2c_devices, ARRAY_SIZE(mbimx51_i2c_devices));
arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c 2011-01-09 09:32:57.000000000 +0100 +2 -4
@@ -150,12 +150,10 @@ void __init eukrea_mbimxsd51_baseboard_i imx51_add_sdhci_esdhc_imx(0, NULL); - gpio_request(GPIO_LED1, "LED1"); - gpio_direction_output(GPIO_LED1, 1); + gpio_request_one(GPIO_LED1, GPIOF_OUT_INIT_HIGH, "LED1"); gpio_free(GPIO_LED1); - gpio_request(GPIO_SWITCH1, "SWITCH1"); - gpio_direction_input(GPIO_SWITCH1); + gpio_request_one(GPIO_SWITCH1, GPIOF_IN, "SWITCH1"); gpio_free(GPIO_SWITCH1); i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices,
arch/arm/mach-mx5/mx51_efika.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-mx5/mx51_efika.c 2011-03-14 17:19:13.000000000 +0100 +6 -8
@@ -168,8 +168,7 @@ static int initialize_usbh1_port(struct void __iomem *socregs_base; mxc_iomux_v3_setup_pad(usbh1gpio); - gpio_request(EFIKAMX_USBH1_STP, "usbh1_stp"); - gpio_direction_output(EFIKAMX_USBH1_STP, 0); + gpio_request_one(EFIKAMX_USBH1_STP, GPIOF_OUT_INIT_LOW, "usbh1_stp"); msleep(1); gpio_set_value(EFIKAMX_USBH1_STP, 1); msleep(1);
@@ -200,8 +199,8 @@ static struct mxc_usbh_platform_data usb static void mx51_efika_hubreset(void) { - gpio_request(EFIKAMX_USB_HUB_RESET, "usb_hub_rst"); - gpio_direction_output(EFIKAMX_USB_HUB_RESET, 1); + gpio_request_one(EFIKAMX_USB_HUB_RESET, GPIOF_OUT_INIT_HIGH, + "usb_hub_rst"); msleep(1); gpio_set_value(EFIKAMX_USB_HUB_RESET, 0); msleep(1);
@@ -213,8 +212,8 @@ static void __init mx51_efika_usb(void) mx51_efika_hubreset(); /* pulling it low, means no USB at all... */ - gpio_request(EFIKA_USB_PHY_RESET, "usb_phy_reset"); - gpio_direction_output(EFIKA_USB_PHY_RESET, 0); + gpio_request_one(EFIKA_USB_PHY_RESET, GPIOF_OUT_INIT_LOW, + "usb_phy_reset"); msleep(1); gpio_set_value(EFIKA_USB_PHY_RESET, 1);
@@ -623,8 +622,7 @@ void __init efika_board_common_init(void if (machine_is_mx51_efikasb()) vgen1_init.constraints.max_uV = 1200000; - gpio_request(EFIKAMX_PMIC, "pmic irq"); - gpio_direction_input(EFIKAMX_PMIC); + gpio_request_one(EFIKAMX_PMIC, GPIOF_IN, "pmic irq"); spi_register_board_info(mx51_efika_spi_board_info, ARRAY_SIZE(mx51_efika_spi_board_info)); imx51_add_ecspi(0, &mx51_efika_spi_pdata);
arch/arm/mach-mxs/mach-mx28evk.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-mxs/mach-mx28evk.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -142,13 +142,13 @@ static void __init mx28evk_fec_reset(voi } /* Reset fec phy */ - ret = gpio_request(MX28EVK_FEC_PHY_RESET, "fec-phy-reset"); + ret = gpio_request_one(MX28EVK_FEC_PHY_RESET, GPIOF_OUT_INIT_LOW, + "fec-phy-reset"); if (ret) { pr_err("Failed to request gpio fec-phy-%s: %d\n", "reset", ret); return; } - gpio_direction_output(MX28EVK_FEC_PHY_RESET, 0); if (ret) { pr_err("Failed to drive gpio fec-phy-%s: %d\n", "reset", ret); return;
arch/arm/mach-omap1/board-ams-delta.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-omap1/board-ams-delta.c 2011-02-11 10:53:31.000000000 +0100 +2 -2
@@ -364,12 +364,12 @@ static int __init ams_delta_modem_init(v ams_delta_modem_ports[0].irq = gpio_to_irq(AMS_DELTA_GPIO_PIN_MODEM_IRQ); - err = gpio_request(AMS_DELTA_GPIO_PIN_MODEM_IRQ, "modem"); + err = gpio_request_one(AMS_DELTA_GPIO_PIN_MODEM_IRQ, GPIOF_IN, + "modem"); if (err) { pr_err("Couldn't request gpio pin for modem\n"); return err; } - gpio_direction_input(AMS_DELTA_GPIO_PIN_MODEM_IRQ); ams_delta_latch2_write( AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC,
arch/arm/mach-omap1/board-fsample.c 2011-03-21 08:55:23.000000000 +0100 renamed from arch/arm/mach-omap1/board-fsample.c 2011-02-11 10:53:31.000000000 +0100 +1 -2
@@ -299,9 +299,8 @@ static void __init omap_fsample_init(voi { fsample_init_smc91x(); - if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0) + if (gpio_request_one(FSAMPLE_NAND_RB_GPIO_PIN, GPIOF_IN, "NAND ready") < 0) BUG(); - gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN); omap_cfg_reg(L3_1610_FLASH_CS2B_OE); omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
arch/arm/mach-omap1/board-h2-mmc.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-omap1/board-h2-mmc.c 2010-10-04 07:26:41.000000000 +0200 +2 -3
@@ -32,12 +32,11 @@ static int mmc_set_power(struct device * static int mmc_late_init(struct device *dev) { - int ret = gpio_request(H2_TPS_GPIO_MMC_PWR_EN, "MMC power"); + int ret = gpio_request_one(H2_TPS_GPIO_MMC_PWR_EN, + GPIOF_OUT_INIT_LOW, "MMC power"); if (ret < 0) return ret; - gpio_direction_output(H2_TPS_GPIO_MMC_PWR_EN, 0); - return ret; }
arch/arm/mach-omap1/board-h2.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-omap1/board-h2.c 2011-02-11 10:53:31.000000000 +0100 +1 -2
@@ -420,9 +420,8 @@ static void __init h2_init(void) h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; h2_nand_resource.end += SZ_4K - 1; - if (gpio_request(H2_NAND_RB_GPIO_PIN, "NAND ready") < 0) + if (gpio_request_one(H2_NAND_RB_GPIO_PIN, GPIOF_IN, "NAND ready") < 0) BUG(); - gpio_direction_input(H2_NAND_RB_GPIO_PIN); omap_cfg_reg(L3_1610_FLASH_CS2B_OE); omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
arch/arm/mach-omap1/board-h3-mmc.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-omap1/board-h3-mmc.c 2010-10-04 07:26:41.000000000 +0200 +2 -2
@@ -51,10 +51,10 @@ void __init h3_mmc_init(void) { int ret; - ret = gpio_request(H3_TPS_GPIO_MMC_PWR_EN, "MMC power"); + ret = gpio_request_one(H3_TPS_GPIO_MMC_PWR_EN, GPIOF_OUT_INIT_LOW, + "MMC power"); if (ret < 0) return; - gpio_direction_output(H3_TPS_GPIO_MMC_PWR_EN, 0); mmc_data[0] = &mmc1_data; omap1_init_mmc(mmc_data, OMAP16XX_NR_MMC);
arch/arm/mach-omap1/board-h3.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-omap1/board-h3.c 2011-02-11 10:53:31.000000000 +0100 +1 -2
@@ -403,9 +403,8 @@ static void __init h3_init(void) nand_resource.end = nand_resource.start = OMAP_CS2B_PHYS; nand_resource.end += SZ_4K - 1; - if (gpio_request(H3_NAND_RB_GPIO_PIN, "NAND ready") < 0) + if (gpio_request_one(H3_NAND_RB_GPIO_PIN, GPIOF_IN, "NAND ready") < 0) BUG(); - gpio_direction_input(H3_NAND_RB_GPIO_PIN); /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */ /* GPIO10 pullup/down register, Enable pullup on GPIO10 */
arch/arm/mach-omap1/board-nokia770.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-omap1/board-nokia770.c 2011-02-11 10:53:31.000000000 +0100 +4 -4
@@ -221,17 +221,17 @@ static void __init nokia770_mmc_init(voi { int ret; - ret = gpio_request(NOKIA770_GPIO_MMC_POWER, "MMC power"); + ret = gpio_request_one(NOKIA770_GPIO_MMC_POWER, GPIOF_OUT_INIT_LOW, + "MMC power"); if (ret < 0) return; - gpio_direction_output(NOKIA770_GPIO_MMC_POWER, 0); - ret = gpio_request(NOKIA770_GPIO_MMC_SWITCH, "MMC cover"); + ret = gpio_request_one(NOKIA770_GPIO_MMC_SWITCH, GPIOF_IN, + "MMC cover"); if (ret < 0) { gpio_free(NOKIA770_GPIO_MMC_POWER); return; } - gpio_direction_input(NOKIA770_GPIO_MMC_SWITCH); /* Only the second MMC controller is used */ nokia770_mmc_data[1] = &nokia770_mmc2_data;
arch/arm/mach-omap1/board-osk.c 2011-03-21 08:55:23.000000000 +0100 renamed from arch/arm/mach-omap1/board-osk.c 2010-12-28 18:26:02.000000000 +0100 +8 -10
@@ -197,19 +197,19 @@ static int osk_tps_setup(struct i2c_clie /* Set GPIO 1 HIGH to disable VBUS power supply; * OHCI driver powers it up/down as needed. */ - gpio_request(OSK_TPS_GPIO_USB_PWR_EN, "n_vbus_en"); - gpio_direction_output(OSK_TPS_GPIO_USB_PWR_EN, 1); + gpio_request_one(OSK_TPS_GPIO_USB_PWR_EN, GPIOF_OUT_INIT_HIGH, + "n_vbus_en"); /* Set GPIO 2 high so LED D3 is off by default */ tps65010_set_gpio_out_value(GPIO2, HIGH); /* Set GPIO 3 low to take ethernet out of reset */ - gpio_request(OSK_TPS_GPIO_LAN_RESET, "smc_reset"); - gpio_direction_output(OSK_TPS_GPIO_LAN_RESET, 0); + gpio_request_one(OSK_TPS_GPIO_LAN_RESET, GPIOF_OUT_INIT_LOW, + "smc_reset"); /* GPIO4 is VDD_DSP */ - gpio_request(OSK_TPS_GPIO_DSP_PWR_EN, "dsp_power"); - gpio_direction_output(OSK_TPS_GPIO_DSP_PWR_EN, 1); + gpio_request_one(OSK_TPS_GPIO_DSP_PWR_EN, GPIOF_OUT_INIT_HIGH, + "dsp_power"); /* REVISIT if DSP support isn't configured, power it off ... */ /* Let LED1 (D9) blink; leds-gpio may override it */
@@ -476,12 +476,10 @@ static void __init osk_mistral_init(void /* omap_cfg_reg(P19_1610_GPIO6); */ /* BUSY */ - gpio_request(6, "ts_busy"); - gpio_direction_input(6); + gpio_request_one(6, GPIOF_IN, "ts_busy"); omap_cfg_reg(P20_1610_GPIO4); /* PENIRQ */ - gpio_request(4, "ts_int"); - gpio_direction_input(4); + gpio_request_one(4, GPIOF_IN, "ts_int"); set_irq_type(gpio_to_irq(4), IRQ_TYPE_EDGE_FALLING); spi_register_board_info(mistral_boardinfo,
arch/arm/mach-omap1/board-palmte.c 2011-03-21 08:55:23.000000000 +0100 renamed from arch/arm/mach-omap1/board-palmte.c 2011-02-11 10:53:31.000000000 +0100 +2 -4
@@ -233,18 +233,16 @@ static struct spi_board_info palmte_spi_ static void __init palmte_misc_gpio_setup(void) { /* Set TSC2102 PINTDAV pin as input (used by TSC2102 driver) */ - if (gpio_request(PALMTE_PINTDAV_GPIO, "TSC2102 PINTDAV") < 0) { + if (gpio_request_one(PALMTE_PINTDAV_GPIO, GPIOF_IN, "TSC2102 PINTDAV") < 0) { printk(KERN_ERR "Could not reserve PINTDAV GPIO!\n"); return; } - gpio_direction_input(PALMTE_PINTDAV_GPIO); /* Set USB-or-DC-IN pin as input (unused) */ - if (gpio_request(PALMTE_USB_OR_DC_GPIO, "USB/DC-IN") < 0) { + if (gpio_request_one(PALMTE_USB_OR_DC_GPIO, GPIOF_IN, "USB/DC-IN") < 0) { printk(KERN_ERR "Could not reserve cable signal GPIO!\n"); return; } - gpio_direction_input(PALMTE_USB_OR_DC_GPIO); } static void __init omap_palmte_init(void)
arch/arm/mach-omap1/board-palmz71.c 2011-03-21 08:55:23.000000000 +0100 renamed from arch/arm/mach-omap1/board-palmz71.c 2010-12-28 18:26:02.000000000 +0100 +3 -4
@@ -285,19 +285,18 @@ palmz71_gpio_setup(int early) gpio_direction_output(1, 1); } else { /* Set MMC/SD host WP pin as input */ - if (gpio_request(PALMZ71_MMC_WP_GPIO, "MMC WP") < 0) { + if (gpio_request_one(PALMZ71_MMC_WP_GPIO, GPIOF_IN, "MMC WP") < 0) { printk(KERN_ERR "Could not reserve WP GPIO!\n"); return; } - gpio_direction_input(PALMZ71_MMC_WP_GPIO); /* Monitor the Power-cable-connected signal */ - if (gpio_request(PALMZ71_USBDETECT_GPIO, "USB detect") < 0) { + if (gpio_request_one(PALMZ71_USBDETECT_GPIO, GPIOF_IN, + "USB detect") < 0) { printk(KERN_ERR "Could not reserve cable signal GPIO!\n"); return; } - gpio_direction_input(PALMZ71_USBDETECT_GPIO); if (request_irq(gpio_to_irq(PALMZ71_USBDETECT_GPIO), palmz71_powercable, IRQF_SAMPLE_RANDOM, "palmz71-cable", 0))
arch/arm/mach-omap1/board-perseus2.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-omap1/board-perseus2.c 2010-12-28 18:26:02.000000000 +0100 +1 -2
@@ -267,9 +267,8 @@ static void __init omap_perseus2_init(vo { perseus2_init_smc91x(); - if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0) + if (gpio_request_one(P2_NAND_RB_GPIO_PIN, GPIOF_IN, "NAND ready") < 0) BUG(); - gpio_direction_input(P2_NAND_RB_GPIO_PIN); omap_cfg_reg(L3_1610_FLASH_CS2B_OE); omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
arch/arm/mach-omap1/board-voiceblue.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-omap1/board-voiceblue.c 2011-02-11 10:53:31.000000000 +0100 +2 -4
@@ -264,16 +264,14 @@ static void __init voiceblue_init(void) /* Watchdog */ gpio_request(0, "Watchdog"); /* smc91x reset */ - gpio_request(7, "SMC91x reset"); - gpio_direction_output(7, 1); + gpio_request_one(7, GPIOF_OUT_INIT_HIGH, "SMC91x reset"); udelay(2); /* wait@least 100ns */ gpio_set_value(7, 0); mdelay(50); /* 50ms until PHY ready */ /* smc91x interrupt pin */ gpio_request(8, "SMC91x irq"); /* 16C554 reset*/ - gpio_request(6, "16C554 reset"); - gpio_direction_output(6, 0); + gpio_request_one(6, GPIOF_OUT_INIT_LOW, "16C554 reset"); /* 16C554 interrupt pins */ gpio_request(12, "16C554 irq"); gpio_request(13, "16C554 irq");
arch/arm/mach-omap1/fpga.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-omap1/fpga.c 2011-01-19 18:51:18.000000000 +0100 +1 -2
@@ -177,12 +177,11 @@ void omap1510_fpga_init_irq(void) * NOTE: For general GPIO/MPUIO access and interrupts, please see * gpio.[ch] */ - res = gpio_request(13, "FPGA irq"); + res = gpio_request_one(13, GPIOF_IN, "FPGA irq"); if (res) { pr_err("%s failed to get gpio\n", __func__); return; } - gpio_direction_input(13); set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING); set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux); }
arch/arm/mach-omap1/serial.c 2011-03-21 08:55:23.000000000 +0100 renamed from arch/arm/mach-omap1/serial.c 2010-12-26 10:19:06.000000000 +0100 +1 -2
@@ -220,13 +220,12 @@ static void __init omap_serial_set_port_ { int ret; - ret = gpio_request(gpio_nr, "UART wake"); + ret = gpio_request_one(gpio_nr, GPIOF_IN, "UART wake"); if (ret < 0) { printk(KERN_ERR "Could not request UART wake GPIO: %i\n", gpio_nr); return; } - gpio_direction_input(gpio_nr); ret = request_irq(gpio_to_irq(gpio_nr), &omap_serial_wake_interrupt, IRQF_TRIGGER_RISING, "serial wakeup", NULL); if (ret) {
arch/arm/mach-omap2/board-3430sdp.c 2011-03-21 08:55:23.000000000 +0100 renamed from arch/arm/mach-omap2/board-3430sdp.c 2011-03-14 17:19:13.000000000 +0100 +3 -6
@@ -132,12 +132,11 @@ static int ts_gpio; /* Needed for ads784 */ static void ads7846_dev_init(void) { - if (gpio_request(ts_gpio, "ADS7846 pendown") < 0) { + if (gpio_request_one(ts_gpio, GPIOF_IN, "ADS7846 pendown") < 0) { printk(KERN_ERR "can't get ads746 pen down GPIO\n"); return; } - gpio_direction_input(ts_gpio); gpio_set_debounce(ts_gpio, 310); }
@@ -360,12 +359,10 @@ static int sdp3430_twl_gpio_setup(struct omap2_hsmmc_init(mmc); /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */ - gpio_request(gpio + 7, "sub_lcd_en_bkl"); - gpio_direction_output(gpio + 7, 0); + gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "sub_lcd_en_bkl"); /* gpio + 15 is "sub_lcd_nRST" (output) */ - gpio_request(gpio + 15, "sub_lcd_nRST"); - gpio_direction_output(gpio + 15, 0); + gpio_request_one(gpio + 15, GPIOF_OUT_INIT_LOW, "sub_lcd_nRST"); return 0; }
arch/arm/mach-omap2/board-am3517evm.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-omap2/board-am3517evm.c 2011-03-14 17:19:13.000000000 +0100 +5 -6
@@ -252,30 +252,29 @@ static void __init am3517_evm_display_in /* * Enable GPIO 182 = LCD Backlight Power */ - r = gpio_request(LCD_PANEL_BKLIGHT_PWR, "lcd_backlight_pwr"); + r = gpio_request_one(LCD_PANEL_BKLIGHT_PWR, GPIOF_OUT_INIT_HIGH, + "lcd_backlight_pwr"); if (r) { printk(KERN_ERR "failed to get lcd_backlight_pwr\n"); return; } - gpio_direction_output(LCD_PANEL_BKLIGHT_PWR, 1); /* * Enable GPIO 181 = LCD Panel PWM */ - r = gpio_request(LCD_PANEL_PWM, "lcd_pwm"); + r = gpio_request_one(LCD_PANEL_PWM, GPIOF_OUT_INIT_HIGH, "lcd_pwm"); if (r) { printk(KERN_ERR "failed to get lcd_pwm\n"); goto err_1; } - gpio_direction_output(LCD_PANEL_PWM, 1); /* * Enable GPIO 176 = LCD Panel Power enable pin */ - r = gpio_request(LCD_PANEL_PWR, "lcd_panel_pwr"); + r = gpio_request_one(LCD_PANEL_PWR, GPIOF_OUT_INIT_HIGH, + "lcd_panel_pwr"); if (r) { printk(KERN_ERR "failed to get lcd_panel_pwr\n"); goto err_2; } - gpio_direction_output(LCD_PANEL_PWR, 1); printk(KERN_INFO "Display initialized successfully\n"); return;
arch/arm/mach-omap2/board-apollon.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-omap2/board-apollon.c 2011-03-14 17:19:13.000000000 +0100 +5 -10
@@ -246,13 +246,12 @@ static inline void __init apollon_init_s udelay(100); omap_mux_init_gpio(74, 0); - if (gpio_request(APOLLON_ETHR_GPIO_IRQ, "SMC91x irq") < 0) { + if (gpio_request_one(APOLLON_ETHR_GPIO_IRQ, GPIOF_IN, "SMC91x irq") < 0) { printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", APOLLON_ETHR_GPIO_IRQ); gpmc_cs_free(APOLLON_ETH_CS); goto out; } - gpio_direction_input(APOLLON_ETHR_GPIO_IRQ); out: clk_disable(gpmc_fck);
@@ -284,16 +283,13 @@ static void __init apollon_led_init(void { /* LED0 - AA10 */ omap_mux_init_signal("vlynq_clk.gpio_13", 0); - gpio_request(LED0_GPIO13, "LED0"); - gpio_direction_output(LED0_GPIO13, 0); + gpio_request_one(LED0_GPIO13, GPIOF_OUT_INIT_LOW, "LED0"); /* LED1 - AA6 */ omap_mux_init_signal("vlynq_rx1.gpio_14", 0); - gpio_request(LED1_GPIO14, "LED1"); - gpio_direction_output(LED1_GPIO14, 0); + gpio_request_one(LED1_GPIO14, GPIOF_OUT_INIT_LOW, "LED1"); /* LED2 - AA4 */ omap_mux_init_signal("vlynq_rx0.gpio_15", 0); - gpio_request(LED2_GPIO15, "LED2"); - gpio_direction_output(LED2_GPIO15, 0); + gpio_request_one(LED2_GPIO15, GPIOF_OUT_INIT_LOW, "LED2"); } static void __init apollon_usb_init(void)
@@ -301,8 +297,7 @@ static void __init apollon_usb_init(void /* USB device */ /* DEVICE_SUSPEND */ omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0); - gpio_request(12, "USB suspend"); - gpio_direction_output(12, 0); + gpio_request_one(12, GPIOF_OUT_INIT_LOW, "USB suspend"); omap2_usbfs_init(&apollon_usb_config); }
arch/arm/mach-omap2/board-cm-t3517.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-omap2/board-cm-t3517.c 2011-03-14 17:19:13.000000000 +0100 +2 -3
@@ -148,14 +148,13 @@ static void __init cm_t3517_init_rtc(voi { int err; - err = gpio_request(RTC_CS_EN_GPIO, "rtc cs en"); + err = gpio_request_one(RTC_CS_EN_GPIO, GPIOF_OUT_INIT_HIGH, + "rtc cs en"); if (err) { pr_err("CM-T3517: rtc cs en gpio request failed: %d\n", err); return; } - gpio_direction_output(RTC_CS_EN_GPIO, 1); - platform_device_register(&cm_t3517_rtc_device); } #else
arch/arm/mach-omap2/board-devkit8000.c 2011-03-21 08:55:26.000000000 +0100 renamed from arch/arm/mach-omap2/board-devkit8000.c 2011-03-14 17:19:13.000000000 +0100 +2 -6
@@ -468,14 +468,12 @@ static void __init devkit8000_ads7846_in int gpio = OMAP3_DEVKIT_TS_GPIO; int ret; - ret = gpio_request(gpio, "ads7846_pen_down"); + ret = gpio_request_one(gpio, GPIOF_IN, "ads7846_pen_down"); if (ret < 0) { printk(KERN_ERR "Failed to request GPIO %d for " "ads7846 pen down IRQ\n", gpio); return; } - - gpio_direction_input(gpio); } static int ads7846_get_pendown_state(void)
@@ -551,14 +549,12 @@ static void __init omap_dm9000_init(void unsigned char *eth_addr = omap_dm9000_platdata.dev_addr; struct omap_die_id odi; - if (gpio_request(OMAP_DM9000_GPIO_IRQ, "dm9000 irq") < 0) { + if (gpio_request_one(OMAP_DM9000_GPIO_IRQ, GPIOF_IN, "dm9000 irq") < 0) { printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n", OMAP_DM9000_GPIO_IRQ); return; } - gpio_direction_input(OMAP_DM9000_GPIO_IRQ); - /* init the mac address using DIE id */ omap_get_die_id(&odi);
arch/arm/mach-omap2/board-ldp.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-omap2/board-ldp.c 2011-03-14 17:19:13.000000000 +0100 +2 -4
@@ -206,12 +206,11 @@ static int ts_gpio; */ static void ads7846_dev_init(void) { - if (gpio_request(ts_gpio, "ads7846 irq") < 0) { + if (gpio_request_one(ts_gpio, GPIOF_IN, "ads7846 irq") < 0) { printk(KERN_ERR "can't get ads746 pen down GPIO\n"); return; } - gpio_direction_input(ts_gpio); gpio_set_debounce(ts_gpio, 310); }
@@ -267,12 +266,11 @@ static inline void __init ldp_init_smsc9 ldp_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio); - if (gpio_request(eth_gpio, "smsc911x irq") < 0) { + if (gpio_request_one(eth_gpio, GPIOF_IN, "smsc911x irq") < 0) { printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", eth_gpio); return; } - gpio_direction_input(eth_gpio); } static struct platform_device ldp_lcd_device = {
arch/arm/mach-omap2/board-n8x0.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-omap2/board-n8x0.c 2011-03-14 17:19:13.000000000 +0100 +8 -9
@@ -106,13 +106,13 @@ static void __init n8x0_usb_init(void) static char announce[] __initdata = KERN_INFO "TUSB 6010\n"; /* PM companion chip power control pin */ - ret = gpio_request(TUSB6010_GPIO_ENABLE, "TUSB6010 enable"); + ret = gpio_request_one(TUSB6010_GPIO_ENABLE, GPIOF_OUT_INIT_LOW, + "TUSB6010 enable"); if (ret != 0) { printk(KERN_ERR "Could not get TUSB power GPIO%i\n", TUSB6010_GPIO_ENABLE); return; } - gpio_direction_output(TUSB6010_GPIO_ENABLE, 0); tusb_set_power(0);
@@ -512,27 +512,26 @@ static void __init n8x0_mmc_init(void) mmc1_data.slots[1].ban_openended = 1; } - err = gpio_request(N8X0_SLOT_SWITCH_GPIO, "MMC slot switch"); + err = gpio_request_one(N8X0_SLOT_SWITCH_GPIO, GPIOF_OUT_INIT_LOW, + "MMC slot switch"); if (err) return; - gpio_direction_output(N8X0_SLOT_SWITCH_GPIO, 0); - if (machine_is_nokia_n810()) { - err = gpio_request(N810_EMMC_VSD_GPIO, "MMC slot 2 Vddf"); + err = gpio_request_one(N810_EMMC_VSD_GPIO, + GPIOF_OUT_INIT_LOW, "MMC slot 2 Vddf"); if (err) { gpio_free(N8X0_SLOT_SWITCH_GPIO); return; } - gpio_direction_output(N810_EMMC_VSD_GPIO, 0); - err = gpio_request(N810_EMMC_VIO_GPIO, "MMC slot 2 Vdd"); + err = gpio_request_one(N810_EMMC_VIO_GPIO, + GPIOF_OUT_INIT_LOW, "MMC slot 2 Vdd"); if (err) { gpio_free(N8X0_SLOT_SWITCH_GPIO); gpio_free(N810_EMMC_VSD_GPIO); return; } - gpio_direction_output(N810_EMMC_VIO_GPIO, 0); } mmc_data[0] = &mmc1_data;
arch/arm/mach-omap2/board-omap3beagle.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap3beagle.c 2011-03-14 17:19:13.000000000 +0100 +2 -3
@@ -243,13 +243,12 @@ static void __init beagle_display_init(v { int r; - r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset"); + r = gpio_request_one(beagle_dvi_device.reset_gpio, + GPIOF_OUT_INIT_LOW, "DVI reset"); if (r < 0) { printk(KERN_ERR "Unable to get DVI reset GPIO\n"); return; } - - gpio_direction_output(beagle_dvi_device.reset_gpio, 0); } #include "sdram-micron-mt46h32m32lf-6.h"
arch/arm/mach-omap2/board-omap3evm.c 2011-03-21 08:55:23.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap3evm.c 2011-03-14 17:19:13.000000000 +0100 +19 -22
111 lines not on this page · raw message
arch/arm/mach-omap2/board-omap3pandora.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap3pandora.c 2011-03-14 17:19:13.000000000 +0100 +1 -3
@@ -575,14 +575,12 @@ static void __init omap3pandora_ads7846_ int gpio = OMAP3_PANDORA_TS_GPIO; int ret; - ret = gpio_request(gpio, "ads7846_pen_down"); + ret = gpio_request_one(gpio, GPIOF_IN, "ads7846_pen_down"); if (ret < 0) { printk(KERN_ERR "Failed to request GPIO %d for " "ads7846 pen down IRQ\n", gpio); return; } - - gpio_direction_input(gpio); } static int ads7846_get_pendown_state(void)
arch/arm/mach-omap2/board-omap3stalker.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap3stalker.c 2011-03-14 17:19:13.000000000 +0100 +7 -9
@@ -107,15 +107,14 @@ static inline void __init omap3stalker_i rate = clk_get_rate(l3ck); omap_mux_init_gpio(19, OMAP_PIN_INPUT_PULLUP); - if (gpio_request(OMAP3STALKER_ETHR_GPIO_IRQ, "SMC911x irq") < 0) { + if (gpio_request_one(OMAP3STALKER_ETHR_GPIO_IRQ, GPIOF_IN, + "SMC911x irq") < 0) { printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n", OMAP3STALKER_ETHR_GPIO_IRQ); return; } - gpio_direction_input(OMAP3STALKER_ETHR_GPIO_IRQ); - platform_device_register(&omap3stalker_smsc911x_device); }
@@ -365,12 +364,11 @@ omap3stalker_twl_gpio_setup(struct devic */ /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */ - gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL"); - gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); + gpio_request_one(gpio + TWL4030_GPIO_MAX, GPIOF_OUT_INIT_LOW, + "EN_LCD_BKL"); /* gpio + 7 == DVI Enable */ - gpio_request(gpio + 7, "EN_DVI"); - gpio_direction_output(gpio + 7, 0); + gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "EN_DVI"); /* TWL4030_GPIO_MAX + 1 == ledB (out, mmc0) */ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
@@ -534,10 +532,10 @@ static int __init omap3_stalker_i2c_init #define OMAP3_STALKER_TS_GPIO 175 static void ads7846_dev_init(void) { - if (gpio_request(OMAP3_STALKER_TS_GPIO, "ADS7846 pendown") < 0) + if (gpio_request_one(OMAP3_STALKER_TS_GPIO, GPIOF_IN, + "ADS7846 pendown") < 0) printk(KERN_ERR "can't get ads7846 pen down GPIO\n"); - gpio_direction_input(OMAP3_STALKER_TS_GPIO); gpio_set_debounce(OMAP3_STALKER_TS_GPIO, 310); }
arch/arm/mach-omap2/board-omap3touchbook.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-omap2/board-omap3touchbook.c 2011-03-14 17:19:13.000000000 +0100 +6 -9
@@ -155,12 +155,11 @@ static int touchbook_twl_gpio_setup(stru * power switch and overcurrent detect */ - gpio_request(gpio + 1, "EHCI_nOC"); - gpio_direction_input(gpio + 1); + gpio_request_one(gpio + 1, GPIOF_IN, "EHCI_nOC"); /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */ - gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR"); - gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); + gpio_request_one(gpio + TWL4030_GPIO_MAX, GPIOF_OUT_INIT_LOW, + "nEN_USB_PWR"); /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
@@ -303,13 +302,12 @@ static int __init omap3_touchbook_i2c_in static void __init omap3_ads7846_init(void) { - if (gpio_request(OMAP3_TS_GPIO, "ads7846_pen_down")) { + if (gpio_request_one(OMAP3_TS_GPIO, GPIOF_IN, "ads7846_pen_down")) { printk(KERN_ERR "Failed to request GPIO %d for " "ads7846 pen down IRQ\n", OMAP3_TS_GPIO); return; } - gpio_direction_input(OMAP3_TS_GPIO); gpio_set_debounce(OMAP3_TS_GPIO, 310); }
@@ -483,13 +481,12 @@ static void omap3_touchbook_poweroff(voi { int r; - r = gpio_request(TB_KILL_POWER_GPIO, "DVI reset"); + r = gpio_request_one(TB_KILL_POWER_GPIO, GPIOF_OUT_INIT_LOW, + "DVI reset"); if (r < 0) { printk(KERN_ERR "Unable to get kill power GPIO\n"); return; } - - gpio_direction_output(TB_KILL_POWER_GPIO, 0); } static int __init early_touchbook_revision(char *p)
arch/arm/mach-omap2/board-rx51-peripherals.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-omap2/board-rx51-peripherals.c 2011-03-14 17:19:13.000000000 +0100 +2 -4
@@ -557,10 +557,8 @@ static __init void rx51_init_si4713(void static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) { /* FIXME this gpio setup is just a placeholder for now */ - gpio_request(gpio + 6, "backlight_pwm"); - gpio_direction_output(gpio + 6, 0); - gpio_request(gpio + 7, "speaker_en"); - gpio_direction_output(gpio + 7, 1); + gpio_request_one(gpio + 6, GPIOF_OUT_INIT_LOW, "backlight_pwm"); + gpio_request_one(gpio + 7, GPIOF_OUT_INIT_HIGH, "speaker_en"); return 0; }
arch/arm/mach-omap2/board-rx51-video.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-omap2/board-rx51-video.c 2011-02-19 08:28:51.000000000 +0100 +2 -3
@@ -76,13 +76,12 @@ static int __init rx51_video_init(void) return 0; } - if (gpio_request(RX51_LCD_RESET_GPIO, "LCD ACX565AKM reset")) { + if (gpio_request_one(RX51_LCD_RESET_GPIO, GPIOF_OUT_INIT_HIGH, + "LCD ACX565AKM reset")) { pr_err("%s failed to get LCD Reset GPIO\n", __func__); return 0; } - gpio_direction_output(RX51_LCD_RESET_GPIO, 1); - omap_display_init(&rx51_dss_board_info); return 0; }
arch/arm/mach-omap2/board-zoom-debugboard.c 2011-03-21 08:55:23.000000000 +0100 renamed from arch/arm/mach-omap2/board-zoom-debugboard.c 2010-10-14 18:30:03.000000000 +0200 +4 -6
@@ -74,12 +74,11 @@ static inline void __init zoom_init_smsc zoom_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio); - if (gpio_request(eth_gpio, "smsc911x irq") < 0) { + if (gpio_request_one(eth_gpio, GPIOF_IN, "smsc911x irq") < 0) { printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", eth_gpio); return; } - gpio_direction_input(eth_gpio); } static struct plat_serial8250_port serial_platform_data[] = {
@@ -120,12 +119,11 @@ static inline void __init zoom_init_quad quart_gpio = ZOOM_QUADUART_GPIO; - if (gpio_request(quart_gpio, "TL16CP754C GPIO") < 0) { + if (gpio_request_one(quart_gpio, GPIOF_IN, "TL16CP754C GPIO") < 0) { printk(KERN_ERR "Failed to request GPIO%d for TL16CP754C\n", quart_gpio); return; } - gpio_direction_input(quart_gpio); } static inline int omap_zoom_debugboard_detect(void)
@@ -135,12 +133,12 @@ static inline int omap_zoom_debugboard_d debug_board_detect = ZOOM_SMSC911X_GPIO; - if (gpio_request(debug_board_detect, "Zoom debug board detect") < 0) { + if (gpio_request_one(debug_board_detect, GPIOF_IN, + "Zoom debug board detect") < 0) { printk(KERN_ERR "Failed to request GPIO%d for Zoom debug" "board detect\n", debug_board_detect); return 0; } - gpio_direction_input(debug_board_detect); if (!gpio_get_value(debug_board_detect)) { ret = 0;
arch/arm/mach-omap2/board-zoom-display.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-omap2/board-zoom-display.c 2011-02-19 08:28:51.000000000 +0100 +4 -4
@@ -30,21 +30,21 @@ static void zoom_lcd_panel_init(void) LCD_PANEL_RESET_GPIO_PROD : LCD_PANEL_RESET_GPIO_PILOT; - ret = gpio_request(lcd_panel_reset_gpio, "lcd reset"); + ret = gpio_request_one(lcd_panel_reset_gpio, GPIOF_OUT_INIT_HIGH, + "lcd reset"); if (ret) { pr_err("Failed to get LCD reset GPIO (gpio%d).\n", lcd_panel_reset_gpio); return; } - gpio_direction_output(lcd_panel_reset_gpio, 1); - ret = gpio_request(LCD_PANEL_QVGA_GPIO, "lcd qvga"); + ret = gpio_request_one(LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, + "lcd qvga"); if (ret) { pr_err("Failed to get LCD_PANEL_QVGA_GPIO (gpio%d).\n", LCD_PANEL_QVGA_GPIO); goto err0; } - gpio_direction_output(LCD_PANEL_QVGA_GPIO, 1); return; err0:
arch/arm/mach-omap2/board-zoom-peripherals.c 2011-03-21 08:55:26.000000000 +0100 renamed from arch/arm/mach-omap2/board-zoom-peripherals.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -276,13 +276,13 @@ static int zoom_twl_gpio_setup(struct de zoom_vsim_supply.dev = mmc[0].dev; zoom_vmmc2_supply.dev = mmc[1].dev; - ret = gpio_request(LCD_PANEL_ENABLE_GPIO, "lcd enable"); + ret = gpio_request_one(LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, + "lcd enable"); if (ret) { pr_err("Failed to get LCD_PANEL_ENABLE_GPIO (gpio%d).\n", LCD_PANEL_ENABLE_GPIO); return ret; } - gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0); return ret; }
arch/arm/mach-omap2/gpmc-smc91x.c 2011-03-21 08:55:23.000000000 +0100 renamed from arch/arm/mach-omap2/gpmc-smc91x.c 2009-12-12 00:23:19.000000000 +0100 +5 -6
@@ -147,25 +147,24 @@ void __init gpmc_smc91x_init(struct omap goto free1; } - if (gpio_request(gpmc_cfg->gpio_irq, "SMC91X irq") < 0) + if (gpio_request_one(gpmc_cfg->gpio_irq, GPIOF_IN, "SMC91X irq") < 0) goto free1; - gpio_direction_input(gpmc_cfg->gpio_irq); gpmc_smc91x_resources[1].start = gpio_to_irq(gpmc_cfg->gpio_irq); if (gpmc_cfg->gpio_pwrdwn) { - ret = gpio_request(gpmc_cfg->gpio_pwrdwn, "SMC91X powerdown"); + ret = gpio_request_one(gpmc_cfg->gpio_pwrdwn, + GPIOF_OUT_INIT_LOW, "SMC91X powerdown"); if (ret) goto free2; - gpio_direction_output(gpmc_cfg->gpio_pwrdwn, 0); } if (gpmc_cfg->gpio_reset) { - ret = gpio_request(gpmc_cfg->gpio_reset, "SMC91X reset"); + ret = gpio_request_one(gpmc_cfg->gpio_reset, + GPIOF_OUT_INIT_LOW, "SMC91X reset"); if (ret) goto free3; - gpio_direction_output(gpmc_cfg->gpio_reset, 0); gpio_set_value(gpmc_cfg->gpio_reset, 1); msleep(100); gpio_set_value(gpmc_cfg->gpio_reset, 0);
arch/arm/mach-omap2/gpmc-smsc911x.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-omap2/gpmc-smsc911x.c 2010-09-30 17:54:14.000000000 +0200 +3 -4
@@ -71,26 +71,25 @@ void __init gpmc_smsc911x_init(struct om gpmc_smsc911x_resources[0].start = cs_mem_base + 0x0; gpmc_smsc911x_resources[0].end = cs_mem_base + 0xff; - if (gpio_request(gpmc_cfg->gpio_irq, "smsc911x irq") < 0) { + if (gpio_request_one(gpmc_cfg->gpio_irq, GPIOF_IN, "smsc911x irq") < 0) { printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", gpmc_cfg->gpio_irq); goto free1; } - gpio_direction_input(gpmc_cfg->gpio_irq); gpmc_smsc911x_resources[1].start = gpio_to_irq(gpmc_cfg->gpio_irq); gpmc_smsc911x_resources[1].flags |= (gpmc_cfg->flags & IRQF_TRIGGER_MASK); if (gpio_is_valid(gpmc_cfg->gpio_reset)) { - ret = gpio_request(gpmc_cfg->gpio_reset, "smsc911x reset"); + ret = gpio_request_one(gpmc_cfg->gpio_reset, + GPIOF_OUT_INIT_HIGH, "smsc911x reset"); if (ret) { printk(KERN_ERR "Failed to request GPIO%d for smsc911x reset\n", gpmc_cfg->gpio_reset); goto free2; } - gpio_direction_output(gpmc_cfg->gpio_reset, 1); gpio_set_value(gpmc_cfg->gpio_reset, 0); msleep(100); gpio_set_value(gpmc_cfg->gpio_reset, 1);
arch/arm/mach-omap2/usb-tusb6010.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-omap2/usb-tusb6010.c 2010-12-28 18:26:02.000000000 +0100 +1 -2
@@ -293,12 +293,11 @@ tusb6010_setup_interface(struct musb_hdr ); /* IRQ */ - status = gpio_request(irq, "TUSB6010 irq"); + status = gpio_request_one(irq, GPIOF_IN, "TUSB6010 irq"); if (status < 0) { printk(error, 3, status); return status; } - gpio_direction_input(irq); tusb_resources[2].start = irq + IH_GPIO_BASE; /* set up memory timings ... can speed them up later */
arch/arm/mach-orion5x/dns323-setup.c 2011-03-21 08:55:23.000000000 +0100 renamed from arch/arm/mach-orion5x/dns323-setup.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -642,8 +642,8 @@ static void __init dns323_init(void) * DNS323_GPIO_LED_POWER1 to also be low. */ dns323ab_leds[0].active_low = 1; - gpio_request(DNS323_GPIO_LED_POWER1, "Power Led Enable"); - gpio_direction_output(DNS323_GPIO_LED_POWER1, 0); + gpio_request_one(DNS323_GPIO_LED_POWER1, GPIOF_OUT_INIT_LOW, + "Power Led Enable"); /* Fall through */ case DNS323_REV_B1: i2c_register_board_info(0, dns323ab_i2c_devices,
arch/arm/mach-pxa/cm-x270.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-pxa/cm-x270.c 2010-12-31 15:18:30.000000000 +0100 +1 -2
@@ -208,10 +208,9 @@ static int cmx270_marathon_probe(struct int gpio, err; for (gpio = 58; gpio <= 77; gpio++) { - err = gpio_request(gpio, "LCD"); + err = gpio_request_one(gpio, GPIOF_IN, "LCD"); if (err) return err; - gpio_direction_input(gpio); } pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_marathon_on));
arch/arm/mach-pxa/cm-x300.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-pxa/cm-x300.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -484,14 +484,14 @@ static int cm_x300_ulpi_phy_reset(void) int err; /* reset the PHY */ - err = gpio_request(GPIO_ULPI_PHY_RST, "ulpi reset"); + err = gpio_request_one(GPIO_ULPI_PHY_RST, GPIOF_OUT_INIT_LOW, + "ulpi reset"); if (err) { pr_err("%s: failed to request ULPI reset GPIO: %d\n", __func__, err); return err; } - gpio_direction_output(GPIO_ULPI_PHY_RST, 0); msleep(10); gpio_set_value(GPIO_ULPI_PHY_RST, 1); msleep(10);
arch/arm/mach-pxa/colibri-pxa3xx.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-pxa/colibri-pxa3xx.c 2010-12-28 18:26:02.000000000 +0100 +1 -2
@@ -103,8 +103,7 @@ static struct pxafb_mach_info sharp_lq43 void __init colibri_pxa3xx_init_lcd(int bl_pin) { lcd_bl_pin = bl_pin; - gpio_request(bl_pin, "lcd backlight"); - gpio_direction_output(bl_pin, 0); + gpio_request_one(bl_pin, GPIOF_OUT_INIT_LOW, "lcd backlight"); set_pxa_fb_info(&sharp_lq43_info); } #endif
arch/arm/mach-pxa/em-x270.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-pxa/em-x270.c 2011-03-14 17:19:13.000000000 +0100 +9 -17
@@ -379,23 +379,19 @@ static void __init em_x270_init_nand(voi { int err; - err = gpio_request(GPIO11_NAND_CS, "NAND CS"); + err = gpio_request_one(GPIO11_NAND_CS, GPIOF_OUT_INIT_HIGH, "NAND CS"); if (err) { pr_warning("EM-X270: failed to request NAND CS gpio\n"); return; } - gpio_direction_output(GPIO11_NAND_CS, 1); - - err = gpio_request(nand_rb, "NAND R/B"); + err = gpio_request_one(nand_rb, GPIOF_IN, "NAND R/B"); if (err) { pr_warning("EM-X270: failed to request NAND R/B gpio\n"); gpio_free(GPIO11_NAND_CS); return; } - gpio_direction_input(nand_rb); - platform_device_register(&em_x270_nand); } #else
@@ -473,12 +469,11 @@ static int em_x270_usb_hub_init(void) if (err) goto err_free_usb_ldo; - err = gpio_request(usb_hub_reset, "hub rst"); + err = gpio_request_one(usb_hub_reset, GPIOF_OUT_INIT_HIGH, "hub rst"); if (err) goto err_free_vbus_gpio; /* USB Hub power-on and reset */ - gpio_direction_output(usb_hub_reset, 1); gpio_direction_output(GPIO9_USB_VBUS_EN, 0); regulator_enable(em_x270_usb_ldo); gpio_set_value(usb_hub_reset, 0);
@@ -568,21 +563,20 @@ static int em_x270_mci_init(struct devic } if (machine_is_em_x270()) { - err = gpio_request(GPIO95_MMC_WP, "MMC WP"); + err = gpio_request_one(GPIO95_MMC_WP, GPIOF_IN, "MMC WP"); if (err) { dev_err(dev, "can't request MMC write protect: %d\n", err); goto err_gpio_wp; } - gpio_direction_input(GPIO95_MMC_WP); } else { - err = gpio_request(GPIO38_SD_PWEN, "sdio power"); + err = gpio_request_one(GPIO38_SD_PWEN, GPIOF_OUT_INIT_HIGH, + "sdio power"); if (err) { dev_err(dev, "can't request MMC power control : %d\n", err); goto err_gpio_wp; } - gpio_direction_output(GPIO38_SD_PWEN, 1); } return 0;
@@ -741,11 +735,11 @@ static int em_x270_libertas_setup(struct goto err_free_pwen; if (machine_is_exeda()) { - err = gpio_request(GPIO37_WLAN_RST, "WLAN RST"); + err = gpio_request_one(GPIO37_WLAN_RST, GPIOF_OUT_INIT_HIGH, + "WLAN RST"); if (err) goto err_free_strap; - gpio_direction_output(GPIO37_WLAN_RST, 1); msleep(100); }
@@ -951,12 +945,10 @@ static int em_x270_sensor_init(void) { int ret; - ret = gpio_request(cam_reset, "camera reset"); + ret = gpio_request_one(cam_reset, GPIOF_OUT_INIT_LOW, "camera reset"); if (ret) return ret; - gpio_direction_output(cam_reset, 0); - em_x270_camera_ldo = regulator_get(NULL, "vcc cam"); if (em_x270_camera_ldo == NULL) { gpio_free(cam_reset);
arch/arm/mach-pxa/magician.c 2011-03-21 08:55:23.000000000 +0100 renamed from arch/arm/mach-pxa/magician.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -748,8 +748,8 @@ static void __init magician_init(void) lcd_select = board_id & 0x8; pr_info("LCD type: %s\n", lcd_select ? "Samsung" : "Toppoly"); if (lcd_select && (system_rev < 3)) { - gpio_request(GPIO75_MAGICIAN_SAMSUNG_POWER, "SAMSUNG_POWER"); - gpio_direction_output(GPIO75_MAGICIAN_SAMSUNG_POWER, 0); + gpio_request_one(GPIO75_MAGICIAN_SAMSUNG_POWER, + GPIOF_OUT_INIT_LOW, "SAMSUNG_POWER"); } gpio_request(GPIO104_MAGICIAN_LCD_POWER_1, "LCD_POWER_1"); gpio_request(GPIO105_MAGICIAN_LCD_POWER_2, "LCD_POWER_2");
arch/arm/mach-pxa/saar.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-pxa/saar.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -413,13 +413,13 @@ static void ltm022a97a_lcd_power(int on, int err; if (!pin_requested) { - err = gpio_request(GPIO_LCD_RESET, "lcd reset"); + err = gpio_request_one(GPIO_LCD_RESET, GPIOF_OUT_INIT_LOW, + "lcd reset"); if (err) { pr_err("failed to request gpio for LCD reset\n"); return; } - gpio_direction_output(GPIO_LCD_RESET, 0); pin_requested = 1; }
arch/arm/mach-pxa/sharpsl_pm.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-pxa/sharpsl_pm.c 2010-12-28 18:26:03.000000000 +0100 +7 -6
@@ -899,12 +899,13 @@ static int __devinit sharpsl_pm_probe(st sharpsl_pm.machinfo->init(); - gpio_request(sharpsl_pm.machinfo->gpio_acin, "AC IN"); - gpio_direction_input(sharpsl_pm.machinfo->gpio_acin); - gpio_request(sharpsl_pm.machinfo->gpio_batfull, "Battery Full"); - gpio_direction_input(sharpsl_pm.machinfo->gpio_batfull); - gpio_request(sharpsl_pm.machinfo->gpio_batlock, "Battery Lock"); - gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock); + gpio_request_one(sharpsl_pm.machinfo->gpio_acin, GPIOF_IN, "AC IN"); + + gpio_request_one(sharpsl_pm.machinfo->gpio_batfull, GPIOF_IN, + "Battery Full"); + + gpio_request_one(sharpsl_pm.machinfo->gpio_batlock, GPIOF_IN, + "Battery Lock"); /* Register interrupt handlers */ if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) {
arch/arm/mach-pxa/stargate2.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-pxa/stargate2.c 2011-03-14 17:19:13.000000000 +0100 +5 -6
@@ -693,19 +693,18 @@ static int stargate2_mci_init(struct dev { int err; - err = gpio_request(SG2_SD_POWER_ENABLE, "SG2_sd_power_enable"); + err = gpio_request_one(SG2_SD_POWER_ENABLE, GPIOF_OUT_INIT_LOW, + "SG2_sd_power_enable"); if (err) { printk(KERN_ERR "Can't get the gpio for SD power control"); goto return_err; } - gpio_direction_output(SG2_SD_POWER_ENABLE, 0); - err = gpio_request(SG2_GPIO_nSD_DETECT, "SG2_sd_detect"); + err = gpio_request_one(SG2_GPIO_nSD_DETECT, GPIOF_IN, "SG2_sd_detect"); if (err) { printk(KERN_ERR "Can't get the sd detect gpio"); goto free_power_en; } - gpio_direction_input(SG2_GPIO_nSD_DETECT); err = request_irq(IRQ_GPIO(SG2_GPIO_nSD_DETECT), stargate2_detect_int,
@@ -799,12 +798,12 @@ static struct at24_platform_data pca9500 static int stargate2_reset_bluetooth(void) { int err; - err = gpio_request(SG2_BT_RESET, "SG2_BT_RESET"); + err = gpio_request_one(SG2_BT_RESET, GPIOF_OUT_INIT_HIGH, + "SG2_BT_RESET"); if (err) { printk(KERN_ERR "Could not get gpio for bluetooth reset\n"); return err; } - gpio_direction_output(SG2_BT_RESET, 1); mdelay(5); /* now reset it - 5 msec minimum */ gpio_set_value(SG2_BT_RESET, 0);
arch/arm/mach-pxa/zylonite_pxa300.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-pxa/zylonite_pxa300.c 2011-03-14 17:19:13.000000000 +0100 +1 -2
@@ -197,8 +197,7 @@ static void __init zylonite_detect_lcd_p for (i = 0; i < NUM_LCD_DETECT_PINS; i++) { id = id << 1; gpio = mfp_to_gpio(lcd_detect_pins[i]); - gpio_request(gpio, "LCD_ID_PINS"); - gpio_direction_input(gpio); + gpio_request_one(gpio, GPIOF_IN, "LCD_ID_PINS"); if (gpio_get_value(gpio)) id = id | 0x1;
arch/arm/mach-pxa/zylonite_pxa320.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-pxa/zylonite_pxa320.c 2010-01-12 18:05:01.000000000 +0100 +1 -2
@@ -176,8 +176,7 @@ static void __init zylonite_detect_lcd_p for (i = 0; i < NUM_LCD_DETECT_PINS; i++) { id = id << 1; gpio = mfp_to_gpio(lcd_detect_pins[i]); - gpio_request(gpio, "LCD_ID_PINS"); - gpio_direction_input(gpio); + gpio_request_one(gpio, GPIOF_IN, "LCD_ID_PINS"); if (gpio_get_value(gpio)) id = id | 0x1;
arch/arm/mach-s3c2410/mach-h1940.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-s3c2410/mach-h1940.c 2011-03-14 17:19:13.000000000 +0100 +4 -6
@@ -305,10 +305,10 @@ int h1940_bat_init(void) { int ret; - ret = gpio_request(H1940_LATCH_SM803_ENABLE, "h1940-charger-enable"); + ret = gpio_request_one(H1940_LATCH_SM803_ENABLE, GPIOF_OUT_INIT_LOW, + "h1940-charger-enable"); if (ret) return ret; - gpio_direction_output(H1940_LATCH_SM803_ENABLE, 0); return 0;
@@ -473,9 +473,8 @@ static struct s3c24xx_mci_pdata h1940_mm static int h1940_backlight_init(struct device *dev) { - gpio_request(S3C2410_GPB(0), "Backlight"); + gpio_request_one(S3C2410_GPB(0), GPIOF_OUT_INIT_LOW, "Backlight"); - gpio_direction_output(S3C2410_GPB(0), 0); s3c_gpio_setpull(S3C2410_GPB(0), S3C_GPIO_PULL_NONE); s3c_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPB0_TOUT0); gpio_set_value(H1940_LATCH_MAX1698_nSHUTDOWN, 1);
@@ -723,8 +722,7 @@ static void __init h1940_init(void) gpio_direction_output(H1940_LATCH_LCD_P4, 0); gpio_direction_output(H1940_LATCH_MAX1698_nSHUTDOWN, 0); - gpio_request(H1940_LATCH_SD_POWER, "SD power"); - gpio_direction_output(H1940_LATCH_SD_POWER, 0); + gpio_request_one(H1940_LATCH_SD_POWER, GPIOF_OUT_INIT_LOW, "SD power"); platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices));
arch/arm/mach-s3c2410/mach-qt2410.c 2011-03-21 08:55:23.000000000 +0100 renamed from arch/arm/mach-s3c2410/mach-qt2410.c 2010-10-23 19:40:31.000000000 +0200 +2 -2
@@ -354,8 +354,8 @@ static void __init qt2410_machine_init(v s3c24xx_udc_set_platdata(&qt2410_udc_cfg); s3c_i2c0_set_platdata(NULL); - WARN_ON(gpio_request(S3C2410_GPB(5), "spi cs")); - gpio_direction_output(S3C2410_GPB(5), 1); + WARN_ON(gpio_request_one(S3C2410_GPB(5), GPIOF_OUT_INIT_HIGH, + "spi cs")); platform_add_devices(qt2410_devices, ARRAY_SIZE(qt2410_devices)); s3c_pm_init();
arch/arm/mach-s3c2412/mach-jive.c 2011-03-21 08:55:23.000000000 +0100 renamed from arch/arm/mach-s3c2412/mach-jive.c 2010-10-23 19:40:31.000000000 +0200 +4 -6
@@ -636,11 +636,9 @@ static void __init jive_machine_init(voi /* initialise the spi */ - gpio_request(S3C2410_GPG(13), "lcm reset"); - gpio_direction_output(S3C2410_GPG(13), 0); + gpio_request_one(S3C2410_GPG(13), GPIOF_OUT_INIT_LOW, "lcm reset"); - gpio_request(S3C2410_GPB(7), "jive spi"); - gpio_direction_output(S3C2410_GPB(7), 1); + gpio_request_one(S3C2410_GPB(7), GPIOF_OUT_INIT_HIGH, "jive spi"); s3c2410_gpio_setpin(S3C2410_GPB(6), 0); s3c_gpio_cfgpin(S3C2410_GPB(6), S3C2410_GPIO_OUTPUT);
@@ -650,8 +648,8 @@ static void __init jive_machine_init(voi /* initialise the WM8750 spi */ - gpio_request(S3C2410_GPH(10), "jive wm8750 spi"); - gpio_direction_output(S3C2410_GPH(10), 1); + gpio_request_one(S3C2410_GPH(10), GPIOF_OUT_INIT_HIGH, + "jive wm8750 spi"); /* Turn off suspend on both USB ports, and switch the * selectable USB port to USB device mode. */
arch/arm/mach-s3c2416/mach-smdk2416.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-s3c2416/mach-smdk2416.c 2011-01-09 09:32:57.000000000 +0100 +3 -6
@@ -203,14 +203,11 @@ static void __init smdk2416_machine_init s3c_sdhci0_set_platdata(&smdk2416_hsmmc0_pdata); s3c_sdhci1_set_platdata(&smdk2416_hsmmc1_pdata); - gpio_request(S3C2410_GPB(4), "USBHost Power"); - gpio_direction_output(S3C2410_GPB(4), 1); + gpio_request_one(S3C2410_GPB(4), GPIOF_OUT_INIT_HIGH, "USBHost Power"); - gpio_request(S3C2410_GPB(3), "Display Power"); - gpio_direction_output(S3C2410_GPB(3), 1); + gpio_request_one(S3C2410_GPB(3), GPIOF_OUT_INIT_HIGH, "Display Power"); - gpio_request(S3C2410_GPB(1), "Display Reset"); - gpio_direction_output(S3C2410_GPB(1), 1); + gpio_request_one(S3C2410_GPB(1), GPIOF_OUT_INIT_HIGH, "Display Reset"); platform_add_devices(smdk2416_devices, ARRAY_SIZE(smdk2416_devices)); smdk_machine_init();
arch/arm/mach-s3c2440/mach-mini2440.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-s3c2440/mach-mini2440.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -618,8 +618,8 @@ static void __init mini2440_init(void) s3c_gpio_cfgpin(S3C2410_GPC(0), S3C2410_GPC0_LEND); /* Turn the backlight early on */ - WARN_ON(gpio_request(S3C2410_GPG(4), "backlight")); - gpio_direction_output(S3C2410_GPG(4), 1); + WARN_ON(gpio_request_one(S3C2410_GPG(4), GPIOF_OUT_INIT_HIGH, + "backlight")); /* remove pullup on optional PWM backlight -- unused on 3.5 and 7"s */ s3c_gpio_setpull(S3C2410_GPB(1), S3C_GPIO_PULL_UP);
arch/arm/mach-s3c2440/mach-osiris-dvs.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-s3c2440/mach-osiris-dvs.c 2009-12-08 20:58:27.000000000 +0100 +2 -4
@@ -99,15 +99,13 @@ static int __devinit osiris_dvs_probe(st dev_info(&pdev->dev, "initialising\n"); - ret = gpio_request(OSIRIS_GPIO_DVS, "osiris-dvs"); + ret = gpio_request_one(OSIRIS_GPIO_DVS, GPIOF_OUT_INIT_HIGH, + "osiris-dvs"); if (ret) { dev_err(&pdev->dev, "cannot claim gpio\n"); goto err_nogpio; } - /* start with dvs disabled */ - gpio_direction_output(OSIRIS_GPIO_DVS, 1); - ret = cpufreq_register_notifier(&osiris_dvs_nb, CPUFREQ_TRANSITION_NOTIFIER); if (ret) {
arch/arm/mach-s3c2440/mach-rx1950.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/mach-s3c2440/mach-rx1950.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -785,8 +785,8 @@ static void __init rx1950_init_machine(v S3C2410_MISCCR_USBSUSPND1, 0x0); /* mmc power is disabled by default */ - WARN_ON(gpio_request(S3C2410_GPJ(1), "MMC power")); - gpio_direction_output(S3C2410_GPJ(1), 0); + WARN_ON(gpio_request_one(S3C2410_GPJ(1), GPIOF_OUT_INIT_LOW, + "MMC power")); for (i = 0; i < 8; i++) WARN_ON(gpio_request(S3C2410_GPC(i), "LCD power"));
arch/arm/mach-s3c64xx/mach-hmt.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-s3c64xx/mach-hmt.c 2010-10-23 19:40:31.000000000 +0200 +6 -8
@@ -251,14 +251,12 @@ static void __init hmt_machine_init(void s3c_fb_set_platdata(&hmt_lcd_pdata); s3c_nand_set_platdata(&hmt_nand_info); - gpio_request(S3C64XX_GPC(7), "usb power"); - gpio_direction_output(S3C64XX_GPC(7), 0); - gpio_request(S3C64XX_GPM(0), "usb power"); - gpio_direction_output(S3C64XX_GPM(0), 1); - gpio_request(S3C64XX_GPK(7), "usb power"); - gpio_direction_output(S3C64XX_GPK(7), 1); - gpio_request(S3C64XX_GPF(13), "usb power"); - gpio_direction_output(S3C64XX_GPF(13), 1); + gpio_request_one(S3C64XX_GPC(7), GPIOF_OUT_INIT_LOW, "usb power"); + gpio_request_one(S3C64XX_GPM(0), GPIOF_OUT_INIT_HIGH, "usb power"); + + gpio_request_one(S3C64XX_GPK(7), GPIOF_OUT_INIT_HIGH, "usb power"); + + gpio_request_one(S3C64XX_GPF(13), GPIOF_OUT_INIT_HIGH, "usb power"); platform_add_devices(hmt_devices, ARRAY_SIZE(hmt_devices)); }
arch/arm/mach-s3c64xx/mach-smartq.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/arm/mach-s3c64xx/mach-smartq.c 2010-09-04 09:22:04.000000000 +0200 +4 -8
@@ -189,13 +189,11 @@ static int __init smartq_lcd_setup_gpio( { int ret; - ret = gpio_request(S3C64XX_GPM(3), "LCD power"); + ret = gpio_request_one(S3C64XX_GPM(3), GPIOF_OUT_INIT_LOW, + "LCD power"); if (ret < 0) return ret; - /* turn power off */ - gpio_direction_output(S3C64XX_GPM(3), 0); - return 0; }
@@ -276,15 +274,13 @@ static int __init smartq_power_off_init( { int ret; - ret = gpio_request(S3C64XX_GPK(15), "Power control"); + ret = gpio_request_one(S3C64XX_GPK(15), GPIOF_OUT_INIT_LOW, + "Power control"); if (ret < 0) { pr_err("%s: failed to get GPK15\n", __func__); return ret; } - /* leave power on */ - gpio_direction_output(S3C64XX_GPK(15), 0); - pm_power_off = smartq_power_off; return ret;
arch/arm/mach-s5pv210/mach-aquila.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-s5pv210/mach-aquila.c 2011-03-14 17:19:13.000000000 +0100 +1 -2
@@ -595,8 +595,7 @@ static struct s3c_sdhci_platdata aquila_ static void aquila_setup_sdhci(void) { - gpio_request(AQUILA_EXT_FLASH_EN, "FLASH_EN"); - gpio_direction_output(AQUILA_EXT_FLASH_EN, 1); + gpio_request_one(AQUILA_EXT_FLASH_EN, GPIOF_OUT_INIT_HIGH, "FLASH_EN"); s3c_sdhci0_set_platdata(&aquila_hsmmc0_data); s3c_sdhci1_set_platdata(&aquila_hsmmc1_data);
arch/arm/mach-s5pv210/mach-smdkv210.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-s5pv210/mach-smdkv210.c 2011-03-14 17:19:13.000000000 +0100 +3 -7
@@ -153,15 +153,12 @@ static void smdkv210_lte480wv_set_power( { if (power) { #if !defined(CONFIG_BACKLIGHT_PWM) - gpio_request(S5PV210_GPD0(3), "GPD0"); - gpio_direction_output(S5PV210_GPD0(3), 1); + gpio_request_one(S5PV210_GPD0(3), GPIOF_OUT_INIT_HIGH, "GPD0"); gpio_free(S5PV210_GPD0(3)); #endif /* fire nRESET on power up */ - gpio_request(S5PV210_GPH0(6), "GPH0"); - - gpio_direction_output(S5PV210_GPH0(6), 1); + gpio_request_one(S5PV210_GPH0(6), GPIOF_OUT_INIT_HIGH, "GPH0"); gpio_set_value(S5PV210_GPH0(6), 0); mdelay(10);
@@ -172,8 +169,7 @@ static void smdkv210_lte480wv_set_power( gpio_free(S5PV210_GPH0(6)); } else { #if !defined(CONFIG_BACKLIGHT_PWM) - gpio_request(S5PV210_GPD0(3), "GPD0"); - gpio_direction_output(S5PV210_GPD0(3), 0); + gpio_request_one(S5PV210_GPD0(3), GPIOF_OUT_INIT_LOW, "GPD0"); gpio_free(S5PV210_GPD0(3)); #endif }
arch/arm/mach-shmobile/board-ag5evm.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-shmobile/board-ag5evm.c 2011-02-02 17:27:36.000000000 +0100 +5 -10
@@ -418,14 +418,11 @@ static void __init ag5evm_init(void) gpio_request(GPIO_FN_MMCD0_5, NULL); gpio_request(GPIO_FN_MMCD0_6, NULL); gpio_request(GPIO_FN_MMCD0_7, NULL); - gpio_request(GPIO_PORT208, NULL); /* Reset */ - gpio_direction_output(GPIO_PORT208, 1); + gpio_request_one(GPIO_PORT208, GPIOF_OUT_INIT_HIGH, NULL); /* enable SMSC911X */ - gpio_request(GPIO_PORT144, NULL); /* PINTA2 */ - gpio_direction_input(GPIO_PORT144); - gpio_request(GPIO_PORT145, NULL); /* RESET */ - gpio_direction_output(GPIO_PORT145, 1); + gpio_request_one(GPIO_PORT144, GPIOF_IN, NULL); /* PINTA2 */ + gpio_request_one(GPIO_PORT145, GPIOF_OUT_INIT_HIGH, NULL); /* FSI A */ gpio_request(GPIO_FN_FSIACK, NULL);
@@ -440,15 +437,13 @@ static void __init ag5evm_init(void) gpio_request(GPIO_FN_PORT243_IRDA_FIRSEL, NULL); /* LCD panel */ - gpio_request(GPIO_PORT217, NULL); /* RESET */ - gpio_direction_output(GPIO_PORT217, 0); + gpio_request_one(GPIO_PORT217, GPIOF_OUT_INIT_LOW, NULL); /* RESET */ mdelay(1); gpio_set_value(GPIO_PORT217, 1); mdelay(100); /* LCD backlight controller */ - gpio_request(GPIO_PORT235, NULL); /* RESET */ - gpio_direction_output(GPIO_PORT235, 0); + gpio_request_one(GPIO_PORT235, GPIOF_OUT_INIT_LOW, NULL); /* RESET */ lcd_backlight_reset(); /* MIPI-DSI clock setup */
arch/arm/mach-shmobile/board-ap4evb.c 2011-03-21 08:55:26.000000000 +0100 renamed from arch/arm/mach-shmobile/board-ap4evb.c 2011-03-14 17:19:13.000000000 +0100 +5 -11
@@ -1054,9 +1054,7 @@ static int ts_get_pendown_state(void) gpio_free(GPIO_TSC_IRQ); - gpio_request(GPIO_TSC_PORT, NULL); - - gpio_direction_input(GPIO_TSC_PORT); + gpio_request_one(GPIO_TSC_PORT, GPIOF_IN, NULL); val = gpio_get_value(GPIO_TSC_PORT);
@@ -1198,8 +1196,7 @@ static void __init ap4evb_init(void) gpio_request(GPIO_FN_FSIAILR, NULL); gpio_request(GPIO_FN_FSIAISLD, NULL); gpio_request(GPIO_FN_FSIAOSLD, NULL); - gpio_request(GPIO_PORT161, NULL); - gpio_direction_output(GPIO_PORT161, 0); /* slave */ + gpio_request_one(GPIO_PORT161, GPIOF_OUT_INIT_LOW, NULL);/* slave */ gpio_request(GPIO_PORT9, NULL); gpio_request(GPIO_PORT10, NULL);
@@ -1207,8 +1204,7 @@ static void __init ap4evb_init(void) gpio_no_direction(GPIO_PORT10CR); /* FSIAOLR needs no direction */ /* card detect pin for MMC slot (CN7) */ - gpio_request(GPIO_PORT41, NULL); - gpio_direction_input(GPIO_PORT41); + gpio_request_one(GPIO_PORT41, GPIOF_IN, NULL); /* setup FSI2 port B (HDMI) */ gpio_request(GPIO_FN_FSIBCK, NULL);
@@ -1296,11 +1292,9 @@ static void __init ap4evb_init(void) gpio_request(GPIO_FN_LCDDISP, NULL); gpio_request(GPIO_FN_LCDDCK, NULL); - gpio_request(GPIO_PORT189, NULL); /* backlight */ - gpio_direction_output(GPIO_PORT189, 1); + gpio_request_one(GPIO_PORT189, GPIOF_OUT_INIT_HIGH, NULL); - gpio_request(GPIO_PORT151, NULL); /* LCDDON */ - gpio_direction_output(GPIO_PORT151, 1); + gpio_request_one(GPIO_PORT151, GPIOF_OUT_INIT_HIGH, NULL); lcdc_info.clock_source = LCDC_CLK_BUS; lcdc_info.ch[0].interface_type = RGB18;
arch/arm/mach-shmobile/board-g3evm.c 2011-03-21 08:55:26.000000000 +0100 renamed from arch/arm/mach-shmobile/board-g3evm.c 2011-01-19 18:51:18.000000000 +0100 +3 -6
@@ -271,18 +271,15 @@ static void __init g3evm_init(void) sh7367_pinmux_init(); /* Lit DS4 LED */ - gpio_request(GPIO_PORT22, NULL); - gpio_direction_output(GPIO_PORT22, 1); + gpio_request_one(GPIO_PORT22, GPIOF_OUT_INIT_HIGH, NULL); gpio_export(GPIO_PORT22, 0); /* Lit DS8 LED */ - gpio_request(GPIO_PORT23, NULL); - gpio_direction_output(GPIO_PORT23, 1); + gpio_request_one(GPIO_PORT23, GPIOF_OUT_INIT_HIGH, NULL); gpio_export(GPIO_PORT23, 0); /* Lit DS3 LED */ - gpio_request(GPIO_PORT24, NULL); - gpio_direction_output(GPIO_PORT24, 1); + gpio_request_one(GPIO_PORT24, GPIOF_OUT_INIT_HIGH, NULL); gpio_export(GPIO_PORT24, 0); /* SCIFA1 */
arch/arm/mach-shmobile/board-g4evm.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/mach-shmobile/board-g4evm.c 2011-01-19 18:51:18.000000000 +0100 +4 -8
@@ -315,23 +315,19 @@ static void __init g4evm_init(void) sh7377_pinmux_init(); /* Lit DS14 LED */ - gpio_request(GPIO_PORT109, NULL); - gpio_direction_output(GPIO_PORT109, 1); + gpio_request_one(GPIO_PORT109, GPIOF_OUT_INIT_HIGH, NULL); gpio_export(GPIO_PORT109, 1); /* Lit DS15 LED */ - gpio_request(GPIO_PORT110, NULL); - gpio_direction_output(GPIO_PORT110, 1); + gpio_request_one(GPIO_PORT110, GPIOF_OUT_INIT_HIGH, NULL); gpio_export(GPIO_PORT110, 1); /* Lit DS16 LED */ - gpio_request(GPIO_PORT112, NULL); - gpio_direction_output(GPIO_PORT112, 1); + gpio_request_one(GPIO_PORT112, GPIOF_OUT_INIT_HIGH, NULL); gpio_export(GPIO_PORT112, 1); /* Lit DS17 LED */ - gpio_request(GPIO_PORT113, NULL); - gpio_direction_output(GPIO_PORT113, 1); + gpio_request_one(GPIO_PORT113, GPIOF_OUT_INIT_HIGH, NULL); gpio_export(GPIO_PORT113, 1); /* USBHS */
arch/arm/mach-shmobile/board-mackerel.c 2011-03-21 08:55:27.000000000 +0100 renamed from arch/arm/mach-shmobile/board-mackerel.c 2011-03-14 17:19:13.000000000 +0100 +5 -10
@@ -1058,11 +1058,9 @@ static void __init mackerel_init(void) gpio_request(GPIO_FN_LCDDISP, NULL); gpio_request(GPIO_FN_LCDDCK, NULL); - gpio_request(GPIO_PORT31, NULL); /* backlight */ - gpio_direction_output(GPIO_PORT31, 1); + gpio_request_one(GPIO_PORT31, GPIOF_OUT_INIT_HIGH, NULL); - gpio_request(GPIO_PORT151, NULL); /* LCDDON */ - gpio_direction_output(GPIO_PORT151, 1); + gpio_request_one(GPIO_PORT151, GPIOF_OUT_INIT_HIGH, NULL); /* USB enable */ gpio_request(GPIO_FN_VBUS0_1, NULL);
@@ -1080,8 +1078,7 @@ static void __init mackerel_init(void) gpio_request(GPIO_FN_FSIAILR, NULL); gpio_request(GPIO_FN_FSIAISLD, NULL); gpio_request(GPIO_FN_FSIAOSLD, NULL); - gpio_request(GPIO_PORT161, NULL); - gpio_direction_output(GPIO_PORT161, 0); /* slave */ + gpio_request_one(GPIO_PORT161, GPIOF_OUT_INIT_LOW, NULL);/* slave */ gpio_request(GPIO_PORT9, NULL); gpio_request(GPIO_PORT10, NULL);
@@ -1133,8 +1130,7 @@ static void __init mackerel_init(void) gpio_request(GPIO_FN_SDHID1_0, NULL); #endif /* card detect pin for MMC slot (CN7) */ - gpio_request(GPIO_PORT41, NULL); - gpio_direction_input(GPIO_PORT41); + gpio_request_one(GPIO_PORT41, GPIOF_IN, NULL); /* enable SDHI2 */ gpio_request(GPIO_FN_SDHICMD2, NULL);
@@ -1145,8 +1141,7 @@ static void __init mackerel_init(void) gpio_request(GPIO_FN_SDHID2_0, NULL); /* card detect pin for microSD slot (CN23) */ - gpio_request(GPIO_PORT162, NULL); - gpio_direction_input(GPIO_PORT162); + gpio_request_one(GPIO_PORT162, GPIOF_IN, NULL); /* MMCIF */ gpio_request(GPIO_FN_MMCD0_0, NULL);
arch/arm/mach-stmp378x/stmp378x_devb.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-stmp378x/stmp378x_devb.c 2010-10-23 19:40:31.000000000 +0200 +2 -5
@@ -133,18 +133,15 @@ static int stmp3xxxmmc_hw_init_ssp1(void goto out; /* Configure write protect GPIO pin */ - ret = gpio_request(PINID_PWM4, "mmc wp"); + ret = gpio_request_one(PINID_PWM4, GPIOF_IN, "mmc wp"); if (ret) goto out_wp; - gpio_direction_input(PINID_PWM4); - /* Configure POWER pin as gpio to drive power to MMC slot */ - ret = gpio_request(PINID_PWM3, "mmc power"); + ret = gpio_request_one(PINID_PWM3, GPIOF_OUT_INIT_LOW, "mmc power"); if (ret) goto out_power; - gpio_direction_output(PINID_PWM3, 0); mdelay(100); return 0;
arch/arm/mach-tegra/board-harmony-pcie.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-tegra/board-harmony-pcie.c 2011-03-20 18:17:23.000000000 +0100 +2 -3
@@ -38,12 +38,11 @@ static int __init harmony_pcie_init(void if (!machine_is_harmony()) return 0; - err = gpio_request(EN_VDD_1V05_GPIO, "EN_VDD_1V05"); + err = gpio_request_one(EN_VDD_1V05_GPIO, GPIOF_OUT_INIT_HIGH, + "EN_VDD_1V05"); if (err) return err; - gpio_direction_output(EN_VDD_1V05_GPIO, 1); - regulator = regulator_get(NULL, "pex_clk"); if (IS_ERR_OR_NULL(regulator)) goto err_reg;
arch/arm/mach-tegra/board-seaboard.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-tegra/board-seaboard.c 2011-03-20 18:17:23.000000000 +0100 +1 -2
@@ -154,8 +154,7 @@ static struct i2c_board_info __initdata static void __init seaboard_i2c_init(void) { - gpio_request(TEGRA_GPIO_ISL29018_IRQ, "isl29018"); - gpio_direction_input(TEGRA_GPIO_ISL29018_IRQ); + gpio_request_one(TEGRA_GPIO_ISL29018_IRQ, GPIOF_IN, "isl29018"); i2c_register_board_info(0, &isl29018_device, 1);
arch/arm/mach-tegra/usb_phy.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/arm/mach-tegra/usb_phy.c 2011-03-14 17:19:13.000000000 +0100 +2 -2
@@ -710,8 +710,8 @@ struct tegra_usb_phy *tegra_usb_phy_open goto err1; } tegra_gpio_enable(ulpi_config->reset_gpio); - gpio_request(ulpi_config->reset_gpio, "ulpi_phy_reset_b"); - gpio_direction_output(ulpi_config->reset_gpio, 0); + gpio_request_one(ulpi_config->reset_gpio, GPIOF_OUT_INIT_LOW, + "ulpi_phy_reset_b"); phy->ulpi = otg_ulpi_create(&ulpi_viewport_access_ops, 0); phy->ulpi->io_priv = regs + ULPI_VIEWPORT; } else {
arch/arm/plat-mxc/3ds_debugboard.c 2011-03-21 08:55:25.000000000 +0100 renamed from arch/arm/plat-mxc/3ds_debugboard.c 2011-01-19 18:51:18.000000000 +0100 +1 -2
@@ -176,8 +176,7 @@ int __init mxc_expio_init(u32 base, u32 /* * Configure INT line as GPIO input */ - gpio_request(MXC_IRQ_TO_GPIO(p_irq), "expio_pirq"); - gpio_direction_input(MXC_IRQ_TO_GPIO(p_irq)); + gpio_request_one(MXC_IRQ_TO_GPIO(p_irq), GPIOF_IN, "expio_pirq"); /* disable the interrupt and clear the status */ __raw_writew(0, brd_io + INTR_MASK_REG);
arch/arm/plat-omap/debug-devices.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/arm/plat-omap/debug-devices.c 2009-12-12 00:23:19.000000000 +0100 +1 -2
@@ -82,12 +82,11 @@ int __init debug_card_init(u32 addr, uns smc91x_resources[1].start = gpio_to_irq(gpio); smc91x_resources[1].end = gpio_to_irq(gpio); - status = gpio_request(gpio, "SMC91x irq"); + status = gpio_request_one(gpio, GPIOF_IN, "SMC91x irq"); if (status < 0) { printk(KERN_ERR "GPIO%d unavailable for smc91x IRQ\n", gpio); return status; } - gpio_direction_input(gpio); led_resources[0].start = addr; led_resources[0].end = addr + SZ_4K - 1;
arch/avr32/boards/atngw100/mrmt.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/avr32/boards/atngw100/mrmt.c 2009-09-21 18:11:44.000000000 +0200 +6 -12
@@ -314,13 +314,11 @@ static int __init mrmt1_init(void) #endif at32_select_gpio( PIN_LCD_DISP, AT32_GPIOF_OUTPUT ); - gpio_request( PIN_LCD_DISP, "LCD_DISP" ); - gpio_direction_output( PIN_LCD_DISP, 0 ); /* LCD DISP */ + gpio_request_one(PIN_LCD_DISP, GPIOF_OUT_INIT_LOW, "LCD_DISP");/* LCD DISP */ #ifdef CONFIG_BOARD_MRMT_LCD_DISABLE /* Keep Backlight and DISP off */ at32_select_gpio( PIN_LCD_BL, AT32_GPIOF_OUTPUT ); - gpio_request( PIN_LCD_BL, "LCD_BL" ); - gpio_direction_output( PIN_LCD_BL, 0 ); /* Backlight */ + gpio_request_one(PIN_LCD_BL, GPIOF_OUT_INIT_LOW, "LCD_BL");/* Backlight */ #else gpio_set_value( PIN_LCD_DISP, 1 ); /* DISP asserted first */ #ifdef CONFIG_BOARD_MRMT_BL_PWM
@@ -331,20 +329,17 @@ static int __init mrmt1_init(void) /* Backlight always on */ udelay( 1 ); at32_select_gpio( PIN_LCD_BL, AT32_GPIOF_OUTPUT ); - gpio_request( PIN_LCD_BL, "LCD_BL" ); - gpio_direction_output( PIN_LCD_BL, 1 ); + gpio_request_one(PIN_LCD_BL, GPIOF_OUT_INIT_HIGH, "LCD_BL"); #endif #endif /* Make sure BT and Zigbee modules in reset */ at32_select_gpio( PIN_BT_RST, AT32_GPIOF_OUTPUT ); - gpio_request( PIN_BT_RST, "BT_RST" ); - gpio_direction_output( PIN_BT_RST, 1 ); + gpio_request_one(PIN_BT_RST, GPIOF_OUT_INIT_HIGH, "BT_RST"); /* BT Module in Reset */ at32_select_gpio( PIN_ZB_RST_N, AT32_GPIOF_OUTPUT ); - gpio_request( PIN_ZB_RST_N, "ZB_RST_N" ); - gpio_direction_output( PIN_ZB_RST_N, 0 ); + gpio_request_one(PIN_ZB_RST_N, GPIOF_OUT_INIT_LOW, "ZB_RST_N"); /* XBee Module in Reset */ #ifdef CONFIG_BOARD_MRMT_WIRELESS_ZB
@@ -366,8 +361,7 @@ static int __init mrmt1_early_init(void) { /* To maintain power-on signal in case boot loader did not already */ at32_select_gpio( PIN_PWR_ON, AT32_GPIOF_OUTPUT ); - gpio_request( PIN_PWR_ON, "PIN_PWR_ON" ); - gpio_direction_output( PIN_PWR_ON, 1 ); + gpio_request_one(PIN_PWR_ON, GPIOF_OUT_INIT_HIGH, "PIN_PWR_ON"); return 0; }
arch/avr32/boards/atngw100/setup.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/avr32/boards/atngw100/setup.c 2011-01-19 18:51:18.000000000 +0100 +2 -4
@@ -309,13 +309,11 @@ static int __init atngw100_arch_init(voi */ #ifdef CONFIG_BOARD_ATNGW100_MKII at32_select_gpio(GPIO_PIN_PE(30), 0); - gpio_request(GPIO_PIN_PE(30), "j15"); - gpio_direction_input(GPIO_PIN_PE(30)); + gpio_request_one(GPIO_PIN_PE(30), GPIOF_IN, "j15"); gpio_export(GPIO_PIN_PE(30), false); #else at32_select_gpio(GPIO_PIN_PB(30), 0); - gpio_request(GPIO_PIN_PB(30), "j15"); - gpio_direction_input(GPIO_PIN_PB(30)); + gpio_request_one(GPIO_PIN_PB(30), GPIOF_IN, "j15"); gpio_export(GPIO_PIN_PB(30), false); #endif
arch/blackfin/mach-bf533/boards/stamp.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/blackfin/mach-bf533/boards/stamp.c 2011-01-19 18:51:18.000000000 +0100 +1 -2
@@ -718,6 +718,5 @@ void __init native_machine_early_platfor void native_machine_restart(char *cmd) { /* workaround pull up on cpld / flash pin not being strong enough */ - gpio_request(GPIO_PF0, "flash_cpld"); - gpio_direction_output(GPIO_PF0, 0); + gpio_request_one(GPIO_PF0, GPIOF_OUT_INIT_LOW, "flash_cpld"); }
arch/mips/alchemy/devboards/db1200/platform.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/mips/alchemy/devboards/db1200/platform.c 2010-09-04 09:22:04.000000000 +0200 +1 -2
@@ -468,8 +468,7 @@ static int __init db1200_dev_init(void) pfc = __raw_readl((void __iomem *)SYS_PINFUNC) & ~SYS_PINFUNC_P0A; /* switch off OTG VBUS supply */ - gpio_request(215, "otg-vbus"); - gpio_direction_output(215, 1); + gpio_request_one(215, GPIOF_OUT_INIT_HIGH, "otg-vbus"); printk(KERN_INFO "DB1200 device configuration:\n");
arch/mips/alchemy/mtx-1/platform.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/mips/alchemy/mtx-1/platform.c 2011-03-20 18:17:23.000000000 +0100 +2 -3
@@ -153,14 +153,13 @@ static int __init mtx1_register_devices( au1xxx_override_eth_cfg(0, &mtx1_au1000_eth0_pdata); - rc = gpio_request(mtx1_gpio_button[0].gpio, - mtx1_gpio_button[0].desc); + rc = gpio_request_one(mtx1_gpio_button[0].gpio, GPIOF_IN, + mtx1_gpio_button[0].desc); if (rc < 0) { printk(KERN_INFO "mtx1: failed to request %d\n", mtx1_gpio_button[0].gpio); goto out; } - gpio_direction_input(mtx1_gpio_button[0].gpio); out: return platform_add_devices(mtx1_devs, ARRAY_SIZE(mtx1_devs)); }
arch/mips/txx9/rbtx4927/setup.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/mips/txx9/rbtx4927/setup.c 2010-02-11 23:53:22.000000000 +0100 +1 -2
@@ -207,8 +207,7 @@ static void __init rbtx4927_mem_setup(vo #endif /* TX4927-SIO DTR on (PIO[15]) */ - gpio_request(15, "sio-dtr"); - gpio_direction_output(15, 1); + gpio_request_one(15, GPIOF_OUT_INIT_HIGH, "sio-dtr"); tx4927_sio_init(0, 0); }
arch/mips/txx9/rbtx4938/setup.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/mips/txx9/rbtx4938/setup.c 2010-02-11 23:53:22.000000000 +0100 +6 -8
@@ -285,14 +285,12 @@ static int __init rbtx4938_spi_init(void spi_eeprom_register(SPI_BUSNO, SEEPROM1_CS, 128); spi_eeprom_register(SPI_BUSNO, 16 + SEEPROM2_CS, 128); spi_eeprom_register(SPI_BUSNO, 16 + SEEPROM3_CS, 128); - gpio_request(16 + SRTC_CS, "rtc-rs5c348"); - gpio_direction_output(16 + SRTC_CS, 0); - gpio_request(SEEPROM1_CS, "seeprom1"); - gpio_direction_output(SEEPROM1_CS, 1); - gpio_request(16 + SEEPROM2_CS, "seeprom2"); - gpio_direction_output(16 + SEEPROM2_CS, 1); - gpio_request(16 + SEEPROM3_CS, "seeprom3"); - gpio_direction_output(16 + SEEPROM3_CS, 1); + gpio_request_one(16 + SRTC_CS, GPIOF_OUT_INIT_LOW, "rtc-rs5c348"); + gpio_request_one(SEEPROM1_CS, GPIOF_OUT_INIT_HIGH, "seeprom1"); + + gpio_request_one(16 + SEEPROM2_CS, GPIOF_OUT_INIT_HIGH, "seeprom2"); + + gpio_request_one(16 + SEEPROM3_CS, GPIOF_OUT_INIT_HIGH, "seeprom3"); tx4938_spi_init(SPI_BUSNO); return 0; }
arch/sh/boards/board-sh7757lcr.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/sh/boards/board-sh7757lcr.c 2011-03-20 18:17:23.000000000 +0100 +12 -16
@@ -492,26 +492,22 @@ static int __init sh7757lcr_devices_setu gpio_request(GPIO_FN_EVENT0, NULL); /* LED for heartbeat */ - gpio_request(GPIO_PTU3, NULL); - gpio_direction_output(GPIO_PTU3, 1); - gpio_request(GPIO_PTU2, NULL); - gpio_direction_output(GPIO_PTU2, 1); - gpio_request(GPIO_PTU1, NULL); - gpio_direction_output(GPIO_PTU1, 1); - gpio_request(GPIO_PTU0, NULL); - gpio_direction_output(GPIO_PTU0, 1); + gpio_request_one(GPIO_PTU3, GPIOF_OUT_INIT_HIGH, NULL); + + gpio_request_one(GPIO_PTU2, GPIOF_OUT_INIT_HIGH, NULL); + + gpio_request_one(GPIO_PTU1, GPIOF_OUT_INIT_HIGH, NULL); + + gpio_request_one(GPIO_PTU0, GPIOF_OUT_INIT_HIGH, NULL); /* control for MDIO of Gigabit Ethernet */ - gpio_request(GPIO_PTT4, NULL); - gpio_direction_output(GPIO_PTT4, 1); + gpio_request_one(GPIO_PTT4, GPIOF_OUT_INIT_HIGH, NULL); /* control for eMMC */ - gpio_request(GPIO_PTT7, NULL); /* eMMC_RST# */ - gpio_direction_output(GPIO_PTT7, 0); - gpio_request(GPIO_PTT6, NULL); /* eMMC_INDEX# */ - gpio_direction_output(GPIO_PTT6, 0); - gpio_request(GPIO_PTT5, NULL); /* eMMC_PRST# */ - gpio_direction_output(GPIO_PTT5, 1); + gpio_request_one(GPIO_PTT7, GPIOF_OUT_INIT_LOW, NULL); /* eMMC_RST# */ + + gpio_request_one(GPIO_PTT6, GPIOF_OUT_INIT_LOW, NULL); /* eMMC_INDEX# */ + gpio_request_one(GPIO_PTT5, GPIOF_OUT_INIT_HIGH, NULL); /* register SPI device information */ spi_register_board_info(spi_board_info,
arch/sh/boards/mach-ap325rxa/setup.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/sh/boards/mach-ap325rxa/setup.c 2011-01-19 18:51:18.000000000 +0100 +11 -16
@@ -548,17 +548,14 @@ static int __init ap325rxa_devices_setup &ap325rxa_sdram_leave_end); /* LD3 and LD4 LEDs */ - gpio_request(GPIO_PTX5, NULL); /* RUN */ - gpio_direction_output(GPIO_PTX5, 1); + gpio_request_one(GPIO_PTX5, GPIOF_OUT_INIT_HIGH, NULL); /* RUN */ gpio_export(GPIO_PTX5, 0); - gpio_request(GPIO_PTX4, NULL); /* INDICATOR */ - gpio_direction_output(GPIO_PTX4, 0); + gpio_request_one(GPIO_PTX4, GPIOF_OUT_INIT_LOW, NULL); /* INDICATOR */ gpio_export(GPIO_PTX4, 0); /* SW1 input */ - gpio_request(GPIO_PTF7, NULL); /* MODE */ - gpio_direction_input(GPIO_PTF7); + gpio_request_one(GPIO_PTF7, GPIOF_IN, NULL); /* MODE */ gpio_export(GPIO_PTF7, 0); /* LCDC */
@@ -588,8 +585,7 @@ static int __init ap325rxa_devices_setup gpio_request(GPIO_FN_LCDDON, NULL); /* LCD backlight */ - gpio_request(GPIO_PTS3, NULL); - gpio_direction_output(GPIO_PTS3, 1); + gpio_request_one(GPIO_PTS3, GPIOF_OUT_INIT_HIGH, NULL); /* CEU */ gpio_request(GPIO_FN_VIO_CLK2, NULL);
@@ -606,14 +602,13 @@ static int __init ap325rxa_devices_setup gpio_request(GPIO_FN_VIO_D9, NULL); gpio_request(GPIO_FN_VIO_D8, NULL); - gpio_request(GPIO_PTZ7, NULL); - gpio_direction_output(GPIO_PTZ7, 0); /* OE_CAM */ - gpio_request(GPIO_PTZ6, NULL); - gpio_direction_output(GPIO_PTZ6, 0); /* STBY_CAM */ - gpio_request(GPIO_PTZ5, NULL); - gpio_direction_output(GPIO_PTZ5, 0); /* RST_CAM */ - gpio_request(GPIO_PTZ4, NULL); - gpio_direction_output(GPIO_PTZ4, 0); /* SADDR */ + gpio_request_one(GPIO_PTZ7, GPIOF_OUT_INIT_LOW, NULL); + /* OE_CAM */ + gpio_request_one(GPIO_PTZ6, GPIOF_OUT_INIT_LOW, NULL); + /* STBY_CAM */ + gpio_request_one(GPIO_PTZ5, GPIOF_OUT_INIT_LOW, NULL); + /* RST_CAM */ + gpio_request_one(GPIO_PTZ4, GPIOF_OUT_INIT_LOW, NULL);/* SADDR */ __raw_writew(__raw_readw(PORT_MSELCRB) & ~0x0001, PORT_MSELCRB);
arch/sh/boards/mach-ecovec24/setup.c 2011-03-21 08:55:23.000000000 +0100 renamed from arch/sh/boards/mach-ecovec24/setup.c 2011-03-20 18:17:23.000000000 +0100 +15 -28
105 lines not on this page · raw message
arch/sh/boards/mach-kfr2r09/setup.c 2011-03-21 08:55:24.000000000 +0100 renamed from arch/sh/boards/mach-kfr2r09/setup.c 2011-01-19 18:51:18.000000000 +0100 +8 -12
@@ -500,8 +500,7 @@ static int kfr2r09_usb0_gadget_setup(voi { int plugged_in; - gpio_request(GPIO_PTN4, NULL); /* USB_DET */ - gpio_direction_input(GPIO_PTN4); + gpio_request_one(GPIO_PTN4, GPIOF_IN, NULL); /* USB_DET */ plugged_in = gpio_get_value(GPIO_PTN4); if (!plugged_in) return -ENODEV; /* no cable plugged in */
@@ -511,8 +510,7 @@ static int kfr2r09_usb0_gadget_setup(voi __raw_writew((__raw_readw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB); gpio_request(GPIO_FN_PDSTATUS, NULL); /* R-standby disables USB clock */ - gpio_request(GPIO_PTV6, NULL); /* USBCLK_ON */ - gpio_direction_output(GPIO_PTV6, 1); /* USBCLK_ON = H */ + gpio_request_one(GPIO_PTV6, GPIOF_OUT_INIT_HIGH, NULL); /* USBCLK_ON *//* USBCLK_ON = H */ msleep(20); /* wait 20ms to let the clock settle */ clk_enable(clk_get(NULL, "usb0")); __raw_writew(0x0600, 0xa40501d4);
@@ -539,8 +537,7 @@ static int __init kfr2r09_devices_setup( gpio_request(GPIO_FN_SCIF1_RXD, NULL); gpio_request(GPIO_FN_SCIF1_TXD, NULL); kfr2r09_serial_i2c_setup(); /* ECONTMSK(bit6=L10ONEN) set 1 */ - gpio_request(GPIO_PTG3, NULL); /* HPON_ON */ - gpio_direction_output(GPIO_PTG3, 1); /* HPON_ON = H */ + gpio_request_one(GPIO_PTG3, GPIOF_OUT_INIT_HIGH, NULL); /* HPON_ON *//* HPON_ON = H */ /* setup NOR flash@CS0 */ __raw_writel(0x36db0400, BSC_CS0BCR);
@@ -587,12 +584,11 @@ static int __init kfr2r09_devices_setup( gpio_request(GPIO_FN_LCDRD, NULL); /* LCD_RD/ */ gpio_request(GPIO_FN_LCDWR, NULL); /* LCD_WR/ */ gpio_request(GPIO_FN_LCDVSYN, NULL); /* LCD_VSYNC */ - gpio_request(GPIO_PTE4, NULL); /* LCD_RST/ */ - gpio_direction_output(GPIO_PTE4, 1); - gpio_request(GPIO_PTF4, NULL); /* PROTECT/ */ - gpio_direction_output(GPIO_PTF4, 1); - gpio_request(GPIO_PTU0, NULL); /* LEDSTDBY/ */ - gpio_direction_output(GPIO_PTU0, 1); + gpio_request_one(GPIO_PTE4, GPIOF_OUT_INIT_HIGH, NULL); /* LCD_RST/ */ + + gpio_request_one(GPIO_PTF4, GPIOF_OUT_INIT_HIGH, NULL); /* PROTECT/ */ + + gpio_request_one(GPIO_PTU0, GPIOF_OUT_INIT_HIGH, NULL); /* setup USB function */ if (kfr2r09_usb0_gadget_setup() == 0)
arch/sh/boards/mach-migor/setup.c 2011-03-21 08:55:22.000000000 +0100 renamed from arch/sh/boards/mach-migor/setup.c 2011-01-19 18:51:18.000000000 +0100 +5 -10
@@ -538,8 +538,7 @@ static int __init migor_devices_setup(vo /* NAND Flash */ gpio_request(GPIO_FN_CS6A_CE2B, NULL); __raw_writel((__raw_readl(BSC_CS6ABCR) & ~0x0600) | 0x0200, BSC_CS6ABCR); - gpio_request(GPIO_PTA1, NULL); - gpio_direction_input(GPIO_PTA1); + gpio_request_one(GPIO_PTA1, GPIOF_IN, NULL); /* SDHI */ gpio_request(GPIO_FN_SDHICD, NULL);
@@ -576,8 +575,7 @@ static int __init migor_devices_setup(vo gpio_request(GPIO_FN_LCDCS, NULL); gpio_request(GPIO_FN_LCDRD, NULL); gpio_request(GPIO_FN_LCDWR, NULL); - gpio_request(GPIO_PTH2, NULL); /* LCD_DON */ - gpio_direction_output(GPIO_PTH2, 1); + gpio_request_one(GPIO_PTH2, GPIOF_OUT_INIT_HIGH, NULL); /* LCD_DON */ #endif #ifdef CONFIG_SH_MIGOR_RTA_WVGA /* LCDC - WVGA - Enable RGB Interface signals */ gpio_request(GPIO_FN_LCDD15, NULL);
@@ -621,13 +619,10 @@ static int __init migor_devices_setup(vo gpio_request(GPIO_FN_VIO_D9, NULL); gpio_request(GPIO_FN_VIO_D8, NULL); - gpio_request(GPIO_PTT3, NULL); /* VIO_RST */ - gpio_direction_output(GPIO_PTT3, 0); - gpio_request(GPIO_PTT2, NULL); /* TV_IN_EN */ - gpio_direction_output(GPIO_PTT2, 1); - gpio_request(GPIO_PTT0, NULL); /* CAM_EN */ + gpio_request_one(GPIO_PTT3, GPIOF_OUT_INIT_LOW, NULL); /* VIO_RST */ + gpio_request_one(GPIO_PTT2, GPIOF_OUT_INIT_HIGH, NULL); /* TV_IN_EN */ + gpio_request_one(GPIO_PTT0, GPIOF_OUT_INIT_LOW, NULL); /* CAM_EN */ #ifdef CONFIG_SH_MIGOR_RTA_WVGA - gpio_direction_output(GPIO_PTT0, 0); #else gpio_direction_output(GPIO_PTT0, 1); #endif
arch/sh/boards/mach-se/7724/setup.c 2011-03-21 08:55:21.000000000 +0100 renamed from arch/sh/boards/mach-se/7724/setup.c 2011-02-02 17:27:37.000000000 +0100 +1 -2
@@ -899,8 +899,7 @@ static int __init devices_setup(void) gpio_request(GPIO_FN_RMII_CRS_DV, NULL); gpio_request(GPIO_FN_MDIO, NULL); gpio_request(GPIO_FN_MDC, NULL); - gpio_request(GPIO_PTX5, NULL); - gpio_direction_input(GPIO_PTX5); + gpio_request_one(GPIO_PTX5, GPIOF_IN, NULL); sh_eth_init(); if (sw & SW41_B) {
drivers/block/mg_disk.c 2011-03-21 08:55:24.000000000 +0100 renamed from drivers/block/mg_disk.c 2010-08-25 09:45:50.000000000 +0200 +2 -4
@@ -882,10 +882,9 @@ static int mg_probe(struct platform_devi host->rst = rsc->start; /* init rst pin */ - err = gpio_request(host->rst, MG_RST_PIN); + err = gpio_request_one(host->rst, GPIOF_OUT_INIT_HIGH, MG_RST_PIN); if (err) goto probe_err_3; - gpio_direction_output(host->rst, 1); /* reset out pin */ if (!(prv_data->dev_attr & MG_DEV_MASK))
@@ -901,10 +900,9 @@ static int mg_probe(struct platform_devi goto probe_err_3a; } host->rstout = rsc->start; - err = gpio_request(host->rstout, MG_RSTOUT_PIN); + err = gpio_request_one(host->rstout, GPIOF_IN, MG_RSTOUT_PIN); if (err) goto probe_err_3a; - gpio_direction_input(host->rstout); } /* disk reset */
drivers/hwmon/sht15.c 2011-03-21 08:55:24.000000000 +0100 renamed from drivers/hwmon/sht15.c 2011-03-20 18:17:23.000000000 +0100 +2 -2
@@ -555,12 +555,12 @@ static int __devinit sht15_probe(struct ret = regulator_register_notifier(data->reg, &data->nb); } /* Try requesting the GPIOs */ - ret = gpio_request(data->pdata->gpio_sck, "SHT15 sck"); + ret = gpio_request_one(data->pdata->gpio_sck, GPIOF_OUT_INIT_LOW, + "SHT15 sck"); if (ret) { dev_err(&pdev->dev, "gpio request failed"); goto err_free_data; } - gpio_direction_output(data->pdata->gpio_sck, 0); ret = gpio_request(data->pdata->gpio_data, "SHT15 data"); if (ret) { dev_err(&pdev->dev, "gpio request failed");
drivers/input/keyboard/matrix_keypad.c 2011-03-21 08:55:22.000000000 +0100 renamed from drivers/input/keyboard/matrix_keypad.c 2010-07-03 18:06:34.000000000 +0200 +2 -3
@@ -318,15 +318,14 @@ static int __devinit init_matrix_gpio(st } for (i = 0; i < pdata->num_row_gpios; i++) { - err = gpio_request(pdata->row_gpios[i], "matrix_kbd_row"); + err = gpio_request_one(pdata->row_gpios[i], GPIOF_IN, + "matrix_kbd_row"); if (err) { dev_err(&pdev->dev, "failed to request GPIO%d for ROW%d\n", pdata->row_gpios[i], i); goto err_free_rows; } - - gpio_direction_input(pdata->row_gpios[i]); } if (pdata->clustered_irq > 0) {
drivers/input/keyboard/omap-keypad.c 2011-03-21 08:55:22.000000000 +0100 renamed from drivers/input/keyboard/omap-keypad.c 2010-12-28 18:26:03.000000000 +0100 +5 -4
@@ -336,23 +336,24 @@ static int __devinit omap_kp_probe(struc if (cpu_is_omap24xx()) { /* Cols: outputs */ for (col_idx = 0; col_idx < omap_kp->cols; col_idx++) { - if (gpio_request(col_gpios[col_idx], "omap_kp_col") < 0) { + if (gpio_request_one(col_gpios[col_idx], + GPIOF_OUT_INIT_LOW, + "omap_kp_col") < 0) { printk(KERN_ERR "Failed to request" "GPIO%d for keypad\n", col_gpios[col_idx]); goto err1; } - gpio_direction_output(col_gpios[col_idx], 0); } /* Rows: inputs */ for (row_idx = 0; row_idx < omap_kp->rows; row_idx++) { - if (gpio_request(row_gpios[row_idx], "omap_kp_row") < 0) { + if (gpio_request_one(row_gpios[row_idx], GPIOF_IN, + "omap_kp_row") < 0) { printk(KERN_ERR "Failed to request" "GPIO%d for keypad\n", row_gpios[row_idx]); goto err2; } - gpio_direction_input(row_gpios[row_idx]); } } else { col_idx = 0;
drivers/input/mouse/gpio_mouse.c 2011-03-21 08:55:22.000000000 +0100 renamed from drivers/input/mouse/gpio_mouse.c 2009-07-12 20:48:31.000000000 +0200 +1 -3
@@ -83,14 +83,12 @@ static int __devinit gpio_mouse_probe(st dev_dbg(&pdev->dev, "no left button defined\n"); } else { - error = gpio_request(pin, "gpio_mouse"); + error = gpio_request_one(pin, GPIOF_IN, "gpio_mouse"); if (error) { dev_err(&pdev->dev, "fail %d pin (%d idx)\n", pin, i); goto out_free_gpios; } - - gpio_direction_input(pin); } }
drivers/input/serio/ams_delta_serio.c 2011-03-21 08:55:21.000000000 +0100 renamed from drivers/input/serio/ams_delta_serio.c 2010-11-24 07:55:11.000000000 +0100 +4 -4
@@ -122,19 +122,19 @@ static int __init ams_delta_serio_init(v strlcpy(ams_delta_serio->phys, "GPIO/serio0", sizeof(ams_delta_serio->phys)); - err = gpio_request(AMS_DELTA_GPIO_PIN_KEYBRD_DATA, "serio-data"); + err = gpio_request_one(AMS_DELTA_GPIO_PIN_KEYBRD_DATA, GPIOF_IN, + "serio-data"); if (err) { pr_err("ams_delta_serio: Couldn't request gpio pin for data\n"); goto serio; } - gpio_direction_input(AMS_DELTA_GPIO_PIN_KEYBRD_DATA); - err = gpio_request(AMS_DELTA_GPIO_PIN_KEYBRD_CLK, "serio-clock"); + err = gpio_request_one(AMS_DELTA_GPIO_PIN_KEYBRD_CLK, GPIOF_IN, + "serio-clock"); if (err) { pr_err("ams_delta_serio: couldn't request gpio pin for clock\n"); goto gpio_data; } - gpio_direction_input(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); err = request_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), ams_delta_serio_interrupt, IRQ_TYPE_EDGE_RISING,
drivers/leds/leds-bd2802.c 2011-03-21 08:55:21.000000000 +0100 renamed from drivers/leds/leds-bd2802.c 2010-08-06 00:40:23.000000000 +0200 +1 -2
@@ -697,8 +697,7 @@ static int __devinit bd2802_probe(struct i2c_set_clientdata(client, led); /* Configure RESET GPIO (L: RESET, H: RESET cancel) */ - gpio_request(pdata->reset_gpio, "RGB_RESETB"); - gpio_direction_output(pdata->reset_gpio, 1); + gpio_request_one(pdata->reset_gpio, GPIOF_OUT_INIT_HIGH, "RGB_RESETB"); /* Tacss = min 0.1ms */ udelay(100);
drivers/mfd/dm355evm_msp.c 2011-03-21 08:55:23.000000000 +0100 renamed from drivers/mfd/dm355evm_msp.c 2009-09-19 08:25:19.000000000 +0200 +1 -2
@@ -307,8 +307,7 @@ static int add_children(struct i2c_clien for (i = 0; i < ARRAY_SIZE(config_inputs); i++) { int gpio = dm355evm_msp_gpio.base + config_inputs[i].offset; - gpio_request(gpio, config_inputs[i].label); - gpio_direction_input(gpio); + gpio_request_one(gpio, GPIOF_IN, config_inputs[i].label); /* make it easy for userspace to see these */ gpio_export(gpio, false);
drivers/mfd/omap-usb-host.c 2011-03-21 08:55:23.000000000 +0100 renamed from drivers/mfd/omap-usb-host.c 2011-03-14 17:19:15.000000000 +0100 +6 -8
@@ -716,17 +716,15 @@ static int usbhs_enable(struct device *d if (pdata->ehci_data->phy_reset) { if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) { - gpio_request(pdata->ehci_data->reset_gpio_port[0], - "USB1 PHY reset"); - gpio_direction_output - (pdata->ehci_data->reset_gpio_port[0], 1); + gpio_request_one(pdata->ehci_data->reset_gpio_port[0], + GPIOF_OUT_INIT_HIGH, + "USB1 PHY reset"); } if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) { - gpio_request(pdata->ehci_data->reset_gpio_port[1], - "USB2 PHY reset"); - gpio_direction_output - (pdata->ehci_data->reset_gpio_port[1], 1); + gpio_request_one(pdata->ehci_data->reset_gpio_port[1], + GPIOF_OUT_INIT_HIGH, + "USB2 PHY reset"); } /* Hold the PHY in RESET for enough time till DIR is high */
drivers/mmc/host/pxamci.c 2011-03-21 08:55:23.000000000 +0100 renamed from drivers/mmc/host/pxamci.c 2010-09-30 17:54:15.000000000 +0200 +3 -4
@@ -719,20 +719,19 @@ static int pxamci_probe(struct platform_ host->pdata->gpio_power_invert); } if (gpio_is_valid(gpio_ro)) { - ret = gpio_request(gpio_ro, "mmc card read only"); + ret = gpio_request_one(gpio_ro, GPIOF_IN, + "mmc card read only"); if (ret) { dev_err(&pdev->dev, "Failed requesting gpio_ro %d\n", gpio_ro); goto err_gpio_ro; } - gpio_direction_input(gpio_ro); } if (gpio_is_valid(gpio_cd)) { - ret = gpio_request(gpio_cd, "mmc card detect"); + ret = gpio_request_one(gpio_cd, GPIOF_IN, "mmc card detect"); if (ret) { dev_err(&pdev->dev, "Failed requesting gpio_cd %d\n", gpio_cd); goto err_gpio_cd; } - gpio_direction_input(gpio_cd); ret = request_irq(gpio_to_irq(gpio_cd), pxamci_detect_irq,
Lines of this file are not shown. View the raw message.
drivers/mmc/host/s3cmci.c 2011-03-21 08:55:25.000000000 +0100 renamed from drivers/mmc/host/s3cmci.c 2010-09-18 08:59:06.000000000 +0200 +2 -3
Lines of this file are not shown. View the raw message.
drivers/mtd/maps/bfin-async-flash.c 2011-03-21 08:55:25.000000000 +0100 renamed from drivers/mtd/maps/bfin-async-flash.c 2010-03-29 19:27:56.000000000 +0200 +2 -2
Lines of this file are not shown. View the raw message.
drivers/mtd/maps/gpio-addr-flash.c 2011-03-21 08:55:25.000000000 +0100 renamed from drivers/mtd/maps/gpio-addr-flash.c 2010-11-01 20:33:30.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/mtd/nand/cmx270_nand.c 2011-03-21 08:55:25.000000000 +0100 renamed from drivers/mtd/nand/cmx270_nand.c 2010-03-29 19:27:56.000000000 +0200 +2 -6
Lines of this file are not shown. View the raw message.
drivers/mtd/nand/fsl_upm.c 2011-03-21 08:55:25.000000000 +0100 renamed from drivers/mtd/nand/fsl_upm.c 2011-03-14 17:19:15.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/mtd/nand/gpio.c 2011-03-21 08:55:24.000000000 +0100 renamed from drivers/mtd/nand/gpio.c 2010-01-03 21:18:12.000000000 +0100 +9 -10
Lines of this file are not shown. View the raw message.
drivers/mtd/onenand/omap2.c 2011-03-21 08:55:25.000000000 +0100 renamed from drivers/mtd/onenand/omap2.c 2011-03-14 17:19:15.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/pcmcia/bfin_cf_pcmcia.c 2011-03-21 08:55:26.000000000 +0100 renamed from drivers/pcmcia/bfin_cf_pcmcia.c 2010-03-29 19:27:57.000000000 +0200 +1 -2
Lines of this file are not shown. View the raw message.
drivers/pcmcia/pxa2xx_cm_x255.c 2011-03-21 08:55:26.000000000 +0100 renamed from drivers/pcmcia/pxa2xx_cm_x255.c 2009-11-08 21:45:05.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/pcmcia/pxa2xx_cm_x270.c 2011-03-21 08:55:26.000000000 +0100 renamed from drivers/pcmcia/pxa2xx_cm_x270.c 2009-11-08 21:45:05.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/rtc/rtc-v3020.c 2011-03-21 08:55:23.000000000 +0100 renamed from drivers/rtc/rtc-v3020.c 2010-03-29 19:27:57.000000000 +0200 +3 -3
Lines of this file are not shown. View the raw message.
drivers/spi/mpc52xx_spi.c 2011-03-21 08:55:23.000000000 +0100 renamed from drivers/spi/mpc52xx_spi.c 2011-03-14 17:19:16.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/spi/spi_bfin5xx.c 2011-03-21 08:55:21.000000000 +0100 renamed from drivers/spi/spi_bfin5xx.c 2011-02-19 08:28:52.000000000 +0100 +3 -2
Lines of this file are not shown. View the raw message.
drivers/spi/spi_oc_tiny.c 2011-03-21 08:55:22.000000000 +0100 renamed from drivers/spi/spi_oc_tiny.c 2011-02-26 13:17:47.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/spi/spi_s3c24xx.c 2011-03-21 08:55:23.000000000 +0100 renamed from drivers/spi/spi_s3c24xx.c 2010-03-29 19:27:58.000000000 +0200 +2 -2
Lines of this file are not shown. View the raw message.
drivers/staging/iio/adc/ad7816.c 2011-03-21 08:55:24.000000000 +0100 renamed from drivers/staging/iio/adc/ad7816.c 2010-11-13 10:26:39.000000000 +0100 +3 -6
Lines of this file are not shown. View the raw message.
drivers/staging/iio/resolver/ad2s120x.c 2011-03-21 08:55:24.000000000 +0100 renamed from drivers/staging/iio/resolver/ad2s120x.c 2010-11-13 10:26:39.000000000 +0100 +1 -2
Lines of this file are not shown. View the raw message.
drivers/usb/gadget/at91_udc.c 2011-03-21 08:55:26.000000000 +0100 renamed from drivers/usb/gadget/at91_udc.c 2011-02-19 08:28:52.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/usb/gadget/pxa25x_udc.c 2011-03-21 08:55:26.000000000 +0100 renamed from drivers/usb/gadget/pxa25x_udc.c 2010-09-04 09:22:05.000000000 +0200 +6 -6
Lines of this file are not shown. View the raw message.
drivers/usb/host/ohci-at91.c 2011-03-21 08:55:25.000000000 +0100 renamed from drivers/usb/host/ohci-at91.c 2010-05-08 13:16:00.000000000 +0200 +2 -2
Lines of this file are not shown. View the raw message.
drivers/usb/host/ohci-omap.c 2011-03-21 08:55:25.000000000 +0100 renamed from drivers/usb/host/ohci-omap.c 2009-10-28 12:03:41.000000000 +0100 +1 -2
Lines of this file are not shown. View the raw message.
drivers/usb/musb/blackfin.c 2011-03-21 08:55:25.000000000 +0100 renamed from drivers/usb/musb/blackfin.c 2011-02-11 10:53:32.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/usb/otg/gpio_vbus.c 2011-03-21 08:55:25.000000000 +0100 renamed from drivers/usb/otg/gpio_vbus.c 2010-03-29 19:27:58.000000000 +0200 +1 -2
Lines of this file are not shown. View the raw message.
drivers/video/bf537-lq035.c 2011-03-21 08:55:27.000000000 +0100 renamed from drivers/video/bf537-lq035.c 2011-02-02 17:27:39.000000000 +0100 +1 -3
Lines of this file are not shown. View the raw message.
drivers/video/bf54x-lq043fb.c 2011-03-21 08:55:21.000000000 +0100 renamed from drivers/video/bf54x-lq043fb.c 2010-08-10 09:17:44.000000000 +0200 +1 -3
Lines of this file are not shown. View the raw message.
drivers/video/bfin-lq035q1-fb.c 2011-03-21 08:55:26.000000000 +0100 renamed from drivers/video/bfin-lq035q1-fb.c 2010-05-27 15:47:04.000000000 +0200 +4 -4
Lines of this file are not shown. View the raw message.
drivers/video/bfin_adv7393fb.c 2011-03-21 08:55:26.000000000 +0100 renamed from drivers/video/bfin_adv7393fb.c 2010-12-04 18:54:36.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
drivers/video/omap2/displays/panel-taal.c 2011-03-21 08:55:26.000000000 +0100 renamed from drivers/video/omap2/displays/panel-taal.c 2011-03-14 17:19:17.000000000 +0100 +1 -3
Lines of this file are not shown. View the raw message.
sound/pci/cs5535audio/cs5535audio_olpc.c 2011-03-21 08:55:25.000000000 +0100 renamed from sound/pci/cs5535audio/cs5535audio_olpc.c 2009-12-17 08:30:15.000000000 +0100 +1 -2
Lines of this file are not shown. View the raw message.
sound/soc/blackfin/bf5xx-ac97.c 2011-03-21 08:55:24.000000000 +0100 renamed from sound/soc/blackfin/bf5xx-ac97.c 2011-01-19 18:51:20.000000000 +0100 +3 -4
Lines of this file are not shown. View the raw message.
sound/soc/blackfin/bf5xx-ad73311.c 2011-03-21 08:55:25.000000000 +0100 renamed from sound/soc/blackfin/bf5xx-ad73311.c 2010-11-24 07:55:12.000000000 +0100 +1 -3
Lines of this file are not shown. View the raw message.
sound/soc/codecs/tlv320aic3x.c 2011-03-21 08:55:24.000000000 +0100 renamed from sound/soc/codecs/tlv320aic3x.c 2010-12-26 10:19:08.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
sound/soc/codecs/tlv320dac33.c 2011-03-21 08:55:22.000000000 +0100 renamed from sound/soc/codecs/tlv320dac33.c 2011-03-14 17:19:19.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
sound/soc/codecs/tpa6130a2.c 2011-03-21 08:55:22.000000000 +0100 renamed from sound/soc/codecs/tpa6130a2.c 2011-01-19 18:51:20.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
sound/soc/omap/n810.c 2011-03-21 08:55:22.000000000 +0100 renamed from sound/soc/omap/n810.c 2011-01-09 09:32:58.000000000 +0100 +2 -2
Lines of this file are not shown. View the raw message.
sound/soc/omap/zoom2.c 2011-03-21 08:55:22.000000000 +0100 renamed from sound/soc/omap/zoom2.c 2010-11-24 07:55:12.000000000 +0100 +4 -4
Lines of this file are not shown. View the raw message.
sound/soc/samsung/s3c24xx_uda134x.c 2011-03-21 08:55:24.000000000 +0100 renamed from sound/soc/samsung/s3c24xx_uda134x.c 2011-02-02 17:27:40.000000000 +0100 +1 -2
Lines of this file are not shown. View the raw message.
sound/soc/tegra/harmony.c 2011-03-21 08:55:22.000000000 +0100 renamed from sound/soc/tegra/harmony.c 2011-02-19 08:28:53.000000000 +0100 +6 -11
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
In reply to Julia Lawall2011/3/15 Julia Lawall <[email protected]>:
Quoted 33 lines · Uwe Kleine-K?nig
Quoted 15 lines · Julia Lawall
Quoted 6 lines
I tried the following
@@
expression E1,E2;
@@Quoted 7 lines
? ? ?
gpio_direction_output(E1,E2);
? ? ? ...
- ? ?gpio_set_value(E1,E2);and found occurrences in 15 files. ?In some cases there seems to be some delay before the call to
gpio_set_value. ?Does that have any impacton whether it is needed?Quoted 6 lines
gpio_direction_output(E1,E2)impliesgpio_set_value(E1,E2), so unless there is agpio_set_value(E1,!E2)beforegpio_set_value(E1,E2)is a noop.I still don't know how to work with coccinelle, so if you point me to a concrete location I can be more specific.
OK. ?I have changed the semantic patch to the following:
@@
expression E1,E2,E3;
@@? ? ?gpio_direction_output(E1,E2);
? ? ?... when !=gpio_set_value(E1,E3)
- ? ?gpio_set_value(E1,E2);
Quoted 5 lines
Now it doesn't do all the cases where there is an earlier set ofr some other value. ?The patch I obtain is below. ?This only concerns 5 files. I haven't checked the result at all.
julia
Hi Julia,
Similar to my other reply, even though this patch is much smaller, I'm not particularly excited about changing all the drivers wholesale unless someone with hardware can give it a test.
g.
PATCH 2/2 ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
Quoted 38 lines · Grant Likely
2011/3/15 Julia Lawall <[email protected]>:
Quoted 37 lines · Uwe Kleine-K?nig
Quoted 15 lines · Julia Lawall
Quoted 6 lines
I tried the following
@@
expression E1,E2;
@@Quoted 7 lines
? ? ?
gpio_direction_output(E1,E2);
? ? ? ...
- ? ?gpio_set_value(E1,E2);and found occurrences in 15 files. ?In some cases there seems to be some delay before the call to
gpio_set_value. ?Does that have any impacton whether it is needed?Quoted 6 lines
gpio_direction_output(E1,E2)impliesgpio_set_value(E1,E2), so unless there is agpio_set_value(E1,!E2)beforegpio_set_value(E1,E2)is a noop.I still don't know how to work with coccinelle, so if you point me to a concrete location I can be more specific.
OK. ?I have changed the semantic patch to the following:
@@
expression E1,E2,E3;
@@? ? ?gpio_direction_output(E1,E2);
? ? ?... when !=gpio_set_value(E1,E3)
- ? ?gpio_set_value(E1,E2);Now it doesn't do all the cases where there is an earlier set ofr some other value. ?The patch I obtain is below. ?This only concerns 5 files. I haven't checked the result at all.
Quoted 7 lines
Quoted 1 line
julia
Hi Julia,
Similar to my other reply, even though this patch is much smaller, I'm not particularly excited about changing all the drivers wholesale unless someone with hardware can give it a test.
I wasn't proposing either as an actual patch. Only as a way to see what the actual code looks like and what issues should be taken into account.
thanks,
julia