Skip to content

Commit 64b08df

Browse files
committed
Merge tag 'hwmon-for-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon updates from Guenter Roeck: - New drivers for Infineon PXE1610 and IRPS5401 - Minor improvements, cleanup, and fixes in several drivers * tag 'hwmon-for-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (33 commits) hwmon: (ina3221) Add of_node_put() before return hwmon: (gpio-fan) fix sysfs notifications and udev events for gpio-fan alarms hwmon: (gpio-fan) move fan_alarm_init after devm_hwmon_device_register_with_groups hwmon: (lm90) Introduce function to update configuration register hwmon: (lm90) Cache configuration register value hwmon: (lm90) Fix max6658 sporadic wrong temperature reading hwmon: (nct7904) Changes comments in probe function. hwmon: (nct7904) Add error handling in probe function. hwmon: Convert remaining drivers to use SPDX identifier hwmon: (max6650) Fix unused variable warning hwmon: (pmbus/adm1275) Fix power sampling support hwmon: (lm90) simplify getting the adapter of a client hwmon: (asus_atk0110) no need to check return value of debugfs_create functions hwmon: (max6650) Fix minor formatting issues hwmon: (max6650) Improve error handling in max6650_update_device hwmon: (max6650) Read non-volatile registers only once hwmon: (max6650) Convert to use devm_hwmon_device_register_with_info hwmon: (max6650) Simplify alarm handling hwmon: (max6650) Cache alarm_en register hwmon: (max6650) Declare valid as boolean ...
2 parents c079512 + 9f75465 commit 64b08df

File tree

18 files changed

+954
-457
lines changed

18 files changed

+954
-457
lines changed

Documentation/hwmon/pxe1610

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
Kernel driver pxe1610
2+
=====================
3+
4+
Supported chips:
5+
* Infineon PXE1610
6+
Prefix: 'pxe1610'
7+
Addresses scanned: -
8+
Datasheet: Datasheet is not publicly available.
9+
10+
* Infineon PXE1110
11+
Prefix: 'pxe1110'
12+
Addresses scanned: -
13+
Datasheet: Datasheet is not publicly available.
14+
15+
* Infineon PXM1310
16+
Prefix: 'pxm1310'
17+
Addresses scanned: -
18+
Datasheet: Datasheet is not publicly available.
19+
20+
Author: Vijay Khemka <[email protected]>
21+
22+
23+
Description
24+
-----------
25+
26+
PXE1610/PXE1110 are Multi-rail/Multiphase Digital Controllers
27+
and compliant to
28+
-- Intel VR13 DC-DC converter specifications.
29+
-- Intel SVID protocol.
30+
Used for Vcore power regulation for Intel VR13 based microprocessors
31+
-- Servers, Workstations, and High-end desktops
32+
33+
PXM1310 is a Multi-rail Controller and it is compliant to
34+
-- Intel VR13 DC-DC converter specifications.
35+
-- Intel SVID protocol.
36+
Used for DDR3/DDR4 Memory power regulation for Intel VR13 and
37+
IMVP8 based systems
38+
39+
40+
Usage Notes
41+
-----------
42+
43+
This driver does not probe for PMBus devices. You will have
44+
to instantiate devices explicitly.
45+
46+
Example: the following commands will load the driver for an PXE1610
47+
at address 0x70 on I2C bus #4:
48+
49+
# modprobe pxe1610
50+
# echo pxe1610 0x70 > /sys/bus/i2c/devices/i2c-4/new_device
51+
52+
It can also be instantiated by declaring in device tree
53+
54+
55+
Sysfs attributes
56+
----------------
57+
58+
curr1_label "iin"
59+
curr1_input Measured input current
60+
curr1_alarm Current high alarm
61+
62+
curr[2-4]_label "iout[1-3]"
63+
curr[2-4]_input Measured output current
64+
curr[2-4]_crit Critical maximum current
65+
curr[2-4]_crit_alarm Current critical high alarm
66+
67+
in1_label "vin"
68+
in1_input Measured input voltage
69+
in1_crit Critical maximum input voltage
70+
in1_crit_alarm Input voltage critical high alarm
71+
72+
in[2-4]_label "vout[1-3]"
73+
in[2-4]_input Measured output voltage
74+
in[2-4]_lcrit Critical minimum output voltage
75+
in[2-4]_lcrit_alarm Output voltage critical low alarm
76+
in[2-4]_crit Critical maximum output voltage
77+
in[2-4]_crit_alarm Output voltage critical high alarm
78+
79+
power1_label "pin"
80+
power1_input Measured input power
81+
power1_alarm Input power high alarm
82+
83+
power[2-4]_label "pout[1-3]"
84+
power[2-4]_input Measured output power
85+
86+
temp[1-3]_input Measured temperature
87+
temp[1-3]_crit Critical high temperature
88+
temp[1-3]_crit_alarm Chip temperature critical high alarm
89+
temp[1-3]_max Maximum temperature
90+
temp[1-3]_max_alarm Chip temperature high alarm

