mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-23 03:06:52 -04:00
powctl: implement client api (needs board-specific impl)
This commit is contained in:
parent
3d31837ca1
commit
485304bd17
37 changed files with 1984 additions and 11 deletions
|
@ -191,14 +191,25 @@ int main(int argc, char **argv)
|
|||
/* Initialize the gpio server library. */
|
||||
boot::InitializeGpioDriverLibrary();
|
||||
|
||||
/* Initialize the i2c server library. */
|
||||
boot::InitializeI2cDriverLibrary();
|
||||
|
||||
/* Get the hardware type. */
|
||||
const auto hw_type = spl::GetHardwareType();
|
||||
|
||||
/* Initialize the power control library without interrupt event handling. */
|
||||
if (hw_type != spl::HardwareType::Calcio) {
|
||||
powctl::Initialize(false);
|
||||
}
|
||||
|
||||
/* Check USB PLL/UTMIP clock. */
|
||||
boot::CheckClock();
|
||||
|
||||
/* Talk to PMIC/RTC, set boot reason with SPL. */
|
||||
boot::DetectBootReason();
|
||||
|
||||
const auto hw_type = spl::GetHardwareType();
|
||||
if (hw_type != spl::HardwareType::Copper && hw_type != spl::HardwareType::Calcio) {
|
||||
/* Display the splash screen and check the battery charge. */
|
||||
if (hw_type != spl::HardwareType::Calcio) {
|
||||
/* Display splash screen for two seconds. */
|
||||
boot::ShowSplashScreen();
|
||||
|
||||
|
@ -213,16 +224,24 @@ int main(int argc, char **argv)
|
|||
gpio::driver::SetInitialWakePinConfig();
|
||||
|
||||
/* Configure output clock. */
|
||||
if (hw_type != spl::HardwareType::Copper && hw_type != spl::HardwareType::Calcio) {
|
||||
if (hw_type != spl::HardwareType::Calcio) {
|
||||
boot::SetInitialClockConfiguration();
|
||||
}
|
||||
|
||||
/* Set Fan enable config (Copper only). */
|
||||
boot::SetFanEnabled();
|
||||
boot::SetFanPowerEnabled();
|
||||
|
||||
/* Repair boot partitions in NAND if needed. */
|
||||
boot::CheckAndRepairBootImages();
|
||||
|
||||
/* Finalize the power control library. */
|
||||
if (hw_type != spl::HardwareType::Calcio) {
|
||||
powctl::Finalize();
|
||||
}
|
||||
|
||||
/* Finalize the i2c server library. */
|
||||
boot::FinalizeI2cDriverLibrary();
|
||||
|
||||
/* Tell PM to start boot2. */
|
||||
R_ABORT_UNLESS(pmshellNotifyBootFinished());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue