Merge tag 'pinctrl-v5.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control fixes from Linus Walleij:
"Some pin control fixes here. All of them are driver fixes, the Intel
Cherryview being the most interesting one.

- Fix a mux problem for I2C in the MVEBU driver.

- Fix a really hairy inversion problem in the Intel Cherryview
driver.

- Fix the register for the sdc2_clk in the Qualcomm SM8250 driver.

- Check the virtual GPIO boot failur in the Mediatek driver"

* tag 'pinctrl-v5.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
pinctrl: mediatek: check mtk_is_virt_gpio input parameter
pinctrl: qcom: sm8250: correct sdc2_clk
pinctrl: cherryview: Preserve CHV_PADCTRL1_INVRXTX_TXDATA flag on GPIOs
pinctrl: mvebu: Fix i2c sda definition for 98DX3236

+19 -3
+13 -1
drivers/pinctrl/intel/pinctrl-cherryview.c
··· 58 #define CHV_PADCTRL1_CFGLOCK BIT(31) 59 #define CHV_PADCTRL1_INVRXTX_SHIFT 4 60 #define CHV_PADCTRL1_INVRXTX_MASK GENMASK(7, 4) 61 #define CHV_PADCTRL1_INVRXTX_RXDATA BIT(6) 62 #define CHV_PADCTRL1_INVRXTX_TXENABLE BIT(5) 63 #define CHV_PADCTRL1_ODEN BIT(3) ··· 793 static void chv_gpio_clear_triggering(struct chv_pinctrl *pctrl, 794 unsigned int offset) 795 { 796 u32 value; 797 798 value = chv_readl(pctrl, offset, CHV_PADCTRL1); 799 value &= ~CHV_PADCTRL1_INTWAKECFG_MASK; 800 - value &= ~CHV_PADCTRL1_INVRXTX_MASK; 801 chv_writel(pctrl, offset, CHV_PADCTRL1, value); 802 } 803
··· 58 #define CHV_PADCTRL1_CFGLOCK BIT(31) 59 #define CHV_PADCTRL1_INVRXTX_SHIFT 4 60 #define CHV_PADCTRL1_INVRXTX_MASK GENMASK(7, 4) 61 + #define CHV_PADCTRL1_INVRXTX_TXDATA BIT(7) 62 #define CHV_PADCTRL1_INVRXTX_RXDATA BIT(6) 63 #define CHV_PADCTRL1_INVRXTX_TXENABLE BIT(5) 64 #define CHV_PADCTRL1_ODEN BIT(3) ··· 792 static void chv_gpio_clear_triggering(struct chv_pinctrl *pctrl, 793 unsigned int offset) 794 { 795 + u32 invrxtx_mask = CHV_PADCTRL1_INVRXTX_MASK; 796 u32 value; 797 + 798 + /* 799 + * One some devices the GPIO should output the inverted value from what 800 + * device-drivers / ACPI code expects (inverted external buffer?). The 801 + * BIOS makes this work by setting the CHV_PADCTRL1_INVRXTX_TXDATA flag, 802 + * preserve this flag if the pin is already setup as GPIO. 803 + */ 804 + value = chv_readl(pctrl, offset, CHV_PADCTRL0); 805 + if (value & CHV_PADCTRL0_GPIOEN) 806 + invrxtx_mask &= ~CHV_PADCTRL1_INVRXTX_TXDATA; 807 808 value = chv_readl(pctrl, offset, CHV_PADCTRL1); 809 value &= ~CHV_PADCTRL1_INTWAKECFG_MASK; 810 + value &= ~invrxtx_mask; 811 chv_writel(pctrl, offset, CHV_PADCTRL1, value); 812 } 813
+4
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
··· 259 260 desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio_n]; 261 262 if (desc->funcs && !desc->funcs[desc->eint.eint_m].name) 263 virt_gpio = true; 264
··· 259 260 desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio_n]; 261 262 + /* if the GPIO is not supported for eint mode */ 263 + if (desc->eint.eint_m == NO_EINT_SUPPORT) 264 + return virt_gpio; 265 + 266 if (desc->funcs && !desc->funcs[desc->eint.eint_m].name) 267 virt_gpio = true; 268
+1 -1
drivers/pinctrl/mvebu/pinctrl-armada-xp.c
··· 414 MPP_VAR_FUNCTION(0x1, "i2c0", "sck", V_98DX3236_PLUS)), 415 MPP_MODE(15, 416 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS), 417 - MPP_VAR_FUNCTION(0x4, "i2c0", "sda", V_98DX3236_PLUS)), 418 MPP_MODE(16, 419 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS), 420 MPP_VAR_FUNCTION(0x4, "dev", "oe", V_98DX3236_PLUS)),
··· 414 MPP_VAR_FUNCTION(0x1, "i2c0", "sck", V_98DX3236_PLUS)), 415 MPP_MODE(15, 416 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS), 417 + MPP_VAR_FUNCTION(0x1, "i2c0", "sda", V_98DX3236_PLUS)), 418 MPP_MODE(16, 419 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS), 420 MPP_VAR_FUNCTION(0x4, "dev", "oe", V_98DX3236_PLUS)),
+1 -1
drivers/pinctrl/qcom/pinctrl-sm8250.c
··· 1308 [178] = PINGROUP(178, WEST, _, _, _, _, _, _, _, _, _), 1309 [179] = PINGROUP(179, WEST, _, _, _, _, _, _, _, _, _), 1310 [180] = UFS_RESET(ufs_reset, 0xb8000), 1311 - [181] = SDC_PINGROUP(sdc2_clk, 0x7000, 14, 6), 1312 [182] = SDC_PINGROUP(sdc2_cmd, 0xb7000, 11, 3), 1313 [183] = SDC_PINGROUP(sdc2_data, 0xb7000, 9, 0), 1314 };
··· 1308 [178] = PINGROUP(178, WEST, _, _, _, _, _, _, _, _, _), 1309 [179] = PINGROUP(179, WEST, _, _, _, _, _, _, _, _, _), 1310 [180] = UFS_RESET(ufs_reset, 0xb8000), 1311 + [181] = SDC_PINGROUP(sdc2_clk, 0xb7000, 14, 6), 1312 [182] = SDC_PINGROUP(sdc2_cmd, 0xb7000, 11, 3), 1313 [183] = SDC_PINGROUP(sdc2_data, 0xb7000, 9, 0), 1314 };