This is a note to let you know that I've just added the patch titled pinctrl: armada-37xx: Correct PWM pins definitions to the 4.14-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-armada-37xx-correct-pwm-pins-definitions.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Mon Nov 29 01:32:04 PM CET 2021 From: "Marek Behún" <kabel@xxxxxxxxxx> Date: Wed, 24 Nov 2021 23:49:31 +0100 Subject: pinctrl: armada-37xx: Correct PWM pins definitions To: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Sasha Levin <sashal@xxxxxxxxxx> Cc: pali@xxxxxxxxxx, stable@xxxxxxxxxxxxxxx, "Marek Behún" <kabel@xxxxxxxxxx>, "Rob Herring" <robh@xxxxxxxxxx>, "Linus Walleij" <linus.walleij@xxxxxxxxxx> Message-ID: <20211124224933.24275-23-kabel@xxxxxxxxxx> From: "Marek Behún" <kabel@xxxxxxxxxx> commit baf8d6899b1e8906dc076ef26cc633e96a8bb0c3 upstream. The PWM pins on North Bridge on Armada 37xx can be configured into PWM or GPIO functions. When in PWM function, each pin can also be configured to drive low on 0 and tri-state on 1 (LED mode). The current definitions handle this by declaring two pin groups for each pin: - group "pwmN" with functions "pwm" and "gpio" - group "ledN_od" ("od" for open drain) with functions "led" and "gpio" This is semantically incorrect. The correct definition for each pin should be one group with three functions: "pwm", "led" and "gpio". Change the "pwmN" groups to support "led" function. Remove "ledN_od" groups. This cannot break backwards compatibility with older device trees: no device tree uses it since there is no PWM driver for this SOC yet. Also "ledN_od" groups are not even documented. Fixes: b835d6953009 ("pinctrl: armada-37xx: swap polarity on LED group") Signed-off-by: Marek Behún <kabel@xxxxxxxxxx> Acked-by: Rob Herring <robh@xxxxxxxxxx> Link: https://lore.kernel.org/r/20210719112938.27594-1-kabel@xxxxxxxxxx Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx> Signed-off-by: Marek Behún <kabel@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- Documentation/devicetree/bindings/pinctrl/marvell,armada-37xx-pinctrl.txt | 8 ++-- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 17 ++++------ 2 files changed, 12 insertions(+), 13 deletions(-) --- a/Documentation/devicetree/bindings/pinctrl/marvell,armada-37xx-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/marvell,armada-37xx-pinctrl.txt @@ -43,19 +43,19 @@ group emmc_nb group pwm0 - pin 11 (GPIO1-11) - - functions pwm, gpio + - functions pwm, led, gpio group pwm1 - pin 12 - - functions pwm, gpio + - functions pwm, led, gpio group pwm2 - pin 13 - - functions pwm, gpio + - functions pwm, led, gpio group pwm3 - pin 14 - - functions pwm, gpio + - functions pwm, led, gpio group pmic1 - pin 7 --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c @@ -153,10 +153,14 @@ static struct armada_37xx_pin_group arma PIN_GRP_GPIO("jtag", 20, 5, BIT(0), "jtag"), PIN_GRP_GPIO("sdio0", 8, 3, BIT(1), "sdio"), PIN_GRP_GPIO("emmc_nb", 27, 9, BIT(2), "emmc"), - PIN_GRP_GPIO("pwm0", 11, 1, BIT(3), "pwm"), - PIN_GRP_GPIO("pwm1", 12, 1, BIT(4), "pwm"), - PIN_GRP_GPIO("pwm2", 13, 1, BIT(5), "pwm"), - PIN_GRP_GPIO("pwm3", 14, 1, BIT(6), "pwm"), + PIN_GRP_GPIO_3("pwm0", 11, 1, BIT(3) | BIT(20), 0, BIT(20), BIT(3), + "pwm", "led"), + PIN_GRP_GPIO_3("pwm1", 12, 1, BIT(4) | BIT(21), 0, BIT(21), BIT(4), + "pwm", "led"), + PIN_GRP_GPIO_3("pwm2", 13, 1, BIT(5) | BIT(22), 0, BIT(22), BIT(5), + "pwm", "led"), + PIN_GRP_GPIO_3("pwm3", 14, 1, BIT(6) | BIT(23), 0, BIT(23), BIT(6), + "pwm", "led"), PIN_GRP_GPIO("pmic1", 7, 1, BIT(7), "pmic"), PIN_GRP_GPIO("pmic0", 6, 1, BIT(8), "pmic"), PIN_GRP_GPIO("i2c2", 2, 2, BIT(9), "i2c"), @@ -170,11 +174,6 @@ static struct armada_37xx_pin_group arma PIN_GRP_EXTRA("uart2", 9, 2, BIT(1) | BIT(13) | BIT(14) | BIT(19), BIT(1) | BIT(13) | BIT(14), BIT(1) | BIT(19), 18, 2, "gpio", "uart"), - PIN_GRP_GPIO_2("led0_od", 11, 1, BIT(20), BIT(20), 0, "led"), - PIN_GRP_GPIO_2("led1_od", 12, 1, BIT(21), BIT(21), 0, "led"), - PIN_GRP_GPIO_2("led2_od", 13, 1, BIT(22), BIT(22), 0, "led"), - PIN_GRP_GPIO_2("led3_od", 14, 1, BIT(23), BIT(23), 0, "led"), - }; static struct armada_37xx_pin_group armada_37xx_sb_groups[] = { Patches currently in stable-queue which might be from kabel@xxxxxxxxxx are queue-4.14/pci-aardvark-move-pcie-reset-card-code-to-advk_pcie_train_link.patch queue-4.14/pci-aardvark-introduce-an-advk_pcie_valid_device-helper.patch queue-4.14/pci-aardvark-update-comment-about-disabling-link-training.patch queue-4.14/pci-aardvark-train-link-immediately-after-enabling-training.patch queue-4.14/arm64-dts-marvell-armada-37xx-declare-pcie-reset-pin.patch queue-4.14/pci-aardvark-replace-custom-macros-by-standard-linux-pci_regs.h-macros.patch queue-4.14/pci-aardvark-fix-a-leaked-reference-by-adding-missing-of_node_put.patch queue-4.14/pci-aardvark-fix-pcie-max-payload-size-setting.patch queue-4.14/pinctrl-armada-37xx-correct-pwm-pins-definitions.patch queue-4.14/arm64-dts-marvell-armada-37xx-set-pcie_reset_pin-to-gpio-function.patch queue-4.14/pci-aardvark-configure-pcie-resources-from-ranges-dt-property.patch queue-4.14/pci-aardvark-improve-link-training.patch queue-4.14/pci-aardvark-fix-link-training.patch queue-4.14/pci-aardvark-fix-checking-for-link-up-via-ltssm-state.patch queue-4.14/pci-aardvark-issue-perst-via-gpio.patch queue-4.14/pinctrl-armada-37xx-correct-mpp-definitions.patch queue-4.14/pci-add-pci_exp_lnkctl2_tls-macros.patch queue-4.14/pci-aardvark-wait-for-endpoint-to-be-ready-before-training-link.patch queue-4.14/pinctrl-armada-37xx-add-missing-pin-pcie1-wakeup.patch queue-4.14/pci-aardvark-fix-compilation-on-s390.patch queue-4.14/pci-aardvark-fix-i-o-space-page-leak.patch queue-4.14/pci-aardvark-don-t-touch-pcie-registers-if-no-card-connected.patch queue-4.14/pci-aardvark-remove-pcie-outbound-window-configuration.patch queue-4.14/pci-aardvark-indicate-error-in-val-when-config-read-fails.patch