From: Paul Cercueil <paul@crapouillou.net>
To: Thierry Reding <thierry.reding@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>
Cc: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] pwm: pwm-jz4740: Implement set_polarity
Date: Sat, 17 Mar 2018 21:46:04 +0100 [thread overview]
Message-ID: <1521319566.2835.0@smtp.crapouillou.net> (raw)
In-Reply-To: <20180106165843.3461-2-paul@crapouillou.net>
Hi,
Could this patchset get a bit of love?
I have other changes waiting for this patchset to get in, so it'd be
great
to see it in 4.17-rc1.
Thanks,
-Paul
Le sam. 6 janv. 2018 à 17:58, Paul Cercueil <paul@crapouillou.net> a
écrit :
> This permits clients of this driver to specify the polarity to use for
> their PWM channel.
>
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---
> drivers/pwm/pwm-jz4740.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/drivers/pwm/pwm-jz4740.c b/drivers/pwm/pwm-jz4740.c
> index 2e41ba213f39..6539c001fe32 100644
> --- a/drivers/pwm/pwm-jz4740.c
> +++ b/drivers/pwm/pwm-jz4740.c
> @@ -130,10 +130,29 @@ static int jz4740_pwm_config(struct pwm_chip
> *chip, struct pwm_device *pwm,
> return 0;
> }
>
> +static int jz4740_pwm_set_polarity(struct pwm_chip *chip,
> + struct pwm_device *pwm, enum pwm_polarity polarity)
> +{
> + uint32_t ctrl = jz4740_timer_get_ctrl(pwm->pwm);
> +
> + switch (polarity) {
> + case PWM_POLARITY_NORMAL:
> + ctrl &= ~JZ_TIMER_CTRL_PWM_ACTIVE_LOW;
> + break;
> + case PWM_POLARITY_INVERSED:
> + ctrl |= JZ_TIMER_CTRL_PWM_ACTIVE_LOW;
> + break;
> + }
> +
> + jz4740_timer_set_ctrl(pwm->hwpwm, ctrl);
> + return 0;
> +}
> +
> static const struct pwm_ops jz4740_pwm_ops = {
> .request = jz4740_pwm_request,
> .free = jz4740_pwm_free,
> .config = jz4740_pwm_config,
> + .set_polarity = jz4740_pwm_set_polarity,
> .enable = jz4740_pwm_enable,
> .disable = jz4740_pwm_disable,
> .owner = THIS_MODULE,
> --
> 2.11.0
>
next prev parent reply other threads:[~2018-03-17 20:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-06 16:58 [PATCH 1/4] pwm: jz4740: Make disable operation compatible with TCU2 mode Paul Cercueil
2018-01-06 16:58 ` [PATCH 2/4] pwm: pwm-jz4740: Implement set_polarity Paul Cercueil
2018-03-17 20:46 ` Paul Cercueil [this message]
2018-01-06 16:58 ` [PATCH 3/4] pwm: jz4740: Add support for devicetree Paul Cercueil
2018-01-19 19:44 ` Rob Herring
2018-01-06 16:58 ` [PATCH 4/4] pwm: jz4740: Enable for all Ingenic SoCs Paul Cercueil
2018-03-27 22:25 ` [PATCH 1/4] pwm: jz4740: Make disable operation compatible with TCU2 mode Thierry Reding
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=1521319566.2835.0@smtp.crapouillou.net \
--to=paul@crapouillou.net \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--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