]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
pwm: bcm2835: Dynamically allocate base
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 3 Feb 2020 21:35:35 +0000 (13:35 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 14 May 2020 08:54:06 +0000 (10:54 +0200)
BugLink: https://bugs.launchpad.net/bugs/1877461
[ Upstream commit 2c25b07e5ec119cab609e41407a1fb3fa61442f5 ]

The newer 2711 and 7211 chips have two PWM controllers and failure to
dynamically allocate the PWM base would prevent the second PWM
controller instance being probed for succeeding with an -EEXIST error
from alloc_pwms().

Fixes: e5a06dc5ac1f ("pwm: Add BCM2835 PWM driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/pwm/pwm-bcm2835.c

index db001cba937fd8617fc81720e21c30601f2bfec5..e340ad79a1ec95c060af20691832a346c1b49e26 100644 (file)
@@ -166,6 +166,7 @@ static int bcm2835_pwm_probe(struct platform_device *pdev)
 
        pc->chip.dev = &pdev->dev;
        pc->chip.ops = &bcm2835_pwm_ops;
+       pc->chip.base = -1;
        pc->chip.npwm = 2;
        pc->chip.of_xlate = of_pwm_xlate_with_flags;
        pc->chip.of_pwm_n_cells = 3;