aw_pwm: ensure sane configuration, just in case

Make sure that the hardware is configured to cycle mode and that the
bypass is disabled.

MFC after:	2 weeks
This commit is contained in:
Andriy Gapon 2020-09-25 07:40:56 +00:00
parent fc1ec731c8
commit 6957a14075
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=366141

View File

@ -290,6 +290,13 @@ aw_pwm_channel_config(device_t dev, u_int channel, u_int period, u_int duty)
/* Write the prescalar */
reg &= ~AW_PWM_CTRL_PRESCALE_MASK;
reg |= prescaler;
reg &= ~AW_PWM_CTRL_MODE_MASK;
reg |= AW_PWM_CTRL_CYCLE_MODE;
reg &= ~AW_PWM_CTRL_PULSE_START;
reg &= ~AW_PWM_CTRL_CLK_BYPASS;
AW_PWM_WRITE(sc, AW_PWM_CTRL, reg);
/* Write the total/active cycles */