linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Martin Botka <martin.botka1@gmail.com>
Cc: Fenglin Wu <fenglinw@codeaurora.org>,
	Konrad Dybcio <konradybcio@gmail.com>,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	Pavel Machek <pavel@ucw.cz>, Dan Murphy <dmurphy@ti.com>,
	Rob Herring <robh+dt@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Lee Jones <lee.jones@linaro.org>,
	Linux LED Subsystem <linux-leds@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-pwm@vger.kernel.org
Subject: Re: [PATCH RCC 1/6] pwm: Add different PWM output types support
Date: Tue, 28 Jul 2020 09:52:57 +0200	[thread overview]
Message-ID: <20200728075257.efhsju2odehpbv6f@pengutronix.de> (raw)
In-Reply-To: <CADQ2G_GxpWk1AK4OQPZZuk=vCmostC4vEGSHjj01WMzFxpD7CA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2015 bytes --]

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@pengutronix.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/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-07-28  7:53 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24 21:36 [PATCH RFC 0/6] Add QCOM pwm-lpg and tri-led drivers Martin Botka
2020-07-24 21:36 ` [PATCH RCC 1/6] pwm: Add different PWM output types support Martin Botka
2020-07-27 20:10   ` Uwe Kleine-König
2020-07-27 20:56     ` Martin Botka
2020-07-28  7:52       ` Uwe Kleine-König [this message]
2020-07-27 21:46   ` Guru Das Srinagesh
2020-07-24 21:36 ` [PATCH RFC 2/6] pwm: core: Add option to config PWM duty/period with u64 data length Martin Botka
2020-07-25 14:55   ` Martin Botka
2020-07-25 15:24     ` Pavel Machek
2020-07-25 15:30       ` Martin Botka
2020-07-26  9:04   ` Andy Shevchenko
2020-07-26  9:12     ` Martin Botka
2020-07-27  7:29       ` Martin Botka
2020-07-27  7:32         ` Martin Botka
2020-07-27  7:52         ` Uwe Kleine-König
2020-07-27  7:58           ` Martin Botka
2020-07-27  8:34             ` Uwe Kleine-König
2020-07-24 21:36 ` [PATCH RFC 3/6] pwm: pwm-qti-lpg: Add PWM driver for QTI LPG module Martin Botka
2020-07-27 20:09   ` Uwe Kleine-König
2020-07-27 21:16     ` Martin Botka
2020-07-28  7:08       ` Uwe Kleine-König
2020-07-24 21:36 ` [PATCH RFC 4/6] leds: leds-qti-tri-led: Add LED driver for QTI TRI_LED module Martin Botka
2020-07-26 17:25   ` Martin Botka
2020-07-24 21:36 ` [PATCH RFC 5/6] Documentation: Add binding for qti-tri-led Martin Botka
2020-07-24 21:36 ` [PATCH RFC 6/6] Documentation: Add binding for pwm-qti-lpg Martin Botka
2020-07-24 22:05 ` [PATCH RFC 0/6] Add QCOM pwm-lpg and tri-led drivers Pavel Machek
2020-07-24 22:26   ` Martin Botka
2020-07-24 22:32     ` Pavel Machek
2020-07-24 22:48       ` Martin Botka
     [not found]   ` <CADQ2G_HbysJbiQKSRmA6HDRfjPYPiDjbZfeuUjM1mNV-BBBC-A@mail.gmail.com>
2020-07-24 22:31     ` Pavel Machek
2020-07-24 22:46       ` Martin Botka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200728075257.efhsju2odehpbv6f@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dmurphy@ti.com \
    --cc=fenglinw@codeaurora.org \
    --cc=jacek.anaszewski@gmail.com \
    --cc=konradybcio@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=martin.botka1@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).