Commit graph

2197 commits

Author SHA1 Message Date
Guenter Roeck 5ff512b458 hwmon: (lm87) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:40 -07:00
Guenter Roeck 747e5d62ac hwmon: (lm85) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:40 -07:00
Guenter Roeck c38b2820cb hwmon: (lm80) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:40 -07:00
Guenter Roeck 52714c04df hwmon: (lm77) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:40 -07:00
Guenter Roeck efd2d117ae hwmon: (lm77) Improve code readability
Rename new_client variable, and define new variable for client->dev.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:40 -07:00
Guenter Roeck 13ac7a0176 hwmon: (lm75) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:40 -07:00
Guenter Roeck c5a4a91d24 hwmon: (lm63) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:40 -07:00
Guenter Roeck 647ff514d8 hwmon: (gl520sm) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:40 -07:00
Guenter Roeck bba636d059 hwmon: (gl518sm) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:39 -07:00
Guenter Roeck 6ecffe1691 hwmon: (emc6w201) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:39 -07:00
Guenter Roeck e20b4b38cd hwmon: (ds1621) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:39 -07:00
Guenter Roeck d466a35305 hwmon: (atxp1) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:39 -07:00
Guenter Roeck e5ebb772c6 hwmon: (adm9240) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:39 -07:00
Guenter Roeck dc2fd66327 hwmon: (adm1031) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:39 -07:00
Guenter Roeck 3421e212e6 hwmon: (adm1026) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:39 -07:00
Guenter Roeck 06ce97d608 hwmon: (adm1021) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:39 -07:00
Guenter Roeck 4cb14a3a65 hwmon: (w83795) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:39 -07:00
Guenter Roeck 20f426ff02 hwmon: (lm90) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:38 -07:00
Guenter Roeck c087f73a24 hwmon: (lm83) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:38 -07:00
Guenter Roeck adc1413279 hwmon: (f71805f) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:38 -07:00
Guenter Roeck 7b7bb90ca3 hwmon: (lm78) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:38 -07:00
Guenter Roeck e3ecb2eeed hwmon: (adt7475) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:38 -07:00
Guenter Roeck 6702c9981e hwmon: (adm1025) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:38 -07:00
Guenter Roeck 61d4d17ea9 hwmon: (pc87360) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Cc: Jim Cromie <jim.cromie@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Jim Cromie <jim.cromie@gmail.com>
2012-07-21 21:48:38 -07:00
Guenter Roeck ed2e073b13 hwmon: (mc13783-adc.c) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Cc: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
2012-07-21 21:48:38 -07:00
Guenter Roeck b07405fbc3 hwmon: (max6639) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Cc: Roland Stigge <stigge@antcom.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Roland Stigge <stigge@antcom.de>
2012-07-21 21:48:38 -07:00
Guenter Roeck 94cd52027a hwmon: (max6650) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Cc: Hans J. Koch <hjk@hansjkoch.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Hans J. Koch <hjk@hansjkoch.de>
2012-07-21 21:48:37 -07:00
Guenter Roeck e7d5bf7ed5 hwmon: (wm831x-hwmon) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-21 21:48:37 -07:00
Ashish Jangam e41f6432d1 hwmon: Driver for DA9052/53 PMIC
The DA9052 PMIC provides an Analogue to Digital Converter with 10 bits
resolution and 10 channels.

This patch monitors the DA9052 PMIC's ADC channels mostly for battery
parameters like battery temperature, junction temperature, battery
current etc.

This patch is functionally tested on Samsung SMDKV6410

Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Signed-off-by: Ashish Jangam <ashish.jangam@kpitcummins.com>
[Guenter Roeck: __init --> __devinit for probe function]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-07-21 21:48:37 -07:00
Guenter Roeck 62867d491a hwmon: (fam15h_power) Fix unintentional integer overflow
Expression with two unsigned integer variables is calculated as unsigned integer
before it is converted to u64. This may result in an integer overflow.
Fix by typecasting the left operand to u64 before performing the left shift.

This patch addresses Coverity #402320: Unintentional integer overflow.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Andreas Herrmann <andreas.herrmann3@amd.com>
2012-07-21 21:48:28 -07:00
Guenter Roeck 58c3667d83 hwmon: (w83627ehf) Add missing break statement
A case statement in nct6775_write_fan_div() is missing a break. Fix it.

This patch addresses Coverity #141439: Missing break in switch.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21 21:48:28 -07:00
Rafael J. Wysocki 6148d38b37 Merge branch 'pm-acpi'
* pm-acpi: (24 commits)
  olpc-xo15-sci: Use struct dev_pm_ops for power management
  ACPI / PM: Drop PM callbacks from the ACPI bus type
  ACPI / PM: Drop legacy driver PM callbacks that are not used any more
  ACPI / PM: Do not execute legacy driver PM callbacks
  acpi_power_meter: Use struct dev_pm_ops for power management
  fujitsu-tablet: Use struct dev_pm_ops for power management
  classmate-laptop: Use struct dev_pm_ops for power management
  xo15-ebook: Use struct dev_pm_ops for power management
  toshiba_bluetooth: Use struct dev_pm_ops for power management
  panasonic-laptop: Use struct dev_pm_ops for power management
  sony-laptop: Use struct dev_pm_ops for power management
  hp_accel: Use struct dev_pm_ops for power management
  toshiba_acpi: Use struct dev_pm_ops for power management
  ACPI: Use struct dev_pm_ops for power management in the SBS driver
  ACPI: Use struct dev_pm_ops for power management in the power driver
  ACPI: Use struct dev_pm_ops for power management in the button driver
  ACPI: Use struct dev_pm_ops for power management in the battery driver
  ACPI: Use struct dev_pm_ops for power management in the AC driver
  ACPI: Use struct dev_pm_ops for power management in processor driver
  ACPI: Use struct dev_pm_ops for power management in the thermal driver
  ...
2012-07-19 00:03:35 +02:00
Steve Glendinning 90b24cfb42 Change email address for Steve Glendinning
I no longer have a mailbox at smsc.com, and I've had two reports
that that email address now bounces from people trying to
contact me.  This patch updates all references to that invalid
address to one that I can be contacted on more permanently.

This patch also updates the maintainer status to reflect
the fact I'm no longer directly paid to maintain these drivers.

Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-17 16:15:38 +02:00
Jean Delvare 41002f8dd5 hwmon: (it87) Preserve configuration register bits on init
We were accidentally losing one bit in the configuration register on
device initialization. It was reported to freeze one specific system
right away. Properly preserve all bits we don't explicitly want to
change in order to prevent that.

Reported-by: Stevie Trujillo <stevie.trujillo@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
2012-07-12 22:47:37 +02:00
Ingo Molnar 92254d3144 Linux 3.5-rc6
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQEcBAABAgAGBQJP+NMmAAoJEHm+PkMAQRiGPxEH/18YQN8FAzEIjcC10ytA3RC3
 KzPv31jXgJGZDy1UqmpKtJ7GDwb92AhqZxVnJimMa+6d1uA8NsZQq5EMOPPiX8Qi
 8P4AEaw5kSMmR/6zxsxguCGdbDLU3xZ1nJZkHyMgjo2UJbMU0jBPneb/79heWPhe
 0HOkLzN5VA6Yx3Nt70sWQ1zsuj0Ji5jCGO0iNTCBmTiv4J9ZlOx3xJQn4aK6JscO
 /3QRTM43GG0j6zToEOCTHrn8ajOq6rHQQkG0bPVR723nFrSGLoaCT6QVBXYug+AZ
 9Xay7zVNvrq2oH5x5jADG2t2vyaG+nEJpSrVjXznzxgDnK7tWjYqiuG5zqKhAq8=
 =IMfr
 -----END PGP SIGNATURE-----

Merge tag 'v3.5-rc6' into x86/mce

Merge Linux 3.5-rc6 before merging more code.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
2012-07-11 09:41:37 +02:00
Rafael J. Wysocki c5dec01822 acpi_power_meter: Use struct dev_pm_ops for power management
Make the ACPI power meter driver define its PM callbacks through
a struct dev_pm_ops object rather than by using legacy PM hooks
in struct acpi_device_ops.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2012-07-01 13:31:05 +02:00
Linus Torvalds 15b77435ed Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar.

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, cpufeature: Remove stray %s, add -w to mkcapflags.pl
  x86, cpufeature: Catch duplicate CPU feature strings
  x86, cpufeature: Rename X86_FEATURE_DTS to X86_FEATURE_DTHERM
  x86: Fix kernel-doc warnings
  x86, compat: Use test_thread_flag(TIF_IA32) in compat signal delivery
2012-06-29 10:29:54 -07:00
H. Peter Anvin 4ad3341130 x86, cpufeature: Rename X86_FEATURE_DTS to X86_FEATURE_DTHERM
It makes sense to label "Digital Thermal Sensor" as "DTS", but
unfortunately the string "dts" was already used for "Debug Store", and
/proc/cpuinfo is a user space ABI.

Therefore, rename this to "dtherm".

This conflict went into mainline via the hwmon tree without any x86
maintainer ack, and without any kind of hint in the subject.

    a4659053 x86/hwmon: fix initialization of coretemp

Reported-by: Jean Delvare <khali@linux-fr.org>
Link: http://lkml.kernel.org/r/4FE34BCB.5050305@linux.intel.com
Cc: Jan Beulich <JBeulich@suse.com>
Cc: <stable@vger.kernel.org> v2.6.36..v3.4
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2012-06-25 09:01:15 -07:00
Guenter Roeck bb9a80e571 hwmon: Update my e-mail address
My old e-mail address won't be valid for much longer. Time to update it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-06-25 06:46:24 -07:00
Jesper Juhl aa8521ec28 hwmon: (applesmc) correct email address for Jesper Juhl
I've not had a gmail address for years. This commit updates the
address to my actual working one.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-06-24 23:36:03 -07:00
Linus Torvalds 7b8377862b hwmon fixes for 3.5-rc4
Two minor fixes in emc2103 and applesmc drivers.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJP4orkAAoJEMsfJm/On5mBIa4P/Awha20ciGg44zONpGD7xC5/
 G2xbmR4qRey0WD1Ot4lMBUfM6NQT3yeZELfykq5KWv9O83VcwaKp+eRUeacE2f9K
 Jzhe0zz6mJvb8uqQteoCJsPJg435KOeYKUaqlQzAP2warTne9fAY5ugZ3eEIEfs/
 1vT0BreVC5PSvf82qP0+xHHeGOGMI3ti7iqm9IN7pnzZDYrVJgjCMDXra000eGnW
 wX0ZPWrT5+/7eFTDEPu6PtmY8jRcWlc9AGeE6DMsvKYp7k0yyAAiN8ebNrQtkW5J
 nSj9QAJG4hej59aiS/QJD2QQWHNgrBstHcW4ZxXYp/IhayGPq2K8YF30wJl+X9bx
 /9e6K5RNvOUxTh9QjOodAN0EhEO4rsJTb6VsjZ/1L6d9aPHJD22ZFQZKYzDrApPw
 b0DwxLKJwehm1pqT0C/ptbsx0vVUWdwc9xwBo5co8lmIRasHR9J92iEKndNGTicl
 eGMXOgE3rjEgelwXvLDaIvple8PIRDj6Hc6TmKJlaxvAfBms4yMBHvASEuOujpD2
 mT8lhrrArf4mDeEl2ks2b+z5eEje9nuSgP5V1XNmxTYmh4eF96XiIWg9Gov7J1zr
 7JmgrxJv2nr7n/rSxcmA+POlNhGTRsMb52l5em8lbKlcd7A80V0k23xQDuTxWlrx
 uoefguLWBt82fjVqNi/S
 =kDRE
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:
 "Two minor fixes in emc2103 and applesmc drivers."

* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (emc2103) Fix use of an uninitilized variable in error case
  hwmon: (applesmc) Limit key length in warning messages
2012-06-21 13:40:40 -07:00
Guenter Roeck 2355375efd hwmon: (emc2103) Fix use of an uninitilized variable in error case
Fix:

emc2103.c: In function set_pwm_enable:
emc2103.c:463:12: warning: conf_reg may be used uninitialized in this function

by checking the return value from read_u8_from_i2c(). This fixes a real problem,
as conf_reg is really uninitialized if read_u8_from_i2c returns an error.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-06-18 08:48:00 -07:00
Henrik Rydberg ac852edb47 hwmon: (applesmc) Limit key length in warning messages
Key lookups may call read_smc() with a fixed-length key string,
and if the lookup fails, trailing stack content may appear in the
kernel log. Fixed with this patch.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-06-18 08:48:00 -07:00
Jean Delvare 1268a172cd hwmon: (coretemp) Drop needless initialization
The value is overridden a few lines later.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-06-17 18:05:06 +02:00
Guenter Roeck 41e58a1f2b hwmon: (coretemp) Improve support for TjMax detection on Atom CPUs
Atom CPUs don't have a register to retrieve TjMax. Detection so far was
incomplete. Use the X86 model ID to improve it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-06-17 18:05:05 +02:00
Guenter Roeck 5592906f8b hwmon: (coretemp) Add support for Atom D2000 and N2000 series CPU models
Document the Atom series D2000 and N2000 (Cedar Trail) as being supported.
List and set TjMax for those series.

Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "R, Durgadoss" <durgadoss.r@intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-06-17 18:05:05 +02:00
Jean Delvare fcc14ac1a8 hwmon: (coretemp) Improve support of recent Atom CPU models
Document the new Atom series (Tunnel Creek and Medfield) as being
supported, and list TjMax for the Atom E600 series.

Also enable the Atom tjmax heuristic for these Atom CPU models.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Reviewed-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Alexander Stein <alexander.stein@systec-electronic.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "R, Durgadoss" <durgadoss.r@intel.com>
2012-06-17 18:05:05 +02:00
Borislav Petkov 24214449b0 x86, amd_nb: Export model 0x10 and later PCI id
Add the F3 PCI id of F15h, model 0x10 to pci_ids.h and to the amd_nb
code which generates the list of northbridges on an AMD box. Shorten
define name while at it so that it fits into pci_ids.h.

Acked-by: Clemens Ladisch <clemens@ladisch.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
2012-06-07 12:43:41 +02:00
Hans de Goede 2d8c7ff52c hwmon/sch56xx: Depend on watchdog for watchdog core functions
Since the watchdog code in sch56xx-common now uses the watchdog core, the
Kconfig entires for the sch5627 and sch5636 should depend on WATCHDOG
being set. Also select the watchdog core when we select one of the drivers.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-30 07:56:20 +02:00
Dan Carpenter bb644913a7 watchdog: sch56xx-common: set correct bits in register()
WDOG_NO_WAY_OUT (3) and WDOG_ACTIVE (0) are the bit numbers, not a mask.
So "data->wddev.status |= WDOG_ACTIVE;" was intended to set bit zero but
it is a no-op.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-30 07:56:17 +02:00
Hans de Goede 54e2dc9341 watchdog: sch56xx-common: Add proper ref-counting of watchdog data
This fixes referencing free-ed memory in the corner case where /dev/watchdog
is open when the platform driver gets unbound from the platform device.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-30 07:55:46 +02:00
Hans de Goede 85a2e40cb5 watchdog: sch56xx: Remove unnecessary checks for register changes
Since the watchdog core keeps track of the watchdog's active state, start/stop
will never get called when no changes are necessary. So we can remove the
check for the output_enable register changing before writing it (which is
an expensive operation).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-30 07:55:41 +02:00
Hans de Goede fb551405c0 watchdog: sch56xx: Use watchdog core
Convert sch56xx drivers to the generic watchdog core.

Note this patch depends on the "watchdog: Add multiple device support" patch
from Alan Cox.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-05-30 07:55:38 +02:00
Linus Torvalds 1259f6ee15 hwmon updates for 3.5-rc1
New driver for INA219 and INA226, added support for IT8782F and IT8783E/F to
 it87 driver, plus cleanups in a couple of drivers.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (GNU/Linux)
 
 iQIcBAABAgAGBQJPu7QNAAoJEMsfJm/On5mB/roP/1l+TKHZiUcOfoBDXIqkX18d
 8XlJywnidCtPPo4dDvssXy3MVFBb/OtIggh58ya2fmibVHdYgQMTaK+ryGYMPE6z
 5iKb7PnkBV8BzP4NiEITHYciExpEJyarl4I0Pu1Z3zgef7AB4u0JHRD7j+c18GNX
 gQuFcu39qHQxw08EmsHTnR9jKwdfladiI3xNcVzKsC6ycUq8jMP/81vNkxTkkhbP
 yZDww+AtLUHzZfiF4t8beB7n9z+u/grMLtmvurW7UUor7A/VCt2JhzD1txvG+mOP
 YHWzkcBvrYbZocb5mP+ULH9ONny4nMErUY+cSxym+5G3CNsymZxD1RqWfTfMHF21
 LVqaGOmU9PNj2GcAhV2karJQ3APVJZFocTaJpmzYtMFkGofoKdlyqV+/Hop4jqyV
 44grojWL3uh5LtOdqKy68qn/BvFEi6gEMx9f094rTDdFRTycLNBXktcGXfubK0y8
 +hUYzFWuSYjAmYHNMXrbUAH80F2/vu4cd4h3LviPfwi/BSWk78EhBfKujjhdTcDM
 /ramG3Z+2qbA6p6wZ6nwTSNSKiDkBfuf+G6dLGCaJHrPqhokAtVq8uQW5aYNTVe4
 Ihe9uPqU/UF10SkFSWyqu2FytsFJ9BDxx8LL4Rsfugka2UgvIE6WPrhIJpvJUbFE
 kXcf0Xre4HBcNjQvuGOF
 =ZX6H
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon updates from Guenter Roeck:
 "New driver for INA219 and INA226, added support for IT8782F and
  IT8783E/F to it87 driver, plus cleanups in a couple of drivers."

* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (it87) Make temp3 attribute conditional for IT8782F
  hwmon: (it87) Convert to use devm_kzalloc and devm_request_region
  hwmon: INA219 and INA226 support
  hwmon: (it87) Create voltage attributes only if voltage is enabled
  hwmon: (ntc_thermistor) Fix checkpatch warning
  hwmon: (ntc_thermistor) Optimize and fix build warning
  hwmon: (ntc_thermistor) Return error code from hwmon_device_register
  hwmon: (ntc_thermistor) Convert to devm_kzalloc
  hwmon: (ad7314) Remove unused defines, and rename OFFSET to SHIFT
  acpi_power_meter: clean up code around setup_attrs
  acpi_power_meter: drop meter_rw_attrs, use common meter_attrs
  acpi_power_meter: remove duplicate code between register_{ro,rw}_attrs
  acpi_power_meter: use a {RW,RO}_SENSOR_TEMPLATE macro to clean things up
  acpi_power_meter: use the same struct {rw,ro}_sensor_template for both
  hwmon: use module_pci_driver
  hwmon: (it87) Add support for IT8782F and IT8783E/F
2012-05-23 14:15:09 -07:00
Linus Torvalds e8650a0823 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Pull trivial updates from Jiri Kosina:
 "As usual, it's mostly typo fixes, redundant code elimination and some
  documentation updates."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (57 commits)
  edac, mips: don't change code that has been removed in edac/mips tree
  xtensa: Change mail addresses of Hannes Weiner and Oskar Schirmer
  lib: Change mail address of Oskar Schirmer
  net: Change mail address of Oskar Schirmer
  arm/m68k: Change mail address of Sebastian Hess
  i2c: Change mail address of Oskar Schirmer
  net: Fix tcp_build_and_update_options comment in struct tcp_sock
  atomic64_32.h: fix parameter naming mismatch
  Kconfig: replace "--- help ---" with "---help---"
  c2port: fix bogus Kconfig "default no"
  edac: Fix spelling errors.
  qla1280: Remove redundant NULL check before release_firmware() call
  remoteproc: remove redundant NULL check before release_firmware()
  qla2xxx: Remove redundant NULL check before release_firmware() call.
  aic94xx: Get rid of redundant NULL check before release_firmware() call
  tehuti: delete redundant NULL check before release_firmware()
  qlogic: get rid of a redundant test for NULL before call to release_firmware()
  bna: remove redundant NULL test before release_firmware()
  tg3: remove redundant NULL test before release_firmware() call
  typhoon: get rid of redundant conditional before all to release_firmware()
  ...
