From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Paul Cercueil <paul@crapouillou.net>
Cc: Thierry Reding <thierry.reding@gmail.com>,
od@opendingux.net, linux-pwm@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org
Subject: Re: [PATCH 5/5] pwm: jz4740: Use regmap_{set,clear}_bits
Date: Tue, 15 Nov 2022 11:51:18 +0100 [thread overview]
Message-ID: <20221115105118.l6lbxml555wsymwh@pengutronix.de> (raw)
In-Reply-To: <20221024205213.327001-6-paul@crapouillou.net>
[-- Attachment #1: Type: text/plain, Size: 2293 bytes --]
Hello,
On Mon, Oct 24, 2022 at 09:52:13PM +0100, Paul Cercueil wrote:
> Simplify a bit the code by using regmap_set_bits() and
> regmap_clear_bits() instead of regmap_update_bits() when possible.
>
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---
> drivers/pwm/pwm-jz4740.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/pwm/pwm-jz4740.c b/drivers/pwm/pwm-jz4740.c
> index c0afc0c316a8..22fcdca66081 100644
> --- a/drivers/pwm/pwm-jz4740.c
> +++ b/drivers/pwm/pwm-jz4740.c
> @@ -88,8 +88,7 @@ static int jz4740_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
> struct jz4740_pwm_chip *jz = to_jz4740(chip);
>
> /* Enable PWM output */
> - regmap_update_bits(jz->map, TCU_REG_TCSRc(pwm->hwpwm),
> - TCU_TCSR_PWM_EN, TCU_TCSR_PWM_EN);
> + regmap_set_bits(jz->map, TCU_REG_TCSRc(pwm->hwpwm), TCU_TCSR_PWM_EN);
>
> /* Start counter */
> regmap_write(jz->map, TCU_REG_TESR, BIT(pwm->hwpwm));
> @@ -129,8 +128,7 @@ static void jz4740_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
> * In TCU2 mode (channel 1/2 on JZ4750+), this must be done before the
> * counter is stopped, while in TCU1 mode the order does not matter.
> */
> - regmap_update_bits(jz->map, TCU_REG_TCSRc(pwm->hwpwm),
> - TCU_TCSR_PWM_EN, 0);
> + regmap_clear_bits(jz->map, TCU_REG_TCSRc(pwm->hwpwm), TCU_TCSR_PWM_EN);
>
> /* Stop counter */
> regmap_write(jz->map, TCU_REG_TECR, BIT(pwm->hwpwm));
> @@ -204,8 +202,8 @@ static int jz4740_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
> regmap_write(jz4740->map, TCU_REG_TDFRc(pwm->hwpwm), period);
>
> /* Set abrupt shutdown */
> - regmap_update_bits(jz4740->map, TCU_REG_TCSRc(pwm->hwpwm),
> - TCU_TCSR_PWM_SD, TCU_TCSR_PWM_SD);
> + regmap_set_bits(jz4740->map, TCU_REG_TCSRc(pwm->hwpwm),
> + TCU_TCSR_PWM_SD);
Nitpick: the regmap_set_bits call is short enough to be put on a single
line.
Other than that (and even if the line is kept as is):
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
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 --]
prev parent reply other threads:[~2022-11-15 10:52 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-24 20:52 [PATCH 0/5] pwm: jz4740: Fixes and some light changes Paul Cercueil
2022-10-24 20:52 ` [PATCH 1/5] pwm: jz4740: Fix pin level of disabled TCU2 channels, part 1 Paul Cercueil
2022-10-25 6:21 ` Uwe Kleine-König
2022-10-25 10:02 ` Paul Cercueil
2022-11-17 13:29 ` Uwe Kleine-König
2022-11-18 9:55 ` Paul Cercueil
2023-01-17 21:35 ` Uwe Kleine-König
2023-01-17 23:05 ` Paul Cercueil
2023-01-18 8:16 ` Uwe Kleine-König
2022-10-24 20:52 ` [PATCH 2/5] pwm: jz4740: Fix pin level of disabled TCU2 channels, part 2 Paul Cercueil
2022-10-25 6:44 ` Uwe Kleine-König
2022-10-25 10:10 ` Paul Cercueil
2022-11-28 14:39 ` Uwe Kleine-König
2022-11-29 12:16 ` Thierry Reding
2022-11-29 12:34 ` Paul Cercueil
2022-11-29 12:25 ` Paul Cercueil
2022-11-29 16:24 ` Uwe Kleine-König
2022-11-29 16:58 ` Paul Cercueil
2022-11-29 17:46 ` Uwe Kleine-König
2022-10-24 20:52 ` [PATCH 3/5] pwm: jz4740: Force dependency on Device Tree Paul Cercueil
2022-11-28 14:41 ` Uwe Kleine-König
2022-10-24 20:52 ` [PATCH 4/5] pwm: jz4740: Depend on MACH_INGENIC instead of MIPS Paul Cercueil
2022-10-25 10:32 ` Philippe Mathieu-Daudé
2022-11-15 10:40 ` Uwe Kleine-König
2022-10-24 20:52 ` [PATCH 5/5] pwm: jz4740: Use regmap_{set,clear}_bits Paul Cercueil
2022-10-25 10:46 ` Philippe Mathieu-Daudé
2022-11-15 10:51 ` Uwe Kleine-König [this message]
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=20221115105118.l6lbxml555wsymwh@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=od@opendingux.net \
--cc=paul@crapouillou.net \
--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).