[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM4PR12MB593888B73B65D25E42490EF29DB1A@DM4PR12MB5938.namprd12.prod.outlook.com>
Date: Wed, 15 Nov 2023 05:55:22 +0000
From: "Sayyed, Mubin" <mubin.sayyed@....com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
CC: "linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-pwm@...r.kernel.org" <linux-pwm@...r.kernel.org>,
"git (AMD-Xilinx)" <git@....com>,
"mubin10@...il.com" <mubin10@...il.com>,
"krzysztof.kozlowski+dt@...aro.org"
<krzysztof.kozlowski+dt@...aro.org>,
"u.kleine-koenig@...gutronix.de" <u.kleine-koenig@...gutronix.de>,
"thierry.reding@...il.com" <thierry.reding@...il.com>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"conor+dt@...nel.org" <conor+dt@...nel.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"daniel.lezcano@...aro.org" <daniel.lezcano@...aro.org>,
"Simek, Michal" <michal.simek@....com>
Subject: RE: [LINUX PATCH v2 1/3] clocksource: timer-cadence-ttc: Do not probe
TTC device configured as PWM
Hi,
> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
> Sent: Wednesday, November 15, 2023 2:41 AM
> To: Sayyed, Mubin <mubin.sayyed@....com>;
> krzysztof.kozlowski+dt@...aro.org; u.kleine-koenig@...gutronix.de;
> thierry.reding@...il.com; robh+dt@...nel.org; conor+dt@...nel.org;
> tglx@...utronix.de; daniel.lezcano@...aro.org; Simek, Michal
> <michal.simek@....com>
> Cc: linux-arm-kernel@...ts.infradead.org; linux-kernel@...r.kernel.org;
> devicetree@...r.kernel.org; linux-pwm@...r.kernel.org; git (AMD-Xilinx)
> <git@....com>; mubin10@...il.com
> Subject: Re: [LINUX PATCH v2 1/3] clocksource: timer-cadence-ttc: Do not
> probe TTC device configured as PWM
>
> On 14/11/2023 13:47, 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@....com>
> > ---
> > Changes for v2:
> > - Added comment regarding pwm-cells property
> > ---
> > drivers/clocksource/timer-cadence-ttc.c | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/clocksource/timer-cadence-ttc.c
> > b/drivers/clocksource/timer-cadence-ttc.c
> > index 32daaac9b132..f8fcb1a4bdd0 100644
> > --- a/drivers/clocksource/timer-cadence-ttc.c
> > +++ b/drivers/clocksource/timer-cadence-ttc.c
> > @@ -477,6 +477,13 @@ static int __init ttc_timer_probe(struct
> platform_device *pdev)
> > u32 timer_width = 16;
> > struct device_node *timer = pdev->dev.of_node;
> >
> > + /*
> > + * If pwm-cells property is present in TTC node,
> > + * it would be treated as PWM device.
> > + */
> > + if (of_property_read_bool(timer, "#pwm-cells"))
> > + return -ENODEV;
>
> You will introduce dmesg errors, so regressions.
>
[Mubin]: I will change it to "return 0" to avoid dmesg errors.
> This does not look right. What you want is to bind one device driver and
> choose different functionality based on properties.
[Mubin]: I am doing it based on earlier discussion related to AXI Timer PWM driver. It was suggested to use #pwm-cells property for identifying role of device(PWM/clocksource) https://lore.kernel.org/linux-devicetree/20210513021631.GA878860@robh.at.kernel.org/.
Thanks,
Mubin
>
> Best regards,
> Krzysztof
Powered by blists - more mailing lists