This is a note to let you know that I've just added the patch titled pinctrl: qcom: lpass-lpi: set output value before enabling output to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: pinctrl-qcom-lpass-lpi-set-output-value-before-enabling-output.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 163bfb0cb1f6fbf961cf912cbde57399ea1ae0e8 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx> Date: Thu, 9 Mar 2023 16:49:46 +0100 Subject: pinctrl: qcom: lpass-lpi: set output value before enabling output From: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx> commit 163bfb0cb1f6fbf961cf912cbde57399ea1ae0e8 upstream. As per Hardware Programming Guide, when configuring pin as output, set the pin value before setting output-enable (OE). Similar approach is in main SoC TLMM pin controller. Cc: <stable@xxxxxxxxxxxxxxx> Fixes: 6e261d1090d6 ("pinctrl: qcom: Add sm8250 lpass lpi pinctrl driver") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx> Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxx> Link: https://lore.kernel.org/r/20230309154949.658380-1-krzysztof.kozlowski@xxxxxxxxxx Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) --- a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c +++ b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c @@ -452,6 +452,15 @@ static int lpi_config_set(struct pinctrl } } + /* + * As per Hardware Programming Guide, when configuring pin as output, + * set the pin value before setting output-enable (OE). + */ + if (output_enabled) { + val = u32_encode_bits(value ? 1 : 0, LPI_GPIO_VALUE_OUT_MASK); + lpi_gpio_write(pctrl, group, LPI_GPIO_VALUE_REG, val); + } + val = lpi_gpio_read(pctrl, group, LPI_GPIO_CFG_REG); u32p_replace_bits(&val, pullup, LPI_GPIO_PULL_MASK); @@ -461,11 +470,6 @@ static int lpi_config_set(struct pinctrl lpi_gpio_write(pctrl, group, LPI_GPIO_CFG_REG, val); - if (output_enabled) { - val = u32_encode_bits(value ? 1 : 0, LPI_GPIO_VALUE_OUT_MASK); - lpi_gpio_write(pctrl, group, LPI_GPIO_VALUE_REG, val); - } - return 0; } Patches currently in stable-queue which might be from krzysztof.kozlowski@xxxxxxxxxx are queue-5.15/soundwire-qcom-correct-setting-ignore-bit-on-v1.5.1.patch queue-5.15/pinctrl-qcom-lpass-lpi-set-output-value-before-enabling-output.patch