Commit graph

2196 commits

Author SHA1 Message Date
Robert Coulson 3a8fe33155 hwmon: (ds1621) Add ds1721 update interval sysfs attribute
The ds1721 device can be configured for 9..12 bit resolutions;
add a sysfs attribute for userspace to configure this attribute.
The definition, description, details, and usage are shown in the
documentation and were crafted from an LM73 driver patch done by
Chris Verges & Guenter Roeck).

Signed-off-by: Robert Coulson <rob.coulson@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-27 10:29:01 -07:00
Robert Coulson cd6c8a4297 hwmon: (ds1621) Add ds1721 chip support
Update the ds1621 documentation, driver, and Kconfig with
ds1721 chip support.

Signed-off-by: Robert Coulson <rob.coulson@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-27 10:28:59 -07:00
Sachin Kamat cd275a5635 hwmon: (w83627ehf) Remove redundant platform_set_drvdata()
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-21 10:05:24 -07:00
Sachin Kamat 3a2af25d84 hwmon: (ntc_thermistor) Remove redundant platform_set_drvdata()
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-21 10:05:19 -07:00
Sachin Kamat 15d2f565f2 hwmon: (i5k_amb) Remove redundant platform_set_drvdata()
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-21 10:05:13 -07:00
Sachin Kamat 807f730105 hwmon: (coretemp) Remove redundant platform_set_drvdata()
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-21 10:05:08 -07:00
Sachin Kamat bb6067e980 hwmon: (abituguru3) Remove redundant platform_set_drvdata()
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-21 10:05:03 -07:00
Guenter Roeck 591bfcfc33 hwmon: (adm1021) Strengthen chip detection for ADM1021, LM84 and MAX1617
On a system with both MAX1617 and JC42 sensors, JC42 sensors can be misdetected
as LM84. Strengthen detection sufficiently enough to avoid this misdetection.
Also improve detection for ADM1021.

Modeled after chip detection code in sensors-detect command.

Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Jean Delvare <khali@linux-fr.org>
2013-06-07 12:29:31 -07:00
Jean Delvare 4e2284d23b hwmon: (tmp401) Drop redundant safety on cache lifetime
time_after (as opposed to time_after_equal) already ensures that the
cache lifetime is at least as much as requested. There is no point in
manually adding another jiffy to that value, and this can confuse the
reader into wrong interpretation.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-05-19 08:19:29 -07:00
Wei Yongjun ecacb0b17c hwmon: fix error return code in abituguru_probe()
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-05-13 08:07:13 -07:00
Axel Lin 159c8cddd9 hwmon: (iio_hwmon) Fix null pointer dereference
This patch fixes the null pointer dereference in goto error_release_channels
path when allocate memory for st fails.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-05-13 06:43:14 -07:00
Guenter Roeck 169c05cd54 hwmon: (nct6775) Do not create non-existing attributes
Overtemperature and hysteresis registers only exist for primary
temperature registers, not for alternates, so do not assign
those registers when initializing alternates.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-05-11 22:55:07 -07:00
Axel Lin 4510d198f9 hwmon: (iio_hwmon) Fix missing iio_channel_release_all call if devm_kzalloc fail
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-05-11 22:55:07 -07:00
Linus Torvalds e72a5d1ceb Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
Pull hwmon update from Jean Delvare:
 "Only lm75 driver updates this time"

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  hwmon: (lm75) Add support for the Dallas/Maxim DS7505
  hwmon: (lm75) Tune resolution and sample time per chip
  hwmon: (lm75) Prepare to support per-chip resolution and sample time
  hwmon: (lm75) Per-chip configuration register initialization
2013-05-04 13:44:38 -07:00
Al Viro 60b7bf4e61 more mode_t whack-a-mole...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-04 14:46:28 -04:00
Jean Delvare 3fbc81e3c0 hwmon: (lm75) Add support for the Dallas/Maxim DS7505
Basically it's the same as the original DS75 but much faster.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
2013-05-04 14:49:36 +02:00
Jean Delvare 0cd2c72d76 hwmon: (lm75) Tune resolution and sample time per chip
Most LM75-compatible chips can either sample much faster or with a
much better resolution than the original LM75 chip. So far the lm75
driver did not let the user take benefit of these improvements. Do it
now.

I decided to almost always configure the chip to use the best
resolution possible, which also means the longest sample time. The
only chips for which I didn't are the DS75, DS1775 and STDS75, because
they are really too slow in 12-bit mode (1.2 to 1.5 second worst case)
so I went for 11-bit mode as a more reasonable tradeoff. This choice is
dictated by the fact that the hwmon subsystem is meant for system
monitoring, it has never been supposed to be ultra-fast, and as a
matter of fact we do cache the sampled values in almost all drivers.

