Skip to content

Commit

Permalink
Platform/ROCK-5A: Enable fan pwm at 1kHz, 50% duty
Browse files Browse the repository at this point in the history
Hardcoded for now

Signed-off-by: Molly Sophia <[email protected]>
  • Loading branch information
MollySophia committed Aug 12, 2023
1 parent 343be28 commit e863285
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <Library/GpioLib.h>
#include <Library/RK806.h>
#include <Library/Rk3588Pcie.h>
#include <Library/PWMLib.h>
#include <Soc.h>

static struct regulator_init_data rk806_init_data[] = {
Expand Down Expand Up @@ -276,4 +277,17 @@ PlatformEarlyInit (
)
{
// Configure various things specific to this platform
DEBUG((EFI_D_WARN, "PlatformEarlyInit called\n"));
GpioPinSetFunction (3, GPIO_PIN_PB2, 0xB); // PWM3_IR_M1

PWM_DATA pwm_data = {
.ControllerID = PWM_CONTROLLER0,
.ChannelID = PWM_CHANNEL3,
.PeriodNs = 1000000,
.DutyNs = 500000,
.Polarity = FALSE,
}; // PWM0_CH3

RkPwmSetConfig(&pwm_data);
RkPwmEnable(&pwm_data);
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
SerialPortLib
CruLib
GpioLib
PWMLib

[Sources.common]
RockchipPlatformLib.c
Expand Down

0 comments on commit e863285

Please sign in to comment.