Commit graph

2351 commits

Author SHA1 Message Date
Linus Torvalds 3e76b749ea Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
Pull hwmon updates from Jean Delvare:
 "This includes a number of driver conversions to
  devm_hwmon_device_register_with_groups, a few cleanups, and
  support for the ITE IT8623E"

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  hwmon: (it87) Add support for IT8623E
  hwmon: (it87) Fix IT8603E define name
  hwmon: (lm90) Convert to use hwmon_device_register_with_groups
  hwmon: (lm90) Create all sysfs groups in one call
  hwmon: (lm90) Always use the dev variable in the probe function
  hwmon: (lm90) Create most optional attributes with sysfs_create_group
  hwmon: Avoid initializing the same field twice
  hwmon: (pc87360) Avoid initializing the same field twice
  hwmon: (lm80) Convert to use devm_hwmon_device_register_with_groups
  hwmon: (adm1021) Convert to use devm_hwmon_device_register_with_groups
  hwmon: (lm63) Avoid initializing the same field twice
  hwmon: (lm63) Convert to use devm_hwmon_device_register_with_groups
  hwmon: (lm63) Create all sysfs groups in one call
  hwmon: (lm63) Introduce 'dev' variable to point to client->dev
  hwmon: (lm63) Add additional sysfs group for temp2_type attribute
  hwmon: (f71805f) Fix author's address
2014-04-05 18:45:11 -07:00
Rudolf Marek 574e9bd8fa hwmon: (it87) Add support for IT8623E
Add support for the IT8623E found on Asus motherboards. It has same
hardware monitoring block as IT8603E.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
2014-04-04 18:01:35 +02:00
Rudolf Marek 7183ae8c20 hwmon: (it87) Fix IT8603E define name
Fix small typo in the define name for IT8603E.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
2014-04-04 18:01:35 +02:00
Guenter Roeck 1de8b250f6 hwmon: (lm90) Convert to use hwmon_device_register_with_groups
Simplify code, reduce code size, and attach hwmon attributes to hwmon device.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
2014-04-04 18:01:35 +02:00
Guenter Roeck 084489e64c hwmon: (lm90) Create all sysfs groups in one call
Create all sysfs groups in one call by using sysfs_create_groups
instead of calling sysfs_create_group individually for each group.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
2014-04-04 18:01:35 +02:00
Guenter Roeck d89fa6867d hwmon: (lm90) Always use the dev variable in the probe function
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
2014-04-04 18:01:35 +02:00
Guenter Roeck 742192f546 hwmon: (lm90) Create most optional attributes with sysfs_create_group
With the new hwmon API, all attributes have to be created as groups.
Use sysfs_create_group and sysfs_remove_group instead of device_create_file
and device_remove_file to prepare for the new API.

Exception is the 'pec' attribute which will stay with the i2c device.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
2014-04-04 18:01:34 +02:00
Jean Delvare 6cf0a91ebe hwmon: Avoid initializing the same field twice
All hwmon drivers allocate their data structure with some form of
kzalloc, so setting data fields to zero explicitly is a waste of time.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
2014-04-04 18:01:34 +02:00
Jean Delvare 5b58157598 hwmon: (pc87360) Avoid initializing the same field twice
data is kzalloc'd, so data->valid, data->innr and data->tempnr are
already 0. Also rework the initialization path to only set name and
data->fannr once.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
2014-04-04 18:01:34 +02:00
Guenter Roeck 118c9a61f1 hwmon: (lm80) Convert to use devm_hwmon_device_register_with_groups
Simplify code, reduce code size, and attach hwmon attributes to
hwmon device.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
2014-04-04 18:01:34 +02:00
Guenter Roeck c669ec8039 hwmon: (adm1021) Convert to use devm_hwmon_device_register_with_groups
Simplify code, reduce code size, and attach hwmon attributes to
hwmon device.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
2014-04-04 18:01:34 +02:00
Jean Delvare 5ec25c93e0 hwmon: (lm63) Avoid initializing the same field twice
data is kzalloc'd, so data->valid is already 0.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
2014-04-04 18:01:33 +02:00
Guenter Roeck e19eea8407 hwmon: (lm63) Convert to use devm_hwmon_device_register_with_groups
Simplify code, reduce code size, attach hwmon attributes to hwmon device.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
2014-04-04 18:01:33 +02:00
Guenter Roeck b76552b310 hwmon: (lm63) Create all sysfs groups in one call
We can create all sysfs groups in one call by using sysfs_create_groups
instead of using sysfs_create_group individually for each group.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
2014-04-04 18:01:33 +02:00
Guenter Roeck 2fd638feb6 hwmon: (lm63) Introduce 'dev' variable to point to client->dev
client->dev is used multiple times in several functions.
Introduce dev variable pointing to it to simplify the code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
2014-04-04 18:01:33 +02:00
Guenter Roeck 0dcb28a152 hwmon: (lm63) Add additional sysfs group for temp2_type attribute
With the new hwmon API, we can only add groups of attributes, not individual
attributes. To prepare for the use of the new API, add an additional sensor
group for the temp2_type attribute and register it with sysfs_create_group
instead of device_create_file.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
2014-04-04 18:01:32 +02:00
Jean Delvare 964f945b5e hwmon: (f71805f) Fix author's address
The original address was incomplete, and this caused it to be missed
by the recent update to my new address.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
2014-04-04 18:01:32 +02:00
Aravind Gopalakrishnan ec0159503a hwmon: (k10temp) Add support for AMD F16 M30h processor
Adding new PCI ID to support AMD F16 M30h processor (Mullins).
While at it, modify Kconfig and Doc files to reflect the
support for newer processors

Note: PCI ID for this processor will make it into pci_ids.h
as part of this patch:
http://marc.info/?l=linux-kernel&m=139291362126057&w=2
which should be pulled into 3.15 when merge window opens
(It currently sits in 'for-next' branch of bp.git-
https://git.kernel.org/cgit/linux/kernel/git/bp/bp.git/log/?h=for-next)

Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-04-02 22:09:14 -07:00
Linus Torvalds 235c7b9feb Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull main powerpc updates from Ben Herrenschmidt:
 "This time around, the powerpc merges are going to be a little bit more
  complicated than usual.

  This is the main pull request with most of the work for this merge
  window.  I will describe it a bit more further down.

  There is some additional cpuidle driver work, however I haven't
  included it in this tree as it depends on some work in tip/timer-core
  which Thomas accidentally forgot to put in a topic branch.  Since I
  didn't want to carry all of that tip timer stuff in powerpc -next, I
  setup a separate branch on top of Thomas tree with just that cpuidle
  driver in it, and Stephen has been carrying that in next separately
  for a while now.  I'll send a separate pull request for it.

  Additionally, two new pieces in this tree add users for a sysfs API
  that Tejun and Greg have been deprecating in drivers-core-next.
  Thankfully Greg reverted the patch that removes the old API so this
  merge can happen cleanly, but once merged, I will send a patch
  adjusting our new code to the new API so that Greg can send you the
  removal patch.

  Now as for the content of this branch, we have a lot of perf work for
  power8 new counters including support for our new "nest" counters
  (also called 24x7) under pHyp (not natively yet).

  We have new functionality when running under the OPAL firmware
  (non-virtualized or KVM host), such as access to the firmware error
  logs and service processor dumps, system parameters and sensors, along
  with a hwmon driver for the latter.

  There's also a bunch of bug fixes accross the board, some LE fixes,
  and a nice set of selftests for validating our various types of copy
  loops.

  On the Freescale side, we see mostly new chip/board revisions, some
  clock updates, better support for machine checks and debug exceptions,
  etc..."

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (70 commits)
  powerpc/book3s: Fix CFAR clobbering issue in machine check handler.
  powerpc/compat: 32-bit little endian machine name is ppcle, not ppc
  powerpc/le: Big endian arguments for ppc_rtas()
  powerpc: Use default set of netfilter modules (CONFIG_NETFILTER_ADVANCED=n)
  powerpc/defconfigs: Enable THP in pseries defconfig
  powerpc/mm: Make sure a local_irq_disable prevent a parallel THP split
  powerpc: Rate-limit users spamming kernel log buffer
  powerpc/perf: Fix handling of L3 events with bank == 1
  powerpc/perf/hv_{gpci, 24x7}: Add documentation of device attributes
  powerpc/perf: Add kconfig option for hypervisor provided counters
  powerpc/perf: Add support for the hv 24x7 interface
  powerpc/perf: Add support for the hv gpci (get performance counter info) interface
  powerpc/perf: Add macros for defining event fields & formats
  powerpc/perf: Add a shared interface to get gpci version and capabilities
  powerpc/perf: Add 24x7 interface headers
  powerpc/perf: Add hv_gpci interface header
  powerpc: Add hvcalls for 24x7 and gpci (Get Performance Counter Info)
  sysfs: create bin_attributes under the requested group
  powerpc/perf: Enable BHRB access for EBB events
  powerpc/perf: Add BHRB constraint and IFM MMCRA handling for EBB
  ...
2014-04-02 13:42:59 -07:00
Shivaprasad G Bhat 0de7f8a917 powerpc/powernv: hwmon driver for power values, fan rpm and temperature
This patch adds basic kernel enablement for reading power values, fan
speed rpm and temperature values on powernv platforms which will
be exported to user space through sysfs interface.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-03-24 09:48:22 +11:00
Guenter Roeck f76992b00a hwmon: (pmbus/ltc2978) Add support for LTM4676
The chip's programming interface is quite similar to LTC3880
and supports the same set of sensors.

Reviewed-by: Robert Coulson <rob.coulson@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-19 18:59:40 -07:00
Guenter Roeck a2e1510743 hwmon: (pmbus/ltc2978) Add new chip ID for LTC2974
LTC2974 datasheet revision C lists the chip ID for LTC2974 as 0x0213.

Reviewed-by: Robert Coulson <rob.coulson@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-05 21:52:06 -08:00
Guenter Roeck 648cd48c9e hwmon: Do not accept invalid name attributes
hwmon name attributes must not include '-', as specified in
Documentation/hwmon/sysfs-interface. Also filter out spaces,
tabs, wildcards, and newline characters.

Tested-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03 08:01:06 -08:00
Jingoo Han 768821a302 hwmon: (max6639) Use SIMPLE_DEV_PM_OPS macro
Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03 08:01:06 -08:00
Guenter Roeck a41a8927e7 hwmon: (lm95245) Make temp2_crit_hyst read-only
The hysteresis register is shared among both temperature sensors.
This means changing one also affects the other. To avoid confusion,
established way to express this is to make only the first instance writable
and keep all other instances as read-only. Otherwise users may be
confused that changing the second writable value also affects the first,
while it is more obvious that a writable value may affect a different
read-only value.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-03-03 08:01:06 -08:00
Guenter Roeck 7276d55e62 hwmon: (lm95245) Convert to use devm_hwmon_device_register_with_groups
Simplify code, reduce code size, and attach hwmon attributes
to hwmon device.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-03-03 08:01:06 -08:00
Guenter Roeck ce50e7faf1 hwmon: (lm95245) Drop useless debug message
It doesn't provide value to get a log message whenever the driver
updates its cached data, so drop the message.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-03-03 08:01:06 -08:00
Guenter Roeck 408c15eaca hwmon: (lm95245) Fix hysteresis temperatures
Hysteresis temperatures are defined as absolute temperatures,
not as delta value from the critical temperatures.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-03-03 08:01:06 -08:00
Guenter Roeck 7981c5846a hwmon: (max6639) Convert to use devm_hwmon_device_register_with_groups
Simplify code, reduce code size, and attach sysfs attricutes to hwmon device.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-03-03 08:01:06 -08:00
Guenter Roeck c1ea0a0431 hwmon: (max6639) Introduce local dev variable, and reduce noisiness
Introduce local variable 'dev' in probe function to make code easier
to read. Also drop dev_info message in probe to reduce noisiness
during boot.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-03-03 08:01:06 -08:00
Guenter Roeck 71ba0f315c hwmon: (max6650) Introduce local 'dev' variable
This makes the code a bit easier to read.

Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03 08:01:06 -08:00
Guenter Roeck 0b5e33b632 hwmon: (max6650) Drop error message after memory allocation failures
The core code already generates an error message.

Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03 08:01:05 -08:00
Guenter Roeck 17eaa25c3e hwmon: (max6650) Convert to use devm_hwmon_device_register_with_groups
Simplify code, reduce code size, and attach sensor attributes
to hwmon device.

Reviewed-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03 08:01:05 -08:00
Guenter Roeck 1577f94bce hwmon: (max6650) Rearrange code to no longer require forward declarations
Cleanup only; no functional change.

Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03 08:01:05 -08:00
Guenter Roeck 6c588b45b0 hwmon: (ltc4215) Convert to devm_hwmon_device_register_with_groups
Simplify code, reduce code size, and attach sysfs attributes to hwmon device.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-03-03 08:01:05 -08:00
Guenter Roeck d72d19c26c hwmon: (coretemp) Convert to use devm_hwmon_device_register_with_groups
Simplify code, reduce code size, and attach sysfs attributes to hwmon device.

For this driver, the only attribute created is the name attribute.
Other attributes are still created and removed dynamically as cores
are added or removed.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jean Delvare <jdelvare@suse.de>
2014-03-03 08:01:05 -08:00
Guenter Roeck c503a811e4 hwmon: (coretemp) Allocate platform data with devm_kzalloc
This simplifies error handling.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jean Delvare <jdelvare@suse.de>
2014-03-03 08:01:05 -08:00
Guenter Roeck 1075305de4 hwmon: (coretemp) Use sysfs_create_group to create sysfs attributes
Instead of creating each attribute individually, use sysfs_create_group
to create all attributes for one core with a single call.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jean Delvare <jdelvare@suse.de>
2014-03-03 08:01:05 -08:00
Guenter Roeck 4fa6cbb1b8 hwmon: (ltc4245) Remove devicetree conditionals
Devicetree functions are stubbed out if CONFIG_OF is undefined.
Therefore, conditional compilation is unnecessary and can be removed.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-03-03 08:01:05 -08:00
Guenter Roeck bdd41aae69 hwmon: (ltc4245) Drop debug messages
The debug messages in this driver have little if any value. Drop them.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-03-03 08:01:04 -08:00
Guenter Roeck 94c42cf9a1 hwmon: (ltc4245) Use device managed function to register hwmon device
This simplifies the code and reduces code size.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-03-03 08:01:04 -08:00
Guenter Roeck 5230551a26 hwmon: (max1668) Convert to use devm_hwmon_device_register_with_groups
Simplify code, reduce code size, and attach hwmon attributes to hwmon device.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-03-03 08:01:04 -08:00
Guenter Roeck c5a706697f hwmon: (max1668) Don't hide return value from i2c_smbus_write_byte_data
i2c_smbus_write_byte_data returns a valid error code.
Return it to the user instead of replacing it with -EIO.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-03-03 08:01:04 -08:00
Guenter Roeck b4c9c1a798 hwmon: Driver for TI ADC128D818
ADC128D818 is a System Monitor with Temperature Sensor. It is similar to LM80
and LM96080, but has 16 bit wide sensor registers and no fan speed monitoring.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03 08:01:04 -08:00
Jean Delvare ebf5e87791 hwmon: Sort Kconfig entries alphabetically
Entries have been added at more or less random positions over time, so
it becomes difficult to find what you are looking for or figure out
where to insert new entries.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03 08:01:04 -08:00
Jean Delvare f91d22fc3e hwmon: (lm95245) Avoid initializing the same field twice
data is kzalloc'd, so data->valid is already 0.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03 08:01:04 -08:00
Jean Delvare a5589cf193 hwmon: (lm95241) Avoid initializing the same field twice
data is kzalloc'd, so data->valid and data->model are already 0.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03 08:01:04 -08:00
Guenter Roeck 9bf3babf3f hwmon: (emc2103) Return error from i2c_smbus_read_byte_data
There is no reason to replace one error with another.

smatch message:
drivers/hwmon/emc2103.c:352 set_fan_div() info: why not propagate 'status'
from i2c_smbus_read_byte_data() instead of (-5)?

Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03 08:01:04 -08:00
Guenter Roeck f44e5c5cf9 hwmon: (smm665): Return error from i2c_smbus_read_word_swapped
There is no reason to replace one error code with another,
and returning -1 as error code is wrong anyway.

Smatch log:
drivers/hwmon/smm665.c:225 smm665_read_adc() info: why not propagate 'rv'
from i2c_smbus_read_word_swapped() instead of (-1)?

Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03 08:01:03 -08:00
Axel Lin 2065bdd64c hwmon: (ltc4260) Fix trivial typo
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03 08:01:03 -08:00