pwm: kconfig: enable kona pwm to be built for cygnus arch
PATCH v2 1/1 pwm: kconfig: enable kona pwm to be built for cygnus arch
The Cygnus architecture use a Kona PWM. This is already present in the device tree but can't be built actually. Hence, allow the Kona PWM to be built for Cygnus arch.
--- drivers/pwm/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pwm/Kconfig +3 -1
@@ -88,7 +88,9 @@ config PWM_BCM_IPROC config PWM_BCM_KONA tristate "Kona PWM support" - depends on ARCH_BCM_MOBILE + depends on ARCH_BCM_MOBILE || ARCH_BCM_CYGNUS || COMPILE_TEST + depends on HAVE_CLK && HAS_IOMEM + default ARCH_BCM_CYGNUS help Generic PWM framework driver for Broadcom Kona PWM block.
Signature · 1 line
2.19.1
Quoted 5 lines · Clément Péron
The Cygnus architecture use a Kona PWM. This is already present in the device tree but can't be built actually. Hence, allow the Kona PWM to be built for Cygnus arch.
Signed-off-by Clément Péron <[email protected]>
The "default ARCH_BCM_CYGNUS" could arguably cover ARCH_BCM_MOBILE as well, but this is not probably worth a respin just to address that.
Quoted 20 lines
--- drivers/pwm/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/pwm/Kconfig +3
-1@@ -88,7 +88,9 @@ config PWM_BCM_IPROC config PWM_BCM_KONA tristate "Kona PWM support" - depends on ARCH_BCM_MOBILE + depends on ARCH_BCM_MOBILE || ARCH_BCM_CYGNUS || COMPILE_TEST + depends on HAVE_CLK && HAS_IOMEM + default ARCH_BCM_CYGNUS help Generic PWM framework driver for Broadcom Kona PWM block.
Signature · 1 line
Florian
Scott Branden
Reviewed-byQuoted 8 lines · Florian Fainelli
Quoted 5 lines · Clément Péron
The Cygnus architecture use a Kona PWM. This is already present in the device tree but can't be built actually. Hence, allow the Kona PWM to be built for Cygnus arch.
Signed-off-by Clément Péron <[email protected]>Reviewed-by Florian Fainelli <[email protected]>
Quoted 3 lines
The "default
ARCH_BCM_CYGNUS" could arguably coverARCH_BCM_MOBILEas well, but this is not probably worth a respin just to address that.
Yes, it's fine as is.
Quoted 21 lines
Quoted 21 lines
--- drivers/pwm/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/pwm/Kconfig +3
-1@@ -88,7 +88,9 @@ config PWM_BCM_IPROC config PWM_BCM_KONA tristate "Kona PWM support" - depends on ARCH_BCM_MOBILE + depends on ARCH_BCM_MOBILE || ARCH_BCM_CYGNUS || COMPILE_TEST + depends on HAVE_CLK && HAS_IOMEM + default ARCH_BCM_CYGNUS help Generic PWM framework driver for Broadcom Kona PWM block.
Hello Clément,
Quoted 14 lines · Clément Péron
The Cygnus architecture use a Kona PWM. This is already present in the device tree but can't be built actually. Hence, allow the Kona PWM to be built for Cygnus arch.
Signed-off-by Clément Péron <[email protected]>--- drivers/pwm/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/pwm/Kconfig +0
-0
drivers/pwm/Kconfig config PWM_BCM_IPROC · line 93
Quoted 7 lines
drivers/pwm/Kconfig +3
-1@@ -88,7 +88,9 @@ config PWM_BCM_IPROC config PWM_BCM_KONA tristate "Kona PWM support" - depends on ARCH_BCM_MOBILE + depends on ARCH_BCM_MOBILE || ARCH_BCM_CYGNUS || COMPILE_TEST + depends on HAVE_CLK && HAS_IOMEM + default ARCH_BCM_CYGNUS
This looks good. As pointed out before the default is a bit strange and could include ARCH_BCM_MOBILE for symmetry.
Anyhow:
Related to this driver I have a set of questions: If the disable callback completed, does the hardware still drive the pin? If yes, would it be possible to disable the pin driver such that the pin gets high-Z? If yes, how?
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |
Hi,
Quoted 19 lines · Uwe Kleine-König
Hello Clément,
Quoted 15 lines · Clément Péron
The Cygnus architecture use a Kona PWM. This is already present in the device tree but can't be built actually. Hence, allow the Kona PWM to be built for Cygnus arch.
Signed-off-by Clément Péron <[email protected]>--- drivers/pwm/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/pwm/Kconfig +0
-0@@ -88,7 +88,9 @@ config PWM_BCM_IPROC
Quoted 9 lines
drivers/pwm/Kconfig config PWM_BCM_IPROC · line 93
Quoted 6 lines
drivers/pwm/Kconfig +3
-1config PWM_BCM_KONA tristate "Kona PWM support" - depends on ARCH_BCM_MOBILE + depends on ARCH_BCM_MOBILE || ARCH_BCM_CYGNUS || COMPILE_TEST + depends on HAVE_CLK && HAS_IOMEM + default ARCH_BCM_CYGNUSThis looks good. As pointed out before the default is a bit strange and could include
ARCH_BCM_MOBILEfor symmetry.
Ok, let me resend a v3
Quoted 9 lines
Anyhow:
Acked-by Uwe Kleine-König <[email protected]>Related to this driver I have a set of questions: If the disable callback completed, does the hardware still drive the pin? If yes, would it be possible to disable the pin driver such that the pin gets high-Z? If yes, how?
The output pin type is configured with the bit "21:16 PWMOUT_TYPE RW default 0x3F" in the Control register PWM_CONTROL_TYPE_SHIFT macro in the driver
Datasheets says : "When set to 1 the PWM Output signal will have a push/pull type.When set to 0 the PWM Output signal will have an open drain output type.Recommend to leave it push/pull type."
In the driver we actually set push/pull mode for all channels :
/* Set push/pull for all channels */
for (chan = 0; chan < kp->chip.npwm; chan++)
value |= (1 << PWM_CONTROL_TYPE_SHIFT(chan));
Regards,
Clement
Quoted 7 lines
Best regards
Uwe--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Hello Clément,
Quoted 14 lines · Clément Péron
Quoted 4 lines · Uwe Kleine-König
Related to this driver I have a set of questions: If the disable callback completed, does the hardware still drive the pin? If yes, would it be possible to disable the pin driver such that the pin gets high-Z? If yes, how?
The output pin type is configured with the bit "21:16
PWMOUT_TYPERW default0x3F" in the Control registerPWM_CONTROL_TYPE_SHIFTmacro in the driver
Datasheets says : "When set to 1 the PWM Output signal will have a push/pull type.When set to 0 the PWM Output signal will have an open drain output type.Recommend to leave it push/pull type."
Quoted 4 lines
In the driver we actually set push/pull mode for all channels :
/* Set push/pull for all channels */
for (chan = 0; chan <kp->chip.npwm; chan++)
value |= (1 <<PWM_CONTROL_TYPE_SHIFT(chan));
So if disabling the output driver was part of the requirements for .disable the bcm-kona driver could not implement this for both inverted and uninverted PWMs. (At least not without resorting to pinmuxing.)
Thanks
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |