Uwe Kleine-König 71523d1812 pwm: Ensure pwm_apply_state() doesn't modify the state argument
It is surprising for a PWM consumer when the variable holding the
requested state is modified by pwm_apply_state(). Consider for example a
driver doing:

        #define PERIOD 5000000
        #define DUTY_LITTLE 10
        ...
        struct pwm_state state = {
                .period = PERIOD,
                .duty_cycle = DUTY_LITTLE,
                .polarity = PWM_POLARITY_NORMAL,
                .enabled = true,
        };

        pwm_apply_state(mypwm, &state);
        ...
        state.duty_cycle = PERIOD / 2;
        pwm_apply_state(mypwm, &state);

For sure the second call to pwm_apply_state() should still have
state.period = PERIOD and not something the hardware driver chose for a
reason that doesn't necessarily apply to the second call.

So declare the state argument as a pointer to a const type and adapt all
drivers' .apply callbacks.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2019-09-21 03:25:10 +02:00
..
2019-07-09 10:59:26 -07:00
2019-07-18 11:05:25 -07:00
2019-07-19 17:13:56 -07:00
2019-07-18 09:49:30 +02:00
2019-07-18 09:49:30 +02:00
2019-07-17 09:55:43 -07:00
2019-07-19 17:13:56 -07:00
2019-07-19 12:29:43 -07:00
2019-07-15 09:42:32 -07:00
2019-07-19 17:13:56 -07:00
2019-07-20 10:04:58 -07:00
2019-07-09 08:59:39 -07:00
2019-07-13 16:08:36 -07:00
2019-07-20 09:34:55 -07:00
2019-07-11 18:11:21 -07:00
2019-07-11 15:14:01 -07:00
2019-07-15 20:18:40 -07:00
2019-07-11 18:11:21 -07:00
2019-07-15 21:20:52 -07:00
2019-07-15 20:44:49 -07:00
2019-07-15 09:20:27 -03:00
2019-07-01 15:04:59 +02:00
2019-07-15 20:18:40 -07:00
2019-07-17 11:44:41 -07:00
2019-07-19 17:13:56 -07:00
2019-07-17 10:03:50 -07:00
2019-07-20 10:04:58 -07:00
2019-07-20 10:04:58 -07:00
2019-07-19 17:19:24 -07:00
2019-07-05 08:15:08 +02:00
2019-07-16 12:21:41 -07:00
2019-07-11 15:14:01 -07:00
2019-07-19 17:05:08 -07:00
2019-07-17 11:23:13 -07:00
2019-07-16 09:25:04 -07:00
2019-07-19 11:41:26 -07:00