If anyone isn't pleased with these default settings, they can always
introduce a platform data structure or DT support for the lm75. That
being said, it seems nobody ever complained that the driver wouldn't
refresh the value faster than every 1.5 second, and the change made
it faster for all chips even in 12-bit mode, so I don't expect any
complaint.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
2013-05-04 14:49:36 +02:00
Jean Delvare 87d0621ae2 hwmon: (lm75) Prepare to support per-chip resolution and sample time
Prepare the lm75 driver to support per-chip resolution and sample
time. For now we only make the code generic enough to support it, but
we still use the same, unchanged resolution (9-bit) and sample time
(1.5 s) for all chips.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
2013-05-04 14:49:36 +02:00
Jean Delvare 8a5c5cc617 hwmon: (lm75) Per-chip configuration register initialization
There is no standard for the configuration register bits of LM75-like
chips. We shouldn't blindly clear bits setting the resolution as they
are either unused or used for something else on some of the supported
chips.

So, switch to per-chip configuration initialization. This will allow
for better tuning later, for example using more resolution bits when
available.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
2013-05-04 14:49:36 +02:00
Linus Torvalds 151173e8ce Highlights:
- OpenFirmware/DeviceTree support for the Power Supply core: the core now
   automatically populates supplied_from hierarchy from the device tree.
   With these patches chargers and batteries can now lookup each other
   without the board files support shim. Rhyland Klein at NVIDIA did the
   work;
 
 - New ST-Ericsson ABX500 hwmon driver. The driver is heavily using the
   AB85xx core and depends on some recent changes to it, so that is why the
   driver comes through the battery tree. It has an appropriate ack from
   the hwmon maintainer (i.e. Guenter Roeck). Martin Persson at ST-Ericsson
   and Hongbo Zhang at Linaro authored the driver;
 
 - Final bits to sync AB85xx ST-Ericsson changes into mainline. The changes
   touch mfd parts, but these were acked by the appropriate MFD maintainer
   (i.e. Samuel Ortiz). Lee Jones at Linaro did most of the work and lead
   the submission process.
 
 Minor changes, but still worth mentioning:
 
 - Battery temperature reporting fix for Nokia N900 phones;
 - Versatile Express poweroff driver moved into drivers/power/reset/.
 - Tree-wise: use devm_kzalloc() where appropriate;
 - Tree-wise: dev_pm_ops cleanups/fixes.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJRf1BPAAoJEGgI9fZJve1bwyoP/3Gv+qStzbN7mUtIVEvH3EAe
 aVJwlODFzEZjk5xoiw7Dc8PuBE8O948hWOnQyCuUQ8+OfK6SyNIjexPYy3Z25a0F
 cX9JMj7rtPWHvxo2q/YuKwBPZoxj/JIPyxwUT7akwXoHAV059fvcy9R1DfFX2Qur
 hSP0NXTg+guvEpxGV4bC2l+LWZPmDFK9n0RsorttYaBvsiRDWl0c2TY2byofYlBw
 ++m/rI8Qgl8db8pKq/WDue62HtMt3kmZj6ZIgej3Wb0+GIRmYHMyPIyAkf82Wlw2
 g2sGNPT7cstrSNOozegzJ7UghJObcYDFf10NCgvFMNjmAT1dAwdneQHEWy6Ek7pT
 9X3e0LmaFqVbufFp4xFiLkMutsCLLTnGyXIbzs7RkTm3XBVIUqiDWtI6I6X44ohG
 6PJn8vUlufu7owXrqFpgSBar2U1vfoQdhInmz4hbQeff0qn2nX/BGNwhxYptZ549
 TudsI9WGzJ6fvYQ56zh6+BfiA0FmjhUiSKOtrXImrhxE6gUf3IOJyMQlkxLx5t8D
 uuhBmO0J6kDi2lqF6alOEo+UDefJj4mUJn2tnIdis90+lNQlSV02GEtiwFT1zt1z
 LFW0xshQkxZ4lMa28h35FB1/Z11ApUOe4Es+OKADDJhAnxdZzXcAwIRyPRRPgdsy
 jTnJno+Kxk9wXLcekxVE
 =5BdE
 -----END PGP SIGNATURE-----

Merge tag 'for-v3.10' of git://git.infradead.org/battery-2.6

