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,61 +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/htclow/htclow_module_types.hpp>
namespace ams::htclow {
using ChannelId = u16;
struct ChannelType {
bool _is_initialized;
ModuleId _module_id;
ChannelId _channel_id;
};
enum ChannelState {
ChannelState_Connectable = 0,
ChannelState_Unconnectable = 1,
ChannelState_Connected = 2,
ChannelState_Disconnected = 3,
};
struct ChannelConfig {
bool flow_control_enabled;
bool handshake_enabled;
u64 initial_counter_max_data;
size_t max_packet_size;
};
constexpr bool IsStateTransitionAllowed(ChannelState from, ChannelState to) {
switch (from) {
case ChannelState_Connectable:
return to == ChannelState_Unconnectable ||
to == ChannelState_Connected ||
to == ChannelState_Disconnected;
case ChannelState_Unconnectable:
return to == ChannelState_Connectable ||
to == ChannelState_Disconnected;
case ChannelState_Connected:
return to == ChannelState_Disconnected;
case ChannelState_Disconnected:
return to == ChannelState_Disconnected;
AMS_UNREACHABLE_DEFAULT_CASE();
}
}
}

View File

@@ -1,35 +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/htclow/htclow_types.hpp>
namespace ams::htclow {
class HtclowManager;
namespace HtclowManagerHolder {
void AddReference();
void Release();
HtclowManager *GetHtclowManager();
void SetDefaultDriver(htclow::impl::DriverType driver_type);
}
}

View File

@@ -1,66 +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/htclow/htclow_module_types.hpp>
namespace ams::htclow {
enum class ModuleId : u8 {
Unknown = 0,
Htcfs = 1,
Htcmisc = 3,
Htcs = 4,
};
struct ModuleType {
bool _is_initialized;
ModuleId _id;
};
constexpr void InitializeModule(ModuleType *out, ModuleId id) {
*out = {
._is_initialized = true,
._id = id,
};
}
constexpr void FinalizeModule(ModuleType *out) {
*out = {
._is_initialized = false,
._id = ModuleId::Unknown,
};
}
class Module final {
private:
ModuleType m_impl;
public:
constexpr explicit Module(ModuleId id) : m_impl() {
InitializeModule(std::addressof(m_impl), id);
}
constexpr ~Module() {
FinalizeModule(std::addressof(m_impl));
}
ModuleType *GetBase() { return std::addressof(m_impl); }
const ModuleType *GetBase() const { return std::addressof(m_impl); }
};
}

View File

@@ -1,42 +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::htclow {
namespace impl {
enum class DriverType {
Unknown = 0,
Debug = 1,
Socket = 2,
Usb = 3,
HostBridge = 4,
PlainChannel = 5,
};
}
constexpr inline s16 ProtocolVersion = 5;
enum ReceiveOption {
ReceiveOption_NonBlocking = 0,
ReceiveOption_ReceiveAnyData = 1,
ReceiveOption_ReceiveAllData = 2,
};
}

View File

@@ -1,61 +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/htclow/htclow_channel_types.hpp>
namespace ams::htclow::impl {
struct ChannelInternalType {
ChannelId channel_id;
s8 reserved;
ModuleId module_id;
};
static_assert(sizeof(ChannelInternalType) == 4);
constexpr ALWAYS_INLINE ChannelInternalType ConvertChannelType(ChannelType channel) {
return {
.channel_id = channel._channel_id,
.reserved = 0,
.module_id = channel._module_id,
};
}
constexpr ALWAYS_INLINE bool operator==(const ChannelInternalType &lhs, const ChannelInternalType &rhs) {
return lhs.module_id == rhs.module_id && lhs.reserved == rhs.reserved && lhs.channel_id == rhs.channel_id;
}
constexpr ALWAYS_INLINE bool operator!=(const ChannelInternalType &lhs, const ChannelInternalType &rhs) {
return !(lhs == rhs);
}
constexpr ALWAYS_INLINE bool operator<(const ChannelInternalType &lhs, const ChannelInternalType &rhs) {
return std::tie(lhs.module_id, lhs.reserved, lhs.channel_id) < std::tie(rhs.module_id, rhs.reserved, rhs.channel_id);
}
constexpr ALWAYS_INLINE bool operator>(const ChannelInternalType &lhs, const ChannelInternalType &rhs) {
return rhs < lhs;
}
constexpr ALWAYS_INLINE bool operator<=(const ChannelInternalType &lhs, const ChannelInternalType &rhs) {
return !(lhs > rhs);
}
constexpr ALWAYS_INLINE bool operator>=(const ChannelInternalType &lhs, const ChannelInternalType &rhs) {
return !(lhs < rhs);
}
}