1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <soc/addressmap.h>
10 struct rockchip_gpio_regs
*gpio_port
[] = {
11 (struct rockchip_gpio_regs
*)GPIO0_BASE
,
12 (struct rockchip_gpio_regs
*)GPIO1_BASE
,
13 (struct rockchip_gpio_regs
*)GPIO2_BASE
,
14 (struct rockchip_gpio_regs
*)GPIO3_BASE
,
15 (struct rockchip_gpio_regs
*)GPIO4_BASE
,
16 (struct rockchip_gpio_regs
*)GPIO5_BASE
,
17 (struct rockchip_gpio_regs
*)GPIO6_BASE
,
18 (struct rockchip_gpio_regs
*)GPIO7_BASE
,
19 (struct rockchip_gpio_regs
*)GPIO8_BASE
22 #define PMU_GPIO_PORT 0
24 int is_pmu_gpio(gpio_t gpio
)
26 if (gpio
.port
== PMU_GPIO_PORT
)
31 void *gpio_grf_reg(gpio_t gpio
)
33 if (is_pmu_gpio(gpio
))
34 return &rk3288_pmu
->gpio0pull
[gpio
.bank
];
35 /* There is one pmu gpio, gpio0, so " - 1" */
36 return &rk3288_grf
->gpio1_p
[(gpio
.port
- 1)][gpio
.bank
];
39 u32
gpio_get_pull_val(gpio_t gpio
, enum gpio_pull pull
)
41 /* use the default gpio pull bias setting defined in soc/gpio.h */