Pull battery updates from Anton Vorontsov:
 "Highlights:

   - OpenFirmware/DeviceTree support for the Power Supply core: the core
     now automatically populates supplied_from hierarchy from the device
     tree.  With these patches chargers and batteries can now lookup
     each other without the board files support shim.  Rhyland Klein at
     NVIDIA did the work

   - New ST-Ericsson ABX500 hwmon driver.  The driver is heavily using
     the AB85xx core and depends on some recent changes to it, so that
     is why the driver comes through the battery tree.  It has an
     appropriate ack from the hwmon maintainer (i.e.  Guenter Roeck).
     Martin Persson at ST-Ericsson and Hongbo Zhang at Linaro authored
     the driver

   - Final bits to sync AB85xx ST-Ericsson changes into mainline.  The
     changes touch mfd parts, but these were acked by the appropriate
     MFD maintainer (ie Samuel Ortiz).  Lee Jones at Linaro did most of
     the work and lead the submission process.

  Minor changes, but still worth mentioning:

   - Battery temperature reporting fix for Nokia N900 phones
   - Versatile Express poweroff driver moved into drivers/power/reset/
   - Tree-wide: use devm_kzalloc() where appropriate
   - Tree-wide: dev_pm_ops cleanups/fixes"

* tag 'for-v3.10' of git://git.infradead.org/battery-2.6: (112 commits)
  pm2301-charger: Fix suspend/resume
  charger-manager: Use kmemdup instead of kzalloc + memcpy
  power_supply: Populate supplied_from hierarchy from the device tree
  power_supply: Add core support for supplied_from
  power_supply: Define Binding for power-supplies
  rx51_battery: Fix reporting temperature
  hwmon: Add ST-Ericsson ABX500 hwmon driver
  ab8500_bmdata: Export abx500_res_to_temp tables for hwmon
  ab8500_{bmdata,fg}: Add const attributes to some data arrays
  ab8500_bmdata: Eliminate CamelCase warning of some variables
  ab8500_btemp: Make ab8500_btemp_get* interfaces public
  goldfish_battery: Use resource_size()
  lp8788-charger: Use PAGE_SIZE for the sysfs read operation
  max8925_power: Use devm_kzalloc()
  da9030_battery: Use devm_kzalloc()
  da9052-battery: Use devm_kzalloc()
  ds2760_battery: Use devm_kzalloc()
  ds2780_battery: Use devm_kzalloc()
  gpio-charger: Use devm_kzalloc()
  isp1704_charger: Use devm_kzalloc()
  ...
2013-04-30 15:15:24 -07:00
Linus Torvalds fdc719b63a Staging driver tree update for 3.10-rc1
Here's the big staging driver tree update for 3.10-rc1
 
 This update contains loads of comedi driver cleanups and fixes in here,
 iio updates, android driver changes, and other various staging driver
 cleanups.
 
 Thanks to some drivers being removed, and the comedi driver cleanups, we
 have removed more code than we added:
  627 files changed, 65145 insertions(+), 76321 deletions(-)
 which is always nice to see.
 
 All of these have been in linux-next for a while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iEYEABECAAYFAlF+nF8ACgkQMUfUDdst+ynlIwCfYm2pSkA0w1K56mftq1T0hpMH
 b9IAmwQlfEHSIKeAxqRO3RRrfLu5XD7L
 =Jnxr
 -----END PGP SIGNATURE-----

Merge tag 'staging-3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver tree update from Greg Kroah-Hartman:
 "Here's the big staging driver tree update for 3.10-rc1

  This update contains loads of comedi driver cleanups and fixes in
  here, iio updates, android driver changes, and other various staging
  driver cleanups.

  Thanks to some drivers being removed, and the comedi driver cleanups,
  we have removed more code than we added:

   627 files changed, 65145 insertions(+), 76321 deletions(-)

  which is always nice to see.

  All of these have been in linux-next for a while."

* tag 'staging-3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (940 commits)
  staging: comedi: ni_labpc: fix legacy driver build
  staging: comedi: das800: cleanup the cio-das802/16 fifo comments
  staging: comedi: das800: rename CamelCase vars in das800_ai_do_cmd()
  staging: comedi: das800: tidy up the private data
  staging: comedi: das800: tidy up das800_interrupt()
  staging: comedi: das800: tidy up das800_ai_insn_read()
  staging: comedi: das800: tidy up das800_di_insn_bits()
  staging: comedi: das800: tidy up das800_do_insn_bits()
  staging: comedi: das800: remove extra divisor calculation call
  staging: comedi: das800: rename {enable,disable}_das800
  staging: comedi: das800: tidy up subdevice init
  staging: comedi: das800: allow attaching without interrupt support
  staging: comedi: das800: interrupts are required for async command support
  staging: comedi: das800: tidy up das800_ai_do_cmdtest()
  staging: comedi: das800: remove 'volatile' on private data variables
  staging: comedi: das800: cleanup the boardinfo
  staging: comedi: das800: cleanup range table declarations
  staging: comedi: das800: introduce das800_ind_{write, read}()
  staging: comedi: das800: remove forward declarations
  staging: comedi: das800: move das800_set_frequency()
  ...
