All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] pwm: kconfig: enable kona pwm to be built for cygnus arch
@ 2018-11-21 12:35 Clément Péron
  2018-11-21 19:00 ` Florian Fainelli
  2018-11-22 20:05 ` Uwe Kleine-König
  0 siblings, 2 replies; 6+ messages in thread
From: Clément Péron @ 2018-11-21 12:35 UTC (permalink / raw)
  To: Thierry Reding, Florian Fainelli, Ray Jui, Scott Branden
  Cc: bcm-kernel-feedback-list, linux-pwm, linux-kernel,
	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 <peron.clem@gmail.com>
---
 drivers/pwm/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
index 27e5dd47a01f..982f4059f4e8 100644
--- a/drivers/pwm/Kconfig
+++ b/drivers/pwm/Kconfig
@@ -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.
 
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] pwm: kconfig: enable kona pwm to be built for cygnus arch
  2018-11-21 12:35 [PATCH v2] pwm: kconfig: enable kona pwm to be built for cygnus arch Clément Péron
@ 2018-11-21 19:00 ` Florian Fainelli
  2018-11-21 19:07   ` Scott Branden
  2018-11-22 20:05 ` Uwe Kleine-König
  1 sibling, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2018-11-21 19:00 UTC (permalink / raw)
  To: Clément Péron, Thierry Reding, Florian Fainelli,
	Ray Jui, Scott Branden
  Cc: bcm-kernel-feedback-list, linux-pwm, linux-kernel



On 11/21/2018 4:35 AM, Clément Péron wrote:
> 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 <peron.clem@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

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.

> ---
>  drivers/pwm/Kconfig | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
> index 27e5dd47a01f..982f4059f4e8 100644
> --- a/drivers/pwm/Kconfig
> +++ b/drivers/pwm/Kconfig
> @@ -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.
>  
> 

-- 
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] pwm: kconfig: enable kona pwm to be built for cygnus arch
  2018-11-21 19:00 ` Florian Fainelli
@ 2018-11-21 19:07   ` Scott Branden
  0 siblings, 0 replies; 6+ messages in thread
From: Scott Branden @ 2018-11-21 19:07 UTC (permalink / raw)
  To: Florian Fainelli, Clément Péron, Thierry Reding,
	Florian Fainelli, Ray Jui, Scott Branden
  Cc: bcm-kernel-feedback-list, linux-pwm, linux-kernel


On 2018-11-21 11:00 a.m., Florian Fainelli wrote:
>
> On 11/21/2018 4:35 AM, Clément Péron wrote:
>> 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 <peron.clem@gmail.com>
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

Reviewed-by: Scott Branden <scott.branden@broadcom.com>

>
> 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.
Yes, it's fine as is.
>
>> ---
>>   drivers/pwm/Kconfig | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
>> index 27e5dd47a01f..982f4059f4e8 100644
>> --- a/drivers/pwm/Kconfig
>> +++ b/drivers/pwm/Kconfig
>> @@ -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.
>>   
>>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] pwm: kconfig: enable kona pwm to be built for cygnus arch
  2018-11-21 12:35 [PATCH v2] pwm: kconfig: enable kona pwm to be built for cygnus arch Clément Péron
  2018-11-21 19:00 ` Florian Fainelli
@ 2018-11-22 20:05 ` Uwe Kleine-König
  2018-11-23  9:31   ` Clément Péron
  1 sibling, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2018-11-22 20:05 UTC (permalink / raw)
  To: Clément Péron
  Cc: Thierry Reding, Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list, linux-pwm, linux-kernel

Hello Clément,

On Wed, Nov 21, 2018 at 01:35:08PM +0100, Clément Péron wrote:
> 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 <peron.clem@gmail.com>
> ---
>  drivers/pwm/Kconfig | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
> index 27e5dd47a01f..982f4059f4e8 100644
> --- a/drivers/pwm/Kconfig
> +++ b/drivers/pwm/Kconfig
> @@ -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:

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

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

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] pwm: kconfig: enable kona pwm to be built for cygnus arch
  2018-11-22 20:05 ` Uwe Kleine-König
@ 2018-11-23  9:31   ` Clément Péron
  2018-11-23 10:25     ` Uwe Kleine-König
  0 siblings, 1 reply; 6+ messages in thread
From: Clément Péron @ 2018-11-23  9:31 UTC (permalink / raw)
  To: u.kleine-koenig
  Cc: Thierry Reding, Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list, linux-pwm, linux-kernel

Hi,

On Thu, 22 Nov 2018 at 21:05, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> Hello Clément,
>
> On Wed, Nov 21, 2018 at 01:35:08PM +0100, Clément Péron wrote:
> > 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 <peron.clem@gmail.com>
> > ---
> >  drivers/pwm/Kconfig | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
> > index 27e5dd47a01f..982f4059f4e8 100644
> > --- a/drivers/pwm/Kconfig
> > +++ b/drivers/pwm/Kconfig
> > @@ -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.

Ok, let me resend a v3

>
> Anyhow:
>
> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> 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

>
> Best regards
> Uwe
>
> --
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] pwm: kconfig: enable kona pwm to be built for cygnus arch
  2018-11-23  9:31   ` Clément Péron
@ 2018-11-23 10:25     ` Uwe Kleine-König
  0 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2018-11-23 10:25 UTC (permalink / raw)
  To: Clément Péron
  Cc: Thierry Reding, Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list, linux-pwm, linux-kernel

Hello Clément,

On Fri, Nov 23, 2018 at 10:31:18AM +0100, Clément Péron wrote:
> On Thu, 22 Nov 2018 at 21:05, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> > 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));

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

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-11-23 10:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-21 12:35 [PATCH v2] pwm: kconfig: enable kona pwm to be built for cygnus arch Clément Péron
2018-11-21 19:00 ` Florian Fainelli
2018-11-21 19:07   ` Scott Branden
2018-11-22 20:05 ` Uwe Kleine-König
2018-11-23  9:31   ` Clément Péron
2018-11-23 10:25     ` Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.