History log of /linux-master/drivers/hwmon/pmbus/pmbus.c
Revision Date Author Comments
# 1975d167 05-May-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

hwmon: Switch i2c drivers back to use .probe()

After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230505131718.1210071-1-u.kleine-koenig@pengutronix.de
[groeck: Added missing change in pmbus/acbel-fsg032.c]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# ea541c18 07-May-2021 Erik Rosen <erik.rosen@metormote.com>

hwmon: (pmbus) Add support for additional Flex BMR converters to pmbus

Add support for Flex BMR310, BMR456, BMR457, BMR458, BMR480, BMR490,
BMR491 and BMR492 to the pmbus driver

Signed-off-by: Erik Rosen <erik.rosen@metormote.com>
Link: https://lore.kernel.org/r/20210507194023.61138-4-erik.rosen@metormote.com
[groeck: Fixed minor whitespace error]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# b94ca77e 20-Apr-2021 Guenter Roeck <linux@roeck-us.net>

hwmon: (pmbus) Introduce PMBUS symbol namespace

Exported pmbus symbols are only supposed to be used from PMBus code.
Introduce PMBUS symbol namespace to prevent misuse from other code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 3bce071a 26-Oct-2020 Bartosz Golaszewski <bgolaszewski@baylibre.com>

hwmon: (pmbus) shrink code and remove pmbus_do_remove()

The only action currently performed in pmbus_do_remove() is removing the
debugfs hierarchy. We can schedule a devm action at probe time and remove
pmbus_do_remove() entirely from all pmbus drivers.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Link: https://lore.kernel.org/r/20201026105352.20359-1-brgl@bgdev.pl
[groeck: Removed references to pmbus_do_remove from documentation]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# dd431939 08-Aug-2020 Stephen Kitt <steve@sk2.org>

hwmon (pmbus) use simple i2c probe function

pmbus_do_probe doesn't use the id information provided in its second
argument, so this can be removed, which then allows using the
single-parameter i2c probe function ("probe_new") for probes.

This avoids scanning the identifier tables during probes.

Drivers which didn't use the id are converted as-is; drivers which did
are modified as follows:

* if the information in i2c_client is sufficient, that's used instead
(client->name);
* configured v. probed comparisons are performed by comparing the
configured name to the detected name, instead of the ids; this
involves strcmp but is still cheaper than comparing all the device
names when scanning the tables;
* anything else is handled by calling i2c_match_id() with the same
level of error-handling (if any) as before.

Additionally, the mismatch message in the ltc2978 driver is adjusted
so that it no longer assumes that the driver_data is an index into
ltc2978_id.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Acked-by: Wolfram Sang <wsa@kernel.org>
Link: https://lore.kernel.org/r/20200808210004.30880-1-steve@sk2.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 43f33b6e 14-Jan-2020 Guenter Roeck <linux@roeck-us.net>

hwmon: (pmbus) Add 'phase' parameter where needed for multi-phase support

In preparation for multi-phase support, add 'phase' parameter to read_word
and set_page functions. Actual multi-phase support will be added in
a subsequent patch.

Cc: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# b9fa0a3a 13-Jan-2020 Vadim Pasternak <vadimp@mellanox.com>

hwmon: (pmbus/core) Add support for vid mode detection per page bases

Add support for VID protocol detection per page bases, instead of
detecting it based on "PMBU_VOUT" readout from page 0 for all the pages
supported by particular device.
The reason that some devices allows to configure different VID modes
per page within the same device.
Patch modifies the field "vrm_version" within the structure
"pmbus_driver_info" to be per page array.

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Link: https://lore.kernel.org/r/20200113150841.17670-2-vadimp@mellanox.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 1a1ea120 13-Dec-2019 Guenter Roeck <linux@roeck-us.net>

hwmon: (pmbus) Add MAX20796 to devices supported by generic pmbus driver

MAX20796 is a dual-phase scalable integrated voltage regulator with
PMBus interface.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 74ba9207 20-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61

Based on 1 normalized pattern(s):

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 either version 2 of the license or at
your option any later version 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 you
should have received a copy of the gnu general public license along
with this program if not write to the free software foundation inc
675 mass ave cambridge ma 02139 usa

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 441 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190520071858.739733335@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 705f2c81 09-Jan-2019 Xiaoting Liu <xiaoting.liu@hxt-semitech.com>

hwmon: (pmbus) add support for DPS-650AB

Provide support for PSU DPS-650AB from Delta Electronics, INC.

Signed-off-by: Xiaoting Liu <xiaoting.liu@hxt-semitech.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 6f4a46f0 09-Jan-2019 Xiaoting Liu <xiaoting.liu@hxt-semitech.com>

hwmon: (pmbus) associate PMBUS_SKIP_STATUS_CHECK with driver data

Current code compares device name with name in i2c_device_id to decide
whether PMBUS_SKIP_STATUS_CHECK should be set in pmbus_platform_data,
which makes adding new devices with PMBUS_SKIP_STATUS_CHECK should also
modify code in pmbus_probe().

This patch adds pmbus_device_info to save pages and flags. Its pointer
is put in driver_data of i2c_device_id, which makes adding new device
more straightforward.

Signed-off-by: Shunyong Yang <shunyong.yang@hxt-semitech.com>
Signed-off-by: Xiaoting Liu <xiaoting.liu@hxt-semitech.com>
[groeck: Use designated structure initializers to improve readability]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# e7c6a556 15-Oct-2018 Dmitry Bazhenov <bazhenov.dn@gmail.com>

hwmon: (pmbus) Fix page count auto-detection.

Devices with compatible="pmbus" field have zero initial page count,
and pmbus_clear_faults() being called before the page count auto-
detection does not actually clear faults because it depends on the
page count. Non-cleared faults in its turn may fail the subsequent
page count auto-detection.

This patch fixes this problem by calling pmbus_clear_fault_page()
for currently set page and calling pmbus_clear_faults() after the
page count was detected.

Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Bazhenov <bazhenov.dn@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 4ba1bb12 21-May-2017 Wolfram Sang <wsa@kernel.org>

hwmon: (pmbus) move header file out of I2C realm

include/linux/i2c is not for client devices. Move the header file to a
more appropriate location.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# cc00decf 25-Jul-2016 Vadim Pasternak <vadimp@mellanox.com>

hwmon: (pmbus) Add explicit support for DPS-460, DPS-800, and SGD009

Provide support for PSU DPS-460, DPS-800 from Delta Electronics, INC
and for SGD009 from Acbel Polytech, INC.

These devices do not support the STATUS_CML register, and reports a
communication error in response to this command. For this reason,
the status register check is disabled for these controllers.

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# cfca3789 07-Aug-2015 Guenter Roeck <linux@roeck-us.net>

hwmon: (pmbus) Add device IDs for TPS544{B,C}2{0,5}

Add device IDs and references for Texas Instruments TPS544B20, TPS544B25,
TPS544C20, and TPS544C25 to the generic PMBus driver.

Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 068c2270 20-Jul-2015 Guenter Roeck <linux@roeck-us.net>

hwmon: (pmbus) Add support for VR12

Newer chips such as MAX20751 support VR12. Add support for it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# a8bfeceb 01-Jul-2014 Zhu, Richard \(NSN - CN/Beijing\) <richard.zhu@nsn.com>

hwmon: (pmbus) Add tps40422 front-end driver

For TI power management chip TPS40422, READ_TEMPERATURE_2 command is supported on
page 1 of the chip, but the original driver(pmbus.c) only tried to detect this command
on page 0, this will lead to a result that the temperature sensor in page 1 couldn't
be detected. This change is to isolate the tps40422 driver from pmbus.c into a solo
front-end driver.

Signed-off-by: Zhu Laiwen <richard.zhu@nsn.com>
[Guenter Roeck: Dropped unnecessary license text (fixes checkpatch warning)]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 21633409 28-Feb-2012 Guenter Roeck <linux@roeck-us.net>

hwmon: (pmbus) Add support for Lineage Power MDT040

MDT040 is supported by the generic PMBus driver. Add device ID and reference to
datasheet. Also mention Lineage Power device support in Kconfig.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# c5f35c9d 28-Feb-2012 Guenter Roeck <linux@roeck-us.net>

hwmon: (pmbus) Add support for TI TPS40400 and TPS40422

TPS40400 and TPS40422 are supported by the generic PMBus driver.
Add device IDs and data sheet references.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# dd285ad7 22-Feb-2012 Guenter Roeck <linux@roeck-us.net>