2013-04-29 11:34:17 -07:00
Guenter Roeck 6445e6600f hwmon: (nct6775) Fix coding style problems
Add space around binary operators (CodingStyle, chapter 3.1).

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-21 09:42:52 -07:00
Guenter Roeck 6d4b3621bb hwmon: (nct6775) Constify strings
nct6775_sio_names should be a constant pointer to an array of
constant strings.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-21 09:42:45 -07:00
Guenter Roeck 29dd3b64b9 hwmon: (tmp401) Add support for TMP432
TMP432 is similar to TMP431 with a second external temperature sensor.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2013-04-21 08:56:48 -07:00
Guenter Roeck 0846e30dd4 hwmon: (tmp401) Add support for update_interval attribute
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2013-04-21 08:27:38 -07:00
Guenter Roeck 8eb6d90fec hwmon: (tmp401) Reset valid flag when resetting temperature history
Cached data is no longer valid after resetting the temperature history.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2013-04-21 08:27:28 -07:00
Guenter Roeck 14f2a6654d hwmon: (tmp401) Simplification and cleanup
Use two-dimensional array pointing to registers
Merge temperature and limit access functions into a single function
Return error codes from I2C reads
Use DIV_ROUND_CLOSEST for rounding operations and improve rounding

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2013-04-21 08:26:41 -07:00
Hongbo Zhang 0bbb06ed56 hwmon: Add ST-Ericsson ABX500 hwmon driver
Each of ST-Ericsson X500 chip set series consists of both ABX500 and DBX500
chips. This is ABX500 hwmon driver, where the abx500.c is a common layer for
all ABX500s, and the ab8500.c is specific for AB8500 chip. Under this designed
structure, other chip specific files can be added simply using the same common
layer abx500.c.

Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-04-16 18:27:52 -07:00
Guenter Roeck b4e665c780 hwmon: (tmp401) Use sysfs_create_group / sysfs_remove_group
instead of creating and removing sysfs attribute files individually.

Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-14 04:47:06 -07:00
Guenter Roeck 947e92719d hwmon: (tmp401) Drop unused defines, use BIT for bit masks
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2013-04-14 04:46:56 -07:00
Guenter Roeck c409fd43bd hwmon: (nct6775) Use ARRAY_SIZE for loops where possible
This ensures that the loop iterations are correct even if/when
the number of elements in an array changes.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-13 08:44:35 -07:00
Guenter Roeck 573728c647 hwmon: (nct6775) Enable both AUXTIN and VIN3 on NCT6776
Per datasheet, VIN3 and AUXTIN share the same external pin. However, there
is no clean way to detect this condition. Furthermore, both are reported
by the BIOS on Supermicro C7H61. It may thus be possible that chip revisions
exist where both attributes are supported at the same time.
Better play safe and report both.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:42 -07:00
Jingoo Han debe597cca hwmon: (ad7314) use spi_get_drvdata() and spi_set_drvdata()
Use the wrapper functions for getting and setting the driver data using
spi_device instead of using dev_{get|set}_drvdata with &spi->dev, so we
can directly pass a struct spi_device.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:42 -07:00
Guenter Roeck 2c7fd30da2 hwmon: (nct6775) Expand scope of supported chips
NCT6775, NCT6776, and NCT6779 have a number of variants with the same
chip ID but different chip labels. Add text "or compatible" to the
message displayed when the driver is loaded and rephrase the Kconfig
entry to reflect that it also supports compatible chips.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:42 -07:00
Guenter Roeck c81cc5a4c1 hwmon: (gpio-fan) Use is_visible to determine if attributes should be created
Simplify code and reduce object size by more than 300 bytes (x86_64).

Cc: Jamie Lentin <jm@lentin.co.uk>
Cc: Simon Guinot <simon.guinot@sequanux.org>
Tested-by: Simon Guinot <simon.guinot@sequanux.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:42 -07:00
Guenter Roeck 4ce5b1fe31 hwmon: (tmp401) Fix device detection for TMP411B and TMP411C
Turns out that TMP411B and TMP411C have different and unique device IDs.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2013-04-07 21:16:42 -07:00
Guenter Roeck e1eb49063b hwmon: Add driver for LM95234
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:42 -07:00
Guenter Roeck a1fac92b8b hwmon: (tmp401) Add support for TMP431
TMP431 is compatible to TMP401.

Also add support for additional I2C addresses supported by TMP411B
and TMP411C.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2013-04-07 21:16:42 -07:00
Guenter Roeck 58615a94f6 hwmon: (pmbus/lm25066) Add support for LM25056
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:41 -07:00
Guenter Roeck e53e6497fc hwmon: (pmbus/lm25066) Refactor device specific coefficients
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>
2013-04-07 21:16:41 -07:00
Guenter Roeck 2507abb3a7 hwmon: (pmbus/lm25066) Clamp limit attributes
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>
2013-04-07 21:16:41 -07:00
Guenter Roeck a7c69118bd hwmon: (pmbus/lm25066) Report VAUX as vmon
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>
2013-04-07 21:16:41 -07:00
Guenter Roeck 6bf44cedab hwmon: (max6697) Use is_visible and sysfs_create_group
Simplify the code and reduce its size by using is_visible to determine
valid attributes, and sysfs_create_group to create all of them with
a single call.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:41 -07:00
Guenter Roeck 71bb2d211e hwmon: (adt7310) Fix sparse warning
Fix: drivers/hwmon/adt7310.c:51:16: sparse: cast to restricted __be16

