[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200728075257.efhsju2odehpbv6f@pengutronix.de>
Date: Tue, 28 Jul 2020 09:52:57 +0200
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: Martin Botka <martin.botka1@...il.com>
Cc: Fenglin Wu <fenglinw@...eaurora.org>,
Konrad Dybcio <konradybcio@...il.com>,
Jacek Anaszewski <jacek.anaszewski@...il.com>,
Pavel Machek <pavel@....cz>, Dan Murphy <dmurphy@...com>,
Rob Herring <robh+dt@...nel.org>,
Thierry Reding <thierry.reding@...il.com>,
Lee Jones <lee.jones@...aro.org>,
Linux LED Subsystem <linux-leds@...r.kernel.org>,
devicetree <devicetree@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-pwm@...r.kernel.org
Subject: Re: [PATCH RCC 1/6] pwm: Add different PWM output types support
Hello Martin,
On Mon, Jul 27, 2020 at 10:56:31PM +0200, Martin Botka wrote:
> Mo 27. 7. 2020 at 22:10 Uwe Kleine-König <u.kleine-koenig@...gutronix.de> wrote:
> > On Fri, Jul 24, 2020 at 11:36:51PM +0200, Martin Botka wrote:
> > > +/*
> > > + * pwm_output_type_support()
> > > + * @pwm: PWM device
> > > + *
> > > + * Returns: output types supported by the PWM device
> > > + */
> > > +static inline int pwm_get_output_type_supported(struct pwm_device *pwm)
> > > +{
> > > + if (pwm->chip->ops->get_output_type_supported != NULL)
> > > + return pwm->chip->ops->get_output_type_supported(pwm->chip, pwm);
> > > + else
> > > + return PWM_OUTPUT_FIXED;
> > > +}
> >
> > I don't like this "advertising" for specific functions. I'd prefer to
> > handle this in .apply(), fix all drivers to return -ESOMETHING when the
> > request cannot be fulfilled.
>
> I will have to disagree on this one. As the functions are called in
> multiple places it would just make mess in the driver.
Note this is something where (I think) I don't agree with Thierry
either. This popped up just yesterday, see
https://www.spinics.net/lists/linux-pwm/msg13290.html
For sure I want at most one such function per driver, so if we really
want to go this path and introduce a capability indicator, this should
be named differently and have a different prototype.
> As the driver is even now not exactly the definition of clean driver i
> would not like to make it even more messy.
> > Having said that I wonder if this output pattern is a common enough
> > property to add support for it in the PWM framework.
> >
>
> I have gotten an email from Guru Das Srinagesh regarding this exact
> issue you are pointing to. Yes the output pattern will be dropped in
> V2.
That's good.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists