pwm: meson: Add the meson_pwm_channel data to struct meson_pwm
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Wed, 12 Jun 2019 19:59:04 +0000 (21:59 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 26 Jun 2019 09:39:08 +0000 (11:39 +0200)
commita50a49a45140a85e3cb8d02859e13b78fafd030b
tree97ec8995cd8c16417abfaf4615404bb185c4b5e8
parent7e0321629c2a7b0e67ce451e566e7d6ce8601d65
pwm: meson: Add the meson_pwm_channel data to struct meson_pwm

Make struct meson_pwm_channel accessible from struct meson_pwm.

PWM core has a limitation: per-channel data can only be set after
pwmchip_add() is called. However, pwmchip_add() internally calls
pwm_ops.get_state(). If pwm_ops.get_state() needs access to the
per-channel data it has to obtain it from struct pwm_chip and struct
pwm_device's hwpwm information.

Add a struct meson_pwm_channel for each PWM channel to struct meson_pwm
so the pwm_ops.get_state() callback can be implemented as it needs
access to the clock from struct meson_pwm_channel.

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-meson.c