[PATCH v4 2/3] clocksource: timer-cadence-ttc: Support TTC device configured as PWM

Rao, Appana Durga Kedareswara appana.durga.kedareswara.rao at amd.com
Fri Jun 20 05:09:19 PDT 2025


[AMD Official Use Only - AMD Internal Distribution Only]

Hi Uwe,

<Snip>
> > +   /*
> > +    * If pwm-cells property is present in TTC node,
> > +    * it would be treated as PWM device.
> > +    */
> > +   if (of_property_read_bool(timer, "#pwm-cells")) {
> > +           #if defined(CONFIG_PWM_CADENCE)
> > +           ttc_config->is_pwm_mode = true;
> > +                   return ttc_pwm_probe(pdev);
>
> strange indention. Maybe use
>
>       if (IS_REACHABLE(CONFIG_PWM_CADENCE))
>
> This is an unusal way to bind the PWM driver. I'd prefer creation of separate device
> in the PWM case. I wonder if it can happen that ttc_pwm_probe() is called during
> boot before pwm_init() completed. Or use an auxbus device to distinguish between
> timer and pwm?
>

Sorry for the delay in response the upstreaming of the TTC PWM driver was previously managed by Mubin. Since his departure from the organization, I will be taking over and continuing the upstreaming effort.

I have reviewed the v1 to v4 patch series along with all the associated feedback. In response to the concerns raised regarding the use of auxbus, I would like to propose an alternative solution: registering the PWM functionality as a separate platform driver using a distinct compatible string. This would allow the PWM driver to be probed only when the specific compatible string is present, while the timer driver would be used otherwise.

If this approach is agreeable, I will proceed with preparing the v5 patch accordingly(after fixing other review comments along with this change) otherwise will explore the auxbus device please let me know your thoughts.

Regards,
Kedar.
> > +           #else
> > +                   return -ENODEV;
> > +           #endif
> > +   }
> > +   dev_set_drvdata(&pdev->dev, ttc_config);
> > +
> >     if (initialized)
> >             return 0;
> >
>
> Best regards
> Uwe



More information about the linux-arm-kernel mailing list