summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'spi-v3.13' of ↵Linus Torvalds2013-11-121-6/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi updates from Mark Brown: "As well as the usual driver updates and cleanups there's a few improvements to the core here: - The start of some improvements to factor out more of the SPI message loop into the core. Right now this is just simplifying the code a bit but hopefully next time around we'll also have managed to roll out some noticable performance improvements which drivers can take advantage of. - Support for loading modules for ACPI enumerated SPI devices. - Managed registration for SPI controllers. - Helper for another common I/O pattern" * tag 'spi-v3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (116 commits) spi/hspi: add device tree support spi: atmel: fix return value check in atmel_spi_probe() spi: spi-imx: only enable the clocks when we start to transfer a message spi/s3c64xx: Fix doubled clock disable on suspend spi/s3c64xx: Do not ignore return value of spi_master_resume/suspend spi: spi-mxs: Use u32 instead of uint32_t spi: spi-mxs: Don't set clock for each xfer spi: spi-mxs: Clean up setup_transfer function spi: spi-mxs: Remove check of spi mode bits spi: spi-mxs: Fix race in setup method spi: spi-mxs: Remove bogus setting of ssp clk rate field spi: spi-mxs: Remove full duplex check, spi core already does it spi: spi-mxs: Fix chip select control bits in DMA mode spi: spi-mxs: Fix extra CS pulses and read mode in multi-transfer messages spi: spi-mxs: Change flag arguments in txrx functions to bit flags spi: spi-mxs: Always clear INGORE_CRC, to keep CS asserted spi: spi-mxs: Remove mxs_spi_enable and mxs_spi_disable spi: spi-mxs: Always set LOCK_CS spi/s3c64xx: Add missing pm_runtime_put on setup fail spi/s3c64xx: Add missing pm_runtime_set_active() call in probe() ...
| * Merge remote-tracking branch 'spi/topic/wr' into spi-nextMark Brown2013-10-251-6/+1
| |\
| | * hwmon: (adt7310) Use spi_w8r16be() instead spi_w8r16()Lars-Peter Clausen2013-10-031-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Using spi_w8r16be() instead of spi_w8r16() in this driver makes a code a bit shorter and cleaner. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | hwmon: (w83793) Clean up a signedness issueDan Carpenter2013-10-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | We cap the upper bound of "mtimeout" but since it's signed we should check for negative values as well. The mistake is harmless. But I have changed it to unsigned as a cleanup. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (nct6775) Remove an unused variableDan Carpenter2013-10-191-2/+2
| | | | | | | | | | | | | | | | | | | | | We don't actually use "j" for anything. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (emc1403) Add support for EMC1404 and EMC1424Guenter Roeck2013-10-181-8/+51
| | | | | | | | | | | | | | | | | | | | | EMC1404 and EMC1424 are similar to EMC1403 and EMC1423, but support an additional external temperature sensor. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (emc1403) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-181-47/+26
| | | | | | | | | | | | | | | | | | Simplify code and reduce its size. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (pmbus/ltc2978): Add support for LTC2978AGuenter Roeck2013-10-181-1/+3
| | | | | | | | | | | | | | | | | | Detect LTC2978A chip ID. Treat it as LC2978. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (pmbus/ltc2978): Add support for LTC2977Guenter Roeck2013-10-181-3/+9
| | | | | | | | | | | | | | | | | | LTC2977 is a pin compatible replacement for LTC2978. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (pmbus/lm25066) Add support for LM25063Guenter Roeck2013-10-181-9/+82
| | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: Correct some typosLABBE Corentin2013-10-188-10/+10
| | | | | | | | | | | | | | | Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (gpio-fan) Include linux/of.h headerSachin Kamat2013-10-181-0/+1
| | | | | | | | | | | | | | | | | | | | | 'of_match_ptr' is defined in linux/of.h. Include it explicitly. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (lm70) Remove redundant spi_set_drvdataSachin Kamat2013-10-181-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Kaiwan N Billimoria <kaiwan@designergraphix.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (adcxx) Remove redundant spi_set_drvdataSachin Kamat2013-10-181-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Marc Pignat <marc.pignat@hevs.ch> Acked-by: Marc Pignat <marc.pignat@hevs.ch> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (jc42) fix coccinelle warningsFengguang Wu2013-10-181-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/hwmon/jc42.c:521:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (ltc4261) fix coccinelle warningsFengguang Wu2013-10-181-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/hwmon/ltc4261.c:243:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (lm95234) fix coccinelle warningsFengguang Wu2013-10-181-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/hwmon/lm95234.c:704:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (max6697) fix coccinelle warningsFengguang Wu2013-10-181-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/hwmon/max6697.c:649:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (max6642 fix coccinelle warningsFengguang Wu2013-10-181-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/hwmon/max6642.c:299:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (ds1621) fix coccinelle warningsFengguang Wu2013-10-181-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/hwmon/ds1621.c:381:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (nct6775) fix coccinelle warningsFengguang Wu2013-10-181-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/hwmon/nct6775.c:3866:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (jc42) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-181-36/+25
| | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (ltc4261) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-181-39/+16
| | | | | | | | | | | | | | | | | | Also use new macro ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (ina209) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-181-28/+18
| | | | | | | | | | | | | | | | | | Also use new macro ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (lm95234) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-181-87/+50
| | | | | | | | | | | | | | | | | | Also use new macro ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (tmp401) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-181-64/+28
| | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (ina2xx) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-131-43/+21
| | | | | | | | | | | | | | | | | | | | | | | | Also introduce dev variable in probe function to simplify access to client->dev, and use new macro ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (max16065) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-131-72/+52
| | | | | | | | | | | | | | | | | | | | | | | | Modify code to use is_visible to determine if an attribute should be created or not, then use devm_hwmon_device_register_with_groups to create the hwmon device and all attributes in one operation. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (max6697) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-131-37/+17
| | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (lm73) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-131-48/+22
| | | | | | | | | | | | | | | | | | | | | Also introduce new variable dev pointing to client->dev in the probe function, and use new macro ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (max6642) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-131-48/+24
| | | | | | | | | | | | | | | | | | | | | | | | Also rename new_client variable to client and introduce new variable dev pointing to client->dev in the probe function, and use new macro ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (ds1621) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-131-20/+4
| | | | | | | | | | | | | | | | | | Also use new macro __ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (nct6775) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck2013-10-131-16/+5
| | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: Provide managed hwmon registrationGuenter Roeck2013-10-131-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drivers using the new hwmon_device_register_with_groups API often have a remove function which consists solely of a call hwmon_device_unregister(). Provide support for devm_hwmon_device_register_with_groups and devm_hwmon_device_unregister to allow this repeated code to be removed and help eliminate error handling code. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (nct6775) Convert to use hwmon_device_register_with_groupsGuenter Roeck2013-10-131-86/+36
| | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (pmbus) Convert to use hwmon_device_register_with_groupsGuenter Roeck2013-10-131-13/+7
| | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (ltc4245) Convert to use hwmon_device_register_with_groupsGuenter Roeck2013-10-131-54/+24
| | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (gpio-fan) Convert to use hwmon_device_register_with_groupsGuenter Roeck2013-10-131-27/+14
| | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (ds1621) Convert to use hwmon_device_register_with_groupsGuenter Roeck2013-10-131-33/+27
| | | | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: Introduce hwmon_device_register_with_groupsGuenter Roeck2013-10-131-16/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hwmon_device_register_with_groups() lets callers register a hwmon device together with all sysfs attributes in a single call. When using hwmon_device_register_with_groups(), hwmon attributes are attached to the hwmon device directly and no longer with its parent device. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (f71882fg) Remove extra return statementGuenter Roeck2013-10-131-1/+0
| | | | | | | | | | | | | | | | | | | | | Leftover from commit 33cd66e3 (hwmon: (f71882fg) Convert to use devm_ functions). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (f75375s) Don't crash the kernel unnecessarilyGuenter Roeck2013-10-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The f75375s driver crashes the kernel if it detects an an internal implementation error. While the detected conditions suggest that there is a bug in the code, the condition is not fatal. Replace BUG() with WARN(). Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (atxp1) Set and use error code from vid_to_reg()Guenter Roeck2013-10-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vid_to_reg() returns -1 if it encounters an error. Return -EINVAL instead. Its only caller, atxp1_storevcore(), doesn't use the return code but returns -1 instead, which is wrong anyway as it means -EPERM. Use the return value from vid_to_reg() instead to report the error. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <khali@linux-fr.org>
* | | hwmon: (acpi_power_meter) Use return value from acpi_bus_register_driverGuenter Roeck2013-10-131-1/+1
| | | | | | | | | | | | | | | | | | acpi_bus_register_driver() returns a valid error code. Use it. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (acpi_power_meter) Don't crash the kernel unnecessarilyGuenter Roeck2013-10-131-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | acpi_power_meter crashes the kernel if it detects an unexpected event or an internal implementation error. While the detected conditions suggest that there is a bug in the code, the condition is not fatal. Replace BUG() with WARN(). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (gpio_fan) Use error value returned from get_fan_speed_index()Guenter Roeck2013-10-131-2/+2
| | | | | | | | | | | | | | | | | | | | | get_fan_speed_index() returns -EINVAL in case of errors, only to have it ignored and replaced with -ENODEV. Make it return -ENODEV and use it. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (adt7462) Use error value returned from find_trange_value()Guenter Roeck2013-10-131-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | find_trange_value() returns -ENODEV in case of errors, only to have it ignored and replaced with -EINVAL. Make it return -EINVAL and use it. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <khali@linux-fr.org>
* | | hwmon: (pmbus) Don't unnecessarily crash the kernelGuenter Roeck2013-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | hwmon: (mc13783-adc) Increase size of name stringGuenter Roeck2013-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | smatch complains about mc13783_adc_probe() error: snprintf() chops off the last chars of 'id->name': 20 +vs 10 Use PLATFORM_NAME_SIZE instead of '10' as size when declaring the name variable. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | | hwmon: (nct6775) Check array index when accessing temp_offsetGuenter Roeck2013-10-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | smatch complains about a potential out-of-bounds access to the temp_offset array. That doesn't happen in practice, but it doesn't hurt to add an explicit check either. This prevents potential problems in the future (for example if the number of 'fixed' temperature sensors is increased to add support for another chip). Signed-off-by: Guenter Roeck <linux@roeck-us.net>