Skip to content

Commit 0f562b7

Browse files
mmindbrgl
authored andcommitted
gpio/rockchip: extended debounce support is only available on v2
The gpio driver runs into issues on v1 gpio blocks, as the db_clk and the whole extended debounce support is only ever defined on v2. So checking for the IS_ERR on the db_clk is not enough, as it will be NULL on v1. Fix this by adding the needed condition for v2 first before checking the existence of the db_clk. This caused my rk3288-veyron-pinky to enter a reboot loop when it tried to enable the power-key as adc-key device. Fixes: 3bcbd1a ("gpio/rockchip: support next version gpio controller") Signed-off-by: Heiko Stuebner <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent f6c35df commit 0f562b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpio/gpio-rockchip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ static int rockchip_gpio_set_debounce(struct gpio_chip *gc,
195195
unsigned int cur_div_reg;
196196
u64 div;
197197

198-
if (!IS_ERR(bank->db_clk)) {
198+
if (bank->gpio_type == GPIO_TYPE_V2 && !IS_ERR(bank->db_clk)) {
199199
div_debounce_support = true;
200200
freq = clk_get_rate(bank->db_clk);
201201
max_debounce = (GENMASK(23, 0) + 1) * 2 * 1000000 / freq;

0 commit comments

Comments
 (0)