Skip to contentSkip to conversation

pwm: bcm2835: Dynamically allocate base

PATCH In review Florian Fainelli 3 participants 6 messages Feb 3, 2020 – Mar 13, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pwm: bcm2835: Dynamically allocate base

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")
---
 drivers/pwm/pwm-bcm2835.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pwm/pwm-bcm2835.c +1 -0
index 91e24f01b54e..d78f86f8e462 100644
@@ -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;
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw

Hallo Florian,

Quoted 7 lines · Florian Fainelli

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")

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
Reviewed-by on v1 1/1
#2 lore raw
In reply to Florian Fainelli
Quoted 8 lines · Florian Fainelli

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")

---

Quoted 15 lines
 drivers/pwm/pwm-bcm2835.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pwm/pwm-bcm2835.c +1 -0
index 91e24f01b54e..d78f86f8e462 100644
@@ -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;
#3 lore raw
Quoted 11 lines · Nicolas Saenz Julienne
Quoted 8 lines · Florian Fainelli

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")

---

Thierry, is there any chance we can get this applied for an upcoming 5.6-rcX? Thank you!

Signature · 1 line
Florian
#4 lore raw

[Dropping Bart Tanghe from recipents as the address bounces]

Hello Thierry,

Quoted 7 lines · Florian Fainelli
Quoted 6 lines · Nicolas Saenz Julienne
Quoted 5 lines · Florian Fainelli

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().

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Fixes e5a06dc5ac1f ("pwm: Add BCM2835 PWM driver")

---

Thierry, is there any chance we can get this applied for an upcoming 5.6-rcX? Thank you!

to assist you with patch sorting:

# revisions < v6 of "Convert period and duty cycle to u64"
pwclient -s Superseded 1237020 1237019 1229049 1229050 1222396
# most of "Add support for Azoteq IQS620A/621/622/624/625" v5 isn't for pwm
pwclient -s "Not Applicable" 1238908 1238907 1238906 1238904 1238903 1238901
# most of "Add support for Azoteq IQS620A/621/622/624/625" v4 isn't for pwm
pwclient -s "Not Applicable" 1224598 1224597 1224596 1224594 1224593 1224592
pwclient -s "Superseeded" 1224595

# "backlight: pwm_bl: Use gpiod_get_value_cansleep() to get initial # state" already applied by Lee Jones
pwclient -s "Not Applicable" 1031586

# Problem resolved by Michal Vokáč
pwclient -s "Rejected" 1059267

(Not sure "Rejected" is the right state.)

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
#5 lore raw
Quoted 33 lines · Uwe Kleine-König

[Dropping Bart Tanghe from recipents as the address bounces]

Hello Thierry,

Quoted 7 lines · Florian Fainelli
Quoted 6 lines · Nicolas Saenz Julienne
Quoted 5 lines · Florian Fainelli

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().

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Fixes e5a06dc5ac1f ("pwm: Add BCM2835 PWM driver")

---

Thierry, is there any chance we can get this applied for an upcoming 5.6-rcX? Thank you!

to assist you with patch sorting:

# revisions < v6 of "Convert period and duty cycle to u64"
pwclient -s Superseded 1237020 1237019 1229049 1229050 1222396
# most of "Add support for Azoteq IQS620A/621/622/624/625" v5 isn't for pwm
pwclient -s "Not Applicable" 1238908 1238907 1238906 1238904 1238903 1238901
# most of "Add support for Azoteq IQS620A/621/622/624/625" v4 isn't for pwm
pwclient -s "Not Applicable" 1224598 1224597 1224596 1224594 1224593 1224592
pwclient -s "Superseeded" 1224595
Quoted 8 lines

# "backlight: pwm_bl: Use gpiod_get_value_cansleep() to get initial # state" already applied by Lee Jones
pwclient -s "Not Applicable" 1031586

# Problem resolved by Michal Vokáč
pwclient -s "Rejected" 1059267

(Not sure "Rejected" is the right state.)

Thierry, can we get this patch included in v5.7? I have not seen it show up in linux-next yet.

Thank you!

Signature · 1 line
Florian