s5pc1xx: support the GPIO interface
PATCH 1/2 s5pc1xx: support the GPIO interface
This patch adds support the GPIO interface
Signed-off-by Minkyu Kang <[email protected]>
--- cpu/arm_cortexa8/s5pc1xx/Makefile | 1 + cpu/arm_cortexa8/s5pc1xx/gpio.c | 143 +++++++++++++++++++++++++++++++++++ include/asm-arm/arch-s5pc1xx/gpio.h | 29 +++++++ 3 files changed, 173 insertions(+), 0 deletions(-) create mode 100644 cpu/arm_cortexa8/s5pc1xx/gpio.c
cpu/arm_cortexa8/s5pc1xx/Makefile +1 -0
@@ -33,6 +33,7 @@ SOBJS += reset.o COBJS += clock.o COBJS += cpu_info.o +COBJS += gpio.o COBJS += timer.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
cpu/arm_cortexa8/s5pc1xx/gpio.c new file +143 -0
143 lines not on this page · raw message
include/asm-arm/arch-s5pc1xx/gpio.h +29 -0
@@ -124,6 +124,35 @@ struct s5pc110_gpio {struct s5pc1xx_gpio_bank gpio_h2;struct s5pc1xx_gpio_bank gpio_h3; }; + +/* functions */ +void gpio_cfg_pin (struct s5pc1xx_gpio_bank *bank,int gpio,int cfg); +void gpio_direction_output (struct s5pc1xx_gpio_bank *bank,int gpio,int en); +void gpio_direction_input (struct s5pc1xx_gpio_bank *bank,int gpio); +void gpio_set_value (struct s5pc1xx_gpio_bank *bank,int gpio,int en); +unsigned int gpio_get_value (struct s5pc1xx_gpio_bank *bank,int gpio); +void gpio_set_pull (struct s5pc1xx_gpio_bank *bank,int gpio,int mode); +void gpio_set_drv (struct s5pc1xx_gpio_bank *bank,int gpio,int mode); +void gpio_set_rate (struct s5pc1xx_gpio_bank *bank,int gpio,int mode);#endif +/* Pin configurations */ +#define GPIO_INPUT 0x0 +#define GPIO_OUTPUT 0x1 +#define GPIO_IRQ 0xf +#define GPIO_FUNC (x) (x) + +/* Pull mode */ +#define GPIO_PULL_NONE 0x0 +#define GPIO_PULL_DOWN 0x1 +#define GPIO_PULL_UP 0x2 + +/* Drive Strength level */ +#define GPIO_DRV_1X 0x0 +#define GPIO_DRV_2X 0x1 +#define GPIO_DRV_3X 0x2 +#define GPIO_DRV_4X 0x3 +#define GPIO_DRV_FAST 0x0 +#define GPIO_DRV_SLOW 0x1 +#endif
Signature · 1 line
1.5.4.3
PATCH 1/2 s5pc1xx: support the GPIO interface
Quoted 10 lines · Minkyu Kang
This patch adds support the GPIO interface
Signed-off-by Minkyu Kang <[email protected]>---
?cpu/arm_cortexa8/s5pc1xx/Makefile ? | ? ?1 + ?cpu/arm_cortexa8/s5pc1xx/gpio.c ? ? | ?143 +++++++++++++++++++++++++++++++++++ ?include/asm-arm/arch-s5pc1xx/gpio.h | ? 29 +++++++?3 files changed, 173 insertions(+), 0 deletions(-) ?create mode 100644
cpu/arm_cortexa8/s5pc1xx/gpio.c
applied to u-boot-samsung
Minkyu Kang
Signature · 2 lines
from. prom. www.promsoft.net