Cc: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:41 -07:00
Guenter Roeck fd9175d2f6 hwmon: (pmbus/ltc2978) Add support for LTC2974 and LTC3883
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:41 -07:00
Guenter Roeck 3d0d283993 hwmon: (pmbus/ltc2978) Code cleanup
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>
2013-04-07 21:16:41 -07:00
Guenter Roeck bec24b74b2 hwmon: (ltc4261) Fix 'Macros with complex values' checkpatch error
Fix:
ERROR: Macros with complex values should be enclosed in parenthesis

by unwinding the problematic macros.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:40 -07:00
Guenter Roeck f539038e0b hwmon: (ltc4245) Fix 'Macros with complex values' checkpatch error
Fix:
ERROR: Macros with complex values should be enclosed in parenthesis

by unwinding the problematic macros.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:40 -07:00
Guenter Roeck b5f0f1eadf hwmon: (ltc4215) Fix 'Macros with complex values' checkpatch error
Fix:
ERROR: Macros with complex values should be enclosed in parenthesis

by unwinding the problematic macros.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:40 -07:00
Guenter Roeck bc0c591ec1 hwmon: (ltc4151) Fix 'Avoid unnecessary line continuations' checkpatch warning
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:40 -07:00
Guenter Roeck f0df0fd92d hwmon: (ina2xx) Fix 'Avoid unnecessary line continuations' checkpatch warning
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:40 -07:00
Guenter Roeck b55f375725 hwmon: Fix checkpatch warning 'quoted string split across lines'
Cc: Corentin Labbe <corentin.labbe@geomatys.fr>
Cc: Mark M. Hoffman <mhoffman@lightlink.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Juerg Haefliger <juergh@gmail.com>
Cc: Andreas Herrmann <herrmann.der.user@googlemail.com>
Cc: Rudolf Marek <r.marek@assembler.cz>
Cc: Jim Cromie <jim.cromie@gmail.com>
Cc: Roger Lucas <vt8231@hiddenengine.co.uk>
Cc: Marc Hulsman <m.hulsman@tudelft.nl>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:40 -07:00
Guenter Roeck 088ce2ac9e hwmon: Fix CamelCase checkpatch warnings
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:40 -07:00
Guenter Roeck 236d903948 hwmon: (nct6775) Drop read/write lock
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>
2013-04-07 21:16:40 -07:00
Guenter Roeck 0fc1f8fc61 hwmon: (nct6775) Only report VID if supported and enabled
VID is not always enabled (NCT6775, NCT6776) or supported (NCT6779).

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:39 -07:00
Guenter Roeck 8e9285b0bb hwmon: (nct6775) Detect and report additional temperature sources
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>
2013-04-07 21:16:39 -07:00
Guenter Roeck bbd8decd41 hwmon: (nct6775) Add support for weighted fan control
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>
2013-04-07 21:16:39 -07:00
Guenter Roeck cdcaeceb74 hwmon: (nct6775) Add support for automatic fan control
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:39 -07:00
Guenter Roeck 77eb5b3703 hwmon: (nct6775) Add support for pwm, pwm_mode, and pwm_enable
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:39 -07:00
Guenter Roeck 84d19d92f7 hwmon: (nct6775) Add power management support
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:39 -07:00
Guenter Roeck 47ece9645f hwmon: (nct6775) Add support for fan debounce module parameter
If set, fan debounce is enabled when loading the driver.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:39 -07:00
Guenter Roeck 5c25d954d3 hwmon: (nct6775) Add support for fanX_pulses sysfs attribute
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:39 -07:00
Guenter Roeck 1c65dc365e hwmon: (nct6775) Add support for fan speed attributes
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:39 -07:00
Guenter Roeck aa136e5dad hwmon: (nct6775) Add support for temperature sensors
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:38 -07:00
Guenter Roeck a6bd587842 hwmon: (nct6775) Add case open detection
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07 21:16:38 -07:00
Guenter Roeck 9de2e2e84e hwmon: Driver for Nuvoton NCT6775F, NCT6776F, and NCT6779D
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>
2013-04-07 21:16:38 -07:00
Guenter Roeck 24f9c539b9 hwmon: Fix 'Macros with complex values' checkpatch errors
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>
2013-04-07 21:16:38 -07:00
Guenter Roeck 692fe501da hwmon: checkpatch cleanup: Replace printk with pr_debug or dev_dbg as 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>
2013-04-07 21:16:38 -07:00
Naveen Krishna Chatradhi 9e8269de10 hwmon: (ntc_thermistor) Add DT with IIO support to NTC thermistor driver
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>
2013-04-07 21:16:38 -07:00
Lars-Peter Clausen 4b5e536b0e hwmon: (adt7x10) Add alarm interrupt support
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>
2013-04-07 21:16:38 -07:00
Lars-Peter Clausen 51c2a4871c hwmon: (adt7410) Add support for the adt7310/adt7320
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>
2013-04-07 21:16:38 -07:00
Lars-Peter Clausen c55dc91e92 hwmon: (adt7410) Don't re-read non-volatile registers
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>
2013-04-07 21:16:38 -07:00
Jingoo Han f40fb63e92 hwmon: (mc13783-adc.c) use module_platform_driver_probe()
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>
2013-04-07 21:16:37 -07:00
Greg Kroah-Hartman b43f9b59e6 Merge 3.9-rc5 into staging-next
This pulls in all of the good fixes we need here.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-01 11:46:45 -07:00
Greg Kroah-Hartman ef994fda44 First set of IIO new drivers and cleanup for the 3.10 cycle.
New stuff
 
 1) Add OF support for specifying mappings between iio devices and their
    in kernel consumers.
 2) Driver for AD7923 (extra functionality and support for ad7904, ad7914 and
    ad7924 added later in series)
 3) Driver for Exynos adc (dt suppor for phy added later in series).
 4) Make iio_push_event save IRQ context - necessary if it is to be used
    within an interrupt handler.  Users of this functionality to follow.
 5) For iio use the device tree node name to provide the hwmon name attribute
    if available.
 
 Removal and moves out of staging
 
 1) Drop the adt7410 driver from IIO now that there is a hmwon driver with
    equivalent support. This device is very much targeted at hardware
    monitoring so hwmon is a more appropriate host for the driver.
 2) Move iio_hwmon driver to drivers/hwmon.
 
 Cleanups
 
 1) Minor cleanup in ST common library.
 2) Large set of patches to break the info_mask element which previously used
 odd and even bits to specify if a channel attribute was either shared across
 similar channels or specific to only one.  Now we have two bitmaps, one for
 those parameters that are specific to this channel and one for those shared
 by all channels with the same type as this one.  This has no effect on the
 userspace abi. It simplifies the core code and provides more space for new
 channel parameters. It has been on the todo list for a long time!
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJRTYe3AAoJEFSFNJnE9BaIxfEQAJDxF7GZKG3pJhJIrN40d42y
 DZD9Tf28Z5Ynd70gA8lITzwyBuj2r56/xpuewR9SH0nsV+s8zUplUoqBg1B5eIOO
 WUg/ojzVjJISyrg+egfkNmwqv7LFkINj9CJfrf2xv99OwjQeCqMc9zHQ1JRK+tl/
 57Z1zCZFX3B2dKDalH8sGcuGFRB+TturctvSAO2FTKcQ6/8FmubXD7+4zamn7+lH
 vsD6+kRhIQ3yZJSUhLMzbueXfdF9OZe3n7MTbCtLhb76JOLmkGAqnSo0APEndBTb
 PyS3DPKFxWJZTzzyKVoEW4pdU/fx2JfOZs101TFDXxh5p1hcALP8zwJQ3CqotYT6
 kosGlyrPKaAiqkkGURqsUQvjjfcvNuhFQY2IMHQxFhEIRLYHZTLPJGBV1oBPQ4sQ
 /OAOgu+Uut45ZeHAo1bTXcykO8GzvYxvQ18LUY1Jo/5Iqid0nRxVL6CkrA6Uw+z4
 Tu4/z3ceeBAx1B34/ty58rkX+Xe6CxPPbzSgCtrV6oMpLZhQegHareItnhxbNRFN
 oO9CULLXf6nyFhoYFbZRi+FStfsvdLKjfoDshHNp2kcpqsrTDyjwaTjjTQ4u30MD
 VVo7lwVmm0ASpOXyVDPIw7ft/HHUDPH8xz7tPhhZHX5uvs74GCHg0WjZ48WMgv/N
 Jk6lERQpZ2x6RYe4eH9+
 =99m9
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-3.10a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

First set of IIO new drivers and cleanup for the 3.10 cycle.

New stuff

1) Add OF support for specifying mappings between iio devices and their
   in kernel consumers.
2) Driver for AD7923 (extra functionality and support for ad7904, ad7914 and
   ad7924 added later in series)
3) Driver for Exynos adc (dt suppor for phy added later in series).
4) Make iio_push_event save IRQ context - necessary if it is to be used
   within an interrupt handler.  Users of this functionality to follow.
5) For iio use the device tree node name to provide the hwmon name attribute
   if available.

Removal and moves out of staging

1) Drop the adt7410 driver from IIO now that there is a hmwon driver with
   equivalent support. This device is very much targeted at hardware
   monitoring so hwmon is a more appropriate host for the driver.
2) Move iio_hwmon driver to drivers/hwmon.

Cleanups

1) Minor cleanup in ST common library.
2) Large set of patches to break the info_mask element which previously used
odd and even bits to specify if a channel attribute was either shared across
similar channels or specific to only one.  Now we have two bitmaps, one for
those parameters that are specific to this channel and one for those shared
by all channels with the same type as this one.  This has no effect on the
userspace abi. It simplifies the core code and provides more space for new
channel parameters. It has been on the todo list for a long time!

Conflicts:
	drivers/iio/dac/ad5064.c
