Revert "hoc-clk: add live vdd2, live boost clock and basic pwm dimming"
This reverts commit 15b7df8ef1.
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <vapours.hpp>
|
||||
|
||||
#if defined(ATMOSPHERE_OS_HORIZON)
|
||||
#include <stratosphere/psc/psc_pm_module.os.horizon.hpp>
|
||||
#else
|
||||
#include <stratosphere/psc/psc_pm_module.os.generic.hpp>
|
||||
#endif
|
||||
@@ -1,102 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <vapours.hpp>
|
||||
#include <stratosphere/psc/psc_types.hpp>
|
||||
#include <stratosphere/psc/psc_pm_module_id.hpp>
|
||||
#include <stratosphere/psc/sf/psc_sf_i_pm_module.hpp>
|
||||
|
||||
namespace ams::psc {
|
||||
|
||||
class PmModule {
|
||||
NON_COPYABLE(PmModule);
|
||||
NON_MOVEABLE(PmModule);
|
||||
private:
|
||||
os::SystemEvent m_system_event;
|
||||
bool m_initialized;
|
||||
PmModuleId m_module_id;
|
||||
uintptr_t m_reserved;
|
||||
PmState m_state;
|
||||
PmFlagSet m_flags;
|
||||
public:
|
||||
PmModule() : m_initialized(false), m_module_id(PmModuleId_Reserved0), m_reserved(0), m_state(PmState_FullAwake), m_flags() { /* ... */ }
|
||||
~PmModule() {
|
||||
if (m_initialized) {
|
||||
R_ABORT_UNLESS(this->Finalize());
|
||||
}
|
||||
}
|
||||
|
||||
Result Initialize(const PmModuleId mid, const PmModuleId *dependencies, u32 dependency_count, os::EventClearMode clear_mode) {
|
||||
/* TODO: Should we do in-process dependency resolution? */
|
||||
AMS_UNUSED(dependencies, dependency_count);
|
||||
|
||||
/* Check that we're not already initialized. */
|
||||
R_UNLESS(!m_initialized, psc::ResultAlreadyInitialized());
|
||||
|
||||
/* Create our event. */
|
||||
R_ABORT_UNLESS(os::CreateSystemEvent(m_system_event.GetBase(), clear_mode, false));
|
||||
|
||||
/* Set our state. */
|
||||
m_module_id = mid;
|
||||
m_initialized = true;
|
||||
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Finalize() {
|
||||
/* Check that we're initialized. */
|
||||
R_UNLESS(m_initialized, psc::ResultNotInitialized());
|
||||
|
||||
/* Destroy our system event. */
|
||||
os::DestroySystemEvent(m_system_event.GetBase());
|
||||
|
||||
/* Mark not initialized. */
|
||||
m_initialized = false;
|
||||
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
constexpr PmModuleId GetId() const { return m_module_id; }
|
||||
|
||||
Result GetRequest(PmState *out_state, PmFlagSet *out_flags) {
|
||||
/* Check that we're initialized. */
|
||||
R_UNLESS(m_initialized, psc::ResultNotInitialized());
|
||||
|
||||
/* Set output. */
|
||||
*out_state = m_state;
|
||||
*out_flags = m_flags;
|
||||
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Acknowledge(PmState state, Result res) {
|
||||
/* Check that we're initialized. */
|
||||
R_UNLESS(m_initialized, psc::ResultNotInitialized());
|
||||
|
||||
/* Check the transition was successful. */
|
||||
R_ABORT_UNLESS(res);
|
||||
|
||||
AMS_UNUSED(state);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
os::SystemEvent *GetEventPointer() {
|
||||
return std::addressof(m_system_event);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <vapours.hpp>
|
||||
#include <stratosphere/psc/psc_types.hpp>
|
||||
#include <stratosphere/psc/psc_pm_module_id.hpp>
|
||||
#include <stratosphere/psc/sf/psc_sf_i_pm_module.hpp>
|
||||
|
||||
namespace ams::psc {
|
||||
|
||||
class PmModule {
|
||||
NON_COPYABLE(PmModule);
|
||||
NON_MOVEABLE(PmModule);
|
||||
private:
|
||||
ams::sf::SharedPointer<psc::sf::IPmModule> m_intf;
|
||||
os::SystemEvent m_system_event;
|
||||
bool m_initialized;
|
||||
PmModuleId m_module_id;
|
||||
uintptr_t m_reserved;
|
||||
public:
|
||||
PmModule();
|
||||
~PmModule();
|
||||
|
||||
Result Initialize(const PmModuleId mid, const PmModuleId *dependencies, u32 dependency_count, os::EventClearMode clear_mode);
|
||||
Result Finalize();
|
||||
|
||||
constexpr PmModuleId GetId() const { return m_module_id; }
|
||||
|
||||
Result GetRequest(PmState *out_state, PmFlagSet *out_flags);
|
||||
Result Acknowledge(PmState state, Result res);
|
||||
|
||||
os::SystemEvent *GetEventPointer();
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <vapours.hpp>
|
||||
|
||||
namespace ams::psc {
|
||||
|
||||
enum PmModuleId : u32 {
|
||||
PmModuleId_Reserved0 = 0,
|
||||
|
||||
PmModuleId_Usb = 4,
|
||||
PmModuleId_Ethernet = 5,
|
||||
PmModuleId_Fgm = 6,
|
||||
PmModuleId_PcvClock = 7,
|
||||
PmModuleId_PcvVoltage = 8,
|
||||
PmModuleId_Gpio = 9,
|
||||
PmModuleId_Pinmux = 10,
|
||||
PmModuleId_Uart = 11,
|
||||
PmModuleId_I2c = 12,
|
||||
PmModuleId_I2cPcv = 13,
|
||||
PmModuleId_Spi = 14,
|
||||
PmModuleId_Pwm = 15,
|
||||
PmModuleId_Psm = 16,
|
||||
PmModuleId_Tc = 17,
|
||||
PmModuleId_Omm = 18,
|
||||
PmModuleId_Pcie = 19,
|
||||
PmModuleId_Lbl = 20,
|
||||
PmModuleId_Display = 21,
|
||||
|
||||
PmModuleId_Hid = 24,
|
||||
PmModuleId_WlanSockets = 25,
|
||||
|
||||
PmModuleId_Fs = 27,
|
||||
PmModuleId_Audio = 28,
|
||||
|
||||
PmModuleId_TmaHostIo = 30,
|
||||
PmModuleId_Bluetooth = 31,
|
||||
PmModuleId_Bpc = 32,
|
||||
PmModuleId_Fan = 33,
|
||||
PmModuleId_Pcm = 34,
|
||||
PmModuleId_Nfc = 35,
|
||||
PmModuleId_Apm = 36,
|
||||
PmModuleId_Btm = 37,
|
||||
PmModuleId_Nifm = 38,
|
||||
PmModuleId_GpioLow = 39,
|
||||
PmModuleId_Npns = 40,
|
||||
PmModuleId_Lm = 41,
|
||||
PmModuleId_Bcat = 42,
|
||||
PmModuleId_Time = 43,
|
||||
PmModuleId_Pctl = 44,
|
||||
PmModuleId_Erpt = 45,
|
||||
PmModuleId_Eupld = 46,
|
||||
PmModuleId_Friends = 47,
|
||||
PmModuleId_Bgtc = 48,
|
||||
PmModuleId_Account = 49,
|
||||
PmModuleId_Sasbus = 50,
|
||||
PmModuleId_Ntc = 51,
|
||||
PmModuleId_Idle = 52,
|
||||
PmModuleId_Tcap = 53,
|
||||
PmModuleId_PsmLow = 54,
|
||||
PmModuleId_Ndd = 55,
|
||||
PmModuleId_Olsc = 56,
|
||||
|
||||
PmModuleId_Ns = 61,
|
||||
|
||||
PmModuleId_Nvservices = 101,
|
||||
|
||||
PmModuleId_Spsm = 127,
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <vapours.hpp>
|
||||
|
||||
namespace ams::psc {
|
||||
|
||||
enum PmState {
|
||||
PmState_FullAwake = 0,
|
||||
PmState_MinimumAwake = 1,
|
||||
PmState_SleepReady = 2,
|
||||
PmState_EssentialServicesSleepReady = 3,
|
||||
PmState_EssentialServicesAwake = 4,
|
||||
PmState_ShutdownReady = 5,
|
||||
PmState_Unknown = 6,
|
||||
};
|
||||
|
||||
constexpr inline u32 MaximumDependencyLevels = 20;
|
||||
|
||||
struct PmFlag {
|
||||
|
||||
};
|
||||
|
||||
using PmFlagSet = util::BitFlagSet<BITSIZEOF(u32), PmFlag>;
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <vapours.hpp>
|
||||
#include <stratosphere/psc/psc_types.hpp>
|
||||
#include <stratosphere/psc/psc_pm_module_id.hpp>
|
||||
|
||||
#define AMS_PSC_I_PM_MODULE_INTERFACE_INFO(C, H) \
|
||||
AMS_SF_METHOD_INFO(C, H, 0, Result, Initialize, (ams::sf::OutCopyHandle out, psc::PmModuleId module_id, const ams::sf::InBuffer &child_list), (out, module_id, child_list)) \
|
||||
AMS_SF_METHOD_INFO(C, H, 1, Result, GetRequest, (ams::sf::Out<psc::PmState> out_state, ams::sf::Out<psc::PmFlagSet> out_flags), (out_state, out_flags)) \
|
||||
AMS_SF_METHOD_INFO(C, H, 2, Result, Acknowledge, (), ()) \
|
||||
AMS_SF_METHOD_INFO(C, H, 3, Result, Finalize, (), ()) \
|
||||
AMS_SF_METHOD_INFO(C, H, 4, Result, AcknowledgeEx, (psc::PmState state), (state), hos::Version_5_1_0)
|
||||
|
||||
AMS_SF_DEFINE_INTERFACE(ams::psc::sf, IPmModule, AMS_PSC_I_PM_MODULE_INTERFACE_INFO, 0x4275F38F)
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <vapours.hpp>
|
||||
#include <stratosphere/psc/sf/psc_sf_i_pm_module.hpp>
|
||||
|
||||
#define AMS_PSC_I_PM_SERVICE_INTERFACE_INFO(C, H) \
|
||||
AMS_SF_METHOD_INFO(C, H, 0, Result, Initialize, (ams::sf::Out<ams::sf::SharedPointer<psc::sf::IPmModule>> out), (out))
|
||||
|
||||
AMS_SF_DEFINE_INTERFACE(ams::psc::sf, IPmService, AMS_PSC_I_PM_SERVICE_INTERFACE_INFO, 0xEABE6F26)
|
||||
Reference in New Issue
Block a user