ADM1278 is mostly compatible to other chips of the same series.
Besides the usual difference in coefficients, it supports
a temperature sensor, and it can measure both input and output
voltage at the same time.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
LTC3815 is a Monolithic Synchronous DC/DC Step-Down Converter.
Cc: Michael Jones <mike@proclivis.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Some of the LTC chips supported by this driver have to be polled
to ensure that they are ready to accept commands.
Signed-off-by: Michael Jones <mike@proclivis.com>
[Guenter Roeck: simplifications and formatting changes]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
PMBus controllers optionally support PEC. Configure the driver
to use it if available to improve operational security.
Suggested-by: Michael Jones <mike@proclivis.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
LTC3886 is a is a dual PolyPhase DC/DC synchronous step-down switching
regulator controller. It is mostly command compatible to LTC3883,
but supports two phases instead of one.
Suggested-by: Michael Jones <mike@proclivis.com>
Tested-by: Michael Jones <mike@proclivis.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
LTC2980 and LTM2987 are command compatible to LTC2977. They consist of
two LTC2977 on a single die, and are instantiated as two separate chips,
each supporting eight channels.
Suggested-by: Michael Jones <mike@proclivis.com>
Tested-by: Michael Jones <mike@proclivis.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Add additional chip ID for an older revision of LTC2978, as well
as two chip IDs for LTC3882. Turns out the LTC3882 does support the
LTC2978_MFR_SPECIAL_ID register, and reading it returns its chip ID,
but the register is undocumented.
Suggested-by: Michael Jones <mike@proclivis.com>
Tested-by: Michael Jones <mike@proclivis.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Per information from Linear Technologies, the ID mask is 12 bit
for all chips of this series. Use this mask to detect chips to ensure
that all chip revisions are detected.
Suggested-by: Michael Jones <mike@proclivis.com>
Tested-by: Michael Jones <mike@proclivis.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
The code used to determine historic low and high peaks is repeated
several times. Introduce helper functions to simplify it.
Tested-by: Michael Jones <mike@proclivis.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
It is becoming cumbersom to track per-chip feature support.
Introduce feature flag to simplify the code.
Tested-by: Michael Jones <mike@proclivis.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
LTC2975 is mostly compatible to LTC2974, but supports input current
and power measurement.
Tested-by: Michael Jones <mike@proclivis.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Per datasheet, the chip ID for LTM4676 is 0x448x. This was observed
in real systems. In addition to that, chip ID 0x4401 was observed
as well. Research shows that the chip ID has been changed from 0x440x
to 0x448x in datasheet revision C. Add support for the additional chip ID.
Also add the chip ID for LTM4676A, which is functionally identical
to LTM4676.
Reported-by: Ananda Babu Nettam <anandab@juniper.net>
Cc: Ananda Babu Nettam <anandab@juniper.net>
Cc: Amit U Jain <amjain@juniper.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
LTC3882 is mostly compatible with LTC3880. Major differences are that it
does not measure the input current, and it no longer supports LTC's legacy
mechanism to identify the chip.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Verifying the chip type is getting more complicated with new chips,
since not all chips support the same mechanism to read the chip type.
Move the code into a separate function to simplify adding support for
those chips.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
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>
MAX20751 is a multiphase power controller with internal buck converter.
It uses VR12.0 to report the output voltage. This requires an explicit
driver, since the VR version can not be auto-detected.
The chip supports a manufacturer specific command to fine-tune the output
voltage. This command is not currently supported.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
ADM1293 and ADM1294 are mostly compatible with other chips of the same
series, but have more configuration options. There are also some
differences in register details.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Introduce have_vout, have_vaux_status, have_pin_max, and have_uc_fault
to simplify adding support for new chips.
Also simplify error returns where appropriate to return immediately
on error.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Each new chip supported by the driver has a new set of coefficients,
making hard-coding coefficients more and more cumbersome. Introduce
a datastructure and table to simplify configuration.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
pmbus_regulator_ops is not modified after initialized, so make it const.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
The pmbus_regulator_ops is for voltage regulators, so explicitly set
regulator type for better readability.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Support for keyword 'boolean' will be dropped later on.
No functional change.
Reference: http://lkml.kernel.org/r/cover.1418003065.git.cj@linux.com
Signed-off-by: Christoph Jaeger <cj@linux.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Add simple on/off regulator support for ltc2978 and
other pmbus parts supported by the ltc2978 driver.
Signed-off-by: Alan Tull <atull@opensource.altera.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Add support for simple on/off control of each channel.
To add regulator support, the pmbus part driver needs to add
regulator_desc information and number of regulators to its
pmbus_driver_info struct.
regulator_desc can be declared using default macro for a
regulator (PMBUS_REGULATOR) that is in pmbus.h
The regulator_init_data can be initialized from either
platform data or the device tree.
Signed-off-by: Alan Tull <atull@opensource.altera.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
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>
The chip's programming interface is quite similar to LTC3880
and supports the same set of sensors.
Reviewed-by: Robert Coulson <rob.coulson@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
LTC2974 datasheet revision C lists the chip ID for LTC2974 as 0x0213.
Reviewed-by: Robert Coulson <rob.coulson@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Some chips use different exponents for sensors on different pages
or rails. Detect and store exponent per page to support this situation.
This fixes a problem with wrong voltages seen on UCD90120.
Reported-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Tested-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
pmbus code currently crashes the kernel if it detects an internal
implementation error. While the detected condition suggests that there
is a bug in the code, it is hardly fatal. Therefore, it should not
trigger a crash. Replace BUG() with WARN().
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Initialize device specific coefficients from table instead of hard-coding it
to simplify adding additional chips.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Limits on all supported sensors and chips have to be within 0..0x0fff,
and limits are always positive.
Clamp written values in chip driver. Also clear value cache to ensure
that the actually written value is read back and reported correctly.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
So far the driver reported the voltage on VAUX as "vout2". This was not
entirely appropriate as it is not an output voltage, and complicates
the code. Use the new virtual "VMON" register set and report the voltage
as "vmon" instead.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Use u16 instead of int to store cached limit attributes.
This reduces allocated data size per driver instance by 48 bytes.
Use defines for the number of pages supported by individual chips.
Use ARRAY_SIZE for loops to initialize array variables, and
initialize all variables in the same code block.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>