2013-03-25 10:50:03 -07:00
Jonathan Cameron 51b53dc991 hwmon: Move the IIO client driver for hwmon out of staging
This driver uses channel maps, defined either through device tree
or platform data, to create a hwmon driver which acts as a client
for the underlying IIO device channels.  Thus a general purpose
IIO adc driver can be used to provide hardware monitoring using a subset
of its channels.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>

--
 The only non move changes here concern the description and changes to the
 dependencies to IIO explicit and hwmon implicit.

 I'm proposing moving this into hwmon on the basis of placing drivers
 based on what they provide rather than what their underlying hardware
 is.

 drivers/hwmon/Kconfig           |   9 ++
 drivers/hwmon/Makefile          |   1 +
 drivers/hwmon/iio_hwmon.c       | 196 ++++++++++++++++++++++++++++++++++++++++
 drivers/staging/iio/Kconfig     |   8 --
 drivers/staging/iio/Makefile    |   2 -
 drivers/staging/iio/iio_hwmon.c | 196 ----------------------------------------
 6 files changed, 206 insertions(+), 206 deletions(-)
2013-03-23 10:08:15 +00:00
Jean Delvare 5a4c060114 hwmon: (lm75.h) Update header inclusion
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>
2013-03-18 21:19:49 +01:00
Guenter Roeck 8c958c703e hwmon: (pmbus/ltc2978) Fix temperature reporting
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>
2013-03-14 09:03:51 -07:00
David Woodhouse 6975404fb9 hwmon: (pmbus) Fix krealloc() misuse in pmbus_add_attribute()
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>
2013-03-14 06:57:19 -07:00
Axel Lin df069079c1 hwmon: (lineage-pem) Add missing terminating entry for 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>
2013-03-14 06:55:21 -07:00
Mark Brown 3e78080f81 hwmon: (sht15) Check return value of regulator_enable()
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>
2013-03-03 21:45:48 -08:00
Guenter Roeck f366fccd08 hwmon: (pmbus/ltc2978) Use detected chip ID to select supported functionality
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>
2013-03-03 21:45:47 -08:00
Guenter Roeck dbd712c227 hwmon: (pmbus/ltc2978) Fix peak attribute handling
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>
2013-03-03 21:45:47 -08:00
Linus Torvalds 8793422fd9 ACPI and power management updates for 3.9-rc1
- 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.
 
 /
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJRIsArAAoJEKhOf7ml8uNsD6MP/j7C4NA+GTq6RdwoJt+Yki0K
 9Ep8I4pEuRFoN/oskv24EyQhpGJIk6UxWcJ/DWFBc+1VhmKORta7k2Idv/wlJA77
 s7AcDveA9xcDh+TVfbh87TeuiMSXiSdDZbiaQO+wMizWJAF3F84AnjiAqqqyQcSK
 bA5/Siz/vWlt9PyYDaQtHTVE4lpvPuVcQdYewsdaH2PsmUjvIg/TUzg28CTrdyvv
 eHOdBK9R0/OLQLhzRbL0VOGJ//wEl+HJRO0QEhTKPgdQ1e/VH/4Zu5WSzF8P/x4C
 s2f8U4IKQqulDuDHXtpMpelFm7hRWgsOqZLkcyXLs+0dvSM9CTPO6P0ZaImxUctk
 5daHWEsXUnCErDQawt1mcZP8l6qnxofMQIfLXyPVzvlSnHyToTmrtXa1v2u4AuL/
 hOo4MYWsFNUmRdtGFFGlExGgEDZ4G5NwiYjRBl/6XJ3v4nhnnMbuzxP8scpoe5m1
 8tjroJHZFUUs/mFU/H+oRbHzSzXPmp1sddNaTg4OpVmTn3DDh6ljnFhiItd1Ndw0
 5ldVbSe6ETq5RoK0TbzvQOeVpa9F3JfqbrXLQPqfd2iz/No41LQYG1uShRYuXKuA
 wfEcc+c9VMd3FILu05pGwBnU8VS9VbxTYMz7xDxg6b29Ywnb7u+Q1ycCk2gFYtkS
 E2oZDuyewTJxaskzYsNr
 =wijn
 -----END PGP SIGNATURE-----

