omap: Don't use gpio_free to change direction to input
PATCH 1/2 omap: Don't use gpio_free to change direction to input
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.
--- 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(-)
arch/arm/cpu/armv7/omap-common/gpio.c +0 -7
@@ -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 ); }
board/logicpd/zoom2/debug_board.c +0 -1
@@ -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)
board/logicpd/zoom2/zoom2.c +0 -1
@@ -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 ;
board/overo/overo.c +1 -6
@@ -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 ;
board/ti/beagle/beagle.c +0 -6
@@ -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; }
Signature · 1 line
1.6.0.2
PATCH 2/2 omap4_panda: Build in cmd_gpio support on panda
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
--- board/ti/panda/panda_mux_data.h | 3 +++ include/configs/omap4_panda.h | 3 +++ 2 files changed, 6 insertions(+), 0 deletions(-)
board/ti/panda/panda_mux_data.h +3 -0
@@ -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_ */
include/configs/omap4_panda.h +3 -0
@@ -35,6 +35,9 @@#include <configs/omap4_common.h> +/* GPIO */ +#define CONFIG_CMD_GPIO 1 +/* ENV related config options */ #define CONFIG_ENV_IS_NOWHERE
Signature · 1 line
1.6.0.2
PATCH v2 1/2 omap: Don't use gpio_free to change direction to input
In reply to Joe Hershbergergpio_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.
---
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(-)
arch/arm/cpu/armv7/omap-common/gpio.c +0 -7
@@ -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 ); }
board/logicpd/zoom2/debug_board.c +0 -1
@@ -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)
board/logicpd/zoom2/zoom2.c +0 -1
@@ -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 ;
board/overo/overo.c +1 -6
@@ -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 ;
board/ti/beagle/beagle.c +0 -6
@@ -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; }
Signature · 1 line
1.6.0.2
PATCH v2 2/2 omap4_panda: Build in cmd_gpio support on panda
In reply to Joe HershbergerEnable the gpio command
---
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(-)
board/ti/panda/panda_mux_data.h +1 -1
@@ -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 */
include/configs/omap4_panda.h +3 -0
@@ -35,6 +35,9 @@#include <configs/omap4_common.h> +/* GPIO */ +#define CONFIG_CMD_GPIO 1 +/* ENV related config options */ #define CONFIG_ENV_IS_NOWHERE
Signature · 1 line
1.6.0.2
PATCH v2 2/2 omap4_panda: Build in cmd_gpio support on panda
Hi Joe,
Quoted 31 lines · Joe Hershberger
Enable the gpio command
Signed-off-by Joe Hershberger <[email protected]>Cc Joe Hershberger <[email protected]>Cc Sandeep Paulraj <[email protected]>---
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(-)board/ti/panda/panda_mux_data.h +1
-1@@ -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 */include/configs/omap4_panda.h +0
-0
include/configs/omap4_panda.h line 39
Quoted 5 lines
include/configs/omap4_panda.h +2
-0@@ -35,6 +35,9 @@#include <configs/omap4_common.h> +/* GPIO */ +#define CONFIG_CMD_GPIO 1
Boolean defines should not have a value.
Signature · 2 lines
Regards, Igor.
PATCH v3 1/2 omap: Don't use gpio_free to change direction to input
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.
---
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(-)
arch/arm/cpu/armv7/omap-common/gpio.c +0 -7
@@ -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 ); }
board/logicpd/zoom2/debug_board.c +0 -1
@@ -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)
board/logicpd/zoom2/zoom2.c +0 -1
@@ -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 ;
board/overo/overo.c +1 -6
@@ -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 ;
board/ti/beagle/beagle.c +0 -6
@@ -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; }
Signature · 1 line
1.6.0.2
PATCH v3 2/2 omap4_panda: Build in cmd_gpio support on panda
In reply to Igor GrinbergEnable the gpio command
---
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(-)
include/configs/omap4_panda.h +3 -0
@@ -35,6 +35,9 @@#include <configs/omap4_common.h> +/* GPIO */ +#define CONFIG_CMD_GPIO +/* ENV related config options */ #define CONFIG_ENV_IS_NOWHERE
Signature · 1 line
1.6.0.2