Skip to content

Commit 7c40b25

Browse files
Ecce_Liscorpiochang
authored andcommitted
Issue 185 and 186 are shorted and avoid 186 setting output high.
Change-Id: I551aa172107eedf54d6175f8b3304889012330e6 Reviewed-on: https://tp-biosrd-v02/gerrit/81549 Reviewed-by: Scorpio Chang(張志賢) <Scorpio_Chang@asus.com> Tested-by: Scorpio Chang(張志賢) <Scorpio_Chang@asus.com>
1 parent 27a4990 commit 7c40b25

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

drivers/pinctrl/core.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,15 +635,21 @@ static int pinctrl_gpio_direction(unsigned gpio, bool input)
635635
if (ret) {
636636
return ret;
637637
}
638-
638+
/* For pin 185 and 186 are shorted.*/
639+
if (gpio == 186) {
640+
input = true;
641+
}
639642
mutex_lock(&pctldev->mutex);
640643

641644
/* Convert to the pin controllers number space */
645+
if (gpio == 185) {
646+
pin = gpio_to_pin(range, 186);
647+
ret = pinmux_gpio_direction(pctldev, range, pin, true);
648+
}
642649
pin = gpio_to_pin(range, gpio);
643650
ret = pinmux_gpio_direction(pctldev, range, pin, input);
644651

645652
mutex_unlock(&pctldev->mutex);
646-
647653
return ret;
648654
}
649655

drivers/pinctrl/pinctrl-rockchip.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,11 +2071,12 @@ static int _rockchip_pmx_gpio_set_direction(struct gpio_chip *chip,
20712071
u32 data;
20722072

20732073
bank = gc_to_pin_bank(chip);
2074-
20752074
ret = rockchip_set_mux(bank, pin, RK_FUNC_GPIO);
20762075
if (ret < 0)
20772076
return ret;
2078-
2077+
/* For pin 185 and 186 are shorted. */
2078+
if (bank->pin_base + pin == 186)
2079+
input = true;
20792080
//clk_enable(bank->clk);
20802081
raw_spin_lock_irqsave(&bank->slock, flags);
20812082

@@ -2085,8 +2086,9 @@ static int _rockchip_pmx_gpio_set_direction(struct gpio_chip *chip,
20852086
data |= BIT(pin);
20862087
else
20872088
data &= ~BIT(pin);
2089+
if (bank->pin_base + pin == 185)
2090+
data &= ~BIT(2);
20882091
writel_relaxed(data, bank->reg_base + GPIO_SWPORT_DDR);
2089-
20902092
raw_spin_unlock_irqrestore(&bank->slock, flags);
20912093
//clk_disable(bank->clk);
20922094

0 commit comments

Comments
 (0)