aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pmbus/ucd9000.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-06-11hwmon: (pmbus) move header file out of I2C realmWolfram Sang1-1/+1
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>
2017-04-02hwmon: (ucd9000) Add OF device ID tableJavier Martinez Canillas1-1/+38
The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:<device>. But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-09-08hwmon: (ucd9000) Add support for UCD90160 Power Supply SequencerMatt Weber1-1/+2
The UCD90160 Power Supply Sequencer reuses the existing register layout, so just an id addition was required. Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Ronak Desai <ronak.desai@rockwellcollins.com> [groeck: Updated description, ordered alphabetically, added documentation] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18hwmon: (pmbus) Simplify remove functionsGuenter Roeck1-8/+1
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>
2012-03-18hwmon: (pmbus) Convert pmbus drivers to use devm_kzallocGuenter Roeck1-19/+7
Marginally less code and eliminate the possibility of memory leaks. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18hwmon: convert drivers/hwmon/* to use module_i2c_driver()Axel Lin1-11/+1
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>
2011-10-24hwmon: (pmbus) Always call _pmbus_read_byte in core driverGuenter Roeck1-2/+2
Always call _pmbus_read_byte() instead of pmbus_read_byte() in PMBus core driver. With this change, device specific read functions can be implemented for all registers. Since the device specific read_byte function is now always called, we need to be more careful with page validations. Only fail if the passed page number is larger than 0, since -1 means "current page". Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24hwmon: (pmbus) Replace EINVAL return codes with more appropriate errorsGuenter Roeck1-2/+2
EINVAL was over-used in the code. Replace it with more appropriate errors. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24hwmon: (pmbus) Don't return errors from driver remove functionsGuenter Roeck1-3/+2
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>
2011-09-06hwmon: (ucd9000/ucd9200) Optimize array walkJean Delvare1-4/+2
Rewrite the loop walking the id array during probe. The new code is better adapted to a null-terminated array, and is also clearer and more efficient than the original. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Axel Lin <axel.lin@gmail.com> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-07-28hwmon: (pmbus) Move PMBus drivers to drivers/hwmon/pmbusGuenter Roeck1-0/+278
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>