linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pwm: stm32: add comment to better describe breakinput feature
@ 2019-10-08 11:41 Fabrice Gasnier
  2019-10-08 14:45 ` Uwe Kleine-König
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Gasnier @ 2019-10-08 11:41 UTC (permalink / raw)
  To: thierry.reding, u.kleine-koenig
  Cc: alexandre.torgue, benjamin.gaignard, fabrice.gasnier, linux-pwm,
	linux-arm-kernel, linux-kernel, linux-stm32

Add a comment to better describe the purpose of breakinput feature that
can be found on some STM32 timer instances. Briefly comment on the
characteristics of this input for PWM, and pinmuxing as suggested in [1].

[1] https://lkml.org/lkml/2019/10/1/207

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
---
 drivers/pwm/pwm-stm32.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
index 359b085..6406ebb 100644
--- a/drivers/pwm/pwm-stm32.c
+++ b/drivers/pwm/pwm-stm32.c
@@ -522,8 +522,14 @@ static int stm32_pwm_apply_breakinputs(struct stm32_pwm *priv,
 					     sizeof(struct stm32_breakinput));
 
 	/*
+	 * Some timer instances can have BRK input pins (e.g. basically a fault
+	 * pin from the output power stage). The break feature allows a safe
+	 * shut-down of the PWM outputs to a predefined state. Further details
+	 * are available in application note AN4277, "Using STM32 device PWM
+	 * shut-down features..."
 	 * Because "st,breakinput" parameter is optional do not make probe
-	 * failed if it doesn't exist.
+	 * failed if it doesn't exist. The pinctrl handle must hold the BRK
+	 * pin(s) when using "st,breakinput" property.
 	 */
 	if (nb <= 0)
 		return 0;
-- 
2.7.4


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

* Re: [PATCH] pwm: stm32: add comment to better describe breakinput feature
  2019-10-08 11:41 [PATCH] pwm: stm32: add comment to better describe breakinput feature Fabrice Gasnier
@ 2019-10-08 14:45 ` Uwe Kleine-König
  2019-10-09  9:51   ` Fabrice Gasnier
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2019-10-08 14:45 UTC (permalink / raw)
  To: Fabrice Gasnier
  Cc: thierry.reding, alexandre.torgue, benjamin.gaignard, linux-pwm,
	linux-arm-kernel, linux-kernel, linux-stm32

On Tue, Oct 08, 2019 at 01:41:27PM +0200, Fabrice Gasnier wrote:
> Add a comment to better describe the purpose of breakinput feature that
> can be found on some STM32 timer instances. Briefly comment on the
> characteristics of this input for PWM, and pinmuxing as suggested in [1].
> 
> [1] https://lkml.org/lkml/2019/10/1/207
> 
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
> ---
>  drivers/pwm/pwm-stm32.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
> index 359b085..6406ebb 100644
> --- a/drivers/pwm/pwm-stm32.c
> +++ b/drivers/pwm/pwm-stm32.c
> @@ -522,8 +522,14 @@ static int stm32_pwm_apply_breakinputs(struct stm32_pwm *priv,
>  					     sizeof(struct stm32_breakinput));
>  
>  	/*
> +	 * Some timer instances can have BRK input pins (e.g. basically a fault
> +	 * pin from the output power stage). The break feature allows a safe
> +	 * shut-down of the PWM outputs to a predefined state. Further details
> +	 * are available in application note AN4277, "Using STM32 device PWM
> +	 * shut-down features..."

Without having read the application note I don't understand the purpose.
Not sure if this should be a show stopper though.

>  	 * Because "st,breakinput" parameter is optional do not make probe
> -	 * failed if it doesn't exist.
> +	 * failed if it doesn't exist. The pinctrl handle must hold the BRK
> +	 * pin(s) when using "st,breakinput" property.

Is this a comment that has a better place in the binding doc?

Best regards
Uwe


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

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

* Re: [PATCH] pwm: stm32: add comment to better describe breakinput feature
  2019-10-08 14:45 ` Uwe Kleine-König
@ 2019-10-09  9:51   ` Fabrice Gasnier
  2019-10-10  7:07     ` Uwe Kleine-König
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Gasnier @ 2019-10-09  9:51 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: thierry.reding, alexandre.torgue, benjamin.gaignard, linux-pwm,
	linux-arm-kernel, linux-kernel, linux-stm32

