* [U-Boot] [PATCH 1/2] omap: Don't use gpio_free to change direction to input
@ 2011-10-06 20:45 Joe Hershberger
2011-10-06 20:45 ` [U-Boot] [PATCH 2/2] omap4_panda: Build in cmd_gpio support on panda Joe Hershberger
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Joe Hershberger @ 2011-10-06 20:45 UTC (permalink / raw)
To: u-boot
gpio_free() should not have the side effect of setting the line to input since this prevents the gpio command from being able to set a line as output.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Sandeep Paulraj <s-paulraj@ti.com>
---
arch/arm/cpu/armv7/omap-common/gpio.c | 7 -------
board/logicpd/zoom2/debug_board.c | 1 -
board/logicpd/zoom2/zoom2.c | 1 -
board/overo/overo.c | 7 +------
board/ti/beagle/beagle.c | 6 ------
5 files changed, 1 insertions(+), 21 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap-common/gpio.c b/arch/arm/cpu/armv7/omap-common/gpio.c
index e62c6f4..75a02da 100644
--- a/arch/arm/cpu/armv7/omap-common/gpio.c
+++ b/arch/arm/cpu/armv7/omap-common/gpio.c
@@ -237,11 +237,4 @@ int gpio_request(int gpio, const char *label)
*/
void gpio_free(unsigned gpio)
{
- const struct gpio_bank *bank;
-
- if (check_gpio(gpio) < 0)
- return;
- bank = get_gpio_bank(gpio);
-
- _set_gpio_direction(bank, get_gpio_index(gpio), 1);
}
diff --git a/board/logicpd/zoom2/debug_board.c b/board/logicpd/zoom2/debug_board.c
index 33aa600..071e7f9 100644
--- a/board/logicpd/zoom2/debug_board.c
+++ b/board/logicpd/zoom2/debug_board.c
@@ -40,7 +40,6 @@ static void zoom2_debug_board_detect (void)
*/
gpio_direction_input(158);
val = gpio_get_value(158);
- gpio_free(158);
}
if (!val)
diff --git a/board/logicpd/zoom2/zoom2.c b/board/logicpd/zoom2/zoom2.c
index 21964c2..be3083d 100644
--- a/board/logicpd/zoom2/zoom2.c
+++ b/board/logicpd/zoom2/zoom2.c
@@ -95,7 +95,6 @@ void zoom2_identify(void)
gpio_direction_input(94);
val = gpio_get_value(94);
- gpio_free(94);
if (val)
revision = ZOOM2_REVISION_BETA;
diff --git a/board/overo/overo.c b/board/overo/overo.c
index 850dfee..bdbd7f3 100644
--- a/board/overo/overo.c
+++ b/board/overo/overo.c
@@ -118,10 +118,6 @@ int get_board_revision(void)
revision = gpio_get_value(115) << 2 |
gpio_get_value(113) << 1 |
gpio_get_value(112);
-
- gpio_free(112);
- gpio_free(113);
- gpio_free(115);
} else {
printf("Error: unable to acquire board revision GPIOs\n");
revision = -1;
@@ -153,8 +149,7 @@ int get_sdio2_config(void)
sdio_direct = 0;
}
- gpio_free(130);
- gpio_free(139);
+ gpio_direction_input(130);
} else {
printf("Error: unable to acquire sdio2 clk GPIOs\n");
sdio_direct = -1;
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index aa5047c..9482c5e 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -127,10 +127,6 @@ int get_board_revision(void)
revision = gpio_get_value(173) << 2 |
gpio_get_value(172) << 1 |
gpio_get_value(171);
-
- gpio_free(171);
- gpio_free(172);
- gpio_free(173);
} else {
printf("Error: unable to acquire board revision GPIOs\n");
revision = -1;
@@ -522,8 +518,6 @@ int do_userbutton(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
printf("NOT pressed.\n");
}
- gpio_free(gpio);
-
return !button;
}
--
1.6.0.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* [U-Boot] [PATCH 2/2] omap4_panda: Build in cmd_gpio support on panda
2011-10-06 20:45 [U-Boot] [PATCH 1/2] omap: Don't use gpio_free to change direction to input Joe Hershberger
@ 2011-10-06 20:45 ` Joe Hershberger
2011-10-06 21:50 ` [U-Boot] [PATCH v2 1/2] omap: Don't use gpio_free to change direction to input Joe Hershberger
2011-10-06 21:50 ` [U-Boot] [PATCH v2 2/2] omap4_panda: Build in cmd_gpio support on panda Joe Hershberger
2 siblings, 0 replies; 8+ messages in thread
From: Joe Hershberger @ 2011-10-06 20:45 UTC (permalink / raw)
To: u-boot
Enable the gpio command
Configure the pads to allow access to the button on GPIO_121 and the 2 LEDS on GPIO_7 and GPIO_8
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Sandeep Paulraj <s-paulraj@ti.com>
---
board/ti/panda/panda_mux_data.h | 3 +++
include/configs/omap4_panda.h | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/board/ti/panda/panda_mux_data.h b/board/ti/panda/panda_mux_data.h
index 63448b6..d630c71 100644
--- a/board/ti/panda/panda_mux_data.h
+++ b/board/ti/panda/panda_mux_data.h
@@ -222,6 +222,9 @@ const struct pad_conf_entry wkup_padconf_array_non_essential[] = {
{PAD1_SYS_PWRON_RESET, (M3)}, /* gpio_wk29 */
{PAD0_SYS_BOOT6, (IEN | M3)}, /* gpio_wk9 */
{PAD1_SYS_BOOT7, (IEN | M3)}, /* gpio_wk10 */
+ {PAD1_FREF_CLK3_REQ, (M3)}, /* gpio_wk30 */
+ {PAD1_FREF_CLK4_REQ, (IEN | M3)}, /* gpio_wk7 */
+ {PAD0_FREF_CLK4_OUT, (IEN | M3)}, /* gpio_wk8 */
};
#endif /* _PANDA_MUX_DATA_H_ */
diff --git a/include/configs/omap4_panda.h b/include/configs/omap4_panda.h
index 67da70e..b88e5ad 100644
--- a/include/configs/omap4_panda.h
+++ b/include/configs/omap4_panda.h
@@ -35,6 +35,9 @@
#include <configs/omap4_common.h>
+/* GPIO */
+#define CONFIG_CMD_GPIO 1
+
/* ENV related config options */
#define CONFIG_ENV_IS_NOWHERE
--
1.6.0.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* [U-Boot] [PATCH v2 1/2] omap: Don't use gpio_free to change direction to input
2011-10-06 20:45 [U-Boot] [PATCH 1/2] omap: Don't use gpio_free to change direction to input Joe Hershberger
2011-10-06 20:45 ` [U-Boot] [PATCH 2/2] omap4_panda: Build in cmd_gpio support on panda Joe Hershberger
@ 2011-10-06 21:50 ` Joe Hershberger
2011-10-06 21:50 ` [U-Boot] [PATCH v2 2/2] omap4_panda: Build in cmd_gpio support on panda Joe Hershberger
2 siblings, 0 replies; 8+ messages in thread
From: Joe Hershberger @ 2011-10-06 21:50 UTC (permalink / raw)
To: u-boot
gpio_free() should not have the side effect of setting the line to input since this prevents the gpio command from being able to set a line as output.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Sandeep Paulraj <s-paulraj@ti.com>
---
Changes for v2:
arch/arm/cpu/armv7/omap-common/gpio.c | 7 -------
board/logicpd/zoom2/debug_board.c | 1 -
board/logicpd/zoom2/zoom2.c | 1 -
board/overo/overo.c | 7 +------
board/ti/beagle/beagle.c | 6 ------
5 files changed, 1 insertions(+), 21 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap-common/gpio.c b/arch/arm/cpu/armv7/omap-common/gpio.c
index e62c6f4..75a02da 100644
--- a/arch/arm/cpu/armv7/omap-common/gpio.c
+++ b/arch/arm/cpu/armv7/omap-common/gpio.c
@@ -237,11 +237,4 @@ int gpio_request(int gpio, const char *label)
*/
void gpio_free(unsigned gpio)
{
- const struct gpio_bank *bank;
-
- if (check_gpio(gpio) < 0)
- return;
- bank = get_gpio_bank(gpio);
-
- _set_gpio_direction(bank, get_gpio_index(gpio), 1);
}
diff --git a/board/logicpd/zoom2/debug_board.c b/board/logicpd/zoom2/debug_board.c
index 33aa600..071e7f9 100644
--- a/board/logicpd/zoom2/debug_board.c
+++ b/board/logicpd/zoom2/debug_board.c
@@ -40,7 +40,6 @@ static void zoom2_debug_board_detect (void)
*/
gpio_direction_input(158);
val = gpio_get_value(158);
- gpio_free(158);
}
if (!val)
diff --git a/board/logicpd/zoom2/zoom2.c b/board/logicpd/zoom2/zoom2.c
index 21964c2..be3083d 100644
--- a/board/logicpd/zoom2/zoom2.c
+++ b/board/logicpd/zoom2/zoom2.c
@@ -95,7 +95,6 @@ void zoom2_identify(void)
gpio_direction_input(94);
val = gpio_get_value(94);
- gpio_free(94);
if (val)
revision = ZOOM2_REVISION_BETA;
diff --git a/board/overo/overo.c b/board/overo/overo.c
index 850dfee..bdbd7f3 100644
--- a/board/overo/overo.c
+++ b/board/overo/overo.c
@@ -118,10 +118,6 @@ int get_board_revision(void)
revision = gpio_get_value(115) << 2 |
gpio_get_value(113) << 1 |
gpio_get_value(112);
-
- gpio_free(112);
- gpio_free(113);
- gpio_free(115);
} else {
printf("Error: unable to acquire board revision GPIOs\n");
revision = -1;
@@ -153,8 +149,7 @@ int get_sdio2_config(void)
sdio_direct = 0;
}
- gpio_free(130);
- gpio_free(139);
+ gpio_direction_input(130);
} else {
printf("Error: unable to acquire sdio2 clk GPIOs\n");
sdio_direct = -1;
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index aa5047c..9482c5e 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -127,10 +127,6 @@ int get_board_revision(void)
revision = gpio_get_value(173) << 2 |
gpio_get_value(172) << 1 |
gpio_get_value(171);
-
- gpio_free(171);
- gpio_free(172);
- gpio_free(173);
} else {
printf("Error: unable to acquire board revision GPIOs\n");
revision = -1;
@@ -522,8 +518,6 @@ int do_userbutton(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
printf("NOT pressed.\n");
}
- gpio_free(gpio);
-
return !button;
}
--
1.6.0.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* [U-Boot] [PATCH v2 2/2] omap4_panda: Build in cmd_gpio support on panda
2011-10-06 20:45 [U-Boot] [PATCH 1/2] omap: Don't use gpio_free to change direction to input Joe Hershberger
2011-10-06 20:45 ` [U-Boot] [PATCH 2/2] omap4_panda: Build in cmd_gpio support on panda Joe Hershberger
2011-10-06 21:50 ` [U-Boot] [PATCH v2 1/2] omap: Don't use gpio_free to change direction to input Joe Hershberger
@ 2011-10-06 21:50 ` Joe Hershberger
2011-10-09 10:47 ` Igor Grinberg
2 siblings, 1 reply; 8+ messages in thread
From: Joe Hershberger @ 2011-10-06 21:50 UTC (permalink / raw)
To: u-boot
Enable the gpio command
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Sandeep Paulraj <s-paulraj@ti.com>
---
Changes for v2:
- Correct a bad merge... sorry.
board/ti/panda/panda_mux_data.h | 2 +-
include/configs/omap4_panda.h | 3 +++
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/board/ti/panda/panda_mux_data.h b/board/ti/panda/panda_mux_data.h
index 63448b6..c692c7b 100644
--- a/board/ti/panda/panda_mux_data.h
+++ b/board/ti/panda/panda_mux_data.h
@@ -212,7 +212,7 @@ const struct pad_conf_entry wkup_padconf_array_non_essential[] = {
{PAD0_FREF_SLICER_IN, (M0)}, /* fref_slicer_in */
{PAD1_FREF_CLK_IOREQ, (M0)}, /* fref_clk_ioreq */
{PAD0_FREF_CLK0_OUT, (M2)}, /* sys_drm_msecure */
- {PAD1_FREF_CLK3_REQ, M7}, /* safe mode */
+ {PAD1_FREF_CLK3_REQ, M7}, /* safe mode */
{PAD0_FREF_CLK3_OUT, (M0)}, /* fref_clk3_out */
{PAD1_FREF_CLK4_REQ, (PTU | M3)}, /* led status_1 */
{PAD0_FREF_CLK4_OUT, (PTU | M3)}, /* led status_2 */
diff --git a/include/configs/omap4_panda.h b/include/configs/omap4_panda.h
index 67da70e..b88e5ad 100644
--- a/include/configs/omap4_panda.h
+++ b/include/configs/omap4_panda.h
@@ -35,6 +35,9 @@
#include <configs/omap4_common.h>
+/* GPIO */
+#define CONFIG_CMD_GPIO 1
+
/* ENV related config options */
#define CONFIG_ENV_IS_NOWHERE
--
1.6.0.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* [U-Boot] [PATCH v2 2/2] omap4_panda: Build in cmd_gpio support on panda
2011-10-06 21:50 ` [U-Boot] [PATCH v2 2/2] omap4_panda: Build in cmd_gpio support on panda Joe Hershberger
@ 2011-10-09 10:47 ` Igor Grinberg
2011-10-12 20:31 ` [U-Boot] [PATCH v3 1/2] omap: Don't use gpio_free to change direction to input Joe Hershberger
2011-10-12 20:31 ` [U-Boot] [PATCH v3 2/2] omap4_panda: Build in cmd_gpio support on panda Joe Hershberger
0 siblings, 2 replies; 8+ messages in thread
From: Igor Grinberg @ 2011-10-09 10:47 UTC (permalink / raw)
To: u-boot
Hi Joe,
On 10/06/11 23:50, Joe Hershberger wrote:
> Enable the gpio command
>
> Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Joe Hershberger <joe.hershberger@gmail.com>
> Cc: Sandeep Paulraj <s-paulraj@ti.com>
> ---
> Changes for v2:
> - Correct a bad merge... sorry.
>
> board/ti/panda/panda_mux_data.h | 2 +-
> include/configs/omap4_panda.h | 3 +++
> 2 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/board/ti/panda/panda_mux_data.h b/board/ti/panda/panda_mux_data.h
> index 63448b6..c692c7b 100644
> --- a/board/ti/panda/panda_mux_data.h
> +++ b/board/ti/panda/panda_mux_data.h
> @@ -212,7 +212,7 @@ const struct pad_conf_entry wkup_padconf_array_non_essential[] = {
> {PAD0_FREF_SLICER_IN, (M0)}, /* fref_slicer_in */
> {PAD1_FREF_CLK_IOREQ, (M0)}, /* fref_clk_ioreq */
> {PAD0_FREF_CLK0_OUT, (M2)}, /* sys_drm_msecure */
> - {PAD1_FREF_CLK3_REQ, M7}, /* safe mode */
> + {PAD1_FREF_CLK3_REQ, M7}, /* safe mode */
> {PAD0_FREF_CLK3_OUT, (M0)}, /* fref_clk3_out */
> {PAD1_FREF_CLK4_REQ, (PTU | M3)}, /* led status_1 */
> {PAD0_FREF_CLK4_OUT, (PTU | M3)}, /* led status_2 */
> diff --git a/include/configs/omap4_panda.h b/include/configs/omap4_panda.h
> index 67da70e..b88e5ad 100644
> --- a/include/configs/omap4_panda.h
> +++ b/include/configs/omap4_panda.h
> @@ -35,6 +35,9 @@
>
> #include <configs/omap4_common.h>
>
> +/* GPIO */
> +#define CONFIG_CMD_GPIO 1
Boolean defines should not have a value.
--
Regards,
Igor.
^ permalink raw reply [flat|nested] 8+ messages in thread* [U-Boot] [PATCH v3 1/2] omap: Don't use gpio_free to change direction to input
2011-10-09 10:47 ` Igor Grinberg
@ 2011-10-12 20:31 ` Joe Hershberger
2011-10-12 20:31 ` [U-Boot] [PATCH v3 2/2] omap4_panda: Build in cmd_gpio support on panda Joe Hershberger
1 sibling, 0 replies; 8+ messages in thread
From: Joe Hershberger @ 2011-10-12 20:31 UTC (permalink / raw)
To: u-boot
gpio_free() should not have the side effect of setting the line to input since this prevents the gpio command from being able to set a line as output.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Sandeep Paulraj <s-paulraj@ti.com>
---
Changes for v2:
Changes for v3:
arch/arm/cpu/armv7/omap-common/gpio.c | 7 -------
board/logicpd/zoom2/debug_board.c | 1 -
board/logicpd/zoom2/zoom2.c | 1 -
board/overo/overo.c | 7 +------
board/ti/beagle/beagle.c | 6 ------
5 files changed, 1 insertions(+), 21 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap-common/gpio.c b/arch/arm/cpu/armv7/omap-common/gpio.c
index e62c6f4..75a02da 100644
--- a/arch/arm/cpu/armv7/omap-common/gpio.c
+++ b/arch/arm/cpu/armv7/omap-common/gpio.c
@@ -237,11 +237,4 @@ int gpio_request(int gpio, const char *label)
*/
void gpio_free(unsigned gpio)
{
- const struct gpio_bank *bank;
-
- if (check_gpio(gpio) < 0)
- return;
- bank = get_gpio_bank(gpio);
-
- _set_gpio_direction(bank, get_gpio_index(gpio), 1);
}
diff --git a/board/logicpd/zoom2/debug_board.c b/board/logicpd/zoom2/debug_board.c
index 33aa600..071e7f9 100644
--- a/board/logicpd/zoom2/debug_board.c
+++ b/board/logicpd/zoom2/debug_board.c
@@ -40,7 +40,6 @@ static void zoom2_debug_board_detect (void)
*/
gpio_direction_input(158);
val = gpio_get_value(158);
- gpio_free(158);
}
if (!val)
diff --git a/board/logicpd/zoom2/zoom2.c b/board/logicpd/zoom2/zoom2.c
index 21964c2..be3083d 100644
--- a/board/logicpd/zoom2/zoom2.c
+++ b/board/logicpd/zoom2/zoom2.c
@@ -95,7 +95,6 @@ void zoom2_identify(void)
gpio_direction_input(94);
val = gpio_get_value(94);
- gpio_free(94);
if (val)
revision = ZOOM2_REVISION_BETA;
diff --git a/board/overo/overo.c b/board/overo/overo.c
index 850dfee..bdbd7f3 100644
--- a/board/overo/overo.c
+++ b/board/overo/overo.c
@@ -118,10 +118,6 @@ int get_board_revision(void)
revision = gpio_get_value(115) << 2 |
gpio_get_value(113) << 1 |
gpio_get_value(112);
-
- gpio_free(112);
- gpio_free(113);
- gpio_free(115);
} else {
printf("Error: unable to acquire board revision GPIOs\n");
revision = -1;
@@ -153,8 +149,7 @@ int get_sdio2_config(void)
sdio_direct = 0;
}
- gpio_free(130);
- gpio_free(139);
+ gpio_direction_input(130);
} else {
printf("Error: unable to acquire sdio2 clk GPIOs\n");
sdio_direct = -1;
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index aa5047c..9482c5e 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -127,10 +127,6 @@ int get_board_revision(void)
revision = gpio_get_value(173) << 2 |
gpio_get_value(172) << 1 |
gpio_get_value(171);
-
- gpio_free(171);
- gpio_free(172);
- gpio_free(173);
} else {
printf("Error: unable to acquire board revision GPIOs\n");
revision = -1;
@@ -522,8 +518,6 @@ int do_userbutton(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
printf("NOT pressed.\n");
}
- gpio_free(gpio);
-
return !button;
}
--
1.6.0.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* [U-Boot] [PATCH v3 2/2] omap4_panda: Build in cmd_gpio support on panda
2011-10-09 10:47 ` Igor Grinberg
2011-10-12 20:31 ` [U-Boot] [PATCH v3 1/2] omap: Don't use gpio_free to change direction to input Joe Hershberger
@ 2011-10-12 20:31 ` Joe Hershberger
1 sibling, 0 replies; 8+ messages in thread
From: Joe Hershberger @ 2011-10-12 20:31 UTC (permalink / raw)
To: u-boot
Enable the gpio command
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Sandeep Paulraj <s-paulraj@ti.com>
---
Changes for v2:
- Correct a bad merge... sorry.
Changes for v3:
- Boolean defines should not have a value
include/configs/omap4_panda.h | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/include/configs/omap4_panda.h b/include/configs/omap4_panda.h
index 67da70e..e9ef2a3 100644
--- a/include/configs/omap4_panda.h
+++ b/include/configs/omap4_panda.h
@@ -35,6 +35,9 @@
#include <configs/omap4_common.h>
+/* GPIO */
+#define CONFIG_CMD_GPIO
+
/* ENV related config options */
#define CONFIG_ENV_IS_NOWHERE
--
1.6.0.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH 1/2] omap3+: Add OMAP support for cmd_gpio
@ 2011-08-10 5:17 Joe Hershberger
2011-08-16 22:17 ` [U-Boot] [PATCH v2 2/2] omap4_panda: Build in cmd_gpio support on panda Joe Hershberger
0 siblings, 1 reply; 8+ messages in thread
From: Joe Hershberger @ 2011-08-10 5:17 UTC (permalink / raw)
To: u-boot
Add a shim driver to drivers/gpio that maps the standard GPIO API to the OMAP GPIO API
Empty gpio.h is needed in the asm/arch dirs for omap3 and omap4 due to include in asm/gpio.h
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Sandeep Paulraj <s-paulraj@ti.com>
---
arch/arm/include/asm/arch-omap3/gpio.h | 1 +
arch/arm/include/asm/arch-omap4/gpio.h | 1 +
drivers/gpio/Makefile | 1 +
drivers/gpio/omap_gpio.c | 69 ++++++++++++++++++++++++++++++++
4 files changed, 72 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/include/asm/arch-omap3/gpio.h
create mode 100644 arch/arm/include/asm/arch-omap4/gpio.h
create mode 100644 drivers/gpio/omap_gpio.c
diff --git a/arch/arm/include/asm/arch-omap3/gpio.h b/arch/arm/include/asm/arch-omap3/gpio.h
new file mode 100644
index 0000000..fdeeadb
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap3/gpio.h
@@ -0,0 +1 @@
+/* gpio.h */
diff --git a/arch/arm/include/asm/arch-omap4/gpio.h b/arch/arm/include/asm/arch-omap4/gpio.h
new file mode 100644
index 0000000..fdeeadb
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap4/gpio.h
@@ -0,0 +1 @@
+/* gpio.h */
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 62ec97d..f9bef58 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_MARVELL_MFP) += mvmfp.o
COBJS-$(CONFIG_MXC_GPIO) += mxc_gpio.o
COBJS-$(CONFIG_PCA953X) += pca953x.o
COBJS-$(CONFIG_S5P) += s5p_gpio.o
+COBJS-$(CONFIG_OMAP_GPIO) += omap_gpio.o
COBJS-$(CONFIG_TEGRA2_GPIO) += tegra2_gpio.o
COBJS-$(CONFIG_DA8XX_GPIO) += da8xx_gpio.o
diff --git a/drivers/gpio/omap_gpio.c b/drivers/gpio/omap_gpio.c
new file mode 100644
index 0000000..4873065
--- /dev/null
+++ b/drivers/gpio/omap_gpio.c
@@ -0,0 +1,69 @@
+/*
+ * Adapter to OMAP GPIO handling.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/omap_gpio.h>
+
+/*
+ * Generic_GPIO primitives.
+ */
+
+int gpio_request(int gp, const char *label)
+{
+ return omap_request_gpio(gp);
+}
+
+void gpio_free(int gp)
+{
+}
+
+/* set GPIO pin 'gp' as an input */
+int gpio_direction_input(int gp)
+{
+ omap_set_gpio_direction(gp, 1);
+ return 0;
+}
+
+void gpio_toggle_value(int gp)
+{
+ omap_set_gpio_dataout(gp, !omap_get_gpio_datain(gp));
+}
+
+/* set GPIO pin 'gp' as an output, with polarity 'value' */
+int gpio_direction_output(int gp, int value)
+{
+ omap_set_gpio_dataout(gp, value);
+ omap_set_gpio_direction(gp, 0);
+ return 0;
+}
+
+/* read GPIO IN value of pin 'gp' */
+int gpio_get_value(int gp)
+{
+ return omap_get_gpio_datain(gp);
+}
+
+/* write GPIO OUT value to pin 'gp' */
+void gpio_set_value(int gp, int value)
+{
+ omap_set_gpio_dataout(gp, value);
+}
--
1.6.0.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* [U-Boot] [PATCH v2 2/2] omap4_panda: Build in cmd_gpio support on panda
2011-08-10 5:17 [U-Boot] [PATCH 1/2] omap3+: Add OMAP support for cmd_gpio Joe Hershberger
@ 2011-08-16 22:17 ` Joe Hershberger
0 siblings, 0 replies; 8+ messages in thread
From: Joe Hershberger @ 2011-08-16 22:17 UTC (permalink / raw)
To: u-boot
Enable the command and the shim driver
Configure the pads to allow access to the button on GPIO_121 and the 2 LEDS on GPIO_7 and GPIO_8
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Sandeep Paulraj <s-paulraj@ti.com>
---
Changes for v2:
board/ti/panda/panda_mux_data.h | 6 +++---
include/configs/omap4_panda.h | 4 ++++
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/board/ti/panda/panda_mux_data.h b/board/ti/panda/panda_mux_data.h
index 16cc0ad..4c9b57e 100644
--- a/board/ti/panda/panda_mux_data.h
+++ b/board/ti/panda/panda_mux_data.h
@@ -115,7 +115,7 @@ const struct pad_conf_entry core_padconf_array_non_essential[] = {
{ABE_CLKS, (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* abe_clks */
{ABE_DMIC_CLK1, (M0)}, /* abe_dmic_clk1 */
{ABE_DMIC_DIN1, (IEN | M0)}, /* abe_dmic_din1 */
- {ABE_DMIC_DIN2, (IEN | M0)}, /* abe_dmic_din2 */
+ {ABE_DMIC_DIN2, (PTU | IEN | M3)}, /* gpio_121 */
{ABE_DMIC_DIN3, (IEN | M0)}, /* abe_dmic_din3 */
{UART2_CTS, (PTU | IEN | M0)}, /* uart2_cts */
{UART2_RTS, (M0)}, /* uart2_rts */
@@ -223,8 +223,8 @@ const struct pad_conf_entry wkup_padconf_array_non_essential[] = {
{PAD0_SYS_BOOT6, (IEN | M3)}, /* gpio_wk9 */
{PAD1_SYS_BOOT7, (IEN | M3)}, /* gpio_wk10 */
{PAD1_FREF_CLK3_REQ, (M3)}, /* gpio_wk30 */
- {PAD1_FREF_CLK4_REQ, (M3)}, /* gpio_wk7 */
- {PAD0_FREF_CLK4_OUT, (M3)}, /* gpio_wk8 */
+ {PAD1_FREF_CLK4_REQ, (IEN | M3)}, /* gpio_wk7 */
+ {PAD0_FREF_CLK4_OUT, (IEN | M3)}, /* gpio_wk8 */
};
#endif /* _SDP4430_MUX_DATA_H */
diff --git a/include/configs/omap4_panda.h b/include/configs/omap4_panda.h
index e313231..f890fc6 100644
--- a/include/configs/omap4_panda.h
+++ b/include/configs/omap4_panda.h
@@ -120,6 +120,10 @@
/* Flash */
#define CONFIG_SYS_NO_FLASH 1
+/* GPIO */
+#define CONFIG_OMAP_GPIO 1
+#define CONFIG_CMD_GPIO 1
+
/* commands to include */
#include <config_cmd_default.h>
--
1.6.0.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-10-12 20:31 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-06 20:45 [U-Boot] [PATCH 1/2] omap: Don't use gpio_free to change direction to input Joe Hershberger
2011-10-06 20:45 ` [U-Boot] [PATCH 2/2] omap4_panda: Build in cmd_gpio support on panda Joe Hershberger
2011-10-06 21:50 ` [U-Boot] [PATCH v2 1/2] omap: Don't use gpio_free to change direction to input Joe Hershberger
2011-10-06 21:50 ` [U-Boot] [PATCH v2 2/2] omap4_panda: Build in cmd_gpio support on panda Joe Hershberger
2011-10-09 10:47 ` Igor Grinberg
2011-10-12 20:31 ` [U-Boot] [PATCH v3 1/2] omap: Don't use gpio_free to change direction to input Joe Hershberger
2011-10-12 20:31 ` [U-Boot] [PATCH v3 2/2] omap4_panda: Build in cmd_gpio support on panda Joe Hershberger
-- strict thread matches above, loose matches on Subject: below --
2011-08-10 5:17 [U-Boot] [PATCH 1/2] omap3+: Add OMAP support for cmd_gpio Joe Hershberger
2011-08-16 22:17 ` [U-Boot] [PATCH v2 2/2] omap4_panda: Build in cmd_gpio support on panda Joe Hershberger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.