All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: linux-pwm@vger.kernel.org, Philipp Zabel <p.zabel@pengutronix.de>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	kernel@pengutronix.de, linux-tegra@vger.kernel.org,
	Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH v1 5/6] pwm: tegra: Implement .apply callback
Date: Mon, 28 Jun 2021 18:46:50 +0200	[thread overview]
Message-ID: <20210628164650.4rnemsvlopy34ss7@pengutronix.de> (raw)
In-Reply-To: <YNnArzeS/DtIlFa9@orome.fritz.box>

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

On Mon, Jun 28, 2021 at 02:29:35PM +0200, Thierry Reding wrote:
> On Thu, Jun 17, 2021 at 11:51:44AM +0200, Uwe Kleine-König wrote:
> > To ease review this reuses the formerly implemented callbacks.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > ---
> >  drivers/pwm/pwm-tegra.c | 32 +++++++++++++++++++++++++++++---
> >  1 file changed, 29 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
> > index 11a10b575ace..1161c6323e60 100644
> > --- a/drivers/pwm/pwm-tegra.c
> > +++ b/drivers/pwm/pwm-tegra.c
> > @@ -227,10 +227,36 @@ static void tegra_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
> >  	clk_disable_unprepare(pc->clk);
> >  }
> >  
> > +static int tegra_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
> > +			   const struct pwm_state *state)
> > +{
> > +	int err;
> > +
> > +	if (state->polarity != PWM_POLARITY_INVERSED)
> > +		return -EINVAL;
> 
> Where does this come from? I can't see this condition anywhere in the
> existing driver.

The old driver doesn't implement .set_polarity, so this condition
originates from

        if (state->polarity != pwm->state.polarity) {
                if (!chip->ops->set_polarity) {
                        err = -EINVAL;
                        goto out_err;
                }
		...

in the legacy code path in the core.

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:[~2021-06-28 16:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17  9:51 [PATCH v1 0/6] pwm: tegra: several improvements Uwe Kleine-König
2021-06-17  9:51 ` [PATCH v1 1/6] pwm: tegra: Drop an if block with an always false condition Uwe Kleine-König
2021-06-17  9:51 ` [PATCH v1 2/6] pwm: tegra: Don't modify HW state in .remove callback Uwe Kleine-König
2021-06-17  9:51 ` [PATCH v1 3/6] pwm: tegra: Don't needlessly enable and disable the clock in .remove() Uwe Kleine-König
2021-06-17  9:51 ` [PATCH v1 4/6] pwm: tegra: Assert reset only after the PWM was unregistered Uwe Kleine-König
2021-06-17  9:51 ` [PATCH v1 5/6] pwm: tegra: Implement .apply callback Uwe Kleine-König
2021-06-28 12:29   ` Thierry Reding
2021-06-28 16:46     ` Uwe Kleine-König [this message]
2021-07-16  7:30   ` Uwe Kleine-König
2021-06-17  9:51 ` [PATCH v1 6/6] pwm: tegra: unfold legacy callbacks into tegra_pwm_apply() Uwe Kleine-König

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=20210628164650.4rnemsvlopy34ss7@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=jonathanh@nvidia.com \
    --cc=kernel@pengutronix.de \
    --cc=lee.jones@linaro.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.