Skip to content

Commit

Permalink
Platform/ROCK-5B: Enable fan pwm at 40kHz, 60% duty
Browse files Browse the repository at this point in the history
  • Loading branch information
silime authored and MollySophia committed Aug 13, 2023
1 parent e863285 commit a46a675
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 @@ -328,4 +329,17 @@ PlatformEarlyInit (
)
{
// Configure various things specific to this platform
DEBUG((EFI_D_WARN, "PlatformEarlyInit called\n"));
GpioPinSetFunction (0, GPIO_PIN_PC0, 0x3); // PWM1_M0

PWM_DATA pwm_data = {
.ControllerID = PWM_CONTROLLER0,
.ChannelID = PWM_CHANNEL1,
.PeriodNs = 25000,
.DutyNs = 15000,
.Polarity = FALSE,
}; // PWM0_CH1

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 a46a675

Please sign in to comment.