Skip to content

Commit db8ea24

Browse files
antoniprzybyliksamueldr
authored andcommitted
rk_gpio: Added spl_gpio_input method
This patch adds spl_gpio_input method for rk_gpio. Signed-off-by: Antoni Przybylik <antoni.przybylik@wp.pl>
1 parent 05aa651 commit db8ea24

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

drivers/gpio/rk_gpio.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,18 @@ int spl_gpio_set_pull(void *vregs, uint gpio, int pull)
160160
return 0;
161161
}
162162

163+
int spl_gpio_input(void *vregs, uint gpio)
164+
{
165+
struct rockchip_gpio_regs * const regs = vregs;
166+
167+
clrsetbits_le32(&regs->swport_dr, 1 << gpio, 0);
168+
169+
/* Set direction */
170+
clrsetbits_le32(&regs->swport_ddr, 1 << gpio, 0);
171+
172+
return 0;
173+
}
174+
163175
int spl_gpio_output(void *vregs, uint gpio, int value)
164176
{
165177
struct rockchip_gpio_regs * const regs = vregs;

0 commit comments

Comments
 (0)