1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-12-18 08:22:04 +00:00

i2c: add aula pmic device code

This commit is contained in:
Michael Scire 2021-04-30 08:42:25 -07:00
parent 296a6af058
commit 7040e8976d

View file

@ -106,6 +106,7 @@ namespace ams::i2c {
I2cDevice_Max77812_2 = 29,
I2cDevice_Ina226VddDdr0V6 = 30,
I2cDevice_HoagNfcIc = 31, /* TODO */
I2cDevice_PmicUnknownAula_4_18 = 32, /* TODO */
};
/* TODO: Better place for this? */
@ -155,6 +156,7 @@ namespace ams::i2c {
constexpr inline const DeviceCode DeviceCode_Max77812_2 = 0x3A000006;
constexpr inline const DeviceCode DeviceCode_Ina226VddDdr0V6 = 0x3F000409;
constexpr inline const DeviceCode DeviceCode_HoagNfcIc = 0x36000001;
constexpr inline const DeviceCode DeviceCode_PmicUnknownAula_4_18 = 0x3A000007;
constexpr inline DeviceCode ConvertToDeviceCode(I2cDevice dv) {
switch (dv) {
@ -190,13 +192,14 @@ namespace ams::i2c {
case I2cDevice_Max77812_2: return DeviceCode_Max77812_2;
case I2cDevice_Ina226VddDdr0V6: return DeviceCode_Ina226VddDdr0V6;
case I2cDevice_HoagNfcIc: return DeviceCode_HoagNfcIc;
case I2cDevice_PmicUnknownAula_4_18: return DeviceCode_PmicUnknownAula_4_18;
AMS_UNREACHABLE_DEFAULT_CASE();
}
}
constexpr inline I2cDevice ConvertToI2cDevice(DeviceCode dc) {
switch (dc.GetInternalValue()) {
case DeviceCode_ClassicController.GetInternalValue(): return I2cDevice_ClassicController;
case DeviceCode_ClassicController .GetInternalValue(): return I2cDevice_ClassicController;
case DeviceCode_Ftm3bd56 .GetInternalValue(): return I2cDevice_Ftm3bd56;
case DeviceCode_Tmp451 .GetInternalValue(): return I2cDevice_Tmp451;
/* case DeviceCode_Nct72 .GetInternalValue(): return I2cDevice_Nct72; */
@ -228,6 +231,7 @@ namespace ams::i2c {
case DeviceCode_Max77812_2 .GetInternalValue(): return I2cDevice_Max77812_2;
case DeviceCode_Ina226VddDdr0V6 .GetInternalValue(): return I2cDevice_Ina226VddDdr0V6;
case DeviceCode_HoagNfcIc .GetInternalValue(): return I2cDevice_HoagNfcIc;
case DeviceCode_PmicUnknownAula_4_18.GetInternalValue(): return I2cDevice_PmicUnknownAula_4_18;
AMS_UNREACHABLE_DEFAULT_CASE();
}
}