• Uwe Kleine-König's avatar
    pwm: atmel: Rework tracking updates pending in hardware · 52eaba4c
    Uwe Kleine-König authored
    This improves the driver's behavior in several ways:
    
     - The lock is held for shorter periods and so a channel that is currently
       waited for doesn't block disabling another channel.
    
     - It's easier to understand because the procedure is split into more
       semantic units and documentation is improved
    
     - A channel is only set to pending when such an event is actually
       scheduled in hardware (by writing the CUPD register).
    
     - Also wait in .get_state() to report the last configured state instead
       of (maybe) the previous one. This fixes the read back duty cycle and so
       prevents a warning being emitted when PWM_DEBUG is on.
    
    Tested on an AriettaG25.
    Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
    52eaba4c
pwm-atmel.c 13.2 KB