On 10/8/19 4:45 PM, Uwe Kleine-König wrote:
> On Tue, Oct 08, 2019 at 01:41:27PM +0200, Fabrice Gasnier wrote:
>> Add a comment to better describe the purpose of breakinput feature that
>> can be found on some STM32 timer instances. Briefly comment on the
>> characteristics of this input for PWM, and pinmuxing as suggested in [1].
>>
>> [1] https://lkml.org/lkml/2019/10/1/207
>>
>> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
>> ---
>>  drivers/pwm/pwm-stm32.c | 8 +++++++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
>> index 359b085..6406ebb 100644
>> --- a/drivers/pwm/pwm-stm32.c
>> +++ b/drivers/pwm/pwm-stm32.c
>> @@ -522,8 +522,14 @@ static int stm32_pwm_apply_breakinputs(struct stm32_pwm *priv,
>>  					     sizeof(struct stm32_breakinput));
>>  
>>  	/*
>> +	 * Some timer instances can have BRK input pins (e.g. basically a fault
>> +	 * pin from the output power stage). The break feature allows a safe
>> +	 * shut-down of the PWM outputs to a predefined state. Further details
>> +	 * are available in application note AN4277, "Using STM32 device PWM
>> +	 * shut-down features..."
> 
> Without having read the application note I don't understand the purpose.
> Not sure if this should be a show stopper though.

Hi Uwe,

I can rephrase this. Do you think the bellow comment would be more
relevant and easy to understand ?

/*
 * The break feature allows a safe shut-down of the PWM outputs.
 * It's based on the BRK event signal defined in the dt-bindings
 * by <index level filter> values.
 * Because "st,breakinput" parameter is optional do not make probe
 * failed if it doesn't exist.
 */

> 
>>  	 * Because "st,breakinput" parameter is optional do not make probe
>> -	 * failed if it doesn't exist.
>> +	 * failed if it doesn't exist. The pinctrl handle must hold the BRK
>> +	 * pin(s) when using "st,breakinput" property.
> 
> Is this a comment that has a better place in the binding doc?

You're right, this is unneeded here. I'll remove this.

Please advise,
BR,
Fabrice

> 
> Best regards
> Uwe
> 
> 

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

* Re: [PATCH] pwm: stm32: add comment to better describe breakinput feature
  2019-10-09  9:51   ` Fabrice Gasnier
@ 2019-10-10  7:07     ` Uwe Kleine-König
  0 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2019-10-10  7:07 UTC (permalink / raw)
  To: Fabrice Gasnier
  Cc: thierry.reding, alexandre.torgue, benjamin.gaignard, linux-pwm,
	linux-arm-kernel, linux-kernel, linux-stm32

On Wed, Oct 09, 2019 at 11:51:05AM +0200, Fabrice Gasnier wrote:
> On 10/8/19 4:45 PM, Uwe Kleine-König wrote:
> > On Tue, Oct 08, 2019 at 01:41:27PM +0200, Fabrice Gasnier wrote:
> >> Add a comment to better describe the purpose of breakinput feature that
> >> can be found on some STM32 timer instances. Briefly comment on the
> >> characteristics of this input for PWM, and pinmuxing as suggested in [1].
> >>
> >> [1] https://lkml.org/lkml/2019/10/1/207
> >>
> >> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
> >> ---
> >>  drivers/pwm/pwm-stm32.c | 8 +++++++-
> >>  1 file changed, 7 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
> >> index 359b085..6406ebb 100644
> >> --- a/drivers/pwm/pwm-stm32.c
> >> +++ b/drivers/pwm/pwm-stm32.c
> >> @@ -522,8 +522,14 @@ static int stm32_pwm_apply_breakinputs(struct stm32_pwm *priv,
> >>  					     sizeof(struct stm32_breakinput));
> >>  
> >>  	/*
> >> +	 * Some timer instances can have BRK input pins (e.g. basically a fault
> >> +	 * pin from the output power stage). The break feature allows a safe
> >> +	 * shut-down of the PWM outputs to a predefined state. Further details
> >> +	 * are available in application note AN4277, "Using STM32 device PWM
> >> +	 * shut-down features..."
> > 
> > Without having read the application note I don't understand the purpose.
> > Not sure if this should be a show stopper though.
> 
> Hi Uwe,
> 
> I can rephrase this. Do you think the bellow comment would be more
> relevant and easy to understand ?
> 
> /*
>  * The break feature allows a safe shut-down of the PWM outputs.
>  * It's based on the BRK event signal defined in the dt-bindings
>  * by <index level filter> values.
>  * Because "st,breakinput" parameter is optional do not make probe
>  * failed if it doesn't exist.
>  */

I still fail to understand. This is an input that determines the actual
value of the output pin? What makes a shutdown of outputs safe? What is
a shutdown anyhow?

Apart from that: s/do not make probe failed/don't fail to probe/.

Best regards
Uwe

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

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

end of thread, other threads:[~2019-10-10  7:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-08 11:41 [PATCH] pwm: stm32: add comment to better describe breakinput feature Fabrice Gasnier
2019-10-08 14:45 ` Uwe Kleine-König
2019-10-09  9:51   ` Fabrice Gasnier
2019-10-10  7:07     ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).