[PATCH 0/2] pwm: brcmstb: Some cleanups

Thierry Reding thierry.reding at gmail.com
Thu Feb 24 05:45:51 PST 2022


On Mon, Feb 14, 2022 at 09:23:52AM +0100, Uwe Kleine-König wrote:
> Hello,
> 
> here are a few cleanups for the brcmstb PWM driver. There are a few
> issues left with it, that I'm not addressing for now. Just mention it in
> case someone wants to work on this driver:
> 
>  - There is no .get_state() callback
>    (That needs to be implemented by some with hardware and
>    documentation)
> 
>  - There are a few places where an overflow can happen in
>    brcmstb_pwm_config() that are not handled
> 
>  - The loop in brcmstb_pwm_config() to calculate cword is ineffective,
>    cword could be calculated ad hoc.
> 
>  - I don't understand
> 
>                 /*
>                  * We can be called with separate duty and period updates,
>                  * so do not reject dc == 0 right away
>                  */
>                 if (pc == PWM_PERIOD_MIN || (dc < PWM_ON_MIN && duty_ns))
>                         return -EINVAL;
> 
>    The usual policy is "With the selected period, pick the biggest
>    possible duty_cycle that isn't bigger thatn the requested duty_cycle.
>    So should this case be handled using dc = 0 instead?
>    But as I don't understand the real issue here (is this about changing
>    period and duty at the same time?), I don't want to touch that.
> 
>  - The driver uses SIMPLE_DEV_PM_OPS which is deprecated.
> 
>  - The driver defines pr_fmt(fmt) but doesn't use it.
> 
> Uwe Kleine-König (2):
>   pwm: brcmstb: Implement .apply() callback
>   pwm: brcmstb: Remove useless locking
> 
>  drivers/pwm/pwm-brcmstb.c | 52 ++++++++++++++++++---------------------
>  1 file changed, 24 insertions(+), 28 deletions(-)

Both patches applied, thanks.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20220224/c5429643/attachment.sig>


More information about the linux-arm-kernel mailing list