hwmon: (ina238) Order chip information alphabetically

Order chip type enum and chip configuration data alphabetically
to simplify adding support for additional chips.

No functional change.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Guenter Roeck
2025-09-07 16:34:48 -07:00
parent a1d5f8ecb9
commit e7702d72c3
+12 -12
View File
@@ -100,7 +100,7 @@ static const struct regmap_config ina238_regmap_config = {
.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 */
@@ -127,7 +127,16 @@ struct ina238_data {
};
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,
@@ -136,7 +145,7 @@ static const struct ina238_config ina238_config[] = {
.bus_voltage_lsb = INA238_BUS_VOLTAGE_LSB,
.temp_resolution = 12,
},
[ina237] = {
[ina238] = {
.has_20bit_voltage_current = false,
.has_energy = false,
.has_power_highest = false,
@@ -154,15 +163,6 @@ static const struct ina238_config ina238_config[] = {
.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)