hwmon: (pmbus/adm1275) add adm1281 support
authorJose Ramon San Buenaventura <jose.sanbuenaventura@analog.com>
Thu, 25 Apr 2024 07:09:48 +0000 (15:09 +0800)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 28 Apr 2024 17:08:43 +0000 (10:08 -0700)
Add support for adm1281 which is similar to adm1275 and other chips
of the series.

Signed-off-by: Jose Ramon San Buenaventura <jose.sanbuenaventura@analog.com>
Link: https://lore.kernel.org/r/20240425070948.25788-3-jose.sanbuenaventura@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Documentation/hwmon/adm1275.rst
drivers/hwmon/pmbus/Kconfig
drivers/hwmon/pmbus/adm1275.c

index 804590eeabdc864b882531cb500203357e045299..467daf8ce3c5b0d6fa8846976eef8f4006bb2419 100644 (file)
@@ -43,6 +43,14 @@ Supported chips:
 
     Datasheet: www.analog.com/static/imported-files/data_sheets/ADM1278.pdf
 
+  * Analog Devices ADM1281
+
+    Prefix: 'adm1281'
+
+    Addresses scanned: -
+
+    Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/adm1281.pdf
+
   * Analog Devices ADM1293/ADM1294
 
     Prefix: 'adm1293', 'adm1294'
@@ -58,10 +66,10 @@ Description
 -----------
 
 This driver supports hardware monitoring for Analog Devices ADM1075, ADM1272,
-ADM1275, ADM1276, ADM1278, ADM1293, and ADM1294 Hot-Swap Controller and
+ADM1275, ADM1276, ADM1278, ADM1281, ADM1293, and ADM1294 Hot-Swap Controller and
 Digital Power Monitors.
 
-ADM1075, ADM1272, ADM1275, ADM1276, ADM1278, ADM1293, and ADM1294 are hot-swap
+ADM1075, ADM1272, ADM1275, ADM1276, ADM1278, ADM1281, ADM1293, and ADM1294 are hot-swap
 controllers that allow a circuit board to be removed from or inserted into
 a live backplane. They also feature current and voltage readback via an
 integrated 12 bit analog-to-digital converter (ADC), accessed using a
@@ -144,5 +152,5 @@ temp1_highest               Highest observed temperature.
 temp1_reset_history    Write any value to reset history.
 
                        Temperature attributes are supported on ADM1272 and
-                       ADM1278.
+                       ADM1278, and ADM1281.
 ======================= =======================================================
index 38e794d83cc3dbf2c0d3b06875b85aa47786accc..2c727003433bed4c793f1f73b0c216c62edbc6dc 100644 (file)
@@ -51,8 +51,8 @@ config SENSORS_ADM1275
        tristate "Analog Devices ADM1275 and compatibles"
        help
          If you say yes here you get hardware monitoring support for Analog
-         Devices ADM1075, ADM1272, ADM1275, ADM1276, ADM1278, ADM1293,
-         and ADM1294 Hot-Swap Controller and Digital Power Monitors.
+         Devices ADM1075, ADM1272, ADM1275, ADM1276, ADM1278, ADM1281,
+         ADM1293, and ADM1294 Hot-Swap Controller and Digital Power Monitors.
 
          This driver can also be built as a module. If so, the module will
          be called adm1275.
index e2c61d6fa521b1ca78e83328a14d2c315822d6c4..59ffc08289bdf734a5a2232ba0a922587b15bee7 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/log2.h>
 #include "pmbus.h"
 
-enum chips { adm1075, adm1272, adm1275, adm1276, adm1278, adm1293, adm1294 };
+enum chips { adm1075, adm1272, adm1275, adm1276, adm1278, adm1281, adm1293, adm1294 };
 
 #define ADM1275_MFR_STATUS_IOUT_WARN2  BIT(0)
 #define ADM1293_MFR_STATUS_VAUX_UV_WARN        BIT(5)
@@ -482,6 +482,7 @@ static const struct i2c_device_id adm1275_id[] = {
        { "adm1275", adm1275 },
        { "adm1276", adm1276 },
        { "adm1278", adm1278 },
+       { "adm1281", adm1281 },
        { "adm1293", adm1293 },
        { "adm1294", adm1294 },
        { }
@@ -555,7 +556,8 @@ static int adm1275_probe(struct i2c_client *client)
                           client->name, mid->name);
 
        if (mid->driver_data == adm1272 || mid->driver_data == adm1278 ||
-           mid->driver_data == adm1293 || mid->driver_data == adm1294)
+           mid->driver_data == adm1281 || mid->driver_data == adm1293 ||
+           mid->driver_data == adm1294)
                config_read_fn = i2c_smbus_read_word_data;
        else
                config_read_fn = i2c_smbus_read_byte_data;
@@ -703,6 +705,7 @@ static int adm1275_probe(struct i2c_client *client)
                          PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT;
                break;
        case adm1278:
+       case adm1281:
                data->have_vout = true;
                data->have_pin_max = true;
                data->have_temp_max = true;