Message ID | 20230112071526.3035949-2-mubin.sayyed@amd.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Add initial support for TTC PWM driver | expand |
On Thu, Jan 12, 2023 at 12:45:24PM +0530, Mubin Sayyed wrote: > TTC device can act either as clocksource/clockevent or > PWM generator, it would be decided by pwm-cells property. > TTC PWM feature would be supported through separate driver > based on PWM framework. > > If pwm-cells property is present in TTC node, it would be > treated as PWM device, and clocksource driver should just > skip it. > > Signed-off-by: Mubin Sayyed <mubin.sayyed@amd.com> > --- > drivers/clocksource/timer-cadence-ttc.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-cadence-ttc.c > index 4efd0cf3b602..ba46649148b1 100644 > --- a/drivers/clocksource/timer-cadence-ttc.c > +++ b/drivers/clocksource/timer-cadence-ttc.c > @@ -476,6 +476,9 @@ static int __init ttc_timer_probe(struct platform_device *pdev) > u32 timer_width = 16; > struct device_node *timer = pdev->dev.of_node; > While it's more obvious here than in the PWM driver, a comment here would be good, too. > + if (of_property_read_bool(timer, "#pwm-cells")) > + return -ENODEV; > + > if (initialized) > return 0; > > -- > 2.25.1 > >
diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-cadence-ttc.c index 4efd0cf3b602..ba46649148b1 100644 --- a/drivers/clocksource/timer-cadence-ttc.c +++ b/drivers/clocksource/timer-cadence-ttc.c @@ -476,6 +476,9 @@ static int __init ttc_timer_probe(struct platform_device *pdev) u32 timer_width = 16; struct device_node *timer = pdev->dev.of_node; + if (of_property_read_bool(timer, "#pwm-cells")) + return -ENODEV; + if (initialized) return 0;
TTC device can act either as clocksource/clockevent or PWM generator, it would be decided by pwm-cells property. TTC PWM feature would be supported through separate driver based on PWM framework. If pwm-cells property is present in TTC node, it would be treated as PWM device, and clocksource driver should just skip it. Signed-off-by: Mubin Sayyed <mubin.sayyed@amd.com> --- drivers/clocksource/timer-cadence-ttc.c | 3 +++ 1 file changed, 3 insertions(+)