pwm: meson: Use GENMASK and FIELD_PREP for the lo and hi values
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Wed, 12 Jun 2019 19:59:00 +0000 (21:59 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 26 Jun 2019 09:39:07 +0000 (11:39 +0200)
commit181164b669c91eccafa2d276ac32873310dec465
tree07e657d032927240978e65c528678060238279f0
parentba4004c715c906474ae84f1f9a97f55d3259c6bd
pwm: meson: Use GENMASK and FIELD_PREP for the lo and hi values

meson_pwm_calc() ensures that "lo" is always less than 16 bits wide
(otherwise it would overflow into the "hi" part of the REG_PWM_{A,B}
register).
Use GENMASK and FIELD_PREP for the lo and hi values to make it easier to
spot how wide these are internally. Additionally this is a preparation
step for the .get_state() implementation where the GENMASK() for lo and
hi becomes handy because it can be used with FIELD_GET() to extract the
values from the register REG_PWM_{A,B} register.

No functional changes intended.

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-meson.c