All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] pwm: brcmstb: Some cleanups
@ 2022-02-14  8:23 ` Uwe Kleine-König
  0 siblings, 0 replies; 24+ messages in thread
From: Uwe Kleine-König @ 2022-02-14  8:23 UTC (permalink / raw)
  To: Thierry Reding, Lee Jones, Florian Fainelli
  Cc: bcm-kernel-feedback-list, linux-pwm, linux-arm-kernel, kernel

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


base-commit: 657e54e54ba5b3859848e0ea78d6384ebb7479d6
-- 
2.34.1


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

end of thread, other threads:[~2022-03-08 10:38 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-14  8:23 [PATCH 0/2] pwm: brcmstb: Some cleanups Uwe Kleine-König
2022-02-14  8:23 ` Uwe Kleine-König
2022-02-14  8:23 ` [PATCH 1/2] pwm: brcmstb: Implement .apply() callback Uwe Kleine-König
2022-02-14  8:23   ` Uwe Kleine-König
2022-02-14  8:23 ` [PATCH 2/2] pwm: brcmstb: Remove useless locking Uwe Kleine-König
2022-02-14  8:23   ` Uwe Kleine-König
2022-02-14 17:18 ` [PATCH 0/2] pwm: brcmstb: Some cleanups Florian Fainelli
2022-02-14 17:18   ` Florian Fainelli
2022-02-14 18:34   ` Uwe Kleine-König
2022-02-14 18:34     ` Uwe Kleine-König
2022-02-14 18:51     ` Florian Fainelli
2022-02-14 18:51       ` Florian Fainelli
2022-02-24 13:45 ` Thierry Reding
2022-02-24 13:45   ` Thierry Reding
2022-03-07 18:47 ` Uwe Kleine-König
2022-03-07 18:47   ` Uwe Kleine-König
2022-03-07 19:11   ` Florian Fainelli
2022-03-07 19:11     ` Florian Fainelli
2022-03-07 20:44     ` Uwe Kleine-König
2022-03-07 20:44       ` Uwe Kleine-König
2022-03-07 22:27       ` Florian Fainelli
2022-03-07 22:27         ` Florian Fainelli
2022-03-08 10:28         ` Uwe Kleine-König
2022-03-08 10:28           ` 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.