Merge tag 'pm+acpi-3.9-rc1' of 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
  ...
2013-02-20 11:26:56 -08:00
Linus Torvalds b3cdda2b4f Device tree changes for v3.9
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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJRI3ZoAAoJEEFnBt12D9kBW0EP/2hTN9cS3b0CMyhh+PVUWZKu
 U+pTMbXBfomYC/9vWEBEpnYQSZuBXA+Sow3ubkRk6p6qjwYi0NUuAE4reQHLwvji
 u9nL7v9WNr4WXqUpMSgSzoxzPkvr2mfrHWRU2adaKpr+p4UvjbYNG1SxppqTJGji
 HThYNsgfdFzNvO7xtFTJGpMe3UhWfazdnVc/rg1csqex2UCZMqmSf1VjNqQIGt+t
 zH6jcCSZY96rX9f+HgdL9rvZyGSjDSIHRllpuG+8u5N3N1CSzbKPe4zSia3mlsC3
 g6g3bOihGJYeG2sc1RzHSdI6ANCn3RTuuA4xQBe/xCKvZIMRNNtzsf2Kbbah0ISG
 NW1WW3KRnq85sEdwv9gtFeMoalZ/sTV1O9m3vG9Xz2XgzWgf7c0V/7ukpFuTpQby
 NiFoTbc7K2E8J/fa8NhKfR4myzNKr3peJ6mJEMMn6PkdQwnOh1AC9l5iuDzMsdvk
 IGY8YvR1qY32IW68E42JQdteZP45EBzEgD9NjU7gRGI6nu2g5czv/VFztjiom4qd
 XahvdsfuVlCitRG8g2CHgBtEsjStYUmCa+gnIoycX7HhMShwYRX/cxA7Yife2UGV
 k+GUKCkGpHOLIoiAEHq+BdEv7amuJsqglJ5kvjL01m80k7JDGJqq8H9UUZ6yOCqe
 iXERO1R4HezNVFtMDrLO
 =Zlkx
 -----END PGP SIGNATURE-----

Merge tag 'dt-for-linus' of git://git.secretlab.ca/git/linux

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
  ...
2013-02-20 11:04:46 -08:00
Sachin Kamat 4626dcff78 hwmon: (ntc_thermistor): Fix sparse warnings
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>
2013-02-19 17:34:17 -08:00
Lars-Peter Clausen e46e5dc2b2 hwmon: (adt7410) Add device table entry for the adt7420
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>
2013-02-19 17:34:16 -08:00
Lars-Peter Clausen 54be068d19 hwmon: (adt7410) Use I2C_ADDRS helper macro
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>
2013-02-19 17:34:16 -08:00
Lars-Peter Clausen 436440fc16 hwmon: (adt7410) Use the SIMPLE_DEV_PM_OPS helper macro
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>
2013-02-19 17:34:15 -08:00
Lars-Peter Clausen e0db9c4bfe hwmon: (adt7410) Let suspend/resume depend on CONFIG_PM_SLEEP
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>
2013-02-19 17:34:15 -08:00
Lars-Peter Clausen 6e7d3b6bb9 hwmon: (adt7410) Clear unwanted bits in the config register
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>
2013-02-19 17:34:15 -08:00
Grant Likely e80beb27d2 gpio: Make of_count_named_gpios() use new of_count_phandle_with_args()
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>
2013-02-13 10:11:53 +00:00
Guenter Roeck d476828037 hwmon: (jc42) Add support for MCP98244
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <khali@linux-fr.org>
2013-02-06 09:58:07 -08:00
Guenter Roeck f880b12c18 hwmon: (pmbus) Clean up for code size reduction
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>
2013-02-06 09:58:07 -08:00
Guenter Roeck 50115ac9b6 hwmon: (pmbus/max34440) Add support for MAX34460 and MAX34461
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>
2013-02-06 09:58:06 -08:00
Guenter Roeck 16c6d01f3b hwmon: (pmbus) Add support for word status register
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>
2013-02-06 09:58:05 -08:00
Guenter Roeck 1640eaecc4 hwmon: (pmbus/zl6100) Add support for VMON/VDRV
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>
2013-02-06 09:58:05 -08:00
Guenter Roeck ce603b18f3 hwmon: (pmbus) Add function to clear sensor cache
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>
2013-02-06 09:58:04 -08:00
Guenter Roeck aebcbbfc49 hwmon: (pmbus) Add support for additional voltage sensor
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>
2013-02-06 09:58:03 -08:00
Guenter Roeck 85cfb3a835 hwmon: (pmbus) Use krealloc to allocate attribute memory
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>
2013-02-06 09:58:03 -08:00