Skip to content

Commit

Permalink
Merge tag 'hwmon-for-v5.3' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/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
  ...
  • Loading branch information
Linus Torvalds committed Jul 11, 2019
2 parents c079512 + 9f75465 commit 64b08df
Show file tree
Hide file tree
Showing 18 changed files with 954 additions and 457 deletions.
90 changes: 90 additions & 0 deletions Documentation/hwmon/pxe1610
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
Kernel driver pxe1610
=====================

Supported chips:
* Infineon PXE1610
Prefix: 'pxe1610'
Addresses scanned: -
Datasheet: Datasheet is not publicly available.

* Infineon PXE1110
Prefix: 'pxe1110'
Addresses scanned: -
Datasheet: Datasheet is not publicly available.

* Infineon PXM1310
Prefix: 'pxm1310'
Addresses scanned: -
Datasheet: Datasheet is not publicly available.

Author: Vijay Khemka <vijaykhemka@fb.com>


Description
-----------

PXE1610/PXE1110 are Multi-rail/Multiphase Digital Controllers
and compliant to
-- Intel VR13 DC-DC converter specifications.
-- Intel SVID protocol.
Used for Vcore power regulation for Intel VR13 based microprocessors
-- Servers, Workstations, and High-end desktops

PXM1310 is a Multi-rail Controller and it is compliant to
-- Intel VR13 DC-DC converter specifications.
-- Intel SVID protocol.
Used for DDR3/DDR4 Memory power regulation for Intel VR13 and
IMVP8 based systems


Usage Notes
-----------

This driver does not probe for PMBus devices. You will have
to instantiate devices explicitly.

Example: the following commands will load the driver for an PXE1610
at address 0x70 on I2C bus #4:

# modprobe pxe1610
# echo pxe1610 0x70 > /sys/bus/i2c/devices/i2c-4/new_device

It can also be instantiated by declaring in device tree


Sysfs attributes
----------------

curr1_label "iin"
curr1_input Measured input current
curr1_alarm Current high alarm

curr[2-4]_label "iout[1-3]"
curr[2-4]_input Measured output current
curr[2-4]_crit Critical maximum current
curr[2-4]_crit_alarm Current critical high alarm

in1_label "vin"
in1_input Measured input voltage
in1_crit Critical maximum input voltage
in1_crit_alarm Input voltage critical high alarm

in[2-4]_label "vout[1-3]"
in[2-4]_input Measured output voltage
in[2-4]_lcrit Critical minimum output voltage
in[2-4]_lcrit_alarm Output voltage critical low alarm
in[2-4]_crit Critical maximum output voltage
in[2-4]_crit_alarm Output voltage critical high alarm

power1_label "pin"
power1_input Measured input power
power1_alarm Input power high alarm

power[2-4]_label "pout[1-3]"
power[2-4]_input Measured output power

temp[1-3]_input Measured temperature
temp[1-3]_crit Critical high temperature
temp[1-3]_crit_alarm Chip temperature critical high alarm
temp[1-3]_max Maximum temperature
temp[1-3]_max_alarm Chip temperature high alarm
10 changes: 0 additions & 10 deletions drivers/hwmon/adm1029.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@
* Very rare chip please let me know if you use it
*
* http://www.analog.com/UploadedFiles/Data_Sheets/ADM1029.pdf
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 2 of the License
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/

#include <linux/module.h>
Expand Down
23 changes: 3 additions & 20 deletions drivers/hwmon/asus_atk0110.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,33 +789,16 @@ static const struct file_operations atk_debugfs_ggrp_fops = {
static void atk_debugfs_init(struct atk_data *data)
{
struct dentry *d;
struct dentry *f;

data->debugfs.id = 0;

d = debugfs_create_dir("asus_atk0110", NULL);
if (!d || IS_ERR(d))
return;

f = debugfs_create_x32("id", 0600, d, &data->debugfs.id);
if (!f || IS_ERR(f))
goto cleanup;

f = debugfs_create_file_unsafe("gitm", 0400, d, data,
&atk_debugfs_gitm);
if (!f || IS_ERR(f))
goto cleanup;

f = debugfs_create_file("ggrp", 0400, d, data,
&atk_debugfs_ggrp_fops);
if (!f || IS_ERR(f))
goto cleanup;
debugfs_create_x32("id", 0600, d, &data->debugfs.id);
debugfs_create_file_unsafe("gitm", 0400, d, data, &atk_debugfs_gitm);
debugfs_create_file("ggrp", 0400, d, data, &atk_debugfs_ggrp_fops);

data->debugfs.root = d;

return;
cleanup:
debugfs_remove_recursive(d);
}

static void atk_debugfs_cleanup(struct atk_data *data)
Expand Down
22 changes: 12 additions & 10 deletions drivers/hwmon/gpio-fan.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ static void fan_alarm_notify(struct work_struct *ws)
struct gpio_fan_data *fan_data =
container_of(ws, struct gpio_fan_data, alarm_work);

sysfs_notify(&fan_data->dev->kobj, NULL, "fan1_alarm");
kobject_uevent(&fan_data->dev->kobj, KOBJ_CHANGE);
sysfs_notify(&fan_data->hwmon_dev->kobj, NULL, "fan1_alarm");
kobject_uevent(&fan_data->hwmon_dev->kobj, KOBJ_CHANGE);
}

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

/* Configure alarm GPIO if available. */
if (fan_data->alarm_gpio) {
err = fan_alarm_init(fan_data);
if (err)
return err;
}

/* Configure control GPIOs if available. */
if (fan_data->gpios && fan_data->num_gpios > 0) {
if (!fan_data->speed || fan_data->num_speed <= 1)
return -EINVAL;
err = fan_ctrl_init(fan_data);
if (err)
return err;
devm_add_action_or_reset(dev, gpio_fan_stop, fan_data);
err = devm_add_action_or_reset(dev, gpio_fan_stop, fan_data);
if (err)
return err;
}

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

/* Configure alarm GPIO if available. */
if (fan_data->alarm_gpio) {
err = fan_alarm_init(fan_data);
if (err)
return err;
}

/* Optional cooling device register for Device tree platforms */
fan_data->cdev = devm_thermal_of_cooling_device_register(dev, np,
"gpio-fan", fan_data, &gpio_fan_cool_ops);
Expand Down
6 changes: 6 additions & 0 deletions drivers/hwmon/hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,12 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
hwdev, j);
if (err) {
device_unregister(hdev);
/*
* Don't worry about hwdev;
* hwmon_dev_release(), called
* from device_unregister(),
* will free it.
*/
goto ida_remove;
}
}
Expand Down
4 changes: 3 additions & 1 deletion drivers/hwmon/ina3221.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,10 @@ static int ina3221_probe_from_dt(struct device *dev, struct ina3221_data *ina)

for_each_child_of_node(np, child) {
ret = ina3221_probe_child_from_dt(dev, child, ina);
if (ret)
if (ret) {
of_node_put(child);
return ret;
}
}

return 0;
Expand Down
Loading

0 comments on commit 64b08df

Please sign in to comment.