nios2: add gpio_free
PATCH 1/1 nios2: add gpio_free
--- arch/nios2/include/asm/gpio.h | 6 ++++++ board/altera/nios2-generic/gpio.c | 5 +++++ 2 files changed, 11 insertions(+), 0 deletions(-)
arch/nios2/include/asm/gpio.h +6 -0
@@ -26,6 +26,11 @@ static inline int gpio_request(unsigned gpio, const char *label)return 0 ; } +static inline int gpio_free (unsigned gpio) +{ +return 0 ; +} +static inline int gpio_direction_input (unsigned gpio) {writel (1 ,CONFIG_SYS_GPIO_BASE + (gpio <<2 ));
@@ -49,6 +54,7 @@ static inline void gpio_set_value(unsigned gpio, int value) }#else extern int gpio_request (unsigned gpio,const char *label); +extern int gpio_free (unsigned gpio);extern int gpio_direction_input (unsigned gpio);extern int gpio_direction_output (unsigned gpio,int value);extern int gpio_get_value (unsigned gpio);
board/altera/nios2-generic/gpio.c +5 -0
@@ -20,6 +20,11 @@ int gpio_request(unsigned gpio, const char *label)return 0 ; } +int gpio_free (unsigned gpio) +{ +return 0 ; +} +int gpio_direction_input (unsigned gpio) {u32 mask =1 << gpio;
Signature · 1 line
1.7.3.4
PATCH 1/1 nios2: add gpio_free
Dear Thomas Chou,
Quoted 5 lines · In message <[email protected]> you wrote:
Signed-off-by Thomas Chou <[email protected]>--- arch/nios2/include/asm/gpio.h | 6 ++++++ board/altera/nios2-generic/gpio.c | 5 +++++ 2 files changed, 11 insertions(+), 0 deletions(-)
What is this needed for? I don;t see any callers, and the code doesn't do anything useful?
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is dangerous to be sincere unless you are also stupid.
- George Bernard ShawPATCH 1/1 nios2: add gpio_free
Quoted 9 lines · Wolfgang Denk
Quoted 5 lines · Thomas Chou
Signed-off-by Thomas Chou <[email protected]>---
?arch/nios2/include/asm/gpio.h ? ? | ? ?6 ++++++ ?board/altera/nios2-generic/gpio.c | ? ?5 +++++ ?2 files changed, 11 insertions(+), 0 deletions(-)What is this needed for? ?I don;t see any callers, and the code doesn't do anything useful?
it's part of the standard GPIO API, his new OpenCores tiny_spi driver is using it, and cmd_gpio.c uses it (which is planning on moving to common code once i remove the tiny Blackfin-specific piece). -mike
PATCH 1/1 nios2: add gpio_free
In reply to Thomas ChouAdded to: git://git.denx.de/u-boot-nios.git 'next'
Thank you,
--Scott
Quoted 46 lines · Thomas Chou
Signed-off-by Thomas Chou <[email protected]>--- arch/nios2/include/asm/gpio.h | 6 ++++++ board/altera/nios2-generic/gpio.c | 5 +++++ 2 files changed, 11 insertions(+), 0 deletions(-)arch/nios2/include/asm/gpio.h +6
-0@@ -26,6 +26,11 @@ static inline int gpio_request(unsigned gpio, const char *label)return 0 ; } +static inline int gpio_free (unsigned gpio) +{ +return 0 ; +} +static inline int gpio_direction_input (unsigned gpio) {writel (1 ,CONFIG_SYS_GPIO_BASE + (gpio <<2 ));@@ -49,6 +54,7 @@ static inline void gpio_set_value(unsigned gpio, int value) }#else extern int gpio_request (unsigned gpio,const char *label); +extern int gpio_free (unsigned gpio);extern int gpio_direction_input (unsigned gpio);extern int gpio_direction_output (unsigned gpio,int value);extern int gpio_get_value (unsigned gpio);board/altera/nios2-generic/gpio.c +5
-0@@ -20,6 +20,11 @@ int gpio_request(unsigned gpio, const char *label)return 0 ; } +int gpio_free (unsigned gpio) +{ +return 0 ; +} +int gpio_direction_input (unsigned gpio) {u32 mask =1 << gpio;