Hello, On Fri, Sep 25, 2020 at 05:53:26PM +0200, Marco Felsch wrote: > The current implementation enables the clock if the current PWM state > is '!enabled' to ensure the register access and left the clock on if the > new state is 'enabled'. Further apply calls don't enable the clock since > they relying on the fact the the clock is already running. Change this > behaviour since it is not very intuitive. > > This commit changes this behaviour. Now the clocks are unconditional > enabled/disabled before/after the register access. If the PWM should be > turned on (state.enabled) we enable the clock again and vice versa if > the PWM should be turned off (!state.enabled). > > Therefore I added the enable member to the driver state struct since > the usage of cstate and pwm_get_state() is a layer violation. I removed > this violation while on it. while looking through patch 2 I found something missing here: You don't initialize .enabled in .probe(). Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |