Re: [PATCH 08/14] pwm: meson: add the per-channel register offsets and bits in a struct

2019-05-28 Thread Neil Armstrong
On 27/05/2019 19:57, Martin Blumenstingl wrote: > Hi Neil, > > On Mon, May 27, 2019 at 2:28 PM Neil Armstrong > wrote: > [...] >> This looks a little over-engineered, but it's correct : > my main motivation was to "not copy the 20 line switch/case statement > from meson_pwm_enable() to

Re: [PATCH 08/14] pwm: meson: add the per-channel register offsets and bits in a struct

2019-05-27 Thread Martin Blumenstingl
Hi Neil, On Mon, May 27, 2019 at 2:28 PM Neil Armstrong wrote: [...] > This looks a little over-engineered, but it's correct : my main motivation was to "not copy the 20 line switch/case statement from meson_pwm_enable() to meson_pwm_get_state()" I extended the idea that already existed for the

Re: [PATCH 08/14] pwm: meson: add the per-channel register offsets and bits in a struct

2019-05-27 Thread Neil Armstrong
On 25/05/2019 20:11, Martin Blumenstingl wrote: > Introduce struct meson_pwm_channel_data which contains the per-channel > offsets for the PWM register and REG_MISC_AB bits. Replace the existing > switch (pwm->hwpwm) statements with an access to the new struct. > > This simplifies the code and

[PATCH 08/14] pwm: meson: add the per-channel register offsets and bits in a struct

2019-05-25 Thread Martin Blumenstingl
Introduce struct meson_pwm_channel_data which contains the per-channel offsets for the PWM register and REG_MISC_AB bits. Replace the existing switch (pwm->hwpwm) statements with an access to the new struct. This simplifies the code and will make it easier to implement pwm_ops.get_state() because