Skip to content

Commit 105f7b9

Browse files
committed
Silicon/Rockchip: PWMLib: Insert delay after locking previous period & duty
Otherwise the new values would sometimes be ignored.
1 parent 8b6b3a6 commit 105f7b9

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

edk2-rockchip/Silicon/Rockchip/Library/PWMLib/PWMLib.c

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <Library/DebugLib.h>
1111
#include <Library/IoLib.h>
12+
#include <Library/TimerLib.h>
1213
#include <Library/PWMLib.h>
1314

1415
#define PWM_INT_EN(ch) (1 << (ch))
@@ -81,6 +82,7 @@ RkPwmSetConfig (
8182
Ctrl = MmioRead32(Base + ChannelOffset + PWM_CTRL_OFFSET);
8283
Ctrl |= PWM_LOCK;
8384
MmioWrite32(Base + ChannelOffset + PWM_CTRL_OFFSET, Ctrl);
85+
MicroSecondDelay (1);
8486

8587
MmioWrite32(Base + ChannelOffset + PWM_PERIOD_HPR_OFFSET, PeriodCycle);
8688
MmioWrite32(Base + ChannelOffset + PWM_DUTY_LPR_OFFSET, DutyCycle);

edk2-rockchip/Silicon/Rockchip/Library/PWMLib/PWMLib.inf

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
[LibraryClasses]
2222
DebugLib
2323
IoLib
24+
TimerLib
2425

2526
[Packages]
2627
EmbeddedPkg/EmbeddedPkg.dec

0 commit comments

Comments
 (0)