2012-05-22 19:22:50 -07:00
Guenter Roeck 4573acbc46 hwmon: (it87) Make temp3 attribute conditional for IT8782F
On IT8782F, temp3 is only supported if UART6 is disabled.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-05-22 06:48:49 -07:00
Guenter Roeck 62a1d05f0e hwmon: (it87) Convert to use devm_kzalloc and devm_request_region
This makes the code a bit simpler and smaller.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-05-22 06:48:48 -07:00
Felten, Lothar f7c2fe386a hwmon: INA219 and INA226 support
Add support for the Texas Instruments INA219 and INA226 power monitors.

Signed-off-by: Lothar Felten <l-felten@ti.com>
[guenter.roeck@ericsson.com: formatting cleanup; check for smbus word data;
 select PGA=8 for INA219]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-05-22 06:48:02 -07:00
Guenter Roeck 9172b5d124 hwmon: (it87) Create voltage attributes only if voltage is enabled
On IT8782F and IT8783F, some voltage input pins may be disabled. Don't create
sysfs attribute files if that is the case.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-05-20 19:41:50 -07:00
Guenter Roeck a7871def65 hwmon: (ntc_thermistor) Fix checkpatch warning
Fix checkpatch WARNING: quoted string split across lines

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-05-20 19:41:50 -07:00
Guenter Roeck dbe43a6276 hwmon: (ntc_thermistor) Optimize and fix build warning
The following build warning is seen in some configurations:

drivers/hwmon/ntc_thermistor.c: In function 'ntc_show_temp':
drivers/hwmon/ntc_thermistor.c:293: warning: 'temp' may be used uninitialized in this function

Fix the problem by re-arranging the code to overload return values with error
codes, and by avoiding error returns whenever possible.

Specifically,

Simplify lookup_comp() to not return an error. Instead, return i_low == i_high
if there is an exact match, or if the ohm value is outside the lookup table
range.

Modify get_temp_mC() to not return an error. Since it only returns an error
after lookup_comp() returned an error, this is quite straightforward after above
change.

Separate ntc_thermistor_read() into a function to read the resistor value (which
can return an error), and the call to get_temp_mC() which doesn't. Call the
functions directly from ntc_show_temp().

Code was tested using a test program, comparing the result of the old and new
versions of get_temp_mC() for resistor values between 0 and 2,000,000 ohm.

As a side effect, this patch reduces code size by approximately 400 bytes on
x86_64.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Donggeun Kim <dg77.kim@samsung.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-05-20 19:41:49 -07:00
Guenter Roeck 425d247680 hwmon: (ntc_thermistor) Return error code from hwmon_device_register
hwmon_device_register() never returns a NULL pointer in case of errors, but
an error value. Use it.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-05-20 19:41:49 -07:00
Guenter Roeck 41141e64e6 hwmon: (ntc_thermistor) Convert to devm_kzalloc
This avoids memory leaks, and makes the code a bit simpler and smaller.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-05-20 19:41:49 -07:00
Guenter Roeck 1137a9a649 hwmon: (ad7314) Remove unused defines, and rename OFFSET to SHIFT
Remove unused defines AD7314_PD, AD7314_TEMP_SIGN, and ADT7301_TEMP_SIGN.
Rename AD7314_TEMP_OFFSET to the more appropriate AD7314_TEMP_SHIFT.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-05-20 19:41:49 -07:00
Kyle McMartin 7bb5ee0169 acpi_power_meter: clean up code around setup_attrs
We don't need to duplicate if (res) checks if we're always running
one or the other.

Signed-off-by: Kyle McMartin <kyle@redhat.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-05-20 19:41:49 -07:00
Kyle McMartin 9fe789f88a acpi_power_meter: drop meter_rw_attrs, use common meter_attrs
We always register these two together, so move meter_rw_attrs into
meter_ro_attrs and use the same for both since we no longer have two
register_attr paths.

Signed-off-by: Kyle McMartin <kyle@redhat.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-05-20 19:41:49 -07:00
Kyle McMartin f49d6a7ed2 acpi_power_meter: remove duplicate code between register_{ro,rw}_attrs
Key off the attr->set method being present to set the sysfs attribute
as writable.

Signed-off-by: Kyle McMartin <kyle@redhat.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-05-20 19:41:48 -07:00
Kyle McMartin 3c45f2c78d acpi_power_meter: use a {RW,RO}_SENSOR_TEMPLATE macro to clean things up
Similar to how we do PCI/USB device id structs.

Signed-off-by: Kyle McMartin <kyle@redhat.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-05-20 19:41:48 -07:00
Kyle McMartin 81194cd240 acpi_power_meter: use the same struct {rw,ro}_sensor_template for both
We don't need both, when we can just key the read/write off of the
presence of the .set member.

Signed-off-by: Kyle McMartin <kyle@redhat.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-05-20 19:41:48 -07:00
Axel Lin f71f5a550a hwmon: use module_pci_driver
This patch converts the drivers in drivers/hwmon/* to use module_pci_driver()
macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Andreas Herrmann <andreas.herrmann3@amd.com>
Cc: Clemens Ladisch <clemens@ladisch.de>
Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-05-20 19:41:48 -07:00
Guenter Roeck 0531d98b1f hwmon: (it87) Add support for IT8782F and IT8783E/F
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-05-20 19:41:48 -07:00
Guenter Roeck bdc71c9a87 hwmon: (coretemp) Increase CPU core limit
CPU core ID is used to index the core_data[] array. The core ID is, however, not
sequential; 10-core CPUS can have a core ID as high as 25. Increase the limit to
32 to be able to deal with current CPUs.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@vger.kernel.org # 3.0+
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Durgadoss R <durgadoss.r@intel.com>
2012-05-01 09:16:14 -07:00
Kirill A. Shutemov b704871124 hwmon: (coretemp) fix oops on cpu unplug
coretemp tries to access core_data array beyond bounds on cpu unplug if
core id of the cpu if more than NUM_REAL_CORES-1.

BUG: unable to handle kernel NULL pointer dereference at 000000000000013c
IP: [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp]
PGD 673e5a067 PUD 66e9b3067 PMD 0
Oops: 0000 [#1] SMP
CPU 79
Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf bnep bluetooth rfkill ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter nf_conntrack_ipv4 nf_defrag_ipv4 ip6_tables xt_state nf_conntrack coretemp crc32c_intel asix tpm_tis pcspkr usbnet iTCO_wdt i2c_i801 microcode mii joydev tpm i2c_core iTCO_vendor_support tpm_bios i7core_edac igb ioatdma edac_core dca megaraid_sas [last unloaded: oprofile]

Pid: 3315, comm: set-cpus Tainted: G        W    3.4.0-rc5+ #2 QCI QSSC-S4R/QSSC-S4R
RIP: 0010:[<ffffffffa00159af>]  [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp]
RSP: 0018:ffff880472fb3d48  EFLAGS: 00010246
RAX: 0000000000000124 RBX: 0000000000000034 RCX: 00000000ffffffff
RDX: 0000000000000000 RSI: 0000000000000046 RDI: 0000000000000246
RBP: ffff880472fb3d88 R08: ffff88077fcd36c0 R09: 0000000000000001
R10: ffffffff8184bc48 R11: 0000000000000000 R12: ffff880273095800
R13: 0000000000000013 R14: ffff8802730a1810 R15: 0000000000000000
FS:  00007f694a20f720(0000) GS:ffff88077fcc0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 000000000000013c CR3: 000000067209b000 CR4: 00000000000007e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process set-cpus (pid: 3315, threadinfo ffff880472fb2000, task ffff880471fa0000)
Stack:
 ffff880277b4c308 0000000000000003 ffff880472fb3d88 0000000000000005
 0000000000000034 00000000ffffffd1 ffffffff81cadc70 ffff880472fb3e14
 ffff880472fb3dc8 ffffffff8161f48d ffff880471fa0000 0000000000000034
Call Trace:
 [<ffffffff8161f48d>] notifier_call_chain+0x4d/0x70
 [<ffffffff8107f1be>] __raw_notifier_call_chain+0xe/0x10
 [<ffffffff81059d30>] __cpu_notify+0x20/0x40
 [<ffffffff815fa251>] _cpu_down+0x81/0x270
 [<ffffffff815fa477>] cpu_down+0x37/0x50
 [<ffffffff815fd6a3>] store_online+0x63/0xc0
 [<ffffffff813c7078>] dev_attr_store+0x18/0x30
 [<ffffffff811f02cf>] sysfs_write_file+0xef/0x170
 [<ffffffff81180443>] vfs_write+0xb3/0x180
 [<ffffffff8118076a>] sys_write+0x4a/0x90
 [<ffffffff816236a9>] system_call_fastpath+0x16/0x1b
Code: 48 c7 c7 94 60 01 a0 44 0f b7 ac 10 ac 00 00 00 31 c0 e8 41 b7 5f e1 41 83 c5 02 49 63 c5 49 8b 44 c4 10 48 85 c0 74 56 45 31 ff <39> 58 18 75 4e eb 1f 49 63 d7 4c 89 f7 48 89 45 c8 48 6b d2 28
RIP  [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp]
 RSP <ffff880472fb3d48>
CR2: 000000000000013c

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-05-01 08:18:05 -07:00
Guenter Roeck c3e40a9972 hwmon: (fam15h_power) Fix pci_device_id array
pci_match_id() takes an *array* of IDs which must be properly zero-
terminated.

Reported-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@vger.kernel.org # 3.0+: 00250ec hwmon: fam15h_power: fix bogus values
Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-04-26 08:40:08 -07:00
Guenter Roeck eae1415dda hwmon: (ad7314) Fix build warning
The following build warning is seen in some configurations.

drivers/hwmon/ad7314.c: In function 'ad7314_show_temperature':
drivers/hwmon/ad7314.c:70: warning: 'data' may be used uninitialized in this function

Fix by overloading the return value from ad7314_spi_read with both data and
error code (the returned data is really u16 and needs to be converted into a
signed value anyway).

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-04-22 18:22:53 -07:00
Guenter Roeck 1196573fe4 hwmon: (ads1015) Fix build warning
The following build warning is seen in some configurations.

drivers/hwmon/ads1015.c: In function 'show_in':
drivers/hwmon/ads1015.c:129: warning: 'in' may be used uninitialized in this function

Fix by separating the register read function from the code converting the result
into mV.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Dirk Eibach <eibach@gdsys.de>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-04-18 11:15:50 -07:00
Andre Przywara 00250ec909 hwmon: fam15h_power: fix bogus values with current BIOSes
Newer BKDG[1] versions recommend a different initialization value for
the running average range register in the northbridge. This improves
the power reading by avoiding counter saturations resulting in bogus
values for anything below about 80% of TDP power consumption.
Updated BIOSes will have this new value set up from the beginning,
but meanwhile we correct this value ourselves.
This needs to be done on all northbridges, even on those where the
driver itself does not register at.

This fixes the driver on all current machines to provide proper
values for idle load.

[1]
http://support.amd.com/us/Processor_TechDocs/42301_15h_Mod_00h-0Fh_BKDG.pdf
Chapter 3.8: D18F5xE0 Processor TDP Running Average (p. 452)

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
[guenter.roeck@ericsson.com: Removed unnecessary return statement]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@vger.kernel.org # 3.0+
2012-04-18 11:15:40 -07:00
Masanari Iida 6b2aac42b2 Fix typo in various Kconfig file
Correct spelling typo in various Kconfig file.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-04-16 14:40:08 +02:00
Guenter Roeck d7ee11157f hwmon: (pmbus_core) Fix compiler warning
Some configurations produce the following compiler warning:

drivers/hwmon/pmbus/pmbus_core.c: In function 'pmbus_show_boolean':
drivers/hwmon/pmbus/pmbus_core.c:752: warning: 'val' may be used uninitialized in this function

While this is a false positive, it can easily be fixed by overloading the return
value from pmbus_get_boolean with both val and error return code (val is a
boolean and thus never negative).

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-04-09 12:17:38 -07:00
Guenter Roeck 1d0045ee4a hwmon: (smsc47m1) Fix compiler warning
Some configurations produce the following compiler warning:

drivers/hwmon/smsc47m1.c: In function 'sm_smsc47m1_init':
drivers/hwmon/smsc47m1.c:938: warning: 'address' may be used uninitialized in this function

While this is a false positive, it can easily be fixed by overloading the return
value from smsc47m1_find with both address and error return code (the address
is an unsigned short and thus never negative). This also reduces module size by
a few bytes (46 bytes for x86_64).

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-04-09 12:17:38 -07:00
Guenter Roeck 776cdc11b3 hwmon: (acpi_power_meter) Fix compiler warning seen in some configurations
In some configurations, BUG() does not result in an endless loop but returns
to the caller. This results in the following compiler warning:

drivers/hwmon/acpi_power_meter.c: In function 'show_str':
drivers/hwmon/acpi_power_meter.c:380: warning: 'val' may be used uninitialized in this function

Fix the warning by setting val to an empty string after BUG().

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-04-09 12:17:37 -07:00
Guenter Roeck 8528e07edf hwmon: (smsc47b397) Fix compiler warning
Some configurations produce the following compiler warning:

drivers/hwmon/smsc47b397.c: In function 'smsc47b397_init':
drivers/hwmon/smsc47b397.c:385: warning: 'address' may be used uninitialized in this function

While this is a false positive, it can easily be fixed by overloading the return
value from smsc47b397_find with both address and error return code (the address
is an unsigned short and thus never negative). This also reduces module size by
a few bytes (64 bytes for x86_64).

Cc: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-04-09 12:17:36 -07:00
Graeme Smecher e16de9137c hwmon: (ad7314) Adds missing spi_dev initialization
This driver was recently moved from IIO (where it worked) to hwmon (where
it doesn't.) This breakage occured because the hwmon version neglected to
correctly initialize a reference to spi_dev in its drvdata. The result is a
segfault every time the temperature is queried.

Signed-off-by: Graeme Smecher <gsmecher@threespeedlogic.com>
Cc: stable@vger.kernel.org # 3.2+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-04-03 17:08:28 -07:00
Andre Przywara fbc729a446 hwmon: (k10temp) Add support for AMD Trinity CPUs
The on-chip northbridge's temperature sensor of the upcoming
AMD Trinity CPUs works the same as for the previous CPUs.
Since it has a different PCI-ID, we just add the new one to the list
supported by k10temp.
This allows to use the k10temp driver on those CPUs.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-04-01 10:25:56 -07:00
Uwe Kleine-König 6f7805a8d9 hwmon: (w83627ehf) mark const init data with __initconst instead of __initdata
As long as there is no other non-const variable marked __initdata in the
same compilation unit it doesn't hurt. If there were one however
compilation would fail with

	error: $variablename causes a section type conflict

because a section containing const variables is marked read only and so
cannot contain non-const variables.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: lm-sensors@lm-sensors.org
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-04-01 10:24:36 -07:00
Kyle McMartin 31e354ee65 hwmon: (acpi_power_meter) fix lockdep spew due to non-static lock class
Similar to a30dcb4f which fixed asus_atk0110.ko, I recently received a
bug report from someone hitting the same issue in acpi_power_meter.

[   13.963168] power_meter ACPI000D:00: Found ACPI power meter.
[   13.963900] BUG: key ffff8802161f3920 not in .data!
[   13.963904] ------------[ cut here ]------------
[   13.963915] WARNING: at kernel/lockdep.c:2986
	lockdep_init_map+0x52f/0x560()

So let's fix that up for them by statically declaring the
lockdep_class_key.

Signed-off-by: Kyle McMartin <kyle@redhat.com>
Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-04-01 10:24:36 -07:00
Guenter Roeck ce15a81da3 hwmon: (adm1031) Fix compiler warning
Some configurations produce the following compile warning:

drivers/hwmon/adm1031.c: In function 'set_fan_auto_channel':
drivers/hwmon/adm1031.c:292: warning: 'reg' may be used uninitialized in this function

While this is a false positive, it can easily be fixed by overloading the return
value from get_fan_auto_nearest with both register value and error return code
(the register value is never negative). Coincidentially, that also reduces
module size by a few bytes.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-04-01 10:24:35 -07:00
Guenter Roeck 6394011d65 hwmon: (f75375s) Fix warning message seen in some configurations
In some configurations, BUG() does not result in an endless loop but returns to
the caller. This results in the following compiler warning:

drivers/hwmon/f75375s.c: In function 'duty_mode_enabled':
drivers/hwmon/f75375s.c:280: warning: control reaches end of non-void function
drivers/hwmon/f75375s.c: In function 'auto_mode_enabled':
drivers/hwmon/f75375s.c:295: warning: control reaches end of non-void function

Fix the warning by returning something sensible after BUG().

Cc: Nikolaus Schulz <schulz@macnetix.de>
Cc: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-04-01 10:24:34 -07:00
Mark Brown 52f30f7717 hwmon: (max6639) Convert to dev_pm_ops
The I2C specific PM operations have been deprecated and printing a
warning on boot for over a year now.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
[guenter.roeck@ericsson.com: Added missing #ifdef around pm functions]
Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-04-01 10:24:08 -07:00
Guenter Roeck be45d422d9 hwmon: (sht15) Fix Kconfig dependencies
sht15 depends on GPIOLIB, not on GENERIC_GPIO.

This fixes the following build error, seen if GPIOLIB is not defined:

src/drivers/hwmon/sht15.c: error: implicit declaration of function 'gpio_direction_input': => 293:2
src/drivers/hwmon/sht15.c: error: implicit declaration of function 'gpio_direction_output': => 216:2
src/drivers/hwmon/sht15.c: error: implicit declaration of function 'gpio_free': => 1000:2
src/drivers/hwmon/sht15.c: error: implicit declaration of function 'gpio_get_value': => 296:2
src/drivers/hwmon/sht15.c: error: implicit declaration of function 'gpio_request': => 946:2
src/drivers/hwmon/sht15.c: error: implicit declaration of function 'gpio_set_value': => 218:2
src/drivers/hwmon/sht15.c: error: implicit declaration of function 'gpio_to_irq': => 514:2

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-04-01 10:09:53 -07:00
Guenter Roeck c1a1260244 hwmon: (gpio-fan) Fix Kconfig dependencies
gpio-fan depends on GPIOLIB, not on GENERIC_GPIO.

This fixes the following build error, seen if GPIOLIB is not defined:

src/drivers/hwmon/gpio-fan.c: error: implicit declaration of function 'gpio_direction_output': => 372:3
src/drivers/hwmon/gpio-fan.c: error: implicit declaration of function 'gpio_free': => 130:2
src/drivers/hwmon/gpio-fan.c: error: implicit declaration of function 'gpio_get_value': => 79:2
src/drivers/hwmon/gpio-fan.c: error: implicit declaration of function 'gpio_request': => 98:2
src/drivers/hwmon/gpio-fan.c: error: implicit declaration of function 'gpio_set_value': => 156:3
src/drivers/hwmon/gpio-fan.c: error: implicit declaration of function 'gpio_to_irq': => 114:2

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Simon Guinot <sguinot@lacie.com>
2012-04-01 10:09:52 -07:00
Linus Torvalds 30304e5a79 MFD changes for 3.4
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPcXgCAAoJEIqAPN1PVmxKh2oP/2Ns+dr4oOF8z+uqYG1oisJd
 CxBTC1Bi9gYBtpiMztPiHZWiQtVXoDgLbLkx6ooWH5dpwCdvU6TVBZUJp4wpELtx
 mMk5vJy4/INHgI0nk5wUOr76rNlQfIcK04f+LHBSG1iljUkoVR3FefVKgoyIP+Wv
 oiCeuCyQcYIUmG1pVt1x43OoS+2xgjWQA67AalLLRj1DOA5OkvUL7NGsrZ1iZTUh
 YHQJsK6ER3MgbFFEImtn10NNFwAEG04o6vi42DFW1O0awm6kmVoLjo46wS+UiKoh
 Vx8t5ZGvlYOZ1ZM9N5ETgQnihBt7cOhA3ivZar8h+WiYVTRJs1ZSkpmnlpmM4YY9
 RCZ5DRw3N39R0ezkNVGSr1Xn1vkysIiZI82frrJiPUYLKihsrBzj2Jq3O25iILCf
 Iyv7HBEJxAb3x0zlF6kPhaA8OW4dssaHTLNx5IJSOKwiwVLdm4RPyOHh9QVz++p/
 p0hvSQWK1MUruBbBrjF/FN+FidgK2iU0iDW/GoDwI7OKymSxg7sauLtp0cZpo6nT
 F+Ep6yl/uR5vxih4LSYFJOjoeKuwIo/x92H0qJ3UroaUs9DNJ7UCKchXXiQ1Wtnz
 tAAsWP1YsMxMzlMxqW5J9w4LJynJ8bqrC0L8+HWzIUwikA8wv8/47Pmc/vPW0Y3N
 5L7KMS8/iFCsS8rPmGeP
 =onDl
 -----END PGP SIGNATURE-----

Merge tag 'mfd_3.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6

Pull MFD changes from Samuel Ortiz:
 - 4 new drivers: Freescale i.MX on-chip Anatop, Ricoh's RC5T583 and
   TI's TPS65090 and TPS65217.
 - New variants support (8420, 8520 ab9540), cleanups and bug fixes for
   the abx500 and db8500 ST-E chipsets.
 - Some minor fixes and update for the wm8994 from Mark.
 - The beginning of a long term TWL cleanup effort coming from the TI
   folks.
 - Various fixes and cleanups for the s5m, TPS659xx, pm860x, and MAX8997
   drivers.

Fix up trivial conflicts due to duplicate patches and header file
cleanups (<linux/device.h> removal etc).

* tag 'mfd_3.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (97 commits)
  gpio/twl: Add DT support to gpio-twl4030 driver
  gpio/twl: Allocate irq_desc dynamically for SPARSE_IRQ support
  mfd: Detach twl6040 from the pmic mfd driver
  mfd: Replace twl-* pr_ macros by the dev_ equivalent and do various cleanups
  mfd: Micro-optimization on twl4030 IRQ handler
  mfd: Make twl4030 SIH SPARSE_IRQ capable
  mfd: Move twl-core IRQ allocation into twl[4030|6030]-irq files
  mfd: Remove references already defineid in header file from twl-core
  mfd: Remove unneeded header from twl-core
  mfd: Make twl-core not depend on pdata->irq_base/end
  ARM: OMAP2+: board-omap4-*: Do not use anymore TWL6030_IRQ_BASE in board files
  mfd: Return twl6030_mmc_card_detect IRQ for board setup
  Revert "mfd: Add platform data for MAX8997 haptic driver"
  mfd: Add support for TPS65090
  mfd: Add some da9052-i2c section annotations
  mfd: Build rtc5t583 only if I2C config is selected to y.
  mfd: Add anatop mfd driver
  mfd: Fix compilation error in tps65910.h
  mfd: Add 8420 variant to db8500-prcmu
  mfd: Add 8520 PRCMU variant to db8500-prcmu
  ...
2012-03-28 13:56:35 -07:00
Wim Van Sebroeck 86a1e1896c watchdog: nowayout is bool
nowayout is actually a boolean value.
So make it bool for all watchdog device drivers.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-03-27 20:06:02 +02:00
Xie Xiaobo 5510e62a66 hwmon: Add MCP3021 ADC driver
Add I2C driver for MCP3021 that is an ADC chip from Microchip.
The MCP3021 is a successive approximation A/D converter (ADC)
with 10-bit resolution.
The driver export the value of Vin to sysfs, the voltage unit is
mV. Through the sysfs interface, lm-sensors tool can also display
Vin voltage.

Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com>
Signed-off-by: Xie Xiaobo <X.Xie@freescale.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-03-23 10:02:20 +01:00
Uwe Kleine-Koenig 0c2732152a hwmon: (mc13783-adc) Add support for the MC13892 PMIC
Based on a patch by David Jander that mostly did s/mc13783/mc13xxx/ .

Additionally use dev_get_drvdata instead of to_platform_device +
platform_get_drvdata in mc13783_adc_read (spotted by Jean Delvare).

Cc: David Jander <david.jander@protonic.nl>
Signed-off-by: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-03-23 10:02:19 +01:00
Frans Meulenbroeks cb88200490 hwmon: (mc13783-adc) Remove space before tab
Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-03-23 10:02:19 +01:00
Jean Delvare af2ef4fc04 hwmon: (lm63) Let the user adjust the lookup table
Make the automatic fan speed control lookup table writable. This lets
the user tweak the fan speed / temperature response curve.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Tested-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-23 10:02:19 +01:00
Jean Delvare 817c6cc546 hwmon: (lm63) Make fan speed control strategy changeable
Let the user switch between automatic and manual fan speed control.
Before switching to automatic fan speed control, we always check that
the lookup table looks sane.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-23 10:02:19 +01:00
Jean Delvare dac27dce31 hwmon: (lm63) Reorganize the code
Reorder functions and driver declaration to no longer need to
forward-declare functions. Also rename new_client to just client
everywhere for readability.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-23 10:02:18 +01:00
Guenter Roeck f7001bb063 hwmon: (lm90) Restore original configuration if probe function fails
The lm90 driver restores the original chip configuration in its exit function.
However, the chip configuration is not restored if the probe function fails.
Restore it there as well.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-03-23 10:02:18 +01:00
Guenter Roeck ae544f64cc hwmon: (lm90) Add support for GMT G781
GMT G781 is a ADM1032-compatible temperature sensor chip.
Add support to the LM90 driver.

Cc: Mike Gorchak <lestat@i.com.ua>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-03-23 10:02:18 +01:00
Guenter Roeck f36ffeab0a hwmon: (lm90) Fix multi-line comments
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-03-23 10:02:18 +01:00
Guenter Roeck c10b3ee8aa hwmon: (w83795) Fix multi-line comments
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-03-23 10:02:18 +01:00
Jean Delvare 72fea694c4 hwmon: (w83795) Unconditionally support manual fan speed control
Manual fan speed control uses a standard interface and has received
sufficient testing and review by now, it can be enabled
unconditionally. This includes attributes pwm[1-8], pwm[1-8]_enable,
pwm[1-8]_mode and pwm[1-8]_freq.

We only let the user switch from automatic mode to manual mode, but
not the other way around, as automatic control settings may not have
been set properly by the BIOS.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-23 10:02:17 +01:00
Andre Przywara 941a956b0e hwmon: (fam15h_power) Increase output resolution
On high CPU load the accumulating values in the running_avg_cap
register are very low (below 10), so averaging them too early leads
to unnecessary poor output resolution. Since we pretend to output
micro-Watt we better keep all the bits we have as long as possible.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-03-23 10:02:17 +01:00
Andreas Herrmann fc0900cbda hwmon: (fam15h_power) Correct sign extension of running_avg_capture
Wrong bit was used for sign extension which caused wrong end results.
Thanks to Andre for spotting this bug.

Reported-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@vger.kernel.org
2012-03-23 10:02:17 +01:00
Linus Torvalds 31f6765266 hwmon changes for v3.4
Mostly cleanup. No new drivers this time around, but support for several chips
 added to existing drivers: TPS40400, TPS40422, MTD040, MAX34446, ZL9101M,
 ZL9117M, and LM96080. Also, added watchdog support for SCH56xx, and additional
 attributes for a couple of drivers.
 
 312869e hwmon: (sch56xx) Add support for the integrated watchdog (v2)
 840e191 hwmon: (w83627ehf) Add support for temperature offset registers
 86dda17 hwmon: (jc42) Remove unnecessary device IDs
 3360a10 hwmon: (zl6100) Add support for ZL9101M and ZL9117M
 9271126 hwmon: (adm1275) Add support for ADM1075
 590defe hwmon: (max34440) Add support for MAX34446
 60b873e hwmon: (pmbus) Add more virtual registers
 2163340 hwmon: (pmbus) Add support for Lineage Power MDT040
 c5f35c9 hwmon: (pmbus) Add support for TI TPS40400 and TPS40422
 56aad5d hwmon: (max34440) Add support for 'lowest' output voltage attribute
 f15df57 hwmon: (jc42) Convert to use devm_kzalloc
 918ddef hwmon: (max16065) Convert to use devm_kzalloc
 b8a5a7c hwmon: (smm665) Convert to use devm_kzalloc
 3683928 hwmon: (ltc4261) Convert to use devm_kzalloc
 dd285ad hwmon: (pmbus) Simplify remove functions
 8b313ca hwmon: (pmbus) Convert pmbus drivers to use devm_kzalloc
 07404aa hwmon: (lineage-pem) Convert to use devm_kzalloc
 f352df6 hwmon: (hwmon-vid) Fix checkpatch issues
 3230f70 hwmon: (hwmon-vid) Add new entries to VRM model table
 9908ad4 hwmon: (lm80) Add detection of NatSemi/TI LM96080
 0e190b7 hwmon: (lm87) Get rid of macro-generated functions
 8652a26 hwmon: (lm87) Reorganize the code
 0fc86ec hwmon: (applesmc) Silence uninitialized warnings
 7599d32 hwmon: (lm70) Fix: do not use assignment in if condition
 e200c14 hwmon: (lm70) Register hwmon device after creating attribute files, and remove it first
 01d9def hwmon: (w83l786ng) Fix multi-line comments
 130067d hwmon: (w83l785ts) Fix multi-line comments
 7950133 hwmon: (w83781d) Fix: do not use assignment in if condition
 aff6e00 hwmon: (w83781d) Fix multi-line comments
 2a52dd6 hwmon: (smsc47b397) Fix multi-line comments
 36564ef hwmon: (pc87427) Fix multi-line comments
 b6707b7 hwmon: (max1668) Fix multi-line comments
 1160631 hwmon: (lm80) Fix multi-line comments
 bf0f3a0 hwmon: (emc2103) Fix multi-line comments
 fbb6670 hwmon: (adm1031) Fix multi-line comments
 94b991d hwmon: (adm1029) Fix multi-line comments
 27b9de3 hwmon: (w83627hf) Fix checkpatch issues
 ca3ccad hwmon: (w83l786ng) Fix checkpatch issues
 47efe87 hwmon: (w83793) Fix checkpatch issues
 d174368 hwmon: (w83792d) Fix checkpatch issues
 2185696 hwmon: (vt1211) Fix: do not use assignment in if condition
 b162c03 hwmon: (vt1211) Fix checkpatch issues
 9004ac8 hwmon: (via686a) Fix checkpatch issues
 bce2778 hwmon: (pc87360) Fix: do not use assignment in if condition
 449a7a0 hwmon: (pc87360) Fix checkpatch issues
 8958dfb hwmon: (max1619): Fix checkpatch issues
 09770b2 hwmon: (lm85) Fix checkpatch issues
 9b03079 hwmon: (lm78) Fix checkpatch issues
 02fe2fd hwmon: (lm77) Fix checkpatch issues
 f445a9a hwmon: (gl520sm) Fix: do not use assignment in if condition
 43da3d1 hwmon: (gl520sm) Fix checkpatch issues
 228f8e0 hwmon: (gl518sm) Fix checkpatch issues
 c8de836 hwmon: (dme1737) Fix checkpatch issues
 8c10369 hwmon: (asb100): Fix checkpatch issues
 c387e4e hwmon: (adm9240) Fix checkpatch issues
 86aa3e2 hwmon: (adm1026) Fix checkpatch issues
 21d2a8f hwmon: (adm1021) Fix checkpatch issues
 1bd385d hwmon: (abituguru) Fix checkpatch issues
 8969e84 hwmon: (w83627ehf) Fix multi-line comments
 51683ee hwmon: (max1111) Fix multi-line comments
 1b05d22 hwmon: (ltc4151) Fix multi-line comments
 1b9c491 hwmon: (g760a) Fix multi-line comments
 20eaf72 hwmon: (f71882fg) Fix multi-line comments
 4bebced hwmon: (emc1403) Fix multi-line comments
 ca3c7b6 hwmon: (amc6821) Fix multi-line comments
 10775d1 hwmon: (ads7871) Fix multi-line comments
 d13d623 hwmon: (ads7828) Fix multi-line comments
 562fca2 hwmon: (abituguru3) Fix multi-line comments
 ec1c319 hwmon: (w83791d) Fix checkpatch issues
 a80b10c hwmon: (ultra45_env) Fix checkpatch issues
 4d387df hwmon: (thmc50) Fix checkpatch issues
 85a0c0d hwmon: (smsc47m1) Fix checkpatch issues
 7e61268 hwmon: (smsc47m1) Fix: do not use assignment in if condition
 7cc3cb6 hwmon: (smsc47m192) Fix checkpatch issues
 8fda79e hwmon: (sis5595) Fix checkpatch issues
 5725608 hwmon: (pcf8591) Fix checkpatch issues
 2804a4c hwmon: (lm93) Fix checkpatch issues
 a318afd hwmon: (lm92) Fix checkpatch issues
 073f1e6c hwmon: (lm87) Fix: do not use assignment in if condition
 c6370db hwmon: (lm87) Fix checkpatch issues
 525ad37 hwmon: (fschmd) Fix checkpatch issues
 f24d548 hwmon: (atxp1) Fix checkpatch issues
 724cc33 hwmon: (adt7462) Fix checkpatch issues
 790fa38 hwmon: (ltc4215) Fix multi-line comments
 430b4fc hwmon: (ltc4245) Fix multi-line comments
 a68abd3 hwmon: (wm8350-hwmon) Constify fixed string array
 85ebfd3 hwmon: (applesmc) Fix multi-line comments
 75bdc93 hwmon: (asus_atk0110) Fix multi-line comments
 3c4c497 hwmon: (it87) Constify fixed string arrays
 8deeac8 hwmon: (ad7414) Fix multi-line comments
 5d577db hwmon: (jc42) Fix multi-line comments
 780affe hwmon: (coretemp) Fix checkpatch error
 3af2861 hwmon: (pc87360) Fix multi-line comments
 07de3df hwmon: (wm831x-hwmon) Fix multi-line comments
 3c22e23 hwmon: (smm665) Fix checkpatch error
 3c56b06 hwmon: (asc7621) Fix multi-line comments
 4a0d71c hwmon: (it87) Fix multi-line comments
 86d566e hwmon: (hwmon-vid) Fix multi-line comments
 5ed0488 hwmon: (hwmon) Fix multi-line comments
 19f2c05 hwmon: (ds1621) Fix checkpatch issues
 91efffe hwmon: convert drivers/hwmon/* to use module_spi_driver()
 f0967ee hwmon: convert drivers/hwmon/* to use module_i2c_driver()
 61ba031 hwmon: (vt8231) Fix multi-line comments
 9ed5bc2 hwmon: (adt7475) Fix multi-line comments
 2fff084 hwmon: (f71805f) Fix checkpatch issues
 703af96 hwmon: (max6650) Fix multi-line comments
 c531eb3 hwmon: (w83781d) Fix checkpatch issues
 2b22de5 hwmon: (adm1025) Fix checkpatch issues
 7973841 hwmon: (abituguru3) Fix checkpatch issues
 65fe5c7 hwmon: (vt8231) Fix checkpatch issues
 bafda5d hwmon: (max6650) Fix checkpatch issues
 0117c3f hwmon: (pmbus) Replace strict_strtol with kstrtol
 b3789a0 hwmon: (lm83) fix checkpatch issues
 93092a6 hwmon: (k8temp) fix checkpatch issues
 96585f1 hwmon: (lm80) reset device if error occurred
 6a9e7c4c hwmon: (lm80) fix checkpatch warnings
 6b904b6 hwmon: (adt7470) fix checkpatch issues
 e6a83db hwmon: (adt7411) fix checkpatch issues
 56c24af hwmon: (lm70) fix checkpatch issues
 1dc3708 hwmon: (f71882fg) fix checkpatch issues
 c6e8ac0 hwmon: (asus_atk0110) fix checkpatch issues
 99b8c83 hwmon: (adt7475) fix checkpatch issues
 b2ae8f8 hwmon: (smm665) fix checkpatch issues
 c9e1498 hwmon: (sht15) fix checkpatch issues
 0910b28 hwmon: (ibmaem) fix checkpatch issues
 dcb7cb9 hwmon: (ad7414) fix checkpatch issues
 e91aef2 hwmon: (ad7418) fix checkpatch issues
 5996542 hwmon: (w83l785ts) fix checkpatch issues
 a6100f6 hwmon: (wm831x-hwmon) fix checkpatch issues
 839a9ee hwmon: fix checkpatch issues
 08f5090 hwmon: (adm1029) fix checkpatch issues
 4d7c5d4 hwmon: (g760a) fix checkpatch issues
 7b102ed hwmon: (i5k_amb) fix checkpatch issues
 600151b hwmon: use DEFINE_PCI_DEVICE_TABLE
 7fe83ad hwmon: remove () used with return
 a6bee4a hwmon: (amc6821) fix initialisation
 2faaa93 hwmon: (lm80) add error handling
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (GNU/Linux)
 
 iQIcBAABAgAGBQJPaJBFAAoJEMsfJm/On5mBhkMP/09vlmsG7J3TLHcSKYJBkvSx
 6VNOOJgPqnvF71Az0dX47SU3zVXhG3I7dZufd/hqOK+0CNylSB7OSZMcWvBTduea
 0hDLTYj++SyVDQfVXb3zCVLU/wAE3YuXB3umWPwAKit4s2wAYYRDVCjwK96B88rv
 llNvo6JryuJDBUq7xiEmr0vKWMO0mKwwjpMTGCD3NpzK02ZV49T0gM94xa4gi5nM
 QAhNeO1AzQTx0+mBSRlq+SBBLSiXQmHcNrhnxcRMPha1bEi1D+QESozsczr+9/lz
 8vuTIULOIZxafM4XkBsZdknvlZnYrA6ukituDfVfiYQVcljO/cNu+seutFQDCMJe
 1zTDoNGIAwwnw0sAWWmTQwUMi+GSvlaL20gmm8FhTlvQaj9hNETsPYxEvPEsBNY1
 ICCixZcwpa1mZBXmryz2btf8az0OlX/sApzyHiq24B7lSE5Fv4tBDtwypLRu5N8m
 C4oNXC2dqDU0gtVxzO5Lavu6LHWV9lhyZvRPO75+zxYt4i5cnO04GTAYWh46aOzO
 DAZcs8M2Rj++dI5VW9Vl0k8hP9eWjxtPJFhNv/OWTx4YYQRICrde+j7QZcikIUWF
 0bzYI/zeIcwOg059vhnglBFM3mr7Z92jm4mftcNaSj/zuUHbWf6AQLbIq86Zq7tF
 3Eru3WuTZTwAkyNAVWd5
 =cUoW
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon changes for v3.4 from Guenter Roeck:
 "Mostly cleanup.  No new drivers this time around, but support for
  several chips added to existing drivers: TPS40400, TPS40422, MTD040,
  MAX34446, ZL9101M, ZL9117M, and LM96080.  Also, added watchdog support
  for SCH56xx, and additional attributes for a couple of drivers."

* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (137 commits)
  hwmon: (sch56xx) Add support for the integrated watchdog (v2)
  hwmon: (w83627ehf) Add support for temperature offset registers
  hwmon: (jc42) Remove unnecessary device IDs
  hwmon: (zl6100) Add support for ZL9101M and ZL9117M
  hwmon: (adm1275) Add support for ADM1075
  hwmon: (max34440) Add support for MAX34446
  hwmon: (pmbus) Add more virtual registers
  hwmon: (pmbus) Add support for Lineage Power MDT040
  hwmon: (pmbus) Add support for TI TPS40400 and TPS40422
  hwmon: (max34440) Add support for 'lowest' output voltage attribute
  hwmon: (jc42) Convert to use devm_kzalloc
  hwmon: (max16065) Convert to use devm_kzalloc
  hwmon: (smm665) Convert to use devm_kzalloc
  hwmon: (ltc4261) Convert to use devm_kzalloc
  hwmon: (pmbus) Simplify remove functions
  hwmon: (pmbus) Convert pmbus drivers to use devm_kzalloc
  hwmon: (lineage-pem) Convert to use devm_kzalloc
  hwmon: (hwmon-vid) Fix checkpatch issues
  hwmon: (hwmon-vid) Add new entries to VRM model table
  hwmon: (lm80) Add detection of NatSemi/TI LM96080
  ...
2012-03-21 10:37:25 -07:00
Linus Torvalds 69a7aebcf0 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Pull trivial tree from Jiri Kosina:
 "It's indeed trivial -- mostly documentation updates and a bunch of
  typo fixes from Masanari.

  There are also several linux/version.h include removals from Jesper."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (101 commits)
  kcore: fix spelling in read_kcore() comment
  constify struct pci_dev * in obvious cases
  Revert "char: Fix typo in viotape.c"
  init: fix wording error in mm_init comment
  usb: gadget: Kconfig: fix typo for 'different'
  Revert "power, max8998: Include linux/module.h just once in drivers/power/max8998_charger.c"
  writeback: fix fn name in writeback_inodes_sb_nr_if_idle() comment header
  writeback: fix typo in the writeback_control comment
  Documentation: Fix multiple typo in Documentation
  tpm_tis: fix tis_lock with respect to RCU
  Revert "media: Fix typo in mixer_drv.c and hdmi_drv.c"
  Doc: Update numastat.txt
  qla4xxx: Add missing spaces to error messages
  compiler.h: Fix typo
  security: struct security_operations kerneldoc fix
  Documentation: broken URL in libata.tmpl
  Documentation: broken URL in filesystems.tmpl
  mtd: simplify return logic in do_map_probe()
  mm: fix comment typo of truncate_inode_pages_range
  power: bq27x00: Fix typos in comment
  ...
2012-03-20 21:12:50 -07:00
Linus Torvalds 4a52246302 driver core merge for 3.4-rc1
Here's the big driver core merge for 3.4-rc1.
 
 Lots of various things here, sysfs fixes/tweaks (with the nlink breakage
 reverted), dynamic debugging updates, w1 drivers, hyperv driver updates,
 and a variety of other bits and pieces, full information in the
 shortlog.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iEYEABECAAYFAk9neCsACgkQMUfUDdst+ylyQwCfY2eizvzw5HhjQs8gOiBRDADe
 yrgAnj1Zan2QkoCnQIFJNAoxqNX9yAhd
 =biH6
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core patches for 3.4-rc1 from Greg KH:
 "Here's the big driver core merge for 3.4-rc1.

  Lots of various things here, sysfs fixes/tweaks (with the nlink
  breakage reverted), dynamic debugging updates, w1 drivers, hyperv
  driver updates, and a variety of other bits and pieces, full
  information in the shortlog."

* tag 'driver-core-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (78 commits)
  Tools: hv: Support enumeration from all the pools
  Tools: hv: Fully support the new KVP verbs in the user level daemon
  Drivers: hv: Support the newly introduced KVP messages in the driver
  Drivers: hv: Add new message types to enhance KVP
  regulator: Support driver probe deferral
  Revert "sysfs: Kill nlink counting."
  uevent: send events in correct order according to seqnum (v3)
  driver core: minor comment formatting cleanups
  driver core: move the deferred probe pointer into the private area
  drivercore: Add driver probe deferral mechanism
  DS2781 Maxim Stand-Alone Fuel Gauge battery and w1 slave drivers
  w1_bq27000: Only one thread can access the bq27000 at a time.
  w1_bq27000 - remove w1_bq27000_write
  w1_bq27000: remove unnecessary NULL test.
  sysfs: Fix memory leak in sysfs_sd_setsecdata().
  intel_idle: Revert change of auto_demotion_disable_flags for Nehalem
  w1: Fix w1_bq27000
  driver-core: documentation: fix up Greg's email address
  powernow-k6: Really enable auto-loading
  powernow-k7: Fix CPU family number
  ...
2012-03-20 11:16:20 -07:00
Hans de Goede 312869ec93 hwmon: (sch56xx) Add support for the integrated watchdog (v2)
Add support for the watchdog integrated into the SMSC SCH5627 and
SCH5636 superio-s. Since the watchdog is part of the hwmon logical device
and thus shares ioports with it, the watchdog driver is integrated into the
existing hwmon drivers for these.

Note that this version of the watchdog support for sch56xx superio-s
implements the watchdog chardev interface itself, rather then relying on
the recently added watchdog core / watchdog_dev. This is done because
currently some needed functionality is missing from watchdog_dev, as soon
as this functionality is added (which is being discussed on the
linux-watchdog mailinglist), I'll convert this driver over to using
watchdog_dev.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[guenter.roeck@ericsson.com: Added missing linux/slab.h include]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-20 06:42:05 -07:00
Guenter Roeck 840e191dba hwmon: (w83627ehf) Add support for temperature offset registers
Add support for temperature offset registers for CPUTIN, SYSTIN,
and AUXTIN temperatures.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18 18:27:54 -07:00
Guenter Roeck 86dda17634 hwmon: (jc42) Remove unnecessary device IDs
We don't really use or need separate device IDs for the various JC42.4 compliant
chips, so remove them and just stick with jc42.

Also update a datasheet references for SE98A, STTS424, and STTS424E02.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18 18:27:53 -07:00
Guenter Roeck 3360a106f8 hwmon: (zl6100) Add support for ZL9101M and ZL9117M
ZL9101M and ZL9117M are compatible to ZL6100. Add support to the zl6100 driver.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18 18:27:53 -07:00
Guenter Roeck 9271126966 hwmon: (adm1275) Add support for ADM1075
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:52 -07:00
Guenter Roeck 590defe59e hwmon: (max34440) Add support for MAX34446
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:52 -07:00
Guenter Roeck 60b873e332 hwmon: (pmbus) Add more virtual registers
Add PMBUS_VIRT_READ_TEMP_AVG, PMBUS_VIRT_READ_TEMP2_AVG,
PMBUS_VIRT_READ_POUT_AVG, PMBUS_VIRT_READ_POUT_MAX,
and PMBUS_VIRT_RESET_POUT_HISTORY.

We'll need those for MAX34446.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:51 -07:00
Guenter Roeck 216334094a hwmon: (pmbus) Add support for Lineage Power MDT040
MDT040 is supported by the generic PMBus driver. Add device ID and reference to
datasheet. Also mention Lineage Power device support in Kconfig.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:50 -07:00
Guenter Roeck c5f35c9d82 hwmon: (pmbus) Add support for TI TPS40400 and TPS40422
TPS40400 and TPS40422 are supported by the generic PMBus driver.
Add device IDs and data sheet references.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:50 -07:00
Guenter Roeck 56aad5d143 hwmon: (max34440) Add support for 'lowest' output voltage attribute
MAX34440 and compatibles support reporting the lowest measured output voltage.
Add support for it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18 18:27:49 -07:00
Guenter Roeck f15df57ded hwmon: (jc42) Convert to use devm_kzalloc
Marginally less code and eliminate the possibility of memory leaks.
Also replace new_client variable with client and introduce dev variable to make
the code a bit easier to read.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:48 -07:00
Guenter Roeck 918ddef35f hwmon: (max16065) Convert to use devm_kzalloc
Marginally less code and eliminate the possibility of memory leaks.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:48 -07:00
Guenter Roeck b8a5a7cebd hwmon: (smm665) Convert to use devm_kzalloc
Marginally less code and eliminate the possibility of memory leaks.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:47 -07:00
Guenter Roeck 3683928720 hwmon: (ltc4261) Convert to use devm_kzalloc
Marginally less code and eliminate the possibility of memory leaks.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:46 -07:00
Guenter Roeck dd285ad737 hwmon: (pmbus) Simplify remove functions
Since devm_kzalloc() is now used to allocate driver memory, the client
driver remove function has no purpose other than to call pmbus_do_remove().
This means we can get rid of it by redefining pmbus_do_remove() to use the
same prototype, and pointing to it directly.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:46 -07:00
Guenter Roeck 8b313ca7f1 hwmon: (pmbus) Convert pmbus drivers to use devm_kzalloc
Marginally less code and eliminate the possibility of memory leaks.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:45 -07:00
Guenter Roeck 07404aab52 hwmon: (lineage-pem) Convert to use devm_kzalloc
Marginally less code and eliminate the possibility of memory leaks.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:44 -07:00
Guenter Roeck f352df652f hwmon: (hwmon-vid) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: space required before the open parenthesis '('
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable

Not fixed (url):
WARNING: line over 80 characters

Not fixed (false positive):
ERROR: Macros with complex values should be enclosed in parenthesis

Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18 18:27:44 -07:00
Guenter Roeck 3230f7049e hwmon: (hwmon-vid) Add new entries to VRM model table
The VRM model table was missing several Intel CPUs, resulting in wrong VRM table
entries to be used for many recent CPUs. Update it. Also, use values from
struct cpuinfo_x86 to retrieve CPU model information instead of re-calculating
it locally.

Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18 18:27:43 -07:00
Jean Delvare 9908ad4cd4 hwmon: (lm80) Add detection of NatSemi/TI LM96080
Add detection of the National Semiconductor (now Texas Instruments)
LM96080. It is functionally compatible with the LM80 but detection is
completely different.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:27:43 -07:00
Jean Delvare 0e190b7fa3 hwmon: (lm87) Get rid of macro-generated functions
Use SENSORS_DEVICE_ATTR instead of DEVICE_ATTR for most attributes,
so that the attribute number can be retrieved and it is no longer
necessary to generate functions using macros.

This shaves about 2 kB on the binary module size.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:27:42 -07:00
Jean Delvare 8652a2642c hwmon: (lm87) Reorganize the code
Reorder functions and driver declaration to no longer need to
forward-declare functions. Also rename new_client to just client
everywhere for readability.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:27:41 -07:00
Henrik Rydberg 0fc86eca1b hwmon: (applesmc) Silence uninitialized warnings
Some error paths do not set a result, leading to the (false)
assumption that the value may be used uninitialized. Set results for
those paths as well.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:27:41 -07:00
Guenter Roeck 7599d32b13 hwmon: (lm70) Fix: do not use assignment in if condition
Fix checkpatch issue:
ERROR: do not use assignment in if condition

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:40 -07:00
Guenter Roeck e200c14f60 hwmon: (lm70) Register hwmon device after creating attribute files, and remove it first
Register hwmon device as last operation in the probe function to ensure that all
attribute files exist when accessed from user applications. Otherwise, there
is a short time frame where the device is registered as hwmon device but
sysfs attributes do not yet exist. This could result in applications erroneously
not detecting attributes.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:39 -07:00
Guenter Roeck 01d9def5ba hwmon: (w83l786ng) Fix multi-line comments
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:39 -07:00
Guenter Roeck 130067d7c6 hwmon: (w83l785ts) Fix multi-line comments
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:38 -07:00
Guenter Roeck 795013333b hwmon: (w83781d) Fix: do not use assignment in if condition
Fix checkpatch issue:
ERROR: do not use assignment in if condition

Replace repeated calls to device_create_file() with calls to sysfs_create_group.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:37 -07:00
Guenter Roeck aff6e00ee1 hwmon: (w83781d) Fix multi-line comments
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:37 -07:00
Guenter Roeck 2a52dd667d hwmon: (smsc47b397) Fix multi-line comments
Cc: Mark M Hoffman <mhoffman@lightlink.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:36 -07:00
Guenter Roeck 36564efadd hwmon: (pc87427) Fix multi-line comments
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18 18:27:35 -07:00
Guenter Roeck b6707b78ff hwmon: (max1668) Fix multi-line comments
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:35 -07:00
Guenter Roeck 1160631b10 hwmon: (lm80) Fix multi-line comments
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18 18:27:34 -07:00
Guenter Roeck bf0f3a0430 hwmon: (emc2103) Fix multi-line comments
Cc: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:33 -07:00
Guenter Roeck fbb6670d94 hwmon: (adm1031) Fix multi-line comments
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:33 -07:00
Guenter Roeck 94b991d4c7 hwmon: (adm1029) Fix multi-line comments
Cc: Corentin Labbe <corentin.labbe@geomatys.fr>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:32 -07:00
Guenter Roeck 27b9de3c4a hwmon: (w83627hf) Fix checkpatch issues
Fixed:
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead
ERROR: do not use assignment in if condition

Modify multi-line comments to follow Documentation/CodingStyle.

Other checkpatch issues not fixed to reduce number of conflicts with pending
rewrite as mfd driver.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:32 -07:00
Guenter Roeck ca3ccad827 hwmon: (w83l786ng) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: space required after that ',' (ctx:VxV)
WARNING: braces {} are not necessary for single statement blocks
WARNING: please, no space before tabs
WARNING: please, no spaces at the start of a line
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead
WARNING: space prohibited between function name and open parenthesis '('

Not fixed (false positive):
ERROR: Macros with complex values should be enclosed in parenthesis

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:31 -07:00
Guenter Roeck 47efe8772f hwmon: (w83793) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: space required after that ',' (ctx:VxV)
WARNING: braces {} are not necessary for any arm of this statement
WARNING: braces {} are not necessary for single statement blocks
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Also replaced "<constant> == <variable>" with "<variable> == <constant>".
Translation was done with the following coccinelle script to limit risk.

@@
identifier i;
constant C;
@@

<...
- C == i
+ i == C
...>

Not fixed (false positive):
ERROR: Macros with complex values should be enclosed in parenthesis

Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:30 -07:00
Guenter Roeck d17436813a hwmon: (w83792d) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: space prohibited after that open parenthesis '('
ERROR: space required after that ',' (ctx:VxV)
ERROR: space required after that ',' (ctx:WxV)
ERROR: spaces required around that ':' (ctx:VxE)
ERROR: spaces required around that '<=' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '||' (ctx:VxV)
ERROR: spaces required around that ':' (ctx:VxV)
ERROR: spaces required around that '?' (ctx:VxV)
WARNING: braces {} are not necessary for any arm of this statement
WARNING: braces {} are not necessary for single statement blocks
WARNING: line over 80 characters
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead
WARNING: space prohibited between function name and open parenthesis '('

Modify multi-line comments to follow Documentation/CodingStyle.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:30 -07:00
Guenter Roeck 2185696d7d hwmon: (vt1211) Fix: do not use assignment in if condition
Fix checkpatch issue:
ERROR: do not use assignment in if condition

Replace repeated calls to device_create_file() with calls to sysfs_create_group.

Cc: Juerg Haefliger <juergh@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:29 -07:00
Guenter Roeck b162c03348 hwmon: (vt1211) Fix checkpatch issues
Fixed:
ERROR: do not use assignment in if condition
ERROR: switch and case should be at the same indent
ERROR: trailing statements should be on next line
WARNING: braces {} are not necessary for single statement blocks
WARNING: simple_strtol is obsolete, use kstrtol instead

Modify multi-line comments to follow Documentation/CodingStyle.

Not fixed (false positive):
ERROR: Macros with complex values should be enclosed in parenthesis

Not all fixed (code complexity):
ERROR: do not use assignment in if condition

Cc: Juerg Haefliger <juergh@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:28 -07:00
Guenter Roeck 9004ac8134 hwmon: (via686a) Fix checkpatch issues
Fixed:
ERROR: do not use assignment in if condition
ERROR: open brace '{' following function declarations go on the next line
ERROR: space prohibited before that close parenthesis ')'
ERROR: space required after that ',' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: spaces required around that ':' (ctx:VxV)
ERROR: spaces required around that '?' (ctx:VxV)
ERROR: that open brace { should be on the previous line
WARNING: line over 80 characters
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Not fixed (false positive):
ERROR: Macros with multiple statements should be enclosed in a do - while loop

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:28 -07:00
Guenter Roeck bce2778df9 hwmon: (pc87360) Fix: do not use assignment in if condition
Fix checkpatch issue:
ERROR: do not use assignment in if condition

Replace repeated calls to device_create_file() with calls to sysfs_create_group.

Cc: Jean Delvare <khali@linux-fr.org>
Cc: Jim Cromie <jim.cromie@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:27 -07:00
Guenter Roeck 449a7a0720 hwmon: (pc87360) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: "foo * bar" should be "foo *bar"
ERROR: space required after that ',' (ctx:VxV)
ERROR: spaces required around that ':' (ctx:VxE)
ERROR: spaces required around that '==' (ctx:VxV)
WARNING: braces {} are not necessary for single statement blocks
WARNING: line over 80 characters
WARNING: please, no space before tabs
WARNING: please, no spaces at the start of a line
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Not or not all fixed (code complexity):
ERROR: Macros with complex values should be enclosed in parenthesis
ERROR: do not use assignment in if condition

Cc: Jim Cromie <jim.cromie@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:26 -07:00
Guenter Roeck 8958dfb74a hwmon: (max1619): Fix checkpatch issues
Fixed:
ERROR: do not use assignment in if condition
ERROR: trailing whitespace
WARNING: line over 80 characters
WARNING: please, no spaces at the start of a line
WARNING: simple_strtol is obsolete, use kstrtol instead

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:26 -07:00
Guenter Roeck 09770b2619 hwmon: (lm85) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Also: s/#define^I/#define /

Not fixed (false positive):
ERROR: Macros with multiple statements should be enclosed in a do - while loop

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:25 -07:00
Guenter Roeck 9b03079fca hwmon: (lm78) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: space prohibited before that close parenthesis ')'
ERROR: space required after that ',' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: trailing statements should be on next line
ERROR: trailing whitespace
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Not fixed (false positive):
ERROR: Macros with multiple statements should be enclosed in a do - while loop

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18 18:27:24 -07:00
Guenter Roeck 02fe2fd949 hwmon: (lm77) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: trailing whitespace
WARNING: line over 80 characters
WARNING: please, no space before tabs
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:24 -07:00
Guenter Roeck f445a9af93 hwmon: (gl520sm) Fix: do not use assignment in if condition
Fix checkpatch issue:
ERROR: do not use assignment in if condition

Replace repeated calls to device_create_file() with calls to sysfs_create_group.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:23 -07:00
Guenter Roeck 43da3d123a hwmon: (gl520sm) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: space required after that ',' (ctx:VxV)
ERROR: spaces required around that '<=' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: spaces required around that ':' (ctx:VxV)
ERROR: spaces required around that '?' (ctx:VxV)
ERROR: trailing statements should be on next line
WARNING: line over 80 characters
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Not always fixed (complexity):
ERROR: do not use assignment in if condition

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:23 -07:00
Guenter Roeck 228f8e0c60 hwmon: (gl518sm) Fix checkpatch issues
Fixed:
ERROR: do not use assignment in if condition
ERROR: space required after that ',' (ctx:VxV)
ERROR: spaces required around that '?' (ctx:VxE)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: spaces required around that ':' (ctx:VxV)
ERROR: spaces required around that '?' (ctx:VxV)
ERROR: trailing statements should be on next line
WARNING: line over 80 characters
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:22 -07:00
Guenter Roeck c8de83624c hwmon: (dme1737) Fix checkpatch issues
Fixed:
WARNING: braces {} are not necessary for any arm of this statement
WARNING: braces {} are not necessary for single statement blocks
WARNING: simple_strtol is obsolete, use kstrtol instead

Modify multi-line comments to follow Documentation/CodingStyle.

Also: s/#define^I/#define /

Not fixed (false positive):
ERROR: Macros with multiple statements should be enclosed in a do - while loop

Cc: Juerg Haefliger <juergh@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:21 -07:00
Guenter Roeck 8c103696fa hwmon: (asb100): Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: space prohibited after that open parenthesis '('
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
WARNING: please, no spaces at the start of a line
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Not fixed (false positive):
ERROR: Macros with multiple statements should be enclosed in a do - while loop

Cc: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:21 -07:00
Guenter Roeck c387e4eb24 hwmon: (adm9240) Fix checkpatch issues
Fixed:
ERROR: do not use assignment in if condition
ERROR: that open brace { should be on the previous line
WARNING: please, no space before tabs
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Not fixed (false positive):
ERROR: Macros with multiple statements should be enclosed in a do - while loop

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:20 -07:00
Guenter Roeck 86aa3e2210 hwmon: (adm1026) Fix checkpatch issues
Fixed:
ERROR: do not use assignment in if condition
ERROR: space prohibited after that '~' (ctx:WxW)
ERROR: space required after that ';' (ctx:VxO)
ERROR: space required after that ';' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that ':' (ctx:VxV)
WARNING: braces {} are not necessary for any arm of this statement
WARNING: braces {} are not necessary for single statement blocks
WARNING: line over 80 characters
WARNING: simple_strtol is obsolete, use kstrtol instead

Modify multi-line comments to follow Documentation/CodingStyle.

Not fixed:
ERROR: Macros with multiple statements should be enclosed in a do - while loop

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:19 -07:00
Guenter Roeck 21d2a8f17b hwmon: (adm1021) Fix checkpatch issues
Fixed:
ERROR: do not use assignment in if condition
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: space prohibited between function name and open parenthesis '('

Modify multi-line comments to follow Documentation/CodingStyle.

Cc: Michael Abbott <michael.abbott@diamond.ac.uk>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:19 -07:00
Guenter Roeck 1bd385d679 hwmon: (abituguru) Fix checkpatch issues
Fixed:
ERROR: do not use assignment in if condition
ERROR: else should follow close brace '}'
ERROR: switch and case should be at the same indent
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Not fixed:
WARNING: msleep < 20ms can sleep for up to 20ms

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:18 -07:00
Guenter Roeck 8969e84d95 hwmon: (w83627ehf) Fix multi-line comments
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:17 -07:00
Guenter Roeck 51683ee83e hwmon: (max1111) Fix multi-line comments
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:17 -07:00
Guenter Roeck 1b05d22f2c hwmon: (ltc4151) Fix multi-line comments
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: Per Dalen <per.dalen@appeartv.com>
2012-03-18 18:27:16 -07:00
Guenter Roeck 1b9c491df8 hwmon: (g760a) Fix multi-line comments
Cc: Herbert Valerio Riedel <hvr@gnu.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:16 -07:00
Guenter Roeck 20eaf7247e hwmon: (f71882fg) Fix multi-line comments
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:15 -07:00
Guenter Roeck 4bebced84f hwmon: (emc1403) Fix multi-line comments
Cc: Kalhan Trisal <kalhan.trisal@intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:14 -07:00
Guenter Roeck ca3c7b6342 hwmon: (amc6821) Fix multi-line comments
Cc: T. Mertelj <tomaz.mertelj@guest.arnes.si>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:14 -07:00
Guenter Roeck 10775d1899 hwmon: (ads7871) Fix multi-line comments
Cc: Paul Thomas <pthomas8589@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:13 -07:00
Guenter Roeck d13d6232de hwmon: (ads7828) Fix multi-line comments
Cc: Steve Hardy <shardy@redhat.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:12 -07:00
Guenter Roeck 562fca2f7a hwmon: (abituguru3) Fix multi-line comments
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Alistair John Strachan <alistair@devzero.co.uk>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:12 -07:00
Guenter Roeck ec1c319417 hwmon: (w83791d) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: space prohibited after that open parenthesis '('
ERROR: space required after that ',' (ctx:VxV)
WARNING: braces {} are not necessary for single statement blocks
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Not fixed (false positive):
ERROR: Macros with complex values should be enclosed in parenthesis

Cc: Charles Spirakis <bezaur@gmail.com>
Cc: Marc Hulsman <m.hulsman@tudelft.nl>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:11 -07:00
Guenter Roeck a80b10ccac hwmon: (ultra45_env) Fix checkpatch issues
Fixed:
WARNING: line over 80 characters
WARNING: simple_strtol is obsolete, use kstrtol instead

Modify multi-line comments to follow Documentation/CodingStyle.

Not fixed (false positive):
ERROR: Macros with multiple statements should be enclosed in a do - while loop

Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:10 -07:00
Guenter Roeck 4d387df74e hwmon: (thmc50) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Not fixed (false positive):
ERROR: Macros with multiple statements should be enclosed in a do - while loop

Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:10 -07:00
Guenter Roeck 85a0c0d1a1 hwmon: (smsc47m1) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: space required after that ',' (ctx:VxV)
ERROR: spaces required around that '<=' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: spaces required around that '>=' (ctx:VxV)
ERROR: trailing statements should be on next line
ERROR: trailing whitespace
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: static const char * array should probably be static const char * const

Modify multi-line comments to follow Documentation/CodingStyle.

Also: s/#define^I/#define /

Not fixed (false positive):
ERROR: Macros with multiple statements should be enclosed in a do - while loop

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:09 -07:00
Guenter Roeck 7e612685a3 hwmon: (smsc47m1) Fix: do not use assignment in if condition
Fix checkpatch issue:
ERROR: do not use assignment in if condition

Replace repeated calls to device_create_file() with calls to sysfs_create_group.

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:08 -07:00
Guenter Roeck 7cc3cb6662 hwmon: (smsc47m192) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '>' (ctx:VxV)
NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or
WARNING: please, no space before tabs
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Not fixed (false positive):
ERROR: Macros with multiple statements should be enclosed in a do - while loop

Cc: Hartmut Rick <linux@rick.claranet.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:08 -07:00
Guenter Roeck 8fda79ec86 hwmon: (sis5595) Fix checkpatch issues
Fixed:
ERROR: do not use assignment in if condition
ERROR: space prohibited after that open parenthesis '('
ERROR: space prohibited before that close parenthesis ')'
ERROR: space required after that ',' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: trailing statements should be on next line
ERROR: trailing whitespace
ERROR: Macros with multiple statements should be enclosed in a do - while loop
WARNING: line over 80 characters
WARNING: please, no space before tabs
WARNING: please, no spaces at the start of a line
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:07 -07:00
Guenter Roeck 57256088e1 hwmon: (pcf8591) Fix checkpatch issues
Fixed:
ERROR: do not use assignment in if condition
ERROR: spaces required around that ':' (ctx:VxV)
ERROR: spaces required around that '?' (ctx:VxV)
WARNING: line over 80 characters
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:07 -07:00
Guenter Roeck 2804a4cfcd hwmon: (lm93) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: else should follow close brace '}'
ERROR: space prohibited after that open parenthesis '('
ERROR: space required after that ',' (ctx:VxV)
ERROR: spaces required around that '<=' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that ':' (ctx:VxW)
ERROR: trailing statements should be on next line
WARNING: braces {} are not necessary for any arm of this statement
WARNING: do not add new typedefs
WARNING: please, no space before tabs
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Not fixed (unknown impact):
WARNING: msleep < 20ms can sleep for up to 20ms

Cc: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:06 -07:00
Guenter Roeck a318afd890 hwmon: (lm92) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '*=' (ctx:VxV)
ERROR: trailing whitespace
WARNING: line over 80 characters
WARNING: please, no space before tabs
WARNING: please, no spaces at the start of a line
WARNING: simple_strtol is obsolete, use kstrtol instead

Modify multi-line comments to follow Documentation/CodingStyle.

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:05 -07:00
Guenter Roeck 073f1e6c89 hwmon: (lm87) Fix: do not use assignment in if condition
Fix checkpatch issue:
ERROR: do not use assignment in if condition

Replace repeated calls to device_create_file() with calls to sysfs_create_group.

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18 18:27:05 -07:00
Guenter Roeck c6370dbe45 hwmon: (lm87) Fix checkpatch issues
Fixed:
ERROR: do not use assignment in if condition
ERROR: space required after that close brace '}'
ERROR: space required after that ',' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: trailing statements should be on next line
WARNING: line over 80 characters
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Not fixed everywhere (code complexity):
ERROR: do not use assignment in if condition

As a side effect of the changes made, attribute set functions now return an
error if an attempt is made to write non-numeric values. Previously, such
writes were interpreted as writing 0.

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18 18:27:04 -07:00
Guenter Roeck 525ad37319 hwmon: (fschmd) Fix checkpatch issues
Fixed:
ERROR: that open brace { should be on the previous line
ERROR: trailing statements should be on next line
WARNING: line over 80 characters
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:03 -07:00
Guenter Roeck f24d548bf2 hwmon: (atxp1) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: else should follow close brace '}'
ERROR: "foo * bar" should be "foo *bar"
WARNING: braces {} are not necessary for single statement blocks
WARNING: line over 80 characters
WARNING: please, no space before tabs
WARNING: please, no spaces at the start of a line
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Modify multi-line comments to follow Documentation/CodingStyle.

Cc: Sebastian Witt <se.witt@gmx.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:03 -07:00
Guenter Roeck 724cc3316e hwmon: (adt7462) Fix checkpatch issues
Fixed:
ERROR: that open brace { should be on the previous line
WARNING: please, no space before tabs

Cc: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:27:02 -07:00
Guenter Roeck 790fa38c12 hwmon: (ltc4215) Fix multi-line comments
Cc: Ira W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Ira W. Snyder <iws@ovro.caltech.edu>
2012-03-18 18:27:02 -07:00
Guenter Roeck 430b4fcd82 hwmon: (ltc4245) Fix multi-line comments
Cc: Ira W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Ira W. Snyder <iws@ovro.caltech.edu>
2012-03-18 18:27:01 -07:00
Guenter Roeck a68abd32b9 hwmon: (wm8350-hwmon) Constify fixed string array
Constify fixed string array and make checkpatch happy.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-18 18:27:00 -07:00
Guenter Roeck 85ebfd3ef9 hwmon: (applesmc) Fix multi-line comments
Cc: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
2012-03-18 18:27:00 -07:00
Guenter Roeck 75bdc936ea hwmon: (asus_atk0110) Fix multi-line comments
Cc: Luca Tettamanti <kronos.it@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Luca Tettamanti <kronos.it@gmail.com>
2012-03-18 18:26:59 -07:00
Guenter Roeck 3c4c497191 hwmon: (it87) Constify fixed string arrays
Make checkpatch happy by constifying fixed string arrays.

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18 18:26:58 -07:00
Guenter Roeck 8deeac82b3 hwmon: (ad7414) Fix multi-line comments
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Stefan Roese <sr@denx.de>
2012-03-18 18:26:58 -07:00
Guenter Roeck 5d577dba04 hwmon: (jc42) Fix multi-line comments
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:57 -07:00
Guenter Roeck 780affe0e9 hwmon: (coretemp) Fix checkpatch error
Fix:
ERROR: Macros with complex values should be enclosed in parenthesis

Cc: Fenghua Yu <fenghua.yu@intel.com>
Acked-By: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:56 -07:00
Guenter Roeck 3af2861e8b hwmon: (pc87360) Fix multi-line comments
Cc: Jim Cromie <jim.cromie@gmail.com>
Acked-by: Jim Cromie <jim.cromie@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:56 -07:00
Guenter Roeck 07de3dfb15 hwmon: (wm831x-hwmon) Fix multi-line comments
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:55 -07:00
Guenter Roeck 3c22e23260 hwmon: (smm665) Fix checkpatch error
Fix:
ERROR: Macros with complex values should be enclosed in parenthesis

Also updated multi-line comments to follow Documentation/CodingStyle.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:54 -07:00
Guenter Roeck 3c56b066fb hwmon: (asc7621) Fix multi-line comments
Cc: George Joseph <george.joseph@fairview5.com>
Acked-by: George Joseph <george.joseph@fairview5.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:54 -07:00
Guenter Roeck 4a0d71cfdc hwmon: (it87) Fix multi-line comments
Fix multi-line comments, and clean up some of the affected comments.

Cc: Jean Delvare <khali@linux-fr.org>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:53 -07:00
Guenter Roeck 86d566e58e hwmon: (hwmon-vid) Fix multi-line comments
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:53 -07:00
Guenter Roeck 5ed04880a3 hwmon: (hwmon) Fix multi-line comments
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:52 -07:00
Guenter Roeck 19f2c05964 hwmon: (ds1621) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: trailing whitespace
WARNING: labels should not be indented
WARNING: please, no spaces at the start of a line
WARNING: simple_strtol is obsolete, use kstrtol instead

Also modified multi-line comments to follow Documentation/CodingStyle.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18 18:26:51 -07:00
Axel Lin 91efffe26a hwmon: convert drivers/hwmon/* to use module_spi_driver()
This patch converts the drivers in drivers/hwmon/* to use the
module_spi_driver() macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Sonic Zhang <sonic.zhang@analog.com>
Cc: Marc Pignat <marc.pignat@hevs.ch>
Cc: Paul Thomas <pthomas8589@gmail.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Acked-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:51 -07:00
Axel Lin f0967eea80 hwmon: convert drivers/hwmon/* to use module_i2c_driver()
This patch converts the drivers in drivers/hwmon/* to use the
module_i2c_driver() macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Corentin Labbe <corentin.labbe@geomatys.fr>
Cc: Dirk Eibach <eibach@gdsys.de>
Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>
Cc: Steve Glendinning <steve.glendinning@smsc.com>
Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: Guillaume Ligneul <guillaume.ligneul@gmail.com>
Cc: David George <david.george@ska.ac.za>
Cc: "Hans J. Koch" <hjk@hansjkoch.de>
Cc: Marc Hulsman <m.hulsman@tudelft.nl>
Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:50 -07:00
Guenter Roeck 61ba031841 hwmon: (vt8231) Fix multi-line comments
Cc: Roger Lucas <vt8231@hiddenengine.co.uk>
Acked-by: Roger Lucas <vt8231@hiddenengine.co.uk>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:49 -07:00
Guenter Roeck 9ed5bc24fa hwmon: (adt7475) Fix multi-line comments
Cc: Jean Delvare <khali@linux-fr.org>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:49 -07:00
Guenter Roeck 2fff0840c2 hwmon: (f71805f) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: "foo* bar" should be "foo *bar"
ERROR: need consistent spacing around '|' (ctx:VxW)
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead
WARNING: static const char * array should probably be static const char * const

Also modified multi-line comments to follow Documents/Codingstyle.

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18 18:26:48 -07:00
Guenter Roeck 703af96040 hwmon: (max6650) Fix multi-line comments
Cc: Hans J. Koch <hjk@hansjkoch.de>
Acked-by: Hans J. Koch <hjk@hansjkoch.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:47 -07:00
Guenter Roeck c531eb3f22 hwmon: (w83781d) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: "foo* bar" should be "foo *bar"
ERROR: space prohibited after that open parenthesis '('
ERROR: space required after that ',' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
WARNING: line over 80 characters
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead
WARNING: space prohibited between function name and open parenthesis '('

Not fixed (false positive):
ERROR: Macros with multiple statements should be enclosed in a do - while loop
ERROR: Macros with complex values should be enclosed in parenthesis

Not all fixed (code complexity):
ERROR: do not use assignment in if condition

Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:47 -07:00
Guenter Roeck 2b22de5117 hwmon: (adm1025) Fix checkpatch issues
Fixed:
ERROR: do not use assignment in if condition
ERROR: space required after that ',' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: trailing whitespace
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Not fixed:
ERROR: Macros with multiple statements should be enclosed in a do - while loop

Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:46 -07:00
Guenter Roeck 79738416f6 hwmon: (abituguru3) Fix checkpatch issues
Fixed:
ERROR: do not use assignment in if condition
ERROR: "foo* bar" should be "foo *bar"
WARNING: line over 80 characters

Not fixed:
WARNING: msleep < 20ms can sleep for up to 20ms

Cc: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:45 -07:00
Guenter Roeck 65fe5c7957 hwmon: (vt8231) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: trailing statements should be on next line
WARNING: braces {} are not necessary for any arm of this statement
WARNING: line over 80 characters
WARNING: please, no space before tabs
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Not fixed (false positive):
ERROR: Macros with multiple statements should be enclosed in a do - while loop

Cc: Roger Lucas <vt8231@hiddenengine.co.uk>
Acked-by: Roger Lucas <vt8231@hiddenengine.co.uk>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:45 -07:00
Guenter Roeck bafda5d0f5 hwmon: (max6650) Fix checkpatch issues
Fixed:
ERROR: do not use assignment in if condition
ERROR: open brace '{' following struct go on the same line
ERROR: spaces required around that '||' (ctx:VxV)
ERROR: switch and case should be at the same indent
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Cc: Hans J. Koch <hjk@hansjkoch.de>
Acked-by: Hans J. Koch <hjk@hansjkoch.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:44 -07:00
Guenter Roeck 0117c3f245 hwmon: (pmbus) Replace strict_strtol with kstrtol
strict_strtol is deprecated and results in a checkpatch warning.
Replace it with kstrtol.

Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:43 -07:00
Frans Meulenbroeks b3789a0de2 hwmon: (lm83) fix checkpatch issues
resolved:
ERROR: trailing whitespace
WARNING: please, no spaces at the start of a line
WARNING: simple_strtol is obsolete, use kstrtol instead
ERROR: do not use assignment in if condition

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:43 -07:00
Frans Meulenbroeks 93092a644f hwmon: (k8temp) fix checkpatch issues
resolved:
WARNING: line over 80 characters
ERROR: do not use assignment in if condition

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:42 -07:00
Frans Meulenbroeks 96585f1ae4 hwmon: (lm80) reset device if error occurred
If an error occurs while updating (e.g. because the chip was
disconnected) the device needs to be reinitialized in order
to get back to 11 bit temperature and set the fan divider.

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:42 -07:00
Frans Meulenbroeks 6a9e7c4c03 hwmon: (lm80) fix checkpatch warnings
fix:
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
[guenter.roeck@ericsson.com: kstrtol->kstrtoul where appropriate]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:41 -07:00
Frans Meulenbroeks 6b904b623a hwmon: (adt7470) fix checkpatch issues
fixed:
ERROR: that open brace { should be on the previous line
#1135: FILE: adt7470.c:1135:
+static struct attribute *adt7470_attr[] =
+{

ERROR: do not use assignment in if condition
#1279: FILE: adt7470.c:1279:
+	if ((err = sysfs_create_group(&client->dev.kobj, &data->attrs)))

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:40 -07:00
Frans Meulenbroeks e6a83dbec9 hwmon: (adt7411) fix checkpatch issues
fixed:
WARNING: please, no space before tabs
#11: FILE: adt7411.c:11:
+ * ^I  use power-down mode for suspend?, interrupt handling?$

not fixed as all other macros around it are the same structure and this one is only 2 chars longer:
WARNING: line over 80 characters
#229: FILE: adt7411.c:229:
+static ADT7411_BIT_ATTR(fast_sampling, ADT7411_REG_CFG3, ADT7411_CFG3_ADC_CLK_225);

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:40 -07:00
Frans Meulenbroeks 56c24af8de hwmon: (lm70) fix checkpatch issues
fixed:
ERROR: spaces required around that '=' (ctx:VxV)
#60: FILE: lm70.c:60:
+	s16 raw=0;
 	       ^

ERROR: do not use assignment in if condition
#168: FILE: lm70.c:168:
+	if ((status = device_create_file(&spi->dev, &dev_attr_temp1_input))

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:39 -07:00
Frans Meulenbroeks 1dc370899f hwmon: (f71882fg) fix checkpatch issues
fixed:
WARNING: static const char * array should probably be static const char * const
+static const char *f71882fg_names[] = {

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:38 -07:00
Frans Meulenbroeks c6e8ac0405 hwmon: (asus_atk0110) fix checkpatch issues
fixed:
WARNING: line over 80 characters
#1321: FILE: asus_atk0110.c:1321:
+	if (data->rtmp_handle && data->rvlt_handle && data->rfan_handle && !new_if)

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:38 -07:00
Frans Meulenbroeks 99b8c83a77 hwmon: (adt7475) fix checkpatch issues
fixed:
WARNING: static const char * array should probably be static const char * const
+	static const char *names[] = {

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:37 -07:00
Frans Meulenbroeks b2ae8f87f4 hwmon: (smm665) fix checkpatch issues
fixed:
WARNING: please, no spaces at the start of a line
#379: FILE: smm665.c:379:
+  static ssize_t smm665_show_##what(struct device *dev, \$

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:36 -07:00
Frans Meulenbroeks c9e1498a18 hwmon: (sht15) fix checkpatch issues
fixed:
WARNING: line over 80 characters
#809: FILE: sht15.c:809:
+		/* If still not occurred or another handler has been scheduled */

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:36 -07:00
Frans Meulenbroeks 0910b28ef4 hwmon: (ibmaem) fix checkpatch issues
fixed:
WARNING: please, no space before tabs
+{"power3_average", ^I  aem2_show_pcap_value,^IPOWER_AUX},$

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:35 -07:00
Frans Meulenbroeks dcb7cb97ba hwmon: (ad7414) fix checkpatch issues
fixed:
WARNING: simple_strtol is obsolete, use kstrtol instead
#133: FILE: ad7414.c:133:
+	long temp = simple_strtol(buf, NULL, 10);

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:35 -07:00
Frans Meulenbroeks e91aef22cd hwmon: (ad7418) fix checkpatch issues
fixed:
WARNING: simple_strtol is obsolete, use kstrtol instead
+	long temp = simple_strtol(buf, NULL, 10);

ERROR: do not use assignment in if condition
+	if (!(data = kzalloc(sizeof(struct ad7418_data), GFP_KERNEL))) {

ERROR: do not use assignment in if condition
+	if ((err = sysfs_create_group(&client->dev.kobj, &data->attrs)))

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:34 -07:00
Frans Meulenbroeks 599654255d hwmon: (w83l785ts) fix checkpatch issues
fixed:
ERROR: trailing whitespace
+ $

WARNING: please, no spaces at the start of a line
+ $

not fixed (did not want to break url):
WARNING: line over 80 characters
+ *   http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/W83L785TS-S.pdf

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:33 -07:00
Frans Meulenbroeks a6100f6b49 hwmon: (wm831x-hwmon) fix checkpatch issues
fixed:
WARNING: static const char * array should probably be static const char * const
+static const char *input_names[] = {

not fixed (will probably provide separate fix later)
ERROR: Macros with multiple statements should be enclosed in a do - while loop
+#define WM831X_NAMED_VOLTAGE(id, name) \
+	WM831X_VOLTAGE(id, name); \
+	static SENSOR_DEVICE_ATTR(in##id##_label, S_IRUGO, show_label,	\
+				  NULL, name)

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:33 -07:00
Frans Meulenbroeks 839a9eefc9 hwmon: fix checkpatch issues
fixed:
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
+EXPORT_SYMBOL_GPL(hwmon_device_register);

WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
+EXPORT_SYMBOL_GPL(hwmon_device_unregister);

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:32 -07:00
Frans Meulenbroeks 08f5090774 hwmon: (adm1029) fix checkpatch issues
fixed:
ERROR: space prohibited after that open parenthesis '('
+#define DIV_FROM_REG(val)	( 1 << (((val) >> 6) - 1))

WARNING: simple_strtol is obsolete, use kstrtol instead
+	long val = simple_strtol(buf, NULL, 10);

ERROR: do not use assignment in if condition
+	if ((err = sysfs_create_group(&client->dev.kobj, &adm1029_group)))

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:31 -07:00
Frans Meulenbroeks 4d7c5d4f40 hwmon: (g760a) fix checkpatch issues
fixed:
ERROR: code indent should use tabs where possible
+            fan speed PWM controller chip$

ERROR: trailing whitespace
+      http://www.gmt.com.tw/product/datasheet/EDS-760A.pdf $

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:31 -07:00
Frans Meulenbroeks 7b102ed660 hwmon: (i5k_amb) fix checkpatch issues
fixed:
WARNING: simple_strtoul is obsolete, use kstrtoul instead
+	unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;

WARNING: simple_strtoul is obsolete, use kstrtoul instead
+	unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;

WARNING: simple_strtoul is obsolete, use kstrtoul instead
+	unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:30 -07:00
Frans Meulenbroeks 600151b9de hwmon: use DEFINE_PCI_DEVICE_TABLE
fix all checkpatch warnings about DEFINE_PCI_DEVICE_TABLE

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:29 -07:00
Frans Meulenbroeks 7fe83ad877 hwmon: remove () used with return
fix checkpatch ERROR:
return is not a function, parentheses are not required

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:29 -07:00
Frans Meulenbroeks a6bee4a557 hwmon: (amc6821) fix initialisation
fix checkpatch error:
ERROR: do not initialise statics to 0 or NULL

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:28 -07:00
Frans Meulenbroeks 2faaa9316c hwmon: (lm80) add error handling
The LM80 driver currently does not return errors after I2C access failures.
Add it.

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:27 -07:00
Guenter Roeck fecfb64422 hwmon: (zl6100) Enable interval between chip accesses for all chips
Intersil reports that all chips supported by the zl6100 driver require
an interval between chip accesses, even ZL2004 and ZL6105 which were thought
to be safe.

Reported-by: Vivek Gani <vgani@intersil.com>
Cc: stable@vger.kernel.org # 3.2+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-14 09:17:03 -07:00
Jean Delvare aacb6b0052 hwmon: (w83627ehf) Fix temp2 source for W83627UHG
Properly set the source of temp2 for the W83627UHG. Also fix a
comment right before that, and document the W83627UHG as reporting up
to 3 temperatures.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-13 03:30:56 -07:00
Guenter Roeck 32260d9440 hwmon: (w83627ehf) Fix memory leak in probe function
The driver probe function leaked memory if creating the cpu0_vid attribute file
failed. Fix by converting the driver to use devm_kzalloc.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org # 2.6.32+
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-12 12:41:44 -07:00
Guenter Roeck 33fa9b6204 hwmon: (w83627ehf) Fix writing into fan_stop_time for NCT6775F/NCT6776F
NCT6775F and NCT6776F have their own set of registers for FAN_STOP_TIME. The
correct registers were used to read FAN_STOP_TIME, but writes used the wrong
registers. Fix it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org # 3.0+
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-12 10:40:30 -07:00
Greg Kroah-Hartman 263a5c8e16 Merge 3.3-rc6 into driver-core-next
This was done to resolve a conflict in the drivers/base/cpu.c file.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-09 12:35:53 -08:00
Guenter Roeck 1bd612a258 hwmon: (jc42) Add support for AT30TS00, TS3000GB2, TSE2002GB2, and MCP9804
Also update IDT datasheet locations.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org # 3.0+
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-07 09:48:44 -08:00
Guenter Roeck 7ad6307ad6 hwmon: (zl6100) Maintain delay parameter in driver instance data
A global delay parameter has the side effect of being overwritten with 0 if a
single ZL2004 or ZL6105 is instantiated. If other chips supported by the same
driver are in the system, this will result in access errors for those chips.

To solve the problem, keep a per-instance copy of the delay parameter, and do
not change the original parameter.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org # 3.1+
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-07 09:48:43 -08:00
Guenter Roeck 7cb3c44fb1 hwmon: (pmbus_core) Fix maximum number of POUT alarm attributes
There are up to three POUT alarm attributes, not two, since cap_alarm was added.

Reported-by: Michele Petracca <mi.petracca@gmail.com>
Cc: stable@vger.kernel.org # 3.0+ [3.0 will need backport]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-07 09:48:42 -08:00
Jean Delvare 4de86126a7 hwmon: (jc42) Add support for ST Microelectronics STTS2002 and STTS3000
These are fully compatible with Jedec JC 42.4 as far as I can see.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-07 09:48:21 -08:00
Michael Thalmeier 1039d762d0 mfd: Add pdata to set mc13783-ts conversion delay
MC13783 can be programmed to wait some clock cycles between the
touchscreen polarization and the resistance conversion. This is
needed to adjust for touchscreens with high capacitance between
plates.

Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-03-06 18:46:30 +01:00
Nikolaus Schulz 15d1ad0cc9 hwmon: (f75375s) Catch some attempts to write to r/o registers
It makes no sense to attempt to manually configure the fan in auto mode,
or set the duty cycle directly in closed loop mode.  The corresponding
registers are then read-only.  If the user tries it nonetheless, error out
with EINVAL instead of silently doing nothing.

Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
[guenter.roeck@ericsson.com: Minor formatting cleanup]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-02 12:02:23 -08:00
Nikolaus Schulz b17d6561ac hwmon: (f75375s) Properly map the F75387 automatic modes to pwm_enable
The F75387 supports automatic fan control using either PWM duty cycle or
RPM speed values.  Make the driver detect the latter mode, and expose the
different modes in sysfs as per pwm_enable, so that the user can switch
between them.

The interpretation of the pwm_enable attribute for the F75387 is adjusted
to be a superset of those values used for similar Fintek chips which do
not support automatic duty mode, with 2 mapping to automatic speed mode,
and moving automatic duty mode to the new value 4.

Toggling the duty mode via pwm_enable is currently denied for the F75387,
as the chip then simply reinterprets the fan configuration register values
according to the new mode, switching between RPM and PWM units, which
makes this a dangerous operation.

This patch introduces a new pwm mode into the driver. This is necessary
because the new mode (automatic pwm mode, 4) may already be enabled by the
BIOS, and the driver should not break existing functionality. This was seen
on at least one board.

Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-02 11:56:43 -08:00
Nikolaus Schulz edeea10285 hwmon: (f75375s) Make pwm*_mode writable for the F75387
Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-02-28 14:44:02 -08:00
Nikolaus Schulz 331255d35d hwmon: (f75375s) Fix writes to the pwm* attribute for the F75387
For the F75387, the register holding the current PWM duty cycle value is
r/o; changing it requires writing to the fan expect register instead.

Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
[guenter.roeck@ericsson.com: Simplified function parameters]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-02-28 14:39:47 -08:00
Guenter Roeck dc91ad8e84 hwmon: (max34440) Fix resetting temperature history
Temperature history is reset by writing 0x8000 into the peak temperature
register, not 0xffff.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-02-24 08:06:15 -08:00
Nikolaus Schulz c1c1a3d012 hwmon: (f75375s) Fix register write order when setting fans to full speed
By hwmon sysfs interface convention, setting pwm_enable to zero sets a fan
to full speed.  In the f75375s driver, this need be done by enabling
manual fan control, plus duty mode for the F875387 chip, and then setting
the maximum duty cycle.  Fix a bug where the two necessary register writes
were swapped, effectively discarding the setting to full-speed.

Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
Cc: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-02-23 06:47:47 -08:00
Guenter Roeck 363434b5dc hwmon: (ads1015) Fix file leak in probe function
An error while creating sysfs attribute files in the driver's probe function
results in an error abort, but already created files are not removed. This patch
fixes the problem.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@vger.kernel.org # 3.0+
Cc: Dirk Eibach <eibach@gdsys.de>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-02-23 06:47:41 -08:00
Chris D Schimp 2f2da1ac0b hwmon: (max6639) Fix PPR register initialization to set both channels
Initialize PPR register for both channels, and set correct PPR register bits.
Also remove unnecessary variable initializations.

Signed-off-by: Chris D Schimp <silverchris@gmail.com>
[guenter.roeck@ericsson.com: Merged two patches into one]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@vger.kernel.org # 3.0+
Acked-by: Roland Stigge <stigge@antcom.de>
2012-02-21 14:30:45 -08:00
Chris D Schimp b63d97a36e hwmon: (max6639) Fix FAN_FROM_REG calculation
RPM calculation from tachometer value does not depend on PPR.
Also, do not report negative RPM values.

Signed-off-by: Chris D Schimp <silverchris@gmail.com>
[guenter.roeck@ericsson.com: do not report negative RPM values]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@vger.kernel.org # 3.0+
Acked-by: Roland Stigge <stigge@antcom.de>
2012-02-21 14:30:12 -08:00
Justin P. Mattock a80581d0d1 Typos: change aditional to additional.
The below patch fixes some typos "aditional" to "additional", and also fixes
a comment with another word mispelled.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-21 11:40:36 +01:00
Nikolaus Schulz a1c1baf00e hwmon: (f75375s) Let f75375_update_device treat pwmX as a measured value
Treat pwmX as a measured value, not as a (mostly static) limit value, so
that it is updated more frequently from the device register.

Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-02-09 11:21:49 -08:00
Nikolaus Schulz eb2f255b2d hwmon: (f75375s) Fix bit shifting in f75375_write16
In order to extract the high byte of the 16-bit word, shift the word to
the right, not to the left.

Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
Cc: stable@kernel.org # 2.6.32+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-02-08 20:47:34 -08:00
Nikolaus Schulz a367a1e08b hwmon: (f75375s) Fix reading of wrong register when initializing the F75387
Unlike the other chips supported by this driver, the F75387 stores the
pwm_mode in register F75375_REG_FAN_TIMER, not F75375_REG_CONFIG1.

Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-02-08 20:47:33 -08:00
Nikolaus Schulz 09e87e5c4f hwmon: (f75375s) Fix automatic pwm mode setting for F75373 & F75375
In order to enable temperature mode aka automatic mode for the F75373 and
F75375 chips, the two FANx_MODE bits in the fan configuration register
need be set to 01, not 10.

Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
Cc: stable@kernel.org # 2.6.32+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-02-08 20:47:33 -08:00
Guenter Roeck eb564e1dbc hwmon: (w83627ehf) Remove duplicate code
Commit ec3e5a1644 slipped in some duplicate code.
Remove it.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-02-08 20:47:32 -08:00
Guenter Roeck 585c0fd821 hwmon: (w83627ehf) Fix number of fans for NCT6776F
NCT6776F can select fan input pins for fans 3 to 5 with a secondary set of
chip register bits. Check that second set of bits in addition to the first set
to detect if fans 3..5 are monitored.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org # 3.0+
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-02-04 18:08:23 -08:00
Greg Kroah-Hartman bd1d462e13 Merge 3.3-rc2 into the driver-core-next branch.
This was done to resolve a merge and build problem with the
drivers/acpi/processor_driver.c file.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-02 11:24:44 -08:00
Guenter Roeck ad77c3e180 hwmon: (w83627ehf) Disable setting DC mode for pwm2, pwm3 on NCT6776F
NCT6776F only supports pwm mode for pwm2 and pwm3. Return error if an attempt
is made to set those pwm channels to DC mode.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-29 13:06:07 -08:00
Vivien Didelot 6edf3c30af hwmon: (sht15) fix bad error code
When no platform data was supplied, returned error code was 0.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: stable@vger.kernel.org # 2.6.32+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-29 10:35:21 -08:00
Andi Kleen 9b38096fde HWMON: Convert coretemp to x86 cpuid autoprobing
Use the new x86 cpuid autoprobe interface for the Intel coretemp
driver.

Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-26 16:48:13 -08:00
Andi Kleen 267fc9788d HWMON: Convert via-cputemp to x86 cpuid autoprobing
Use the new x86 cpuid autoprobe interface.

Cc: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-26 16:48:12 -08:00
Jean Delvare 86b2bbfdbd hwmon: (f71805f) Fix clamping of temperature limits
Properly clamp temperature limits set by the user. Without this fix,
attempts to write temperature limits above the maximum supported by
the chip (255 degrees Celsius) would arbitrarily and unexpectedly
result in the limit being set to 0 degree Celsius.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-20 09:05:35 -08:00
Guenter Roeck 1c720093f6 hwmon: (adm1031) Fix coding style issues
Fix almost all coding style issues except for the multi-line macro errors,
which do not really apply since the macros are not multi-line statements
but declarations.

Based on merged patch series from Zac Storer; fixed remaining checkpatch
errors and warnings.

Cc: Zac Storer <zac.3.14159@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-01-16 22:51:48 +01:00
Jean Delvare 16b5dda22e hwmon: (it87) Add IT8728F support
Until we get a datasheet for the IT8728F, treat it as fully compatible
with the IT8721F, as it seems to work reasonably well.

This closes kernel bug #27262.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-16 22:51:48 +01:00
Jean Delvare d6db23c7ce hwmon: (coretemp) Add missing section annotations
Many functions in the coretemp driver lack a proper section
annotation. Add them to let the kernel free the memory after
initialization when possible.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Durgadoss R <durgadoss.r@intel.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
2012-01-16 22:51:47 +01:00
Guenter Roeck 6b101116ae hwmon: (lm90) Add range check to set_update_interval
When writing the update_interval attribute, the parameter value was
not range checked, which could cause an integer overflow and result
in an arbitrary update interval. Fix by limiting the value range to
<0, 100000>.

Reported-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-01-16 22:51:47 +01:00
Jean Delvare 2fe28ab51d hwmon: (lm63) Support extended lookup table of LM96163
The LM96163 has an extended lookup table with 12 entries instead of 8,
add support for that.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-16 22:51:47 +01:00
Jean Delvare d216f6809e hwmon: (lm63) Expose automatic fan speed control lookup table
The LM63 and compatible devices have a lookup table to control the fan
speed automatically. Expose it in sysfs. Values are cached for 5
seconds, independently of the other register values to avoid slowing
down "sensors". We might make the table values writable in the future.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-16 22:51:47 +01:00
Jean Delvare d93ab78070 hwmon: (lm63) Fix incorrect comment about I2C address
What was true of the LM63 doesn't apply to the LM64.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-16 22:51:47 +01:00
Jean Delvare 409c0b5bdf hwmon: (lm63) LM64 has a dedicated pin for tachometer
On the LM64, the tachometer function has a dedicated pin and fan speed
monitoring is always enabled.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-16 22:51:46 +01:00
Guenter Roeck f496b2d4f1 hwmon: (lm63) Add sensor type attribute for external sensor on LM96163
On LM96163, the external temperature sensor type is configurable to
either a thermal diode or a 3904 transistor. The chip reports a wrong
temperature if misconfigured. Add writable attribute to support it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-01-16 22:51:46 +01:00
Guenter Roeck 04738b2b2f hwmon: (lm63) Add support for update_interval sysfs attribute
The update interval is configurable on LM63 and compatibles. Add
support for it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-01-16 22:51:46 +01:00
Guenter Roeck 94e55df48a hwmon: (lm63) Add support for writing the external critical temperature
On LM64, the external critical temperature limit is always writable. On LM96163,
it is writable if the chip is configured for it. Add conditional support for
writing the register dependent on chip type and configuration.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-01-16 22:51:46 +01:00
Guenter Roeck e872c91e72 hwmon: (lm63) Add support for unsigned upper temperature limits
LM96163 supports unsigned upper limits for the external temperature sensor.
Add support for it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-01-16 22:51:46 +01:00
Guenter Roeck 210961c436 hwmon: (lm63) Add support for LM96163
LM96163 is an enhanced version of LM63 with improved PWM resolution. Add chip
detection code as well as support for improved PWM resolution if the chip is
configured to use it.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-01-16 22:51:45 +01:00
Guenter Roeck 786375f729 hwmon: (lm63) Add support for external temperature offset register
LM63 and compatibles support a temperature offset register for the external
temperature sensor. Add support for it.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-01-16 22:51:45 +01:00
Guenter Roeck 662bda2832 hwmon: (lm63) Fix checkpatch errors
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-01-16 22:51:45 +01:00
Eric Miao 012f3b9118 hwmon: (max1111) Change sysfs interface to in[0-3]_input in millivolts
This patch fixed the inconsistent max1111 sysfs interface as pointed
out by Jean Delvare:

    It was pointed to me that the max1111 driver doesn't implement the
    standard sysfs interface for hwmon drivers (as described in
    Documentation/hwmon/sysfs-interface). It exports files adc[0-3]_in,
    which
    aren't part of the standard interface. Presumably these should be
    renamed to in[0-3]_input. Renaming them is probably not sufficient
    though, as I see no scaling done in the driver. As the MAX1111 chip has
    a documented full scale of 2.048V, I take it that the LSB of the ADC
    has a weight of 8 mV. Exporting raw register values to user-space is
    not OK.

Reported-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-01-16 22:51:45 +01:00
Rusty Russell 90ab5ee941 module_param: make bool parameters really bool (drivers & misc)
module_param(bool) used to counter-intuitively take an int.  In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.

It's time to remove the int/unsigned int option.  For this version
it'll simply give a warning, but it'll break next kernel version.

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-01-13 09:32:20 +10:30
Rusty Russell 69116f279a module_param: avoid bool abuse, add bint for special cases.
For historical reasons, we allow module_param(bool) to take an int (or
an unsigned int).  That's going away.

A few drivers really want an int: they set it to -1 and a parameter
will set it to 0 or 1.  This sucks: reading them from sysfs will give
'Y' for both -1 and 1, but if we change it to an int, then the users
might be broken (if they did "param" instead of "param=1").

Use a new 'bint' parser for them.

(ntfs has a different problem: it needs an int for debug_msgs because
it's also exposed via sysctl.)

Cc: Steve Glendinning <steve.glendinning@smsc.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Cc: Christoph Raisch <raisch@de.ibm.com>
Cc: Roland Dreier <roland@kernel.org>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: linux390@de.ibm.com
Cc: Anton Altaparmakov <anton@tuxera.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: lm-sensors@lm-sensors.org
Cc: linux-rdma@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: linux-ntfs-dev@lists.sourceforge.net
Cc: alsa-devel@alsa-project.org
Acked-by: Takashi Iwai <tiwai@suse.de> (For the sound part)
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com> (For the hwmon driver)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-01-13 09:32:17 +10:30
Linus Torvalds 6950d76c53 Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  max1111.c: fix checkpatch warning
  hwmon: (lm75) fix checkpatch warnings
  hwmon: (lm80) fix checkpatch messages
  hwmon: replaced strict_str* with kstr*
  hwmon: (lm75) fix checkpatch warning
  hwmon: (lm75) added error handling
  hwmon: (ltc4261) set data->valid to 0 if error
  hwmon: (f75375s) Add support for F75387SG/RG
  hwmon: (f75375s) Disable setting DC fan control mode for F75373
  hwmon: (f75375s) Initialize pwmX_mode and pwmX_enable if there is no platform data
  hwmon: (f75375s) Fix value range for PWM modes
  hwmon: (f75375s) Use standard sysfs attribute names
  hwmon: (f75375s) Fix checkpatch errors and warnings
  hwmon: (pmbus/zl6100) Only instantiate external temperature sensor if enabled
  hwmon: (pmbus/zl6100) Add support for Ericsson BMR45[0,1] and BMR46[2,3,4]
  hwmon: (pmbus/zl6100) Add support for ZL2005
  hwmon: (pmbus/adm1275) Validate device ID
2012-01-08 13:39:24 -08:00
Linus Torvalds 972b2c7199 Merge branch 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
* 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (165 commits)
  reiserfs: Properly display mount options in /proc/mounts
  vfs: prevent remount read-only if pending removes
  vfs: count unlinked inodes
  vfs: protect remounting superblock read-only
  vfs: keep list of mounts for each superblock
  vfs: switch ->show_options() to struct dentry *
  vfs: switch ->show_path() to struct dentry *
  vfs: switch ->show_devname() to struct dentry *
  vfs: switch ->show_stats to struct dentry *
  switch security_path_chmod() to struct path *
  vfs: prefer ->dentry->d_sb to ->mnt->mnt_sb
  vfs: trim includes a bit
  switch mnt_namespace ->root to struct mount
  vfs: take /proc/*/mounts and friends to fs/proc_namespace.c
  vfs: opencode mntget() mnt_set_mountpoint()
  vfs: spread struct mount - remaining argument of next_mnt()
  vfs: move fsnotify junk to struct mount
  vfs: move mnt_devname
  vfs: move mnt_list to struct mount
  vfs: switch pnode.h macros to struct mount *
  ...
2012-01-08 12:19:57 -08:00
Linus Torvalds 67b0243131 Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86: Skip cpus with apic-ids >= 255 in !x2apic_mode
  x86, x2apic: Allow "nox2apic" to disable x2apic mode setup by BIOS
  x86, x2apic: Fallback to xapic when BIOS doesn't setup interrupt-remapping
  x86, acpi: Skip acpi x2apic entries if the x2apic feature is not present
  x86, apic: Add probe() for apic_flat
  x86: Simplify code by removing a !SMP #ifdefs from 'struct cpuinfo_x86'
  x86: Convert per-cpu counter icr_read_retry_count into a member of irq_stat
  x86: Add per-cpu stat counter for APIC ICR read tries
  pci, x86/io-apic: Allow PCI_IOAPIC to be user configurable on x86
  x86: Fix the !CONFIG_NUMA build of the new CPU ID fixup code support
  x86: Add NumaChip support
  x86: Add x86_init platform override to fix up NUMA core numbering
  x86: Make flat_init_apic_ldr() available
2012-01-06 13:58:21 -08:00
Frans Meulenbroeks 91c8eabef1 max1111.c: fix checkpatch warning
Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05 08:19:36 -08:00
Frans Meulenbroeks a01a68472c hwmon: (lm75) fix checkpatch warnings
Fix checkpatch warnings in lm75.h include file

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05 08:19:35 -08:00
Frans Meulenbroeks 66b3b1f757 hwmon: (lm80) fix checkpatch messages
Fixed all checkpatch messages except
simple_strto* -> kstr*
This will be addressed in a separate patch

Also left one line-too-long message as it was only a
little bit too long and would become less readable

compile-tested: no warnings or errors

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05 08:19:34 -08:00
Frans Meulenbroeks 179c4fdb56 hwmon: replaced strict_str* with kstr*
replaced strict_strtol with kstrtol and
replaced strict_strtuol with kstrtuol

This satisfies checkpatch -f
Compile tested only: no warnings or errors given

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05 08:19:34 -08:00
Frans Meulenbroeks 24edc0a71b hwmon: (lm75) fix checkpatch warning
Fixed this:

WARNING: strict_strtol is obsolete, use kstrtol instead
+   error = strict_strtol(buf, 10, &temp);

by replacing strict_strtol with kstrtol.

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05 08:19:33 -08:00
Frans Meulenbroeks 1f962f363b hwmon: (lm75) added error handling
Add error handling so if lm75_update_device fails
an error is returned when reading the value through sysfs.
This is closely modeled after the way this is handled in ltc4261.

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05 08:19:33 -08:00
Frans Meulenbroeks aac9fe9b46 hwmon: (ltc4261) set data->valid to 0 if error
If there is an error it is better to set data->valid to 0
so the next call to ltc4261_update_device will always be
executed.

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05 08:19:32 -08:00
Björn Gerhart f58c44e698 hwmon: (f75375s) Add support for F75387SG/RG
Fintek F75387SG/RG is mostly compatible to F75373/F75375. Add support for it
to the F75375S driver.

Fan support for F75387SG/RG has been implemented but not tested.

Cc: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Bjoern Gerhart <oss@extracloud.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05 08:19:32 -08:00
Guenter Roeck 5cd3222a9f hwmon: (f75375s) Disable setting DC fan control mode for F75373
F75373 does not support DC (linear voltage) fan control mode, so don't let
the user set it.

Cc: Riku Voipio <riku.voipio@iki.fi>
Reviewed-by: Bjoern Gerhart <oss@extracloud.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05 08:19:31 -08:00
Guenter Roeck b1b561a228 hwmon: (f75375s) Initialize pwmX_mode and pwmX_enable if there is no platform data
pwmX_mode and pwmX_enable are not initialized if no platform data is provided to
the driver. Read chip configuration at driver initialization time and initialize
attributes to reflect chip configuration.

Cc: Riku Voipio <riku.voipio@iki.fi>
Reviewed-by: Bjoern Gerhart <oss@extracloud.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05 08:19:30 -08:00
Guenter Roeck 3310600aa7 hwmon: (f75375s) Fix value range for PWM modes
Accepted value range for PWM modes was 0..4, even though only 0..3 is
subsequently used. Limit permitted value range to 0..3 to avoid unpredictable
behavior.

Cc: Riku Voipio <riku.voipio@iki.fi>
Reviewed-by: Bjoern Gerhart <oss@extracloud.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05 08:19:30 -08:00
Guenter Roeck 740f6be3cc hwmon: (f75375s) Use standard sysfs attribute names
The driver uses non-standard sysfs attribute names for maximum and target fan
speeds, even though standard attibute names for the same values do exist.
Replace non-standard attribute names with standard attribute names.

Cc: Riku Voipio <riku.voipio@iki.fi>
Reviewed-by: Bjoern Gerhart <oss@extracloud.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05 08:19:29 -08:00
Guenter Roeck 4fd826ef97 hwmon: (f75375s) Fix checkpatch errors and warnings
Clean up driver to follow current coding style.

Cc: Riku Voipio <riku.voipio@iki.fi>
Reviewed-by: Bjoern Gerhart <oss@extracloud.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05 08:19:29 -08:00
Guenter Roeck 56badacb92 hwmon: (pmbus/zl6100) Only instantiate external temperature sensor if enabled
BMR4xx devices don't have an external temperature sensor,
and instantiating it does not provide value anyway if it is disabled.
Only instantiate it if it is enabled.

Also optimize wait time between I2C chip accesses in the probe function, and
replace unnecessary check for support for I2C_FUNC_SMBUS_READ_BYTE_DATA with
now required support for I2C_FUNC_SMBUS_READ_WORD_DATA.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-01-05 08:19:28 -08:00
Guenter Roeck 443830f6fd hwmon: (pmbus/zl6100) Add support for Ericsson BMR45[0,1] and BMR46[2,3,4]
Add support for Ericsson BMR450, BMR451, BMR462, BMR463, and BMR464, which are
based on ZL2005 and ZL2008, to zl6100 driver. Remove BMR450 and BMR451 device
IDs from generic PMBus driver.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-01-05 08:19:28 -08:00
Guenter Roeck bc581e6fcc hwmon: (pmbus/zl6100) Add support for ZL2005
Add explicit support for ZL2005. Functionality is almost the same as with other
Zilker Labs / Intersil chips, but limit register detection does not work reliably.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-01-05 08:19:27 -08:00
Guenter Roeck 87102808d0 hwmon: (pmbus/adm1275) Validate device ID
Since manufacturer and device ID are known, read and validate it.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
[Dan Carpenter <dan.carpenter@oracle.com>: Fixed memory leak]
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-01-05 08:19:27 -08:00
Al Viro 48176a973d switch sysfs_chmod_file() to umode_t
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-01-03 22:54:56 -05:00
Al Viro 587a1f1659 switch ->is_visible() to returning umode_t
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-01-03 22:54:55 -05:00
Kevin Winchester 141168c36c x86: Simplify code by removing a !SMP #ifdefs from 'struct cpuinfo_x86'
Several fields in struct cpuinfo_x86 were not defined for the
!SMP case, likely to save space.  However, those fields still
have some meaning for UP, and keeping them allows some #ifdef
removal from other files.  The additional size of the UP kernel
from this change is not significant enough to worry about
keeping up the distinction:

	   text    data     bss     dec     hex filename
	4737168	 506459	 972040	6215667	 5ed7f3	vmlinux.o.before
	4737444	 506459	 972040	6215943	 5ed907	vmlinux.o.after

for a difference of 276 bytes for an example UP config.

If someone wants those 276 bytes back badly then it should
be implemented in a cleaner way.

Signed-off-by: Kevin Winchester <kjwinchester@gmail.com>
Cc: Steffen Persvold <sp@numascale.com>
Link: http://lkml.kernel.org/r/1324428742-12498-1-git-send-email-kjwinchester@gmail.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2011-12-21 09:25:09 +01:00
Axel Lin d6c4f2ac1d hwmon: (jz4740) Staticise jz4740_hwmon_driver
It is not used outside this driver so no need to make the symbol global.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-12-12 08:31:21 -08:00
Axel Lin 0b57d7602b hwmon: (jz4740) fix signedness bug
wait_for_completion_interruptible_timeout() may return negative value.
In this case, checking if (t > 0)  will return true if t is unsigned.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: stable@kernel.org (3.0+)
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-12-12 08:31:21 -08:00
Axel Lin 25a236a5db hwmon: convert drivers/hwmon/* to use module_platform_driver()
This patch converts the drivers in drivers/hwmon/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Cc: Donggeun Kim <dg77.kim@samsung.com>
Cc: Simon Guinot <sguinot@lacie.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Ben Dooks <ben@simtec.co.uk>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: J Keerthy <j-keerthy@ti.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-11-26 09:48:20 -08:00
Lars-Peter Clausen b52fabca36 hwmon: Remove redundant spi driver bus initialization
In ancient times it was necessary to manually initialize the bus field of an
spi_driver to spi_bus_type. These days this is done in spi_register_driver(),
so we can drop the manual assignment.

The patch was generated using the following coccinelle semantic patch:
// <smpl>
@@
identifier _driver;
@@
struct spi_driver _driver = {
	.driver = {
-		.bus = &spi_bus_type,
	},
};
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: lm-sensors@lm-sensors.org
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-11-25 07:48:16 -08:00
Donggeun Kim 3627902377 hwmon: (exynos4_tmu) Fix Kconfig dependency
Rename dependency of EXYNOS4_TMU in Kconfig to the existing one.

Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-11-17 03:16:19 -08:00
Linus Torvalds 32aaeffbd4 Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
* 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
  Revert "tracing: Include module.h in define_trace.h"
  irq: don't put module.h into irq.h for tracking irqgen modules.
  bluetooth: macroize two small inlines to avoid module.h
  ip_vs.h: fix implicit use of module_get/module_put from module.h
  nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
  include: replace linux/module.h with "struct module" wherever possible
  include: convert various register fcns to macros to avoid include chaining
  crypto.h: remove unused crypto_tfm_alg_modname() inline
  uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
  pm_runtime.h: explicitly requires notifier.h
  linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
  miscdevice.h: fix up implicit use of lists and types
  stop_machine.h: fix implicit use of smp.h for smp_processor_id
  of: fix implicit use of errno.h in include/linux/of.h
  of_platform.h: delete needless include <linux/module.h>
  acpi: remove module.h include from platform/aclinux.h
  miscdevice.h: delete unnecessary inclusion of module.h
  device_cgroup.h: delete needless include <linux/module.h>
  net: sch_generic remove redundant use of <linux/module.h>
  net: inet_timewait_sock doesnt need <linux/module.h>
  ...

Fix up trivial conflicts (other header files, and  removal of the ab3550 mfd driver) in
 - drivers/media/dvb/frontends/dibx000_common.c
 - drivers/media/video/{mt9m111.c,ov6650.c}
 - drivers/mfd/ab3550-core.c
 - include/linux/dmaengine.h
2011-11-06 19:44:47 -08:00
Guenter Roeck bfa02b0da6 hwmon: (w83627ehf) Fix broken driver init
Commit 2265cef2 (hwmon: (w83627ehf) Properly report PECI and AMD-SI
sensor types) results in kernel panic if data->temp_label was not
initialized.
The problem was found with chip W83627DHG-P.

Add check if data->temp->label was set before use.

Based on incomplete patch by Alexander Beregalov.

Reported-by: Alexander Beregalov <a.beregalov@gmail.com>
Tested-by: Alexander Beregalov <a.beregalov@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2011-11-06 20:25:18 +01:00
Jean Delvare 2aba6cac2a hwmon: (coretemp) Fix for non-SMP builds
The definition of TO_ATTR_NO in the non-SMP case is wrong. As the SMP
definition resolves to the correct value, just use this for both
cases.

Without this fix the temperature attributes are named temp0_* instead
of temp2_*, so libsensors won't pick them. Broken since kernel 3.0.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Phil Sutter <phil@nwl.cc>
Cc: stable@kernel.org
Acked-by: Durgadoss R <Durgadoss.r@intel.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-11-06 20:25:18 +01:00
Jean Delvare eff7687d47 hwmon: (w83627ehf) Add support for the W83627UHG
This is essentially a stripped down version of the W83627DHG. Noticeable
difference is that it is still powered with +5V, as older models, even
though the ADC resolution is 8 mV as newer models have.

Thanks to Ulf Bruman (Saab Group) for doing all the testing.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-11-04 12:00:48 +01:00
Jean Delvare 6ba71de5f8 hwmon: (w83627ehf) Clean up probe function
The probe function has grown pretty large, I think it's time for some
cleanups, starting with these two simple ones:
* Move temp3/in6 check for the W83667HG later in the function, where
  it is done for all other chip types.
* Move temperature register setting to a separate function, to avoid
  code duplication.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-11-04 12:00:47 +01:00
Jean Delvare 2265cef275 hwmon: (w83627ehf) Properly report PECI and AMD-SI sensor types
When temperature sources are PECI or AMD-SI agents, it makes no sense
to report their type as diode or thermistor. Instead we must report
their digital nature.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-11-04 12:00:47 +01:00
Jean Delvare 90f4102ce5 hwmon: Use i2c_smbus_{read,write}_word_swapped
Make use of the new i2c_smbus_{read,write}_word_swapped functions.
This makes the driver code more compact and readable. It also ensures
proper error handling.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Dirk Eibach <eibach@gdsys.de>
Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>
Cc: Guillaume Ligneul <guillaume.ligneul@gmail.com>
2011-11-04 12:00:47 +01:00
Jean Delvare 371f2e083b hwmon: (smsc47b397) Fix checkpatch errors
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-11-04 12:00:47 +01:00
Jean Delvare b2589ab02b hwmon: (lm90) Make code more readable
Clean up the code to make it more readable:
* Remove reg_ and new_ prefixes from variable names, they made the
  names longer, causing extra line breaks, while not adding much
  value.
* Introduce struct device dev* = &client->dev in two functions, to
  avoid repeating client->dev everywhere in these functions.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-11-04 12:00:47 +01:00
Jean Delvare 8dc089d68b hwmon: (lm90) Fix warnings
With some configuration option combinations, we get the following
warnings:

drivers/hwmon/lm90.c: In function 'lm90_detect':
drivers/hwmon/lm90.c:1114: warning: 'chip_id' may be used uninitialized
in this function
drivers/hwmon/lm90.c:1114: warning: 'reg_config1' may be used
uninitialized in this function
drivers/hwmon/lm90.c:1114: warning: 'reg_convrate' may be used
uninitialized in this function
drivers/hwmon/lm90.c:1187: warning: 'reg_emerg2' may be used
uninitialized in this function
drivers/hwmon/lm90.c:1187: warning: 'reg_status2' may be used
uninitialized in this function

We can solve these easily by reading the register values first and
checking for errors later. These errors should be very rare, even in
the case of failed detection, so this change has no impact on
performance. And this makes checkpatch.pl happier.

Reported-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-11-04 12:00:46 +01:00
Jean Delvare da8ebe4e09 hwmon: (ibmaem) Avoid repeated memory allocations
Preallocate a buffer for the response to sensor reads, and reuse it
for each read instead of allocating a new one each time. This should
be faster and should also avoid memory fragmentation.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-11-04 12:00:46 +01:00
Jean Delvare 9d84c9e8b5 hwmon: (ibmaem) Make instance initializations independent
There is no good reason that I can see why the failure to initialize
one instance should prevent other instances from being initialized.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-11-04 12:00:46 +01:00
Jean Delvare 547a1c99d0 hwmon: (ibmaem) Fix error paths
I am under the impression that error paths in functions
aem_init_aem1_inst() and aem_init_aem2_inst() are incorrect. In
several cases, the function returns 0 on error, which I suspect is
not intended. Fix this by properly tracking error codes.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-11-04 12:00:46 +01:00
Jean Delvare 24d6e2a89a hwmon: (lm73) Make detection less problematic
Word reads can cause trouble with some I2C devices, so do as much
detection as we can using only byte reads, and only use a word read in
the end to confirm the positive match. Also properly handle read
errors.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Robert Casanova <robertcasanova@nanometrics.ca>
2011-11-04 12:00:46 +01:00
Dean Nelson 746cdfbf01 hwmon: Avoid building drivers for powerpc that read/write ISA addresses
A modprobe of hwmon drivers that read/write ISA addresses on a powerpc results
in a kernel Oops. These reads/writes are being done via the inb()/in_8() and
outb()/out_8() macros.

Prevent these drivers from being built for powerpc.

Signed-off-by: Dean Nelson <dnelson@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2011-11-04 12:00:45 +01:00
Linus Torvalds a0a4194c94 Merge branch 'for-next' of git://git.infradead.org/users/sameo/mfd-2.6
* 'for-next' of git://git.infradead.org/users/sameo/mfd-2.6: (80 commits)
  mfd: Fix missing abx500 header file updates
  mfd: Add missing <linux/io.h> include to intel_msic
  x86, mrst: add platform support for MSIC MFD driver
  mfd: Expose TurnOnStatus in ab8500 sysfs
  mfd: Remove support for early drop ab8500 chip
  mfd: Add support for ab8500 v3.3
  mfd: Add ab8500 interrupt disable hook
  mfd: Convert db8500-prcmu panic() into pr_crit()
  mfd: Refactor db8500-prcmu request_clock() function
  mfd: Rename db8500-prcmu init function
  mfd: Fix db5500-prcmu defines
  mfd: db8500-prcmu voltage domain consumers additions
  mfd: db8500-prcmu reset code retrieval
  mfd: db8500-prcmu tweak for modem wakeup
  mfd: Add db8500-pcmu watchdog accessor functions for watchdog
  mfd: hwacc power state db8500-prcmu accessor
  mfd: Add db8500-prcmu accessors for PLL and SGA clock
  mfd: Move to the new db500 PRCMU API
  mfd: Create a common interface for dbx500 PRCMU drivers
  mfd: Initialize DB8500 PRCMU regs
  ...

Fix up trivial conflicts in
	arch/arm/mach-imx/mach-mx31moboard.c
	arch/arm/mach-omap2/board-omap3beagle.c
	arch/arm/mach-u300/include/mach/irqs.h
	drivers/mfd/wm831x-spi.c
2011-11-03 09:40:51 -07:00
Jonathan Cameron 6580704476 drivers/hwmon/hwmon.c: convert idr to ida and use ida_simple_get()
A straightforward looking use of idr for a device id.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Tejun Heo <tj@kernel.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-31 17:30:51 -07:00
Jonathan Cameron 4ca5f468cc hwmon: convert idr to ida and use ida_simple interface
hwmon was using an idr with a NULL pointer, so convert to an
ida which then allows use of Rusty's ida_simple_get.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Tejun Heo <tj@kernel.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-31 17:30:51 -07:00
Paul Gortmaker 31a1a1526d drivers/hwmon: add module.h to ultra45_env.c
This file needs the full module.h header and up to now was just
implicitly capitalizing on it being present already.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:47 -04:00
Linus Torvalds 8237eb946a Merge branch 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, microcode, AMD: Add microcode revision to /proc/cpuinfo
  x86, microcode: Correct microcode revision format
  coretemp: Get microcode revision from cpu_data
  x86, intel: Use c->microcode for Atom errata check
  x86, intel: Output microcode revision in /proc/cpuinfo
  x86, microcode: Don't request microcode from userspace unnecessarily

Fix up trivial conflicts in arch/x86/kernel/cpu/amd.c (conflict between
moving AMD BSP code to cpu_dev helper function and adding AMD microcode
revision to /proc/cpuinfo code)
2011-10-28 05:14:48 -07:00
Jean Delvare c5794cfac0 hwmon: (w83627ehf) Better fix for negative temperature values
It is more efficient to left-align 8-bit temperature values, so that
8-bit and 9-bit temperature values can be handled exactly the same way
in the rest of the code.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:48 -07:00
Jean Delvare 17296feb3c hwmon: (w83627ehf) Uninline is_word_sized
Helper function is_word_sized has grown too much to be kept inline. It
was OK when there were only 6 word-sized registers but support for new
devices have made the list much longer. The function is also called
from more places than before.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:47 -07:00
Jean Delvare 426343ef34 hwmon: (lm75) Document why clones are not detected
Explain why clones of the LM75 are generally not detected by the
driver, and why this isn't going to change. Also update the
documentation to reflect the list of chip names currently supported by
the driver.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:47 -07:00
Jean Delvare 03f5de2bb7 hwmon: (w83627ehf) Move fan pins check to a separate function
Move the check of fan pin usage to a separate function. This improves
readability, and will make it easier to integrate chip-specific
conditions.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:46 -07:00
Jean Delvare 389ef65d2e hwmon: (w83627ehf) Skip reading unused voltage registers
When in6 is missing, don't read the corresponding registers, it's a
waste of time. The logic is similar to what we do for fans and
temperatures.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:45 -07:00
Michael Hennerich e96f9d89e6 hwmon: (lm75) Add support for Analog Devices ADT75
Add datasheet reference and device ID for ADT75.

The ADT75, like some other LM75 derivatives, needs to be instantiated
using methods 1, 2, or 4.
For more information see Documentation/i2c/instantiating-devices.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:45 -07:00
Guenter Roeck 1af1f5313c hwmon: (pmbus_core) Simplify sign extensions
Shift operations can be used for sign extensions. Use it.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24 11:09:44 -07:00
Guenter Roeck bc365a7f3c hwmon: (pmbus) Add support for Lineage Power DC-DC converters
Add device IDs and reference to datasheets for Lineage Power DC-DC converters.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24 11:09:44 -07:00
Guenter Roeck ddfb41ca2a hwmon: (pmbus/ltc2978) Add support for LTC3880 to LTC2978 driver
The LTC3880 PMBus command set is comparable to LTC2978. Add support for it
to the LTC2978 driver.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24 11:09:43 -07:00
Guenter Roeck c3ff9a674c hwmon: (pmbus/ltc2978) Explicit driver for LTC2978
Provide explicit driver for LTC2978 to enable support for minimum and peak
attributes. Remove ltc2978 chip id from generic pmbus driver.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24 11:09:42 -07:00
Guenter Roeck 3d790287c4 hwmon: (pmbus) Add support for TEMP2 peak attributes
At least one PMBus chip supports peak attributes for READ_TEMPERATURE2.
Add virtual registers to be able to report it to the user.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24 11:09:42 -07:00
Jonathan Cameron 4f3a659581 hwmon: AD7314 driver (ported from IIO)
Driver for AD7314, ADT7301, and ADT7302, ported from IIO.

Currently dropped power down mode support.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
[guenter.roeck@ericsson.com: Added MODULE_DEVICE_TABLE]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:41 -07:00
Guenter Roeck 200855e52d hwmon: (pmbus) Add support for Intersil power management chips
Add support for Intersil / Zilker Labs ZL2004, ZL2006, ZL2008, ZL2105, ZL2106,
ZL6100, and ZL6105.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24 11:09:40 -07:00
Guenter Roeck da8e48ab48 hwmon: (pmbus) Always call _pmbus_read_byte in core driver
Always call _pmbus_read_byte() instead of pmbus_read_byte() in PMBus core
driver. With this change, device specific read functions can be implemented for
all registers.

Since the device specific read_byte function is now always called, we need to be
more careful with page validations. Only fail if the passed page number is larger
than 0, since -1 means "current page".

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24 11:09:40 -07:00
Guenter Roeck 179144a0d4 hwmon: (pmbus) Replace EINVAL return codes with more appropriate errors
EINVAL was over-used in the code. Replace it with more appropriate errors.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24 11:09:39 -07:00
Hans de Goede 6543439f19 hwmon/f71882fg: Make the decision wether to register fan attr. per fan
Before this patch the f71882fg driver completely fails to initialize
on systems which have reserved settings in the pwm enable register, and
it disables all auto pwm sysfs attributes if any fan is controlled by
a digital sensor reading.

This patch changes the fail to initialize into don't register any attributes
for the fan for which there are reserved settings in the pwm enable register
and also makes the not registering of auto pwm sysfs attributes a per fan
thing.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:38 -07:00
Hans de Goede 9af0794c63 hwmon/f71882fg: Add a f71882fg_create_fan_sysfs_files helper function
This is a preparation patch for not registering fan/pwm attributes for
some fans (rather then register them for all or for none).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:37 -07:00
Hans de Goede 5584014256 hwmon/f71882fg: Make all fan/pwm attr tables 2 dimensional
This is a preparation patch for not registering fan/pwm attributes for
some fans (rather then register them for all or for none).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:37 -07:00
Yong Zhang 3f67f83525 hwmon: (exynos4_tmu) Remove IRQF_DISABLED
Since commit [c58543c8: genirq: Run irq handlers with interrupts disabled],
we run all interrupt handlers with interrupts disabled
and we even check and yell when an interrupt handler
returns with interrupts enabled (see commit [b738a50a:
genirq: Warn when handler enables interrupts]).

So now this flag is a NOOP and can be removed.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:36 -07:00
Donggeun Kim 9d97e5c81e hwmon: Add driver for EXYNOS4 TMU
This patch allows to read temperature
from TMU(Thermal Management Unit) of SAMSUNG EXYNOS4 series of SoC.

Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:35 -07:00
Guenter Roeck 5cf231a346 hwmon: (pmbus/adm1275) Add support for ADM1276
ADM1276 is mostly compatible to ADM1275, with added support for input power
measurement. Add support for it to the ADM1275 driver.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2011-10-24 11:09:35 -07:00
Guenter Roeck c5e6763667 hwmon: (pmbus/adm1275) Add support for second current limit
ADM1275 supports a second current limit, which can be configured as either lower
or upper limit. Add support for it and report it as either lower or upper
critical current limit.

Also replace error return code EINVAL for unsupported pages with ENXIO as this
is more appropriate for the observed condition.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2011-10-24 11:09:34 -07:00
Guenter Roeck 866cf12a0e hwmon: (pmbus) Don't return errors from driver remove functions
Driver remove functions have an error return value, but rarely return an error
in practice. If a driver does return an error from its remove function, the
driver won't be unloaded and is expected to stay alive.

pmbus_do_remove() is defined as returning an int, but always returns 0 (no
error). Calling code passes that return value on to high level driver
remove functions, but does not evaluate it and removes driver data even if
pmbus_do_remove() returned an error (which it in practice never does). Even if
this code could never cause a real problem, it is nevertheless conceptually
wrong.

To reduce confusion and simplify the code, change pmbus_do_remove() to be a void
function, and have PMBus client drivers always return zero in their driver
remove functions.

Reported-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2011-10-24 11:09:33 -07:00
Guenter Roeck 20fcfe1721 hwmon: (pmbus) Add comments explaining internal driver API return values
Return values for functions reading/writing manufacturer specific registers are
poorly explained. Add comments to improve documentation.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2011-10-24 11:09:33 -07:00
Dmitry Artamonow 363a12a499 hwmon: (w83627ehf) add caseopen detection
Export caseopen alarm status into userspace for Winbond W83627*
and Nuvoton NCT677[56] chips and implement alarm clear attribute.
Second caseopen alarm on NCT6776 is also supported.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:32 -07:00
Uwe Kleine-König 613c27ab98 hwmon: Convert mc13783-adc to mc13xxx API
The mc13783_... functions are going to be removed, so switch to the
more generic API.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-10-24 14:09:12 +02:00
Jean Delvare 133d324d82 hwmon: (w83627ehf) Fix negative 8-bit temperature values
Since 8-bit temperature values are now handled in 16-bit struct
members, values have to be cast to s8 for negative temperatures to be
properly handled. This is broken since kernel version 2.6.39
(commit bce26c58df86599c9570cee83eac58bdaae760e4.)

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@kernel.org	# 2.6.39+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-20 07:17:08 -07:00
Andi Kleen ca8bc8dc04 coretemp: Get microcode revision from cpu_data
Now that the ucode revision is available in cpu_data remove
the existing code in coretemp.c to query it manually. Read the
ucode revision from cpu_data instead

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Cc: jbeulich@novell.com
Cc: fenghua.yu@intel.com
Cc: khali@linux-fr.org
Link: http://lkml.kernel.org/r/1318466795-7393-3-git-send-email-andi@firstfloor.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2011-10-14 13:16:42 +02:00
Jean Delvare bf164c58e5 hwmon: (w83627ehf) Properly report thermal diode sensors
The w83627ehf driver is improperly reporting thermal diode sensors as
type 2, instead of 3. This caused "sensors" and possibly other
monitoring tools to report these sensors as "transistor" instead of
"thermal diode".

Furthermore, diode subtype selection (CPU vs. external) is only
supported by the original W83627EHF/EHG. All later models only support
CPU diode type, and some (NCT6776F) don't even have the register in
question so we should avoid reading from it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-13 16:51:29 -07:00
Guenter Roeck 20ecb499f6 hwmon: (coretemp) Avoid leaving around dangling pointer
Storing the struct temp_data pointer allocated from create_core_data()
when returning an error has the potential of leaving around a pointer
to freed memory. Reset it to NULL for error returns.

Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2011-09-28 08:19:21 -07:00
Jean Delvare 0eb9782ad9 hwmon: (coretemp) Fixup platform device ID change
With recent change "hwmon: (coretemp) don't use kernel assigned CPU
number as platform device ID", the microcode check is now running on
random CPU. Fix that by checking the microcode before creating the
platform device rather than at probe time.

Also avoid calling TO_PHYS_ID(cpu) twice in the same function, it's
expensive.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-09-28 08:19:20 -07:00
Jan Beulich 2f1c3db0a6 hwmon: (coretemp) remove struct platform_data * parameter from create_core_data()
The only caller of the function obtained the pointer solely for the
purpose of passing it to this function, while it can be easily
determined from the struct platform_device * parameter also passed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-09-23 10:39:11 -07:00
Jan Beulich e3204ed3a4 hwmon: (coretemp) constify static data
These arrays won't ever be written to, so protect them from
unintentional modification.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-09-23 10:39:10 -07:00
Jan Beulich b3a242a6e4 hwmon: (coretemp) don't use kernel assigned CPU number as platform device ID
... as that has the potential to conflict with (particularly soft) CPU
hot removal and re-adding.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
[guenter.roeck@ericsson.com: use platform device ID as physical CPU id]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-09-23 10:38:09 -07:00
Roland Stigge cc41d586e8 hwmon: (ds620) Fix handling of negative temperatures
Signed (negative) temperatures were not handled correctly.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@kernel.org # v2.6.38+
2011-09-21 17:25:18 -07:00
Chris Peterson 7cbe1ceeb6 hwmon: (w83791d) rename prototype parameter from 'register' to 'reg'
gcc -Wextra warns "register is not at beginning of declaration" because the
compiler thinks the parameter has been marked as a 'register' variable, but
the function prototype intended to name the parameter "register" (which is a
reserved keyword).

Signed-off-by: Chris Peterson <cpeterso@cpeterso.com>
Acked-by: Marc Hulsman <m.hulsman@tudelft.nl>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-09-21 17:25:18 -07:00
Guenter Roeck f4af6fd6e2 hwmon: (coretemp) Don't use threshold registers for tempX_max
With commit c814a4c7c4, the meaning of tempX_max
was changed. It no longer returns the value of bits 8:15 of
MSR_IA32_TEMPERATURE_TARGET, but instead returns the value of CPU threshold
register T1. tempX_max_hyst was added to reflect the value of temperature
threshold register T0.

As it turns out, T0 and T1 are used on some systems, presumably by the BIOS.
Also, T0 and T1 don't have a well defined meaning. The thresholds may be used
as upper or lower limits, and it is not guaranteed that T0 <= T1. Thus, the new
attribute mapping does not reflect the actual usage of the threshold registers.
Also, register contents are changed during runtime by an entity other than the
hwmon driver, meaning the values cached by the driver do not reflect actual
register contents.

Revert most of c814a4c7c4 to address the problem.
Support for T0 and T1 will be added back in with a separate commit, using new
attribute names.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2011-09-21 17:25:18 -07:00
Jean Delvare a45a8c8571 hwmon: (coretemp) Let the user force TjMax
On old CPUs (and even some recent Atom CPUs) TjMax can't be read from
the CPU registers, so it is guessed by the driver using a complex
heuristic which isn't reliable. So let users who know their CPU's
TjMax pass it as a module parameter.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "R, Durgadoss" <durgadoss.r@intel.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Alexander Stein <alexander.stein@systec-electronic.com>
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-09-21 17:25:18 -07:00
Jean Delvare 6bf9e9b09c hwmon: (coretemp) Drop duplicate function get_pkg_tjmax
Function get_pkg_tjmax is a simplified copy of get_tjmax. Drop it and
always use get_tjmax, result is the same and this avoids code
duplication.

Also make get_tjmax less verbose: don't warn about MSR read failure
when failure was expected, and don't report TjMax in the logs unless
debugging is enabled.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-09-21 17:25:18 -07:00
Jean Delvare cd5bd3df1a hwmon: (coretemp) Initialize tmin
ttarget is initialized when the driver is loaded, but tmin is not.
As a result, tempX_max_hyst attributes read 0. Fix this.

Also use THERM_*_THRESHOLD* constants in these initializations instead
of hard-coding the constants.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: "R, Durgadoss" <durgadoss.r@intel.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-09-14 03:55:05 -07:00
Guenter Roeck 40257b953f hwmon: (pmbus) Fix low limit temperature alarms
Temperature alarms are detected by checking the alarm bit and comparing
temperature limits against the current temperature. For low limits, this
comparison needs to be reversed (temp < limit instead of temp > limit).
This was not taken into account, resulting in wrong alarms if a temperature
fell below a low limit.

Fix by adding a low limit flag in the limit data structure. When creating the
sensor entry, the order of registers to compare is now reversed for low limits.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 3.0+
2011-09-13 06:19:15 -07:00
Jean Delvare f020b007d5 hwmon: (ucd9000/ucd9200) Optimize array walk
Rewrite the loop walking the id array during probe. The new code is
better adapted to a null-terminated array, and is also clearer and
more efficient than the original.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Axel Lin <axel.lin@gmail.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-09-06 08:56:07 -07:00
Guenter Roeck ff71c182f4 hwmon: (max16065) Fix current calculation
Current calculation is completely wrong. Add missing brackets to fix it.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 3.0+
2011-09-06 08:56:06 -07:00
Jean Delvare b4cb0d4da7 hwmon: (i5k_amb) Drop i5k_channel_pci_id
Function i5k_channel_pci_id looks like it can fail, while a better
code design would make it more obvious that it can't. We can even get
rid of the function.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-08-23 21:04:28 -07:00
Guenter Roeck 858a914324 hwmon: (ntc_thermistor) Simplify if sequence
Replace unnecessary if with else statement.

This fixes the following (false) compile warning reported with some combinations
of C compiler version and configuration.

drivers/hwmon/ntc_thermistor.c: In function 'ntc_show_temp':
drivers/hwmon/ntc_thermistor.c:225: warning: 'low' may be used uninitialized in
this function
drivers/hwmon/ntc_thermistor.c:225: note: 'low' was declared here
drivers/hwmon/ntc_thermistor.c:225: warning: 'high' may be used uninitialized in
this function
drivers/hwmon/ntc_thermistor.c:225: note: 'high' was declared here
drivers/hwmon/ntc_thermistor.c:294: warning: 'temp' may be used uninitialized in
this function

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2011-08-22 14:04:05 -07:00
Julia Lawall 66a89b2164 hwmon: (ibmaem) add missing kfree
rs_resp is dynamically allocated in aem_read_sensor(), so it should be freed
before exiting in every case.  This collects the kfree and the return at
the end of the function.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@kernel.org # 2.6.27+
2011-08-11 10:14:18 -07:00
Guenter Roeck 3a2805e845 hwmon: (pmbus/lm25066) Ignore byte writes to non-zero pages
pmbus_clear_faults() attempts to clear faults on non-existing real pages.
As a result, the command error bit in the status register is set, and faults
are not really cleared.

All byte writes to non-zero pages are requests to clear the status register
on that page. Since non-zero pages are virtual and do not exist on the chip,
there is nothing to do, and such requests have to be ignored. This fixes
above problem.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-08-11 10:14:12 -07:00
Guenter Roeck 044cd3a574 hwmon: (pmbus) Virtualize pmbus_write_byte
With virtual pages and to be able to handle more chips, it is necessary to
virtualise pmbus_write_byte().

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-08-11 10:14:04 -07:00
Linus Torvalds 464c9098bb Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging: (24 commits)
  hwmon: (lm90) Refactor reading of config2 register
  hwmon: (lm90) Make SA56004 detection more robust
  hwmon: (lm90) Simplify handling of extended local temp register
  hwmon: (pmbus) Add client driver for LM25066, LM5064, and LM5066
  hwmon: (max34440) Add support for peak attributes
  hwmon: (max8688) Add support for peak attributes
  hwmon: (max16064) Add support for peak attributes
  hwmon: (adm1275) Add support for peak attributes
  hwmon: (pmbus) Add support for peak attributes
  hwmon: Add new attributes to sysfs ABI
  hwmon: (pmbus) Strengthen check for status register existence
  hwmon: (pmbus) Add support for virtual pages
  hwmon: (pmbus) Support reading and writing of word registers in device specific code
  hwmon: (pmbus) Increase attribute name size
  hwmon: (pmbus) Add ADP4000, NCP4200 and NCP4208 to list of supported devices
  hwmon: (pmbus) Add support for VID output voltage mode
  hwmon: (pmbus) Move PMBus drivers to drivers/hwmon/pmbus
  hwmon: (coretemp) Add core/pkg threshold support to Coretemp
  hwmon: (lm95241) Add support for LM95231
  hwmon: LM95245 driver
  ...
2011-07-30 08:57:57 -10:00
Jean Delvare f90be42fb3 hwmon: (lm90) Refactor reading of config2 register
Several vendors implement a second configuration register, which we
check during device detection. Refactor the code to avoid duplication.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Stijn Devriendt <sdevrien@cisco.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-07-28 20:16:36 -07:00
Jean Delvare 6d101c588f hwmon: (lm90) Make SA56004 detection more robust
With a device ID register value of 0, the SA56004 detection is rather
weak. Check several other register too to confirm the detection, as we
do for other supported devices.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Stijn Devriendt <sdevrien@cisco.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Stijn Devriendt <sdevrien@cisco.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-07-28 20:16:36 -07:00
Jean Delvare a095f687f1 hwmon: (lm90) Simplify handling of extended local temp register
The optional extended local temperature register can never have
address 0, as this address is already used by another register. Thus
we can get rid of flag LM90_HAVE_LOCAL_EXT and simply rely on
reg_local_ext being non-zero to determine if a given chip has this
extension or not. This makes the code more simple.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Stijn Devriendt <sdevrien@cisco.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-07-28 20:16:35 -07:00
Guenter Roeck 03e9bd8dbc hwmon: (pmbus) Add client driver for LM25066, LM5064, and LM5066
PMBus client driver supporting National Semiconductor LM25066, LM5064, and LM5066.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-07-28 20:16:17 -07:00
Guenter Roeck 98591dbe63 hwmon: (max34440) Add support for peak attributes
Add support for voltage, current, and temperature peak (historic maximum)
attributes.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-07-28 17:09:54 -07:00
Guenter Roeck 70e94b276c hwmon: (max8688) Add support for peak attributes
Add support for voltage, current, and temperature peak (historic maximum)
attributes.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-07-28 17:09:53 -07:00
Guenter Roeck 8ebed85450 hwmon: (max16064) Add support for peak attributes
Add support for voltage and temperature peak (historic maximum) attributes.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-07-28 17:09:53 -07:00