Revert "hoc-clk: add live vdd2, live boost clock and basic pwm dimming"

This reverts commit 15b7df8ef1.
This commit is contained in:
souldbminersmwc
2025-11-09 16:14:52 -05:00
parent 22ec140738
commit 21a3f953d7
3804 changed files with 435 additions and 570162 deletions

View File

@@ -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/pwm/pwm_types.hpp>
namespace ams::pwm::driver::board::nintendo::nx {
void Initialize();
}

View File

@@ -1,50 +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/pwm/pwm_types.hpp>
namespace ams::pwm::driver {
namespace impl {
constexpr inline size_t ChannelSessionSize = 0x60;
constexpr inline size_t ChannelSessionAlign = 8;
struct alignas(ChannelSessionAlign) ChannelSessionImplPadded;
}
struct ChannelSession {
util::TypedStorage<impl::ChannelSessionImplPadded, impl::ChannelSessionSize, impl::ChannelSessionAlign> _impl;
};
Result OpenSession(ChannelSession *out, DeviceCode device_code);
void CloseSession(ChannelSession &session);
void SetPeriod(ChannelSession &session, TimeSpan period);
TimeSpan GetPeriod(ChannelSession &session);
void SetDuty(ChannelSession &session, int duty);
int GetDuty(ChannelSession &session);
void SetEnabled(ChannelSession &session, bool en);
bool GetEnabled(ChannelSession &session);
void SetScale(ChannelSession &session, double scale);
double GetScale(ChannelSession &session);
}

View File

@@ -1,25 +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/pwm/pwm_types.hpp>
namespace ams::pwm::driver {
void Initialize();
void Finalize();
}

View File

@@ -1,30 +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/pwm/pwm_types.hpp>
#include <stratosphere/pwm/driver/pwm_i_pwm_device.hpp>
#include <stratosphere/pwm/driver/pwm_i_pwm_driver.hpp>
namespace ams::pwm::driver {
void RegisterDriver(IPwmDriver *driver);
void UnregisterDriver(IPwmDriver *driver);
Result RegisterDeviceCode(DeviceCode device_code, IPwmDevice *device);
bool UnregisterDeviceCode(DeviceCode device_code);
}

View File

@@ -1,36 +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/pwm/pwm_types.hpp>
#include <stratosphere/ddsf.hpp>
namespace ams::pwm::driver {
class IPwmDevice : public ::ams::ddsf::IDevice {
NON_COPYABLE(IPwmDevice);
NON_MOVEABLE(IPwmDevice);
AMS_DDSF_CASTABLE_TRAITS(ams::pwm::driver::IPwmDevice, ::ams::ddsf::IDevice);
private:
int m_channel_index;
public:
IPwmDevice(int id) : IDevice(false), m_channel_index(id) { /* ... */ }
virtual ~IPwmDevice() { /* ... */ }
constexpr int GetChannelIndex() const { return m_channel_index; }
};
}

View File

@@ -1,55 +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/pwm/pwm_types.hpp>
#include <stratosphere/pwm/driver/pwm_i_pwm_device.hpp>
#include <stratosphere/ddsf.hpp>
namespace ams::pwm::driver {
class IPwmDriver : public ::ams::ddsf::IDriver {
NON_COPYABLE(IPwmDriver);
NON_MOVEABLE(IPwmDriver);
AMS_DDSF_CASTABLE_TRAITS(ams::pwm::driver::IPwmDriver, ::ams::ddsf::IDriver);
public:
IPwmDriver() : IDriver() { /* ... */ }
virtual ~IPwmDriver() { /* ... */ }
virtual void InitializeDriver() = 0;
virtual void FinalizeDriver() = 0;
virtual Result InitializeDevice(IPwmDevice *device) = 0;
virtual void FinalizeDevice(IPwmDevice *device) = 0;
virtual Result SetPeriod(IPwmDevice *device, TimeSpan period) = 0;
virtual Result GetPeriod(TimeSpan *out, IPwmDevice *device) = 0;
/* TODO: Nintendo removed these in 14.0.0. Should we? */
virtual Result SetDuty(IPwmDevice *device, int duty) = 0;
virtual Result GetDuty(int *out, IPwmDevice *device) = 0;
virtual Result SetScale(IPwmDevice *device, double scale) = 0;
virtual Result GetScale(double *out, IPwmDevice *device) = 0;
virtual Result SetEnabled(IPwmDevice *device, bool en) = 0;
virtual Result GetEnabled(bool *out, IPwmDevice *device) = 0;
virtual Result Suspend() = 0;
virtual void Resume() = 0;
};
}

View File

@@ -1,36 +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/pwm/pwm_types.hpp>
#include <stratosphere/pwm/driver/pwm_i_pwm_driver.hpp>
#if defined(ATMOSPHERE_BOARD_NINTENDO_NX)
#include <stratosphere/pwm/driver/board/nintendo/nx/pwm_driver_api.hpp>
namespace ams::pwm::driver::board {
using namespace ams::pwm::driver::board::nintendo::nx;
}
#else
// TODO: #error "Unknown board for ams::pwm::driver::"
#endif