aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
Commit message (Collapse)AuthorAge
...
* | | | hwmon: Fix CamelCase checkpatch warningsGuenter Roeck2013-04-08
| | | | | | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (nct6775) Drop read/write lockGuenter Roeck2013-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The read/write lock is acquired for each read/write operation from/to the chip. This occurs either during initialization, when it is not needed, or during updates, when the update_lock is held as well, and it is not needed either. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (nct6775) Only report VID if supported and enabledGuenter Roeck2013-04-08
| | | | | | | | | | | | | | | | | | | | | | | | VID is not always enabled (NCT6775, NCT6776) or supported (NCT6779). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (nct6775) Detect and report additional temperature sourcesGuenter Roeck2013-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Scan all temperature sources used for fan control and report if additional monitoring registers are available. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (nct6775) Add support for weighted fan controlGuenter Roeck2013-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The NCT677X series support weighted fan control. In this mode, a secondary temperature source is used in addition to the primary temperature source to control fan speed. Add support for this feature. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (nct6775) Add support for automatic fan controlGuenter Roeck2013-04-08
| | | | | | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (nct6775) Add support for pwm, pwm_mode, and pwm_enableGuenter Roeck2013-04-08
| | | | | | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (nct6775) Add power management supportGuenter Roeck2013-04-08
| | | | | | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (nct6775) Add support for fan debounce module parameterGuenter Roeck2013-04-08
| | | | | | | | | | | | | | | | | | | | | | | | If set, fan debounce is enabled when loading the driver. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (nct6775) Add support for fanX_pulses sysfs attributeGuenter Roeck2013-04-08
| | | | | | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (nct6775) Add support for fan speed attributesGuenter Roeck2013-04-08
| | | | | | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (nct6775) Add support for temperature sensorsGuenter Roeck2013-04-08
| | | | | | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (nct6775) Add case open detectionGuenter Roeck2013-04-08
| | | | | | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: Driver for Nuvoton NCT6775F, NCT6776F, and NCT6779DGuenter Roeck2013-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver will replace the w83627ehf driver for NCT6775F and NCT6776F, and provides support for NCT6779D. This patch provides support for voltage monitor attributes. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: Fix 'Macros with complex values' checkpatch errorsGuenter Roeck2013-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix: ERROR: Macros with complex values should be enclosed in parenthesis when it is seen due to complex code and not due to multi-line variable declarations. Cc: Hans de Goede <hdegoede@redhat.com> Cc: Alistair John Strachan <alistair@devzero.co.uk> Acked-by: Alistair John Strachan <alistair@devzero.co.uk> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: checkpatch cleanup: Replace printk with pr_debug or dev_dbg as ↵Guenter Roeck2013-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | appropriate Cc: Hans de Goede <hdegoede@redhat.com> Cc: Alistair John Strachan <alistair@devzero.co.uk> Cc: Henrik Rydberg <rydberg@euromail.se> Acked-by: Alistair John Strachan <alistair@devzero.co.uk> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (ntc_thermistor) Add DT with IIO support to NTC thermistor driverNaveen Krishna Chatradhi2013-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds DT support to NTC driver to parse the platform data. Also adds the support to work as an iio device client. During the probe ntc driver gets the respective channels of ADC and uses iio_raw_read calls to get the ADC converted value. Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com> [Guenter Roeck: fixed Kconfig dependencies; use ERR_CAST] Tested-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (adt7x10) Add alarm interrupt supportLars-Peter Clausen2013-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows an userspace application to poll() on the alarm files to get notified in case of a temperature threshold event. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (adt7410) Add support for the adt7310/adt7320Lars-Peter Clausen2013-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The adt7310/adt7320 is the SPI version of the adt7410/adt7420. The register map layout is a bit different, i.e. the register addresses differ between the two variants, but the bit layouts of the individual registers are identical. So both chip variants can easily be supported by the same driver. The issue of non matching register address layouts is solved by a simple look-up table which translates the I2C addresses to the SPI addresses. The patch moves the bulk of the adt7410 driver to a common module that will be shared by the adt7410 and adt7310 drivers. This common module implements the driver logic and uses a set of virtual functions to perform IO access. The adt7410 and adt7310 driver modules provide proper implementations of these IO accessor functions for I2C respective SPI. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (adt7410) Don't re-read non-volatile registersLars-Peter Clausen2013-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently each time the temperature register is read the driver also reads the threshold and hysteresis registers. This increases the amount of I2C traffic and time needed to read the temperature by a factor of ~5. Neither the threshold nor the hysteresis change on their own, so once we have read them, we should be able to just use the cached value of the registers. This patch modifies the code accordingly and only reads the threshold and hysteresis registers once during probe. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | | hwmon: (mc13783-adc.c) use module_platform_driver_probe()Jingoo Han2013-04-08
| |_|/ |/| | | | | | | | | | | | | | | | | | | | This patch uses module_platform_driver_probe() macro which makes the code smaller and simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (lm75.h) Update header inclusionJean Delvare2013-03-18
|/ / | | | | | | | | | | | | | | | | File lm75.h used to include <linux/hwmon.h> for SENSORS_LIMIT() but this function is gone by now. Instead we call clamp_val() so we should include <linux/kernel.h>, where this function is declared. Signed-off-by: Jean Delvare <khali@linux-fr.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (pmbus/ltc2978) Fix temperature reportingGuenter Roeck2013-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On LTC2978, only READ_TEMPERATURE is supported. It reports the internal junction temperature. This register is unpaged. On LTC3880, READ_TEMPERATURE and READ_TEMPERATURE2 are supported. READ_TEMPERATURE is paged and reports external temperatures. READ_TEMPERATURE2 is unpaged and reports the internal junction temperature. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: stable@vger.kernel.org # 3.2+ Acked-by: Jean Delvare <khali@linux-fr.org>
* | hwmon: (pmbus) Fix krealloc() misuse in pmbus_add_attribute()David Woodhouse2013-03-14
| | | | | | | | | | | | | | | | If krealloc() returns NULL, it *doesn't* free the original. So any code of the form 'foo = krealloc(foo, …);' is almost certainly a bug. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (lineage-pem) Add missing terminating entry for ↵Axel Lin2013-03-14
| | | | | | | | | | | | | | | | | | pem_[input|fan]_attributes Signed-off-by: Axel Lin <axel.lin@ingics.com> Cc: stable@vger.kernel.org Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (sht15) Check return value of regulator_enable()Mark Brown2013-03-04
| | | | | | | | | | | | | | | | | | Not having power is a pretty serious error so check that we are able to enable the supply and error out if we can't. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org #3.8+; 3.0+ will need manual backport Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (pmbus/ltc2978) Use detected chip ID to select supported functionalityGuenter Roeck2013-03-04
| | | | | | | | | | | | | | | | | | | | We read the chip ID from the chip, use it to determine if the chip ID provided to the driver is correct, and report it if wrong. We should also use the correct chip ID to select supported functionality. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: stable@vger.kernel.org # 3.2+ Acked-by: Jean Delvare <khali@linux-fr.org>
* | hwmon: (pmbus/ltc2978) Fix peak attribute handlingGuenter Roeck2013-03-04
|/ | | | | | | | | | Peak attributes were not initialized and cleared correctly. Also, temp2_max is only supported on page 0 and thus does not need to be an array. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: stable@vger.kernel.org # 3.2+ Acked-by: Jean Delvare <khali@linux-fr.org>
* Merge tag 'pm+acpi-3.9-rc1' of ↵Linus Torvalds2013-02-20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI and power management updates from Rafael Wysocki: - Rework of the ACPI namespace scanning code from Rafael J. Wysocki with contributions from Bjorn Helgaas, Jiang Liu, Mika Westerberg, Toshi Kani, and Yinghai Lu. - ACPI power resources handling and ACPI device PM update from Rafael J Wysocki. - ACPICA update to version 20130117 from Bob Moore and Lv Zheng with contributions from Aaron Lu, Chao Guan, Jesper Juhl, and Tim Gardner. - Support for Intel Lynxpoint LPSS from Mika Westerberg. - cpuidle update from Len Brown including Intel Haswell support, C1 state for intel_idle, removal of global pm_idle. - cpuidle fixes and cleanups from Daniel Lezcano. - cpufreq fixes and cleanups from Viresh Kumar and Fabio Baltieri with contributions from Stratos Karafotis and Rickard Andersson. - Intel P-states driver for Sandy Bridge processors from Dirk Brandewie. - cpufreq driver for Marvell Kirkwood SoCs from Andrew Lunn. - cpufreq fixes related to ordering issues between acpi-cpufreq and powernow-k8 from Borislav Petkov and Matthew Garrett. - cpufreq support for Calxeda Highbank processors from Mark Langsdorf and Rob Herring. - cpufreq driver for the Freescale i.MX6Q SoC and cpufreq-cpu0 update from Shawn Guo. - cpufreq Exynos fixes and cleanups from Jonghwan Choi, Sachin Kamat, and Inderpal Singh. - Support for "lightweight suspend" from Zhang Rui. - Removal of the deprecated power trace API from Paul Gortmaker. - Assorted updates from Andreas Fleig, Colin Ian King, Davidlohr Bueso, Joseph Salisbury, Kees Cook, Li Fei, Nishanth Menon, ShuoX Liu, Srinivas Pandruvada, Tejun Heo, Thomas Renninger, and Yasuaki Ishimatsu. * tag 'pm+acpi-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (267 commits) PM idle: remove global declaration of pm_idle unicore32 idle: delete stray pm_idle comment openrisc idle: delete pm_idle mn10300 idle: delete pm_idle microblaze idle: delete pm_idle m32r idle: delete pm_idle, and other dead idle code ia64 idle: delete pm_idle cris idle: delete idle and pm_idle ARM64 idle: delete pm_idle ARM idle: delete pm_idle blackfin idle: delete pm_idle sparc idle: rename pm_idle to sparc_idle sh idle: rename global pm_idle to static sh_idle x86 idle: rename global pm_idle to static x86_idle APM idle: register apm_cpu_idle via cpuidle cpufreq / intel_pstate: Add kernel command line option disable intel_pstate. cpufreq / intel_pstate: Change to disallow module build tools/power turbostat: display SMI count by default intel_idle: export both C1 and C1E ACPI / hotplug: Fix concurrency issues and memory leaks ...
| * ACPI: Remove useless type argument of driver .remove() operationRafael J. Wysocki2013-01-25
| | | | | | | | | | | | | | | | | | | | | | | | | | The second argument of ACPI driver .remove() operation is only used by the ACPI processor driver and the value passed to that driver through it is always available from the given struct acpi_device object's removal_type field. For this reason, the second ACPI driver .remove() argument is in fact useless, so drop it. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Jiang Liu <jiang.liu@huawei.com> Acked-by: Toshi Kani <toshi.kani@hp.com> Acked-by: Yinghai Lu <yinghai@kernel.org>
* | Merge tag 'dt-for-linus' of git://git.secretlab.ca/git/linuxLinus Torvalds2013-02-20
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull device tree changes from Grant Likely: "All around device tree changes destined for v3.8. Aside from the documentation updates the highlights in this branch include: - Kbuild changes for using CPP with .dts files - locking fix from preempt_rt patchset - include DT alias names in device uevent - Selftest bugfixes and improvements - New function for counting phandles stanzas in a property - constify argument to of_node_full_name() - Various bug fixes This tree did also contain a commit to use platform_device_add instead of open-coding the device add code, but it caused problems with amba devices and needed to be reverted." * tag 'dt-for-linus' of git://git.secretlab.ca/git/linux: (23 commits) Revert "of: use platform_device_add" kbuild: limit dtc+cpp include path gpio: Make of_count_named_gpios() use new of_count_phandle_with_args() of: Create function for counting number of phandles in a property of/base: Clean up exit paths for of_parse_phandle_with_args() of/selftest: Use selftest() macro throughout of/selftest: Fix GPIOs selftest to cover the 7th case of: fix recursive locking in of_get_next_available_child() documentation/devicetree: Fix a typo in exynos-dw-mshc.txt OF: convert devtree lock from rw_lock to raw spinlock of/exynos_g2d: Add Bindings for exynos G2D driver kbuild: create a rule to run the pre-processor on *.dts files input: Extend matrix-keypad device tree binding devicetree: Move NS2 LEDs binding into LEDs directory of: use platform_device_add powerpc/5200: Fix size to request_mem_region() call documentation/devicetree: Fix typos of: add 'const' to of_node_full_name parameter of: Output devicetree alias names in uevent DT: add vendor prefixes for Renesas and Toshiba ...
| * | gpio: Make of_count_named_gpios() use new of_count_phandle_with_args()Grant Likely2013-02-13
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces the horribly coded of_count_named_gpios() with a call to of_count_phandle_with_args() which is far more efficient. This also changes the return value of of_gpio_count() & of_gpio_named_count() from 'unsigned int' to 'int' so that it can return an error code. All the users of that function are fixed up to correctly handle a negative return value. v2: Split GPIO portion into a separate patch Tested-by: Andreas Larsson <andreas@gaisler.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Rob Herring <rob.herring@calxeda.com>
* | hwmon: (ntc_thermistor): Fix sparse warningsSachin Kamat2013-02-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following sparse warnings: drivers/hwmon/ntc_thermistor.c:46:31: warning: symbol 'ncpXXwb473' was not declared. Should it be static? drivers/hwmon/ntc_thermistor.c:82:31: warning: symbol 'ncpXXwl333' was not declared. Should it be static? Cc: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (adt7410) Add device table entry for the adt7420Lars-Peter Clausen2013-02-19
| | | | | | | | | | | | | | | | The adt7420 is software compatible to the adt7410. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (adt7410) Use I2C_ADDRS helper macroLars-Peter Clausen2013-02-19
| | | | | | | | | | | | | | | | | | Use the I2C_ADDRS macro to initialize the I2C device's address_list. Doing so saves a few lines of boilerplate code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (adt7410) Use the SIMPLE_DEV_PM_OPS helper macroLars-Peter Clausen2013-02-19
| | | | | | | | | | | | | | | | Use the SIMPLE_DEV_PM_OPS macro to declare the driver's pm_ops. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (adt7410) Let suspend/resume depend on CONFIG_PM_SLEEPLars-Peter Clausen2013-02-19
| | | | | | | | | | | | | | | | | | | | Only build the suspend/resume code if CONFIG_PM_SLEEP is selected. Currently the code is built if CONFIG_PM is selected, but it will also be selected if only runtime PM support is built into the kernel. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (adt7410) Clear unwanted bits in the config registerLars-Peter Clausen2013-02-19
| | | | | | | | | | | | | | | | | | Make sure to clear the mode bits from the config register before setting the new mode. Otherwise we might end up with a different mode than we want to. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (jc42) Add support for MCP98244Guenter Roeck2013-02-06
| | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <khali@linux-fr.org>
* | hwmon: (pmbus) Clean up for code size reductionGuenter Roeck2013-02-06
| | | | | | | | | | | | | | Rearranged some data structures, and merged some common functions. Overall code and data size reduction by more than 900 bytes. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (pmbus/max34440) Add support for MAX34460 and MAX34461Guenter Roeck2013-02-06
| | | | | | | | | | | | | | MAX34460 is a PMBus 12-Channel Voltage Monitor & Sequencer. MAX34461 is a PMBus 16-Channel Voltage Monitor & Sequencer. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (pmbus) Add support for word status registerGuenter Roeck2013-02-06
| | | | | | | | | | | | | | Not all PMBus devices support the byte status register at 0x78. Try to use the word status register at 0x79 instead if that is the case. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (pmbus/zl6100) Add support for VMON/VDRVGuenter Roeck2013-02-06
| | | | | | | | | | | | | | | | | | | | | | Some of the ZL6100 compatible chips support monitoring a separate voltage pin, VMON (ZL2004) or VDRV (ZL91xx). Report it as in2 / vmon. The chips support implicit warning limits for VMON/VDRV, as percentage of the respective critical voltage. Support by reading/writing the critical voltages and calculating the associated warning voltages. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (pmbus) Add function to clear sensor cacheGuenter Roeck2013-02-06
| | | | | | | | | | | | | | | | | | | | | | For PMBus chips, modifying one limit register may affect other limits. Since limits are all cached in the PMBus core driver, related changes are not reflected in reported limits. Introduce function to clear the attribute cache. After calling this function, the core pmbus driver re-reads all cached values. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (pmbus) Add support for additional voltage sensorGuenter Roeck2013-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some PMBus chips support monitoring an additional non-standard voltage. While this voltage can in many cases be supported by simulating an additional sensor page, this does not work in all cases. Specifically, it is problematic if the data format is linear and the voltage is reported in LINEAR11 format. Since output voltages use LINEAR16, and the exponent for LINEAR16 data is chip-wide and fixed, this can result in overflows. To solve this problem, add support for an additional virtual input voltage, call it 'vmon', and treat this voltage as input voltage (which, when the chip supports linear data format, uses LINEAR11). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (pmbus) Use krealloc to allocate attribute memoryGuenter Roeck2013-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | So far, attribute memory was allocated by pre-calculating the maximum possible amount of attributes. Not only does this waste memory, it is also risky because the calculation might be wrong. It also requires a lot of defines to specify the maximum number of attributes per class. Allocate attribute memory using krealloc() instead. That means we have to use kfree(), since devm_krealloc() does not exist, but that is still less costly and less risky than trying to predict the number of attributes at the beginning. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (pmbus) Simplify memory allocation for sensor attributesGuenter Roeck2013-02-06
| | | | | | | | | | | | | | | | Since memory is now allocated with dev_ functions, we no longer need to keep track of allocated memory. Sensor memory allocation can therefore be simplified significantly. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (pmbus) Improve boolean handlingGuenter Roeck2013-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | Boolean handling depends on storing the sensor data index in sensor_device_attr as part of the index variable. This limits the number of sensor attributes to 256, and means the sensor sequence number actually has to be maintained to be able to access sensor data from boolean functions. Rework the code to store sensor pointers in the pmbus_boolean data structure directly. With this approach, the number of supportable sensors is now unlimited. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (pmbus) Simplify memory allocation for labels and booleansGuenter Roeck2013-02-06
| | | | | | | | | | | | | | | | Since memory is now allocated with dev_ functions, we no longer need to keep track of allocated memory. Memory allocation for booleans and labels can therefore be simplified substantially by allocating it only as needed. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (pmbus) Use dev variable to represent client->devGuenter Roeck2013-02-06
| | | | | | | | | | | | This simplifies the code and makes it a bit smaller. Signed-off-by: Guenter Roeck <linux@roeck-us.net>