From 2014c95afecee3e76ca4a56956a936e23283f05b Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 2 Feb 2025 15:39:26 -0800 Subject: [PATCH 01/16] Linux 6.14-rc1 --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4117cc79748b..9e0d63d9d94b 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 -PATCHLEVEL = 13 +PATCHLEVEL = 14 SUBLEVEL = 0 -EXTRAVERSION = +EXTRAVERSION = -rc1 NAME = Baby Opossum Posse # *DOCUMENTATION* -- 2.51.0 From 352a21d29092d16aef6905ecb8857c3876038b15 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Wed, 29 Jan 2025 17:20:36 +0200 Subject: [PATCH 02/16] hwmon: (gsc) drop unneeded assignment for cache_type REGCACHE_NONE is the default type of the cache when not provided. Drop unneeded explicit assignment to it. Note, it's defined to 0, and if ever be redefined, it will break literally a lot of the drivers, so it very unlikely to happen. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20250129152036.1797725-1-andriy.shevchenko@linux.intel.com Signed-off-by: Guenter Roeck --- drivers/hwmon/gsc-hwmon.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/hwmon/gsc-hwmon.c b/drivers/hwmon/gsc-hwmon.c index 14a6385cd7cc..0f9af82cebec 100644 --- a/drivers/hwmon/gsc-hwmon.c +++ b/drivers/hwmon/gsc-hwmon.c @@ -47,7 +47,6 @@ static const struct regmap_bus gsc_hwmon_regmap_bus = { static const struct regmap_config gsc_hwmon_regmap_config = { .reg_bits = 8, .val_bits = 8, - .cache_type = REGCACHE_NONE, }; static ssize_t pwm_auto_point_temp_show(struct device *dev, -- 2.51.0 From 8dfd7e08269ad48a8d64d647ced6878f3b2da84a Mon Sep 17 00:00:00 2001 From: Cedric Encarnacion Date: Fri, 24 Jan 2025 23:23:05 +0800 Subject: [PATCH 03/16] dt-bindings: hwmon: ltc2978: add support for ltm4673 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Add LTM4673 to supported devices of LTC2978. Unlike other LTM46xx devices, LTM4673 is a μModule regulator that outputs four channels. Signed-off-by: Cedric Encarnacion Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20250124-ltm4673-v1-1-a2c6aa37c903@analog.com Signed-off-by: Guenter Roeck --- Documentation/devicetree/bindings/hwmon/lltc,ltc2978.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/hwmon/lltc,ltc2978.yaml b/Documentation/devicetree/bindings/hwmon/lltc,ltc2978.yaml index 37e1dc9c7dd3..eeb6a4fe80b2 100644 --- a/Documentation/devicetree/bindings/hwmon/lltc,ltc2978.yaml +++ b/Documentation/devicetree/bindings/hwmon/lltc,ltc2978.yaml @@ -30,6 +30,7 @@ properties: - lltc,ltc7880 - lltc,ltm2987 - lltc,ltm4664 + - lltc,ltm4673 - lltc,ltm4675 - lltc,ltm4676 - lltc,ltm4677 @@ -55,6 +56,7 @@ properties: * ltc7880 : vout0 - vout1 * ltc3883 : vout0 * ltm4664 : vout0 - vout1 + * ltm4673 : vout0 - vout3 * ltm4675, ltm4676, ltm4677, ltm4678 : vout0 - vout1 * ltm4680, ltm4686 : vout0 - vout1 * ltm4700 : vout0 - vout1 -- 2.51.0 From 68b6f9586199fdc7f123bd91ea4a74bf9416eae8 Mon Sep 17 00:00:00 2001 From: Cedric Encarnacion Date: Fri, 24 Jan 2025 23:23:06 +0800 Subject: [PATCH 04/16] hwmon: (pmbus/ltc2978) add support for ltm4673 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Add support for LTM4673. The LTM4673 is a quad output, dual 12A and dual 5A, switching mode DC/DC step-down μModule regulator integrated with 4-channel power system manager. This adds only the chip id, the checks for the manufacturer special id, and the relevant attributes for the device's pmbus_driver_info. The device does not support clear peaks. Signed-off-by: Cedric Encarnacion Link: https://lore.kernel.org/r/20250124-ltm4673-v1-2-a2c6aa37c903@analog.com Signed-off-by: Guenter Roeck --- Documentation/hwmon/ltc2978.rst | 8 ++++++++ drivers/hwmon/pmbus/Kconfig | 4 ++-- drivers/hwmon/pmbus/ltc2978.c | 25 +++++++++++++++++++++++-- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/Documentation/hwmon/ltc2978.rst b/Documentation/hwmon/ltc2978.rst index 651ca4904c66..feae53eb9fbf 100644 --- a/Documentation/hwmon/ltc2978.rst +++ b/Documentation/hwmon/ltc2978.rst @@ -151,6 +151,14 @@ Supported chips: Datasheet: https://www.analog.com/en/products/ltm4644 + * Linear Technology LTM4673 + + Prefix: 'ltm4673' + + Addresses scanned: - + + Datasheet: https://www.analog.com/en/products/ltm4673 + * Linear Technology LTM4675 Prefix: 'ltm4675' diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig index 419469f40ba0..675b0d4703d8 100644 --- a/drivers/hwmon/pmbus/Kconfig +++ b/drivers/hwmon/pmbus/Kconfig @@ -234,8 +234,8 @@ config SENSORS_LTC2978_REGULATOR help If you say yes here you get regulator support for Linear Technology LTC3880, LTC3883, LTC3884, LTC3886, LTC3887, LTC3889, LTC7841, - LTC7880, LTM4644, LTM4675, LTM4676, LTM4677, LTM4678, LTM4680, - LTM4686, and LTM4700. + LTC7880, LTM4644, LTM4673, LTM4675, LTM4676, LTM4677, LTM4678, + LTM4680, LTM4686, and LTM4700. config SENSORS_LTC3815 tristate "Linear Technologies LTC3815" diff --git a/drivers/hwmon/pmbus/ltc2978.c b/drivers/hwmon/pmbus/ltc2978.c index 4c306943383a..658cb1173291 100644 --- a/drivers/hwmon/pmbus/ltc2978.c +++ b/drivers/hwmon/pmbus/ltc2978.c @@ -26,8 +26,8 @@ enum chips { ltc3880, ltc3882, ltc3883, ltc3884, ltc3886, ltc3887, ltc3889, ltc7132, ltc7841, ltc7880, /* Modules */ - ltm2987, ltm4664, ltm4675, ltm4676, ltm4677, ltm4678, ltm4680, ltm4686, - ltm4700, + ltm2987, ltm4664, ltm4673, ltm4675, ltm4676, ltm4677, ltm4678, ltm4680, + ltm4686, ltm4700, }; /* Common for all chips */ @@ -86,6 +86,8 @@ enum chips { #define LTM2987_ID_A 0x8010 /* A/B for two die IDs */ #define LTM2987_ID_B 0x8020 #define LTM4664_ID 0x4120 +#define LTM4673_ID_REV1 0x0230 +#define LTM4673_ID 0x4480 #define LTM4675_ID 0x47a0 #define LTM4676_ID_REV1 0x4400 #define LTM4676_ID_REV2 0x4480 @@ -554,6 +556,7 @@ static const struct i2c_device_id ltc2978_id[] = { {"ltc7880", ltc7880}, {"ltm2987", ltm2987}, {"ltm4664", ltm4664}, + {"ltm4673", ltm4673}, {"ltm4675", ltm4675}, {"ltm4676", ltm4676}, {"ltm4677", ltm4677}, @@ -665,6 +668,8 @@ static int ltc2978_get_id(struct i2c_client *client) return ltm2987; else if (chip_id == LTM4664_ID) return ltm4664; + else if (chip_id == LTM4673_ID || chip_id == LTM4673_ID_REV1) + return ltm4673; else if (chip_id == LTM4675_ID) return ltm4675; else if (chip_id == LTM4676_ID_REV1 || chip_id == LTM4676_ID_REV2 || @@ -869,6 +874,21 @@ static int ltc2978_probe(struct i2c_client *client) | PMBUS_HAVE_IOUT | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP; break; + case ltm4673: + data->features |= FEAT_NEEDS_POLLING; + info->read_word_data = ltc2975_read_word_data; + info->pages = LTC2974_NUM_PAGES; + info->func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT + | PMBUS_HAVE_TEMP2; + for (i = 0; i < info->pages; i++) { + info->func[i] |= PMBUS_HAVE_IIN + | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT + | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT + | PMBUS_HAVE_PIN + | PMBUS_HAVE_POUT + | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP; + } + break; default: return -ENODEV; } @@ -926,6 +946,7 @@ static const struct of_device_id ltc2978_of_match[] = { { .compatible = "lltc,ltc7880" }, { .compatible = "lltc,ltm2987" }, { .compatible = "lltc,ltm4664" }, + { .compatible = "lltc,ltm4673" }, { .compatible = "lltc,ltm4675" }, { .compatible = "lltc,ltm4676" }, { .compatible = "lltc,ltm4677" }, -- 2.51.0 From d9371812f181c8d162d89f23804112888a045d08 Mon Sep 17 00:00:00 2001 From: Ming Yu Date: Fri, 17 Jan 2025 18:07:44 +0800 Subject: [PATCH 05/16] dt-bindings: hwmon: lm90: Add support for NCT7716, NCT7717 and NCT7718 Add support for the Nuvoton NCT7716/7717/7718 thermal sensors. NCT7716 and NCT7717 do not support to add temperature offset. The maximum offset supported by NCT7718 is 127875 millicelsius Reviewed-by: Krzysztof Kozlowski Signed-off-by: Ming Yu Link: https://lore.kernel.org/r/20250117100744.1571385-3-a0282524688@gmail.com Signed-off-by: Guenter Roeck --- Documentation/devicetree/bindings/hwmon/national,lm90.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml index 6e59c8fdef30..4feb76919404 100644 --- a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml +++ b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml @@ -32,6 +32,9 @@ properties: - national,lm89 - national,lm90 - national,lm99 + - nuvoton,nct7716 + - nuvoton,nct7717 + - nuvoton,nct7718 - nxp,sa56004 - onnn,nct1008 - ti,tmp451 @@ -120,6 +123,8 @@ allOf: - dallas,max6659 - dallas,max6695 - dallas,max6696 + - nuvoton,nct7716 + - nuvoton,nct7717 then: patternProperties: "^channel@([0-2])$": @@ -155,6 +160,7 @@ allOf: - national,lm89 - national,lm90 - national,lm99 + - nuvoton,nct7718 - nxp,sa56004 - winbond,w83l771 then: -- 2.51.0 From 02778f69fd34a368dbc8ae37a36cf1b25beb70d1 Mon Sep 17 00:00:00 2001 From: Ming Yu Date: Fri, 17 Jan 2025 18:07:43 +0800 Subject: [PATCH 06/16] hwmon: (lm90): Add support for NCT7716, NCT7717 and NCT7718 NCT7716 is similar to NCT7717 but has one more address support, both of them only have a 8 bit resolution local thermal sensor. NCT7718 has 11 bit resoulution remote thermal sensor. Signed-off-by: Ming Yu Link: https://lore.kernel.org/r/20250117100744.1571385-2-a0282524688@gmail.com Signed-off-by: Guenter Roeck --- Documentation/hwmon/lm90.rst | 43 +++++++++++++++++++ drivers/hwmon/Kconfig | 2 +- drivers/hwmon/lm90.c | 82 +++++++++++++++++++++++++++++++++++- 3 files changed, 124 insertions(+), 3 deletions(-) diff --git a/Documentation/hwmon/lm90.rst b/Documentation/hwmon/lm90.rst index 23af17a0ab44..98452eed16d5 100644 --- a/Documentation/hwmon/lm90.rst +++ b/Documentation/hwmon/lm90.rst @@ -365,6 +365,34 @@ Supported chips: Datasheet: Not publicly available, can be requested from Nuvoton + * Nuvoton NCT7716 + + Prefix: 'nct7716' + + Addresses scanned: I2C 0x48, 0x49 + + Datasheet: Not publicly available, can be requested from Nuvoton + + * Nuvoton NCT7717 + + Prefix: 'nct7717' + + Addresses scanned: I2C 0x48 + + Datasheet: Publicly available at Nuvoton website + + https://www.nuvoton.com/resource-files/Nuvoton_NCT7717U_Datasheet_V111.pdf + + * Nuvoton NCT7718 + + Prefix: 'nct7718' + + Addresses scanned: I2C 0x4c + + Datasheet: Publicly available at Nuvoton website + + https://www.nuvoton.com/resource-files/Nuvoton_NCT7718W_Datasheet_V11.pdf + * Philips/NXP SA56004X Prefix: 'sa56004' @@ -573,6 +601,21 @@ W83L771AWG/ASG * The AWG and ASG variants only differ in package format. * Diode ideality factor configuration (remote sensor) at 0xE3 +NCT7716: + * 8 bit sensor resolution + * Selectable address + * Configurable conversion rate + +NCT7717: + * 8 bit sensor resolution + * Configurable conversion rate + +NCT7718: + * Temperature offset register for remote temperature sensor + * 11 bit resolution for remote temperature sensor + * Low temperature limits + * Configurable conversion rate + SA56004X: * Better local resolution diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 4cbaba15d86e..f114d0c55d78 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -1519,7 +1519,7 @@ config SENSORS_LM90 MAX6657, MAX6658, MAX6659, MAX6680, MAX6681, MAX6692, MAX6695, MAX6696, ON Semiconductor NCT1008, NCT210, NCT72, NCT214, NCT218, - Winbond/Nuvoton W83L771W/G/AWG/ASG, + Winbond/Nuvoton W83L771W/G/AWG/ASG, NCT7716, NCT7717 and NCT7718, Philips NE1618, SA56004, GMT G781, Texas Instruments TMP451 and TMP461 sensor chips. diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 511d95a0efb3..75f09553fd67 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -90,6 +90,9 @@ * This driver also supports NE1618 from Philips. It is similar to NE1617 * but supports 11 bit external temperature values. * + * This driver also supports NCT7716, NCT7717 and NCT7718 from Nuvoton. + * The NCT7716 is similar to NCT7717 but has one more address support. + * * Since the LM90 was the first chipset supported by this driver, most * comments will refer to this chipset, but are actually general and * concern all supported chipsets, unless mentioned otherwise. @@ -119,13 +122,15 @@ * Address is fully defined internally and cannot be changed except for * MAX6659, MAX6680 and MAX6681. * LM86, LM89, LM90, LM99, ADM1032, ADM1032-1, ADT7461, ADT7461A, MAX6649, - * MAX6657, MAX6658, NCT1008 and W83L771 have address 0x4c. + * MAX6657, MAX6658, NCT1008, NCT7718 and W83L771 have address 0x4c. * ADM1032-2, ADT7461-2, ADT7461A-2, LM89-1, LM99-1, MAX6646, and NCT1008D * have address 0x4d. * MAX6647 has address 0x4e. * MAX6659 can have address 0x4c, 0x4d or 0x4e. * MAX6654, MAX6680, and MAX6681 can have address 0x18, 0x19, 0x1a, 0x29, * 0x2a, 0x2b, 0x4c, 0x4d or 0x4e. + * NCT7716 can have address 0x48 or 0x49. + * NCT7717 has address 0x48. * SA56004 can have address 0x48 through 0x4F. */ @@ -136,7 +141,7 @@ static const unsigned short normal_i2c[] = { enum chips { adm1023, adm1032, adt7461, adt7461a, adt7481, g781, lm84, lm90, lm99, max1617, max6642, max6646, max6648, max6654, max6657, max6659, max6680, max6696, - nct210, nct72, ne1618, sa56004, tmp451, tmp461, w83l771, + nct210, nct72, nct7716, nct7717, nct7718, ne1618, sa56004, tmp451, tmp461, w83l771, }; /* @@ -191,6 +196,9 @@ enum chips { adm1023, adm1032, adt7461, adt7461a, adt7481, #define ADT7481_REG_MAN_ID 0x3e #define ADT7481_REG_CHIP_ID 0x3d +/* NCT7716/7717/7718 registers */ +#define NCT7716_REG_CHIP_ID 0xFD + /* Device features */ #define LM90_HAVE_EXTENDED_TEMP BIT(0) /* extended temperature support */ #define LM90_HAVE_OFFSET BIT(1) /* temperature offset register */ @@ -275,6 +283,9 @@ static const struct i2c_device_id lm90_id[] = { { "nct214", nct72 }, { "nct218", nct72 }, { "nct72", nct72 }, + { "nct7716", nct7716 }, + { "nct7717", nct7717 }, + { "nct7718", nct7718 }, { "ne1618", ne1618 }, { "w83l771", w83l771 }, { "sa56004", sa56004 }, @@ -382,6 +393,18 @@ static const struct of_device_id __maybe_unused lm90_of_match[] = { .compatible = "onnn,nct72", .data = (void *)nct72 }, + { + .compatible = "nuvoton,nct7716", + .data = (void *)nct7716 + }, + { + .compatible = "nuvoton,nct7717", + .data = (void *)nct7717 + }, + { + .compatible = "nuvoton,nct7718", + .data = (void *)nct7718 + }, { .compatible = "winbond,w83l771", .data = (void *)w83l771 @@ -601,6 +624,26 @@ static const struct lm90_params lm90_params[] = { .resolution = 11, .max_convrate = 7, }, + [nct7716] = { + .flags = LM90_HAVE_ALARMS | LM90_HAVE_CONVRATE, + .alert_alarms = 0x40, + .resolution = 8, + .max_convrate = 8, + }, + [nct7717] = { + .flags = LM90_HAVE_ALARMS | LM90_HAVE_CONVRATE, + .alert_alarms = 0x40, + .resolution = 8, + .max_convrate = 8, + }, + [nct7718] = { + .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT | LM90_HAVE_CRIT + | LM90_HAVE_ALARMS | LM90_HAVE_LOW | LM90_HAVE_CONVRATE + | LM90_HAVE_REMOTE_EXT, + .alert_alarms = 0x7c, + .resolution = 11, + .max_convrate = 8, + }, [ne1618] = { .flags = LM90_PAUSE_FOR_CONFIG | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_LOW | LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT, @@ -2300,6 +2343,38 @@ static const char *lm90_detect_nuvoton(struct i2c_client *client, int chip_id, return name; } +static const char *lm90_detect_nuvoton_50(struct i2c_client *client, int chip_id, + int config1, int convrate) +{ + int chip_id2 = i2c_smbus_read_byte_data(client, NCT7716_REG_CHIP_ID); + int config2 = i2c_smbus_read_byte_data(client, LM90_REG_CONFIG2); + int address = client->addr; + const char *name = NULL; + + if (chip_id2 < 0 || config2 < 0) + return NULL; + + if (chip_id2 != 0x50 || convrate > 0x08) + return NULL; + + switch (chip_id) { + case 0x90: + if (address == 0x48 && !(config1 & 0x3e) && !(config2 & 0xfe)) + name = "nct7717"; + break; + case 0x91: + if ((address == 0x48 || address == 0x49) && !(config1 & 0x3e) && + !(config2 & 0xfe)) + name = "nct7716"; + else if (address == 0x4c && !(config1 & 0x38) && !(config2 & 0xf8)) + name = "nct7718"; + break; + default: + break; + } + return name; +} + static const char *lm90_detect_nxp(struct i2c_client *client, bool common_address, int chip_id, int config1, int convrate) { @@ -2484,6 +2559,9 @@ static int lm90_detect(struct i2c_client *client, struct i2c_board_info *info) name = lm90_detect_maxim(client, common_address, chip_id, config1, convrate); break; + case 0x50: + name = lm90_detect_nuvoton_50(client, chip_id, config1, convrate); + break; case 0x54: /* ON MC1066, Microchip TC1068, TCM1617 (originally TelCom) */ if (common_address && !(config1 & 0x3f) && !(convrate & 0xf8)) name = "mc1066"; -- 2.51.0 From c36e0a1b26cb914fd4156c68de0687d8df02bf01 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Thu, 23 Jan 2025 17:03:47 +0100 Subject: [PATCH 07/16] hwmon: (isl28022) Use per-client debugfs entry The I2C core now offers a debugfs-directory per client. Use it and remove the custom handling. Signed-off-by: Wolfram Sang Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20250123160347.44635-1-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck --- drivers/hwmon/isl28022.c | 44 ++-------------------------------------- 1 file changed, 2 insertions(+), 42 deletions(-) diff --git a/drivers/hwmon/isl28022.c b/drivers/hwmon/isl28022.c index 3f9b4520b53e..1fb9864635db 100644 --- a/drivers/hwmon/isl28022.c +++ b/drivers/hwmon/isl28022.c @@ -324,26 +324,6 @@ static int shunt_voltage_show(struct seq_file *seqf, void *unused) } DEFINE_SHOW_ATTRIBUTE(shunt_voltage); -static struct dentry *isl28022_debugfs_root; - -static void isl28022_debugfs_remove(void *res) -{ - debugfs_remove_recursive(res); -} - -static void isl28022_debugfs_init(struct i2c_client *client, struct isl28022_data *data) -{ - char name[16]; - struct dentry *debugfs; - - scnprintf(name, sizeof(name), "%d-%04hx", client->adapter->nr, client->addr); - - debugfs = debugfs_create_dir(name, isl28022_debugfs_root); - debugfs_create_file("shunt_voltage", 0444, debugfs, data, &shunt_voltage_fops); - - devm_add_action_or_reset(&client->dev, isl28022_debugfs_remove, debugfs); -} - /* * read property values and make consistency checks. * @@ -475,7 +455,7 @@ static int isl28022_probe(struct i2c_client *client) if (err) return err; - isl28022_debugfs_init(client, data); + debugfs_create_file("shunt_voltage", 0444, client->debugfs, data, &shunt_voltage_fops); hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name, data, &isl28022_chip_info, NULL); @@ -505,27 +485,7 @@ static struct i2c_driver isl28022_driver = { .probe = isl28022_probe, .id_table = isl28022_ids, }; - -static int __init isl28022_init(void) -{ - int err; - - isl28022_debugfs_root = debugfs_create_dir("isl28022", NULL); - err = i2c_add_driver(&isl28022_driver); - if (!err) - return 0; - - debugfs_remove_recursive(isl28022_debugfs_root); - return err; -} -module_init(isl28022_init); - -static void __exit isl28022_exit(void) -{ - i2c_del_driver(&isl28022_driver); - debugfs_remove_recursive(isl28022_debugfs_root); -} -module_exit(isl28022_exit); +module_i2c_driver(isl28022_driver); MODULE_AUTHOR("Carsten Spieß "); MODULE_DESCRIPTION("ISL28022 driver"); -- 2.51.0 From 82dda5cb88f8e8604fc7ddf3ea614579696c5f10 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Sat, 25 Jan 2025 13:39:41 +0100 Subject: [PATCH 08/16] hwmon: (ina3221) Use per-client debugfs entry The I2C core now offers a debugfs-directory per client. Use it and remove the custom handling. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20250125123941.36729-9-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck --- drivers/hwmon/ina3221.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/hwmon/ina3221.c b/drivers/hwmon/ina3221.c index 1bf479a0f793..ce0e3f214f5b 100644 --- a/drivers/hwmon/ina3221.c +++ b/drivers/hwmon/ina3221.c @@ -116,7 +116,6 @@ struct ina3221_input { * @fields: Register fields of the device * @inputs: Array of channel input source specific structures * @lock: mutex lock to serialize sysfs attribute accesses - * @debugfs: Pointer to debugfs entry for device * @reg_config: Register value of INA3221_CONFIG * @summation_shunt_resistor: equivalent shunt resistor value for summation * @summation_channel_control: Value written to SCC field in INA3221_MASK_ENABLE @@ -128,7 +127,6 @@ struct ina3221_data { struct regmap_field *fields[F_MAX_FIELDS]; struct ina3221_input inputs[INA3221_NUM_CHANNELS]; struct mutex lock; - struct dentry *debugfs; u32 reg_config; int summation_shunt_resistor; u32 summation_channel_control; @@ -913,12 +911,9 @@ static int ina3221_probe(struct i2c_client *client) goto fail; } - scnprintf(name, sizeof(name), "%s-%s", INA3221_DRIVER_NAME, dev_name(dev)); - ina->debugfs = debugfs_create_dir(name, NULL); - for (i = 0; i < INA3221_NUM_CHANNELS; i++) { scnprintf(name, sizeof(name), "in%d_summation_disable", i); - debugfs_create_bool(name, 0400, ina->debugfs, + debugfs_create_bool(name, 0400, client->debugfs, &ina->inputs[i].summation_disable); } @@ -940,8 +935,6 @@ static void ina3221_remove(struct i2c_client *client) struct ina3221_data *ina = dev_get_drvdata(&client->dev); int i; - debugfs_remove_recursive(ina->debugfs); - pm_runtime_disable(ina->pm_dev); pm_runtime_set_suspended(ina->pm_dev); -- 2.51.0 From 2e522c2933d0291d470ea8633bb36097304b9361 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Sat, 25 Jan 2025 13:39:42 +0100 Subject: [PATCH 09/16] hwmon: (ltc4282) Use per-client debugfs entry The I2C core now offers a debugfs-directory per client. Use it and remove the custom handling. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20250125123941.36729-10-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck --- drivers/hwmon/ltc4282.c | 44 ++++++++--------------------------------- 1 file changed, 8 insertions(+), 36 deletions(-) diff --git a/drivers/hwmon/ltc4282.c b/drivers/hwmon/ltc4282.c index 4f608a3790fb..7f38d2696239 100644 --- a/drivers/hwmon/ltc4282.c +++ b/drivers/hwmon/ltc4282.c @@ -1674,47 +1674,19 @@ static int ltc4282_show_power1_bad_fault_log(void *arg, u64 *val) DEFINE_DEBUGFS_ATTRIBUTE(ltc4282_power1_bad_fault_log, ltc4282_show_power1_bad_fault_log, NULL, "%llu\n"); -static void ltc4282_debugfs_remove(void *dir) +static void ltc4282_debugfs_init(struct ltc4282_state *st, struct i2c_client *i2c) { - debugfs_remove_recursive(dir); -} - -static void ltc4282_debugfs_init(struct ltc4282_state *st, - struct i2c_client *i2c, - const struct device *hwmon) -{ - const char *debugfs_name; - struct dentry *dentry; - int ret; - - if (!IS_ENABLED(CONFIG_DEBUG_FS)) - return; - - debugfs_name = devm_kasprintf(&i2c->dev, GFP_KERNEL, "ltc4282-%s", - dev_name(hwmon)); - if (!debugfs_name) - return; - - dentry = debugfs_create_dir(debugfs_name, NULL); - if (IS_ERR(dentry)) - return; - - ret = devm_add_action_or_reset(&i2c->dev, ltc4282_debugfs_remove, - dentry); - if (ret) - return; - - debugfs_create_file_unsafe("power1_bad_fault_log", 0400, dentry, st, + debugfs_create_file_unsafe("power1_bad_fault_log", 0400, i2c->debugfs, st, <c4282_power1_bad_fault_log); - debugfs_create_file_unsafe("in0_fet_short_fault_log", 0400, dentry, st, + debugfs_create_file_unsafe("in0_fet_short_fault_log", 0400, i2c->debugfs, st, <c4282_fet_short_fault_log); - debugfs_create_file_unsafe("in0_fet_bad_fault_log", 0400, dentry, st, + debugfs_create_file_unsafe("in0_fet_bad_fault_log", 0400, i2c->debugfs, st, <c4282_fet_bad_fault_log); - debugfs_create_file_unsafe("in1_crit_fault_log", 0400, dentry, st, + debugfs_create_file_unsafe("in1_crit_fault_log", 0400, i2c->debugfs, st, <c4282_in1_crit_fault_log); - debugfs_create_file_unsafe("in1_lcrit_fault_log", 0400, dentry, st, + debugfs_create_file_unsafe("in1_lcrit_fault_log", 0400, i2c->debugfs, st, <c4282_in1_lcrit_fault_log); - debugfs_create_file_unsafe("curr1_crit_fault_log", 0400, dentry, st, + debugfs_create_file_unsafe("curr1_crit_fault_log", 0400, i2c->debugfs, st, <c4282_curr1_crit_fault_log); } @@ -1757,7 +1729,7 @@ static int ltc4282_probe(struct i2c_client *i2c) if (IS_ERR(hwmon)) return PTR_ERR(hwmon); - ltc4282_debugfs_init(st, i2c, hwmon); + ltc4282_debugfs_init(st, i2c); return 0; } -- 2.51.0 From cd4db38c436809bc9ea0ee2988f3f2562570ac93 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Sat, 25 Jan 2025 13:39:44 +0100 Subject: [PATCH 10/16] hwmon: (sg2042) Use per-client debugfs entry The I2C core now offers a debugfs-directory per client. Use it and remove the custom handling. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20250125123941.36729-12-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck --- drivers/hwmon/sg2042-mcu.c | 44 ++++++-------------------------------- 1 file changed, 7 insertions(+), 37 deletions(-) diff --git a/drivers/hwmon/sg2042-mcu.c b/drivers/hwmon/sg2042-mcu.c index aa3fb773602c..74c35945d169 100644 --- a/drivers/hwmon/sg2042-mcu.c +++ b/drivers/hwmon/sg2042-mcu.c @@ -50,12 +50,9 @@ struct sg2042_mcu_data { struct i2c_client *client; - struct dentry *debugfs; struct mutex mutex; }; -static struct dentry *sgmcu_debugfs; - static ssize_t reset_count_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -292,18 +289,15 @@ static const struct hwmon_chip_info sg2042_mcu_chip_info = { .info = sg2042_mcu_info, }; -static void sg2042_mcu_debugfs_init(struct sg2042_mcu_data *mcu, - struct device *dev) +static void sg2042_mcu_debugfs_init(struct sg2042_mcu_data *mcu) { - mcu->debugfs = debugfs_create_dir(dev_name(dev), sgmcu_debugfs); - - debugfs_create_file("firmware_version", 0444, mcu->debugfs, + debugfs_create_file("firmware_version", 0444, mcu->client->debugfs, mcu, &firmware_version_fops); - debugfs_create_file("pcb_version", 0444, mcu->debugfs, mcu, + debugfs_create_file("pcb_version", 0444, mcu->client->debugfs, mcu, &pcb_version_fops); - debugfs_create_file("mcu_type", 0444, mcu->debugfs, mcu, + debugfs_create_file("mcu_type", 0444, mcu->client->debugfs, mcu, &mcu_type_fops); - debugfs_create_file("board_type", 0444, mcu->debugfs, mcu, + debugfs_create_file("board_type", 0444, mcu->client->debugfs, mcu, &board_type_fops); } @@ -333,18 +327,11 @@ static int sg2042_mcu_i2c_probe(struct i2c_client *client) if (IS_ERR(hwmon_dev)) return PTR_ERR(hwmon_dev); - sg2042_mcu_debugfs_init(mcu, dev); + sg2042_mcu_debugfs_init(mcu); return 0; } -static void sg2042_mcu_i2c_remove(struct i2c_client *client) -{ - struct sg2042_mcu_data *mcu = i2c_get_clientdata(client); - - debugfs_remove_recursive(mcu->debugfs); -} - static const struct i2c_device_id sg2042_mcu_id[] = { { "sg2042-hwmon-mcu" }, { } @@ -364,25 +351,8 @@ static struct i2c_driver sg2042_mcu_driver = { .dev_groups = sg2042_mcu_groups, }, .probe = sg2042_mcu_i2c_probe, - .remove = sg2042_mcu_i2c_remove, .id_table = sg2042_mcu_id, }; +module_i2c_driver(sg2042_mcu_driver); -static int __init sg2042_mcu_init(void) -{ - sgmcu_debugfs = debugfs_create_dir("sg2042-mcu", NULL); - return i2c_add_driver(&sg2042_mcu_driver); -} - -static void __exit sg2042_mcu_exit(void) -{ - debugfs_remove_recursive(sgmcu_debugfs); - i2c_del_driver(&sg2042_mcu_driver); -} - -module_init(sg2042_mcu_init); -module_exit(sg2042_mcu_exit); - -MODULE_AUTHOR("Inochi Amaoto "); -MODULE_DESCRIPTION("MCU I2C driver for SG2042 soc platform"); MODULE_LICENSE("GPL"); -- 2.51.0 From 84d867067b2b18f2dd59a12b85c70c3600464874 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Sat, 25 Jan 2025 13:39:46 +0100 Subject: [PATCH 11/16] hwmon: (tps23861) Use per-client debugfs entry The I2C core now offers a debugfs-directory per client. Use it and remove the custom handling. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20250125123941.36729-14-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck --- drivers/hwmon/tps23861.c | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/drivers/hwmon/tps23861.c b/drivers/hwmon/tps23861.c index 80fb03f30c30..4cb3960d5170 100644 --- a/drivers/hwmon/tps23861.c +++ b/drivers/hwmon/tps23861.c @@ -114,7 +114,6 @@ struct tps23861_data { struct regmap *regmap; u32 shunt_resistor; struct i2c_client *client; - struct dentry *debugfs_dir; }; static const struct regmap_config tps23861_regmap_config = { @@ -503,25 +502,6 @@ static int tps23861_port_status_show(struct seq_file *s, void *data) DEFINE_SHOW_ATTRIBUTE(tps23861_port_status); -static void tps23861_init_debugfs(struct tps23861_data *data, - struct device *hwmon_dev) -{ - const char *debugfs_name; - - debugfs_name = devm_kasprintf(&data->client->dev, GFP_KERNEL, "%s-%s", - data->client->name, dev_name(hwmon_dev)); - if (!debugfs_name) - return; - - data->debugfs_dir = debugfs_create_dir(debugfs_name, NULL); - - debugfs_create_file("port_status", - 0400, - data->debugfs_dir, - data, - &tps23861_port_status_fops); -} - static int tps23861_probe(struct i2c_client *client) { struct device *dev = &client->dev; @@ -562,18 +542,12 @@ static int tps23861_probe(struct i2c_client *client) if (IS_ERR(hwmon_dev)) return PTR_ERR(hwmon_dev); - tps23861_init_debugfs(data, hwmon_dev); + debugfs_create_file("port_status", 0400, client->debugfs, data, + &tps23861_port_status_fops); return 0; } -static void tps23861_remove(struct i2c_client *client) -{ - struct tps23861_data *data = i2c_get_clientdata(client); - - debugfs_remove_recursive(data->debugfs_dir); -} - static const struct of_device_id __maybe_unused tps23861_of_match[] = { { .compatible = "ti,tps23861", }, { }, @@ -582,7 +556,6 @@ MODULE_DEVICE_TABLE(of, tps23861_of_match); static struct i2c_driver tps23861_driver = { .probe = tps23861_probe, - .remove = tps23861_remove, .driver = { .name = "tps23861", .of_match_table = of_match_ptr(tps23861_of_match), -- 2.51.0 From bfbb730c4255e1965d202f48e7aa71baa9a7c65b Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Fri, 31 Jan 2025 10:38:33 +0100 Subject: [PATCH 12/16] hwmon: (sht3x) Use per-client debugfs entry The I2C core now offers a debugfs-directory per client. Use it and remove the custom handling. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20250131095148.11973-2-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck --- drivers/hwmon/sht3x.c | 67 +++++++------------------------------------ 1 file changed, 11 insertions(+), 56 deletions(-) diff --git a/drivers/hwmon/sht3x.c b/drivers/hwmon/sht3x.c index 650b0bcc2359..557ad3e7752a 100644 --- a/drivers/hwmon/sht3x.c +++ b/drivers/hwmon/sht3x.c @@ -44,8 +44,6 @@ static const unsigned char sht3x_cmd_read_status_reg[] = { 0xf3, 0x2d }; static const unsigned char sht3x_cmd_clear_status_reg[] = { 0x30, 0x41 }; static const unsigned char sht3x_cmd_read_serial_number[] = { 0x37, 0x80 }; -static struct dentry *debugfs; - /* delays for single-shot mode i2c commands, both in us */ #define SHT3X_SINGLE_WAIT_TIME_HPM 15000 #define SHT3X_SINGLE_WAIT_TIME_MPM 6000 @@ -167,7 +165,6 @@ struct sht3x_data { enum sht3x_chips chip_id; struct mutex i2c_lock; /* lock for sending i2c commands */ struct mutex data_lock; /* lock for updating driver data */ - struct dentry *sensor_dir; u8 mode; const unsigned char *command; @@ -837,23 +834,7 @@ static int sht3x_write(struct device *dev, enum hwmon_sensor_types type, } } -static void sht3x_debugfs_init(struct sht3x_data *data) -{ - char name[32]; - - snprintf(name, sizeof(name), "i2c%u-%02x", - data->client->adapter->nr, data->client->addr); - data->sensor_dir = debugfs_create_dir(name, debugfs); - debugfs_create_u32("serial_number", 0444, - data->sensor_dir, &data->serial_number); -} - -static void sht3x_debugfs_remove(void *sensor_dir) -{ - debugfs_remove_recursive(sensor_dir); -} - -static int sht3x_serial_number_read(struct sht3x_data *data) +static void sht3x_serial_number_read(struct sht3x_data *data) { int ret; char buffer[SHT3X_RESPONSE_LENGTH]; @@ -864,11 +845,12 @@ static int sht3x_serial_number_read(struct sht3x_data *data) buffer, SHT3X_RESPONSE_LENGTH, 0); if (ret) - return ret; + return; data->serial_number = (buffer[0] << 24) | (buffer[1] << 16) | (buffer[3] << 8) | buffer[4]; - return ret; + + debugfs_create_u32("serial_number", 0444, client->debugfs, &data->serial_number); } static const struct hwmon_ops sht3x_ops = { @@ -930,28 +912,14 @@ static int sht3x_probe(struct i2c_client *client) if (ret) return ret; - ret = sht3x_serial_number_read(data); - if (ret) { - dev_dbg(dev, "unable to read serial number\n"); - } else { - sht3x_debugfs_init(data); - ret = devm_add_action_or_reset(dev, - sht3x_debugfs_remove, - data->sensor_dir); - if (ret) - return ret; - } - - hwmon_dev = devm_hwmon_device_register_with_info(dev, - client->name, - data, - &sht3x_chip_info, - sht3x_groups); - + hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name, data, + &sht3x_chip_info, sht3x_groups); if (IS_ERR(hwmon_dev)) - dev_dbg(dev, "unable to register hwmon device\n"); + return PTR_ERR(hwmon_dev); + + sht3x_serial_number_read(data); - return PTR_ERR_OR_ZERO(hwmon_dev); + return 0; } /* device ID table */ @@ -968,20 +936,7 @@ static struct i2c_driver sht3x_i2c_driver = { .probe = sht3x_probe, .id_table = sht3x_ids, }; - -static int __init sht3x_init(void) -{ - debugfs = debugfs_create_dir("sht3x", NULL); - return i2c_add_driver(&sht3x_i2c_driver); -} -module_init(sht3x_init); - -static void __exit sht3x_cleanup(void) -{ - debugfs_remove_recursive(debugfs); - i2c_del_driver(&sht3x_i2c_driver); -} -module_exit(sht3x_cleanup); +module_i2c_driver(sht3x_i2c_driver); MODULE_AUTHOR("David Frey "); MODULE_AUTHOR("Pascal Sachs "); -- 2.51.0 From 89cb3ca56cb3192ebd07a2d8eb62e857a42cf83f Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Wed, 5 Feb 2025 13:14:08 +0100 Subject: [PATCH 13/16] hwmon: (sg2042) Add back module description/author tags A previous code reorganization inadvertently dropped the two tags, which leads to a "make W=1" warning: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hwmon/sg2042-mcu.o Add these back. Fixes: cd4db38c4368 ("hwmon: (sg2042) Use per-client debugfs entry") Signed-off-by: Arnd Bergmann Reviewed-by: Inochi Amaoto Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/20250205121419.373464-1-arnd@kernel.org Signed-off-by: Guenter Roeck --- drivers/hwmon/sg2042-mcu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/hwmon/sg2042-mcu.c b/drivers/hwmon/sg2042-mcu.c index 74c35945d169..105131c4acf7 100644 --- a/drivers/hwmon/sg2042-mcu.c +++ b/drivers/hwmon/sg2042-mcu.c @@ -355,4 +355,6 @@ static struct i2c_driver sg2042_mcu_driver = { }; module_i2c_driver(sg2042_mcu_driver); +MODULE_AUTHOR("Inochi Amaoto "); +MODULE_DESCRIPTION("MCU I2C driver for SG2042 soc platform"); MODULE_LICENSE("GPL"); -- 2.51.0 From 4f3cef561f6551a4fcf0ef100530fd9e4c255f43 Mon Sep 17 00:00:00 2001 From: Purva Yeshi Date: Thu, 6 Feb 2025 01:31:34 +0530 Subject: [PATCH 14/16] docs: hwmon: Fix spelling and grammatical issues Fix spelling and grammatical errors across hwmon driver documentation files. Signed-off-by: Purva Yeshi Reviewed-by: Randy Dunlap Link: https://lore.kernel.org/r/20250205200134.12006-1-purvayeshi550@gmail.com Signed-off-by: Guenter Roeck --- Documentation/hwmon/abituguru-datasheet.rst | 8 ++++---- Documentation/hwmon/abituguru.rst | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/hwmon/abituguru-datasheet.rst b/Documentation/hwmon/abituguru-datasheet.rst index 0cd61471d2a2..19ba4b4cd034 100644 --- a/Documentation/hwmon/abituguru-datasheet.rst +++ b/Documentation/hwmon/abituguru-datasheet.rst @@ -6,9 +6,9 @@ First of all, what I know about uGuru is no fact based on any help, hints or datasheet from Abit. The data I have got on uGuru have I assembled through my weak knowledge in "backwards engineering". And just for the record, you may have noticed uGuru isn't a chip developed by -Abit, as they claim it to be. It's really just an microprocessor (uC) created by +Abit, as they claim it to be. It's really just a microprocessor (uC) created by Winbond (W83L950D). And no, reading the manual for this specific uC or -mailing Windbond for help won't give any useful data about uGuru, as it is +mailing Winbond for help won't give any useful data about uGuru, as it is the program inside the uC that is responding to calls. Olle Sandberg , 2005-05-25 @@ -35,7 +35,7 @@ As far as known the uGuru is always placed at and using the (ISA) I/O-ports ports are holding for detection. We will refer to 0xE0 as CMD (command-port) and 0xE4 as DATA because Abit refers to them with these names. -If DATA holds 0x00 or 0x08 and CMD holds 0x00 or 0xAC an uGuru could be +If DATA holds 0x00 or 0x08 and CMD holds 0x00 or 0xAC a uGuru could be present. We have to check for two different values at data-port, because after a reboot uGuru will hold 0x00 here, but if the driver is removed and later on attached again data-port will hold 0x08, more about this later. @@ -46,7 +46,7 @@ have to test CMD for two different values. On these uGuru's DATA will initially hold 0x09 and will only hold 0x08 after reading CMD first, so CMD must be read first! -To be really sure an uGuru is present a test read of one or more register +To be really sure a uGuru is present a test read of one or more register sets should be done. diff --git a/Documentation/hwmon/abituguru.rst b/Documentation/hwmon/abituguru.rst index cfda60b757ce..4a5ee16b1048 100644 --- a/Documentation/hwmon/abituguru.rst +++ b/Documentation/hwmon/abituguru.rst @@ -40,7 +40,7 @@ Supported chips: .. [2] There is a separate abituguru3 driver for these motherboards, the abituguru (without the 3 !) driver will not work on these - motherboards (and visa versa)! + motherboards (and vice versa)! Authors: - Hans de Goede , -- 2.51.0 From 8df0f002827e18632dcd986f7546c1abf1953a6f Mon Sep 17 00:00:00 2001 From: Andrey Vatoropin Date: Tue, 4 Feb 2025 09:54:08 +0000 Subject: [PATCH 15/16] hwmon: (xgene-hwmon) use appropriate type for the latency value The expression PCC_NUM_RETRIES * pcc_chan->latency is currently being evaluated using 32-bit arithmetic. Since a value of type 'u64' is used to store the eventual result, and this result is later sent to the function usecs_to_jiffies with input parameter unsigned int, the current data type is too wide to store the value of ctx->usecs_lat. Change the data type of "usecs_lat" to a more suitable (narrower) type. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Andrey Vatoropin Link: https://lore.kernel.org/r/20250204095400.95013-1-a.vatoropin@crpt.ru Signed-off-by: Guenter Roeck --- drivers/hwmon/xgene-hwmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c index 1e3bd129a922..eb67190d9a86 100644 --- a/drivers/hwmon/xgene-hwmon.c +++ b/drivers/hwmon/xgene-hwmon.c @@ -105,7 +105,7 @@ struct xgene_hwmon_dev { phys_addr_t comm_base_addr; void *pcc_comm_addr; - u64 usecs_lat; + unsigned int usecs_lat; }; /* -- 2.51.0 From f392611e268f5462b51d90857c72058c31282706 Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Sun, 2 Mar 2025 18:50:53 +0300 Subject: [PATCH 16/16] hwmon: (nct6683) Add customer ID for AMD BC-250 This value was found on an AMD BC-250 board with an NCT6686D chip. Signed-off-by: Mikhail Paulyshka Link: https://lore.kernel.org/r/20250302155053.50096-1-me@mixaill.net Signed-off-by: Guenter Roeck --- Documentation/hwmon/nct6683.rst | 3 ++- drivers/hwmon/nct6683.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/hwmon/nct6683.rst b/Documentation/hwmon/nct6683.rst index 8d4a20d99e59..3e549ba95a15 100644 --- a/Documentation/hwmon/nct6683.rst +++ b/Documentation/hwmon/nct6683.rst @@ -3,7 +3,7 @@ Kernel driver nct6683 Supported chips: - * Nuvoton NCT6683D/NCT6687D + * Nuvoton NCT6683D/NCT6686D/NCT6687D Prefix: 'nct6683' @@ -61,6 +61,7 @@ Board Firmware version Intel DH87RL NCT6683D EC firmware version 1.0 build 04/03/13 Intel DH87MC NCT6683D EC firmware version 1.0 build 04/03/13 Intel DB85FL NCT6683D EC firmware version 1.0 build 04/03/13 +AMD BC-250 NCT6686D EC firmware version 1.0 build 07/28/21 ASRock X570 NCT6683D EC firmware version 1.0 build 06/28/19 ASRock X670E NCT6686D EC firmware version 1.0 build 05/19/22 ASRock B650 Steel Legend WiFi NCT6686D EC firmware version 1.0 build 11/09/23 diff --git a/drivers/hwmon/nct6683.c b/drivers/hwmon/nct6683.c index 416ac02e9f74..6cda35388b24 100644 --- a/drivers/hwmon/nct6683.c +++ b/drivers/hwmon/nct6683.c @@ -176,6 +176,7 @@ superio_exit(int ioreg) #define NCT6683_CUSTOMER_ID_MSI2 0x200 #define NCT6683_CUSTOMER_ID_MSI3 0x207 #define NCT6683_CUSTOMER_ID_MSI4 0x20d +#define NCT6683_CUSTOMER_ID_AMD 0x162b #define NCT6683_CUSTOMER_ID_ASROCK 0xe2c #define NCT6683_CUSTOMER_ID_ASROCK2 0xe1b #define NCT6683_CUSTOMER_ID_ASROCK3 0x1631 @@ -1231,6 +1232,8 @@ static int nct6683_probe(struct platform_device *pdev) break; case NCT6683_CUSTOMER_ID_MSI4: break; + case NCT6683_CUSTOMER_ID_AMD: + break; case NCT6683_CUSTOMER_ID_ASROCK: break; case NCT6683_CUSTOMER_ID_ASROCK2: -- 2.51.0