Skip to content

Commit 7c183f5

Browse files
elkablosmb49
authored andcommitted
pinctrl: armada-37xx: Correct PWM pins definitions
BugLink: https://bugs.launchpad.net/bugs/1956380 commit baf8d68 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: b835d69 ("pinctrl: armada-37xx: swap polarity on LED group") Signed-off-by: Marek Behún <kabel@kernel.org> Acked-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210719112938.27594-1-kabel@kernel.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 8783202 commit 7c183f5

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

Documentation/devicetree/bindings/pinctrl/marvell,armada-37xx-pinctrl.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ group emmc_nb
4343

4444
group pwm0
4545
- pin 11 (GPIO1-11)
46-
- functions pwm, gpio
46+
- functions pwm, led, gpio
4747

4848
group pwm1
4949
- pin 12
50-
- functions pwm, gpio
50+
- functions pwm, led, gpio
5151

5252
group pwm2
5353
- pin 13
54-
- functions pwm, gpio
54+
- functions pwm, led, gpio
5555

5656
group pwm3
5757
- pin 14
58-
- functions pwm, gpio
58+
- functions pwm, led, gpio
5959

6060
group pmic1
6161
- pin 7

drivers/pinctrl/mvebu/pinctrl-armada-37xx.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,14 @@ static struct armada_37xx_pin_group armada_37xx_nb_groups[] = {
166166
PIN_GRP_GPIO("jtag", 20, 5, BIT(0), "jtag"),
167167
PIN_GRP_GPIO("sdio0", 8, 3, BIT(1), "sdio"),
168168
PIN_GRP_GPIO("emmc_nb", 27, 9, BIT(2), "emmc"),
169-
PIN_GRP_GPIO("pwm0", 11, 1, BIT(3), "pwm"),
170-
PIN_GRP_GPIO("pwm1", 12, 1, BIT(4), "pwm"),
171-
PIN_GRP_GPIO("pwm2", 13, 1, BIT(5), "pwm"),
172-
PIN_GRP_GPIO("pwm3", 14, 1, BIT(6), "pwm"),
169+
PIN_GRP_GPIO_3("pwm0", 11, 1, BIT(3) | BIT(20), 0, BIT(20), BIT(3),
170+
"pwm", "led"),
171+
PIN_GRP_GPIO_3("pwm1", 12, 1, BIT(4) | BIT(21), 0, BIT(21), BIT(4),
172+
"pwm", "led"),
173+
PIN_GRP_GPIO_3("pwm2", 13, 1, BIT(5) | BIT(22), 0, BIT(22), BIT(5),
174+
"pwm", "led"),
175+
PIN_GRP_GPIO_3("pwm3", 14, 1, BIT(6) | BIT(23), 0, BIT(23), BIT(6),
176+
"pwm", "led"),
173177
PIN_GRP_GPIO("pmic1", 7, 1, BIT(7), "pmic"),
174178
PIN_GRP_GPIO("pmic0", 6, 1, BIT(8), "pmic"),
175179
PIN_GRP_GPIO("i2c2", 2, 2, BIT(9), "i2c"),
@@ -183,11 +187,6 @@ static struct armada_37xx_pin_group armada_37xx_nb_groups[] = {
183187
PIN_GRP_EXTRA("uart2", 9, 2, BIT(1) | BIT(13) | BIT(14) | BIT(19),
184188
BIT(1) | BIT(13) | BIT(14), BIT(1) | BIT(19),
185189
18, 2, "gpio", "uart"),
186-
PIN_GRP_GPIO_2("led0_od", 11, 1, BIT(20), BIT(20), 0, "led"),
187-
PIN_GRP_GPIO_2("led1_od", 12, 1, BIT(21), BIT(21), 0, "led"),
188-
PIN_GRP_GPIO_2("led2_od", 13, 1, BIT(22), BIT(22), 0, "led"),
189-
PIN_GRP_GPIO_2("led3_od", 14, 1, BIT(23), BIT(23), 0, "led"),
190-
191190
};
192191

193192
static struct armada_37xx_pin_group armada_37xx_sb_groups[] = {

0 commit comments

Comments
 (0)