Skip to content

Commit 29b416f

Browse files
Ecce_Liscorpiochang
authored andcommitted
ARCH_GPIO_BASE 1000 for I2S short Issue.
Change-Id: I14f5cc906756ef32ed40261fd9fdf6d935a609ff Reviewed-on: https://tp-biosrd-v02/gerrit/81994 Reviewed-by: Scorpio Chang(張志賢) <Scorpio_Chang@asus.com> Tested-by: Scorpio Chang(張志賢) <Scorpio_Chang@asus.com>
1 parent 8a105f6 commit 29b416f

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

drivers/pinctrl/core.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,16 +637,24 @@ static int pinctrl_gpio_direction(unsigned gpio, bool input)
637637
}
638638
#ifdef CONFIG_I2S_SHORT
639639
/* For pin 185 and 186 are shorted.*/
640-
if (gpio == 186)
640+
#ifdef ARCH_GPIO_BASE
641+
if (gpio % 1000 == 186) //% 1000 for ARCH_GPIO_BASE Issue
642+
#else
643+
if (gpio == 186)
644+
#endif
641645
input = true;
642646
#endif
643647
mutex_lock(&pctldev->mutex);
644648

645649
/* Convert to the pin controllers number space */
646650
#ifdef CONFIG_I2S_SHORT
647651
/* For pin 185 and 186 are shorted.*/
652+
#ifdef ARCH_GPIO_BASE
653+
if (gpio % 1000 == 185) { // % 1000 for ARCH_GPIO_BASE Issue
654+
#else
648655
if (gpio == 185) {
649-
pin = gpio_to_pin(range, 186);
656+
#endif
657+
pin = gpio_to_pin(range, gpio + 1);
650658
ret = pinmux_gpio_direction(pctldev, range, pin, true);
651659
}
652660
#endif

drivers/pinctrl/pinctrl-rockchip.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2097,6 +2097,9 @@ static int _rockchip_pmx_gpio_set_direction(struct gpio_chip *chip,
20972097
#ifdef CONFIG_I2S_SHORT
20982098
/* For GPIO 185 and 186 are shorted. */
20992099
gpio_pin = bank->pin_base + pin;
2100+
#ifdef ARCH_GPIO_BASE // % 1000 for ARCH_GPIO_BASE 1000
2101+
gpio_pin = gpio_pin % 1000;
2102+
#endif
21002103
if (gpio_pin == 185 || gpio_pin == 186) {
21012104
ret = rockchip_set_pull(bank, 2, PIN_CONFIG_BIAS_DISABLE);
21022105
if (ret < 0)

0 commit comments

Comments
 (0)