drivers/hwmon/adm1029.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@
1010
* Very rare chip please let me know if you use it
1111
*
1212
* http://www.analog.com/UploadedFiles/Data_Sheets/ADM1029.pdf
13-
*
14-
*
15-
* This program is free software; you can redistribute it and/or modify
16-
* it under the terms of the GNU General Public License as published by
17-
* the Free Software Foundation version 2 of the License
18-
*
19-
* This program is distributed in the hope that it will be useful,
20-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22-
* GNU General Public License for more details.
2313
*/
2414

2515
#include <linux/module.h>

drivers/hwmon/asus_atk0110.c

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -789,33 +789,16 @@ static const struct file_operations atk_debugfs_ggrp_fops = {
789789
static void atk_debugfs_init(struct atk_data *data)
790790
{
791791
struct dentry *d;
792-
struct dentry *f;
793792

794793
data->debugfs.id = 0;
795794

796795
d = debugfs_create_dir("asus_atk0110", NULL);
797-
if (!d || IS_ERR(d))
798-
return;
799796

800-
f = debugfs_create_x32("id", 0600, d, &data->debugfs.id);
801-
if (!f || IS_ERR(f))
802-
goto cleanup;
803-
804-
f = debugfs_create_file_unsafe("gitm", 0400, d, data,
805-
&atk_debugfs_gitm);
806-
if (!f || IS_ERR(f))
807-
goto cleanup;
808-
809-
f = debugfs_create_file("ggrp", 0400, d, data,
810-
&atk_debugfs_ggrp_fops);
811-
if (!f || IS_ERR(f))
812-
goto cleanup;
797+
debugfs_create_x32("id", 0600, d, &data->debugfs.id);
798+
debugfs_create_file_unsafe("gitm", 0400, d, data, &atk_debugfs_gitm);
799+
debugfs_create_file("ggrp", 0400, d, data, &atk_debugfs_ggrp_fops);
813800

814801
data->debugfs.root = d;
815-
816-
return;
817-
cleanup:
818-
debugfs_remove_recursive(d);
819802
}
820803

821804
static void atk_debugfs_cleanup(struct atk_data *data)

drivers/hwmon/gpio-fan.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ static void fan_alarm_notify(struct work_struct *ws)
5454
struct gpio_fan_data *fan_data =
5555
container_of(ws, struct gpio_fan_data, alarm_work);
5656

57-
sysfs_notify(&fan_data->dev->kobj, NULL, "fan1_alarm");
58-
kobject_uevent(&fan_data->dev->kobj, KOBJ_CHANGE);
57+
sysfs_notify(&fan_data->hwmon_dev->kobj, NULL, "fan1_alarm");
58+
kobject_uevent(&fan_data->hwmon_dev->kobj, KOBJ_CHANGE);
5959
}
6060

6161
static irqreturn_t fan_alarm_irq_handler(int irq, void *dev_id)
@@ -510,21 +510,16 @@ static int gpio_fan_probe(struct platform_device *pdev)
510510
platform_set_drvdata(pdev, fan_data);
511511
mutex_init(&fan_data->lock);
512512

513-
/* Configure alarm GPIO if available. */
514-
if (fan_data->alarm_gpio) {
515-
err = fan_alarm_init(fan_data);
516-
if (err)
517-
return err;
518-
}
519-
520513
/* Configure control GPIOs if available. */
521514
if (fan_data->gpios && fan_data->num_gpios > 0) {
522515
if (!fan_data->speed || fan_data->num_speed <= 1)
523516
return -EINVAL;
524517
err = fan_ctrl_init(fan_data);
525518
if (err)
526519
return err;
527-
devm_add_action_or_reset(dev, gpio_fan_stop, fan_data);
520+
err = devm_add_action_or_reset(dev, gpio_fan_stop, fan_data);
521+
if (err)
522+
return err;
528523
}
529524

530525
/* Make this driver part of hwmon class. */
@@ -535,6 +530,13 @@ static int gpio_fan_probe(struct platform_device *pdev)
535530
if (IS_ERR(fan_data->hwmon_dev))
536531
return PTR_ERR(fan_data->hwmon_dev);
537532

533+
/* Configure alarm GPIO if available. */
534+
if (fan_data->alarm_gpio) {
535+
err = fan_alarm_init(fan_data);
536+
if (err)
537+
return err;
538+
}
539+
538540
/* Optional cooling device register for Device tree platforms */
539541
fan_data->cdev = devm_thermal_of_cooling_device_register(dev, np,
540542
"gpio-fan", fan_data, &gpio_fan_cool_ops);

drivers/hwmon/hwmon.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,12 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
651651
hwdev, j);
652652
if (err) {
653653
device_unregister(hdev);
654+
/*
655+
* Don't worry about hwdev;
656+
* hwmon_dev_release(), called
657+
* from device_unregister(),
658+
* will free it.
659+
*/
654660
goto ida_remove;
655661
}
656662
}

drivers/hwmon/ina3221.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,10 @@ static int ina3221_probe_from_dt(struct device *dev, struct ina3221_data *ina)
713713

714714
for_each_child_of_node(np, child) {
715715
ret = ina3221_probe_child_from_dt(dev, child, ina);
716-
if (ret)
716+
if (ret) {
717+
of_node_put(child);
717718
return ret;
719+
}
718720
}
719721

720722
return 0;

0 commit comments

Comments
 (0)