.val_bits = 16,
};
-enum ina238_ids { ina238, ina237, sq52206, ina228 };
+enum ina238_ids { ina228, ina237, ina238, sq52206 };
struct ina238_config {
bool has_20bit_voltage_current; /* vshunt, vbus and current are 20-bit fields */
};
static const struct ina238_config ina238_config[] = {
- [ina238] = {
+ [ina228] = {
+ .has_20bit_voltage_current = true,
+ .has_energy = true,
+ .has_power_highest = false,
+ .power_calculate_factor = 20,
+ .config_default = INA238_CONFIG_DEFAULT,
+ .bus_voltage_lsb = INA238_BUS_VOLTAGE_LSB,
+ .temp_resolution = 16,
+ },
+ [ina237] = {
.has_20bit_voltage_current = false,
.has_energy = false,
.has_power_highest = false,
.bus_voltage_lsb = INA238_BUS_VOLTAGE_LSB,
.temp_resolution = 12,
},
- [ina237] = {
+ [ina238] = {
.has_20bit_voltage_current = false,
.has_energy = false,
.has_power_highest = false,
.bus_voltage_lsb = SQ52206_BUS_VOLTAGE_LSB,
.temp_resolution = 16,
},
- [ina228] = {
- .has_20bit_voltage_current = true,
- .has_energy = true,
- .has_power_highest = false,
- .power_calculate_factor = 20,
- .config_default = INA238_CONFIG_DEFAULT,
- .bus_voltage_lsb = INA238_BUS_VOLTAGE_LSB,
- .temp_resolution = 16,
- },
};
static int ina238_read_reg24(const struct i2c_client *client, u8 reg, u32 *val)