]> www.infradead.org Git - users/hch/misc.git/commitdiff
hwmon: (ina238) Order chip information alphabetically
authorGuenter Roeck <linux@roeck-us.net>
Sun, 31 Aug 2025 16:34:13 +0000 (09:34 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 7 Sep 2025 23:34:48 +0000 (16:34 -0700)
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>
drivers/hwmon/ina238.c

index 97f12efcaef49dc40877e152e28aa8e0ff4c2060..4681325f58f03cc2fb14a11e65f4f25d56a4a16e 100644 (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)