Skip to content

Commit 4335417

Browse files
palibrgl
authored andcommitted
gpio: mvebu: Fix check for pwm support on non-A8K platforms
pwm support incompatible with Armada 80x0/70x0 API is not only in Armada 370, but also in Armada XP, 38x and 39x. So basically every non-A8K platform. Fix check for pwm support appropriately. Fixes: 85b7d8a ("gpio: mvebu: add pwm support for Armada 8K/7K") Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent f76349c commit 4335417

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

drivers/gpio/gpio-mvebu.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -790,8 +790,12 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
790790
u32 offset;
791791
u32 set;
792792

793-
if (of_device_is_compatible(mvchip->chip.of_node,
794-
"marvell,armada-370-gpio")) {
793+
if (mvchip->soc_variant == MVEBU_GPIO_SOC_VARIANT_A8K) {
794+
int ret = of_property_read_u32(dev->of_node,
795+
"marvell,pwm-offset", &offset);
796+
if (ret < 0)
797+
return 0;
798+
} else {
795799
/*
796800
* There are only two sets of PWM configuration registers for
797801
* all the GPIO lines on those SoCs which this driver reserves
@@ -801,13 +805,6 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
801805
if (!platform_get_resource_byname(pdev, IORESOURCE_MEM, "pwm"))
802806
return 0;
803807
offset = 0;
804-
} else if (mvchip->soc_variant == MVEBU_GPIO_SOC_VARIANT_A8K) {
805-
int ret = of_property_read_u32(dev->of_node,
806-
"marvell,pwm-offset", &offset);
807-
if (ret < 0)
808-
return 0;
809-
} else {
810-
return 0;
811808
}
812809

813810
if (IS_ERR(mvchip->clk))

0 commit comments

Comments
 (0)