hwmon: (pmbus) Simplify remove functions

Since devm_kzalloc() is now used to allocate driver memory, the client
driver remove function has no purpose other than to call pmbus_do_remove().
This means we can get rid of it by redefining pmbus_do_remove() to use the
same prototype, and pointing to it directly.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 8b313ca7 22-Feb-2012 Guenter Roeck <linux@roeck-us.net>

hwmon: (pmbus) Convert pmbus drivers to use devm_kzalloc

Marginally less code and eliminate the possibility of memory leaks.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# f0967eea 20-Jan-2012 Axel Lin <axel.lin@gmail.com>

hwmon: convert drivers/hwmon/* to use module_i2c_driver()

This patch converts the drivers in drivers/hwmon/* to use the
module_i2c_driver() macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Corentin Labbe <corentin.labbe@geomatys.fr>
Cc: Dirk Eibach <eibach@gdsys.de>
Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>
Cc: Steve Glendinning <steve.glendinning@smsc.com>
Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: Guillaume Ligneul <guillaume.ligneul@gmail.com>
Cc: David George <david.george@ska.ac.za>
Cc: "Hans J. Koch" <hjk@hansjkoch.de>
Cc: Marc Hulsman <m.hulsman@tudelft.nl>
Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>


# 443830f6 01-Oct-2011 Guenter Roeck <guenter.roeck@ericsson.com>

hwmon: (pmbus/zl6100) Add support for Ericsson BMR45[0,1] and BMR46[2,3,4]

Add support for Ericsson BMR450, BMR451, BMR462, BMR463, and BMR464, which are
based on ZL2005 and ZL2008, to zl6100 driver. Remove BMR450 and BMR451 device
IDs from generic PMBus driver.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>


# bc365a7f 15-Sep-2011 Guenter Roeck <guenter.roeck@ericsson.com>

hwmon: (pmbus) Add support for Lineage Power DC-DC converters

Add device IDs and reference to datasheets for Lineage Power DC-DC converters.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>


# c3ff9a67 02-Sep-2011 Guenter Roeck <guenter.roeck@ericsson.com>

hwmon: (pmbus/ltc2978) Explicit driver for LTC2978

Provide explicit driver for LTC2978 to enable support for minimum and peak
attributes. Remove ltc2978 chip id from generic pmbus driver.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>


# 866cf12a 26-Aug-2011 Guenter Roeck <guenter.roeck@ericsson.com>

hwmon: (pmbus) Don't return errors from driver remove functions

Driver remove functions have an error return value, but rarely return an error
in practice. If a driver does return an error from its remove function, the
driver won't be unloaded and is expected to stay alive.

pmbus_do_remove() is defined as returning an int, but always returns 0 (no
error). Calling code passes that return value on to high level driver
remove functions, but does not evaluate it and removes driver data even if
pmbus_do_remove() returned an error (which it in practice never does). Even if
this code could never cause a real problem, it is nevertheless conceptually
wrong.

To reduce confusion and simplify the code, change pmbus_do_remove() to be a void
function, and have PMBus client drivers always return zero in their driver
remove functions.

Reported-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>


# e0455e38 25-Jun-2011 Guenter Roeck <guenter.roeck@ericsson.com>

hwmon: (pmbus) Add ADP4000, NCP4200 and NCP4208 to list of supported devices

Add ADP4000, NCP4200 and NCP4208 to the list of devices supported by the generic
PMBus driver, and add device IDs to enable explicit instantiation.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>


# 1061d851 25-Jun-2011 Guenter Roeck <guenter.roeck@ericsson.com>

hwmon: (pmbus) Add support for VID output voltage mode

In VID mode, output voltages are measured and reported as VID values, and
have to be converted to voltages using VID conversion tables or functions.
Support is added for VR11 only at this time.

This patch enables support for PMBus devices supporting VID VR11 based output
voltage selection such as NCP4200 and NCP4208.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>


# 9d2ecfb7 12-Jul-2011 Guenter Roeck <guenter.roeck@ericsson.com>

hwmon: (pmbus) Move PMBus drivers to drivers/hwmon/pmbus

Since the number of PMBus drivers is getting large, move them into
directory drivers/hwmon/pmbus to improve readability and scalability.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>