Commit Graph

1457 Commits

Author SHA1 Message Date
Rohit Vaswani
a76e99abc5 Merge branch 'Linux 3.0.21' into msm-3.0
Merge Upstream's stable 3.0.21 branch into msm-3.0
This consists 814 commits and some merge conflicts.

The merge conflicts are because of some local changes to
msm-3.0 as well as some conflicts between google's tree and
the upstream tree.

Conflicts:
	arch/arm/kernel/head.S
	drivers/bluetooth/ath3k.c
	drivers/bluetooth/btusb.c
	drivers/mmc/core/core.c
	drivers/tty/serial/serial_core.c
	drivers/usb/host/ehci-hub.c
	drivers/usb/serial/qcserial.c
	fs/namespace.c
	fs/proc/base.c

Change-Id: I62e2edbe213f84915e27f8cd6e4f6ce23db22a21
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2012-03-30 00:09:34 -07:00
Siddartha Mohanadoss
eb90c92bb7 hwmon: epm: Add file interface support
Add IOCTL to initialize the I2C expander and SPI
initialization for ADS ADC. Clients issue a request
to initialize and enable the device before issuing
requests to perform an ADC read.

The file interface is necessary since it takes
considerable amount of time to initialize the
I2C expander and the ADS ADC device for every
ADC read transaction.

Change-Id: I9e830232592288cbc41554070c70882f05c842ce
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2012-03-28 19:25:26 -07:00
Linux Build Service Account
d3e0aab89f Merge "hwmon: pm8xxx-adc: Fix Buffer overflow" into msm-3.0 2012-03-25 00:56:45 -07:00
Siddartha Mohanadoss
53c16f91fb msm: hwmon: Add EPM ADC driver
External Power Monitor(EPM) uses the external ADS1158 ADC
to measure voltage and current. Each ADS1158 ADC supports
measuring 16 Analog input channels.

APQ8064 has support for 2ADS ADC and can measure upto 32
analog input channels. The power to the EPM uses a
SX1509 I2C expander to enable the ADS ADC. Depending on
the input channel the appropriate chip select is de-asserted
to select the ADS ADC to measure the input signal. The
ADS1158 chip is configured through the SPI interface.

Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Change-Id: Ib9f36606b6b183f75754b7763dbe45455c779327
2012-03-23 11:12:20 -07:00
Siddartha Mohanadoss
cb6d300f6c hwmon: pm8xxx-adc: Fix Buffer overflow
Use the maximum number of channels added in the
ADC entry list in the board to check for channel
validity. This patch also adds additional checks
in the driver to validate the requested channel.

CRs-Fixed: 339631
Change-Id: I347f0d39a00b6ee12976ec2c24843626b54617d4
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2012-03-22 22:01:42 -07:00
Linux Build Service Account
ac7952d778 Merge "hwmon: msm_adc: Fix section mismatches" into msm-3.0 2012-02-26 04:31:41 -08:00
Stephen Boyd
3c9bd8f4cf hwmon: msm_adc: Fix section mismatches
WARNING: drivers/hwmon/built-in.o(.text+0x1204): Section mismatch
in reference from the function msm_adc_probe() to the function
.devinit.text:msm_rpc_adc_init()
The function msm_adc_probe() references
the function __devinit msm_rpc_adc_init().
This is often because msm_adc_probe lacks a __devinit
annotation or the annotation of msm_rpc_adc_init is wrong.

Change-Id: I277124f27f732bdf411533225459cd26c39572eb
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2012-02-22 17:18:24 -08:00
Siddartha Mohanadoss
2c546d33b1 hwmon: pm8xxx-adc: Fix error handling conditions
a) Fix returning error code back to clients when pa_therm
power enable fails and call regulator_get once at init for
pa_therm instead of every enable call.
b) Fix checking for the pm8xxx_adc probe has succeeded before
allowing clients of MPP configure and read to issue requests.

CRs-Fixed: 338187
Change-Id: I4c14d8e63429779b611d550ca699a0822c01d1c9
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2012-02-22 13:46:33 -08:00
Guenter Roeck
eb521fbb33 hwmon: (w83627ehf) Fix number of fans for NCT6776F
commit 585c0fd8216e0c9f98e2434092af7ec0f999522d upstream.

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>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-13 11:06:10 -08:00
Vivien Didelot
0b4e972693 hwmon: (sht15) fix bad error code
commit 6edf3c30af01854c416f8654d3d5d2652470afd4 upstream.

When no platform data was supplied, returned error code was 0.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-03 09:19:02 -08:00
Guenter Roeck
70c3e9e414 hwmon: (w83627ehf) Disable setting DC mode for pwm2, pwm3 on NCT6776F
commit ad77c3e1808f07fa70f707b1c92a683b7c7d3f85 upstream.

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>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-03 09:19:01 -08:00
Jean Delvare
c39714f1da hwmon: (f71805f) Fix clamping of temperature limits
commit 86b2bbfdbd1fcc4a3aa62ccd3f245c40c5ad5b85 upstream.

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>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-03 09:19:01 -08:00
Siddartha Mohanadoss
402673e9a0 hwmon: pm8xxx-adc: Fix reading sysfs for vbatt
The memory where the sysfs attribute is stored on
initialization gets overwritten causing invalid length
on the vbatt sysfs reading. Fix it by removing the
dynamic memory allocation for BTM parameters.

Change-Id: If8b88c9460b0018a159688b5ba28798d97e0b0b6
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2012-01-26 17:26:45 -08:00
Siddartha Mohanadoss
ef10213c2f mfd: pmic8038-core: Add HK/XOADC device
HouseKeeping ADC (HKADC) on the PMIC is used by clients
to measure voltage, current and temperature. Clients
include the Battery, Charger and Thermal clients that
require reading the ADC in real time. This also
supports reading the ADC channels that are mapped through
the PMIC MPP's such as the PA THERM channel.

Change-Id: I3c4fd9d368550c1cca168ea097e0d457d01d695e
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2012-01-06 18:15:08 -08:00
Jean Delvare
ccd5790e5f hwmon: (coretemp) Fix oops on CPU offlining
This is for stable kernel branch 3.0 only. Previous and later versions
have different code paths and are not affected by this bug.

This is the same fix as "hwmon: (coretemp) Fix oops on driver load"
but for the CPU offlining case. Sorry for missing it at first.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-21 12:57:41 -08:00
Axel Lin
cadacbdef3 hwmon: (jz4740) fix signedness bug
commit 0b57d7602b68f7b2786b2f0e22da39cbd4139a95 upstream.

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>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-21 12:57:39 -08:00
Siddartha Mohanadoss
866fe9f914 hwmon: pm8xxx-adc: Set the trim bit in the RSV register
Default value read from the RSV register is 0 when the driver
is initialized. Set the TRIM bit for every read during the
configuration. Setting this bit improves the PON OCV readings
done by the BMS controller as part of the XOADC calibration
routine.

Change-Id: I164897c053e3dad08612739f5df9ee28cf5e06d3
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2011-12-16 13:21:25 -08:00
Siddartha Mohanadoss
37e6fc0bf7 hwmon: pm8xxx-adc-scale: Change scaling function
Modify the scaling function routines for Battery temperature
and all channels whose units return milli-volts for voltage.

The Charger driver requires the Units of Voltage and temperature
in uV and 0.1 DegC according to the framework where all voltages,
currents, chargers, energies, time and temperature are in uV, uA,
uAh, uWh, seconds and tenths of degree Celsius unless otherwise
stated. In accordance with the above expected units, the scaling
functions are modified for all voltage channels and the Batt Therm.

This change fixes the XO Therm temperature scaling routine,
PA Therm and Batt id to use the ratiometric calibration.
XO Therm and PA therm units are returned as milli-degree and
degree Centigrade respectively.

Accordingly, update the clients of xoadc to handle this change in
units.

CRs-Fixed: 315797
Change-Id: I6fa3b808062563fef3b0e70cc694e3132421f735
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2011-12-16 10:16:03 -08:00
Siddartha Mohanadoss
68ceac1a4b hwmon: pm8xxx-adc: Limit BTM interval period
Due to a PMIC bug the interval time cannot be set greater than
or equal to 0x15. If a value of 0x15 or higher is set the
measurement interval time ends up reading the battery temperature
continously. Therfore limit the interval time to 0x14 if the input
value is equal or greater than 0x15.

Change-Id: If5a5d2bfe42741064f255ba1535301452960aca1
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2011-12-14 22:24:35 -08:00
Siddartha Mohanadoss
6217da090d hwmon: pm8xxx-adc: Fix setting disable bit for CNTRL register
Fix setting the disable bit in the BTM end routing by
writing 0 to the BTM control register.

Change-Id: Ic51664f7f5703dc314c5e46240dd18a001f764f1
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2011-12-13 20:23:05 -08:00
Jean Delvare
0500898d30 hwmon: (coretemp) Fix oops on driver load
This is for stable kernel branch 3.0 only. Previous and later versions
have different code paths and are not affected by this bug.

If the CPU microcode is too old, the coretemp driver won't work. But
instead of failing gracefully, it currently oops. Check for NULL
platform device data to avoid this.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Durgadoss R <durgadoss.r@intel.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 08:52:34 -08:00
Siddartha Mohanadoss
af91d9056d hwmon: pm8xxx_adc: Remove pm8921-adc
Switch clients to use pm8xxx-adc and remove pm8921-adc.
pm8xxx-adc supports PMIC HK/XOADC for 8960, 9x15, 8064
platforms.

Change-Id: Id27fa908cc097d52e6033c28ce243c6bcf64ed27
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2011-12-01 04:35:59 -07:00
Bryan Huntsman
d074fa2796 Merge remote-tracking branch 'common/android-3.0' into msm-3.0
* common/android-3.0: (570 commits)
  misc: remove kernel debugger core
  ARM: common: fiq_debugger: dump sysrq directly to console if enabled
  ARM: common: fiq_debugger: add irq context debug functions
  net: wireless: bcmdhd: Call init_ioctl() only if was started properly for WEXT
  net: wireless: bcmdhd: Call init_ioctl() only if was started properly
  net: wireless: bcmdhd: Fix possible memory leak in escan/iscan
  cpufreq: interactive governor: default 20ms timer
  cpufreq: interactive governor: go to intermediate hi speed before max
  cpufreq: interactive governor: scale to max only if at min speed
  cpufreq: interactive governor: apply intermediate load on current speed
  ARM: idle: update idle ticks before call idle end notifier
  input: gpio_input: don't print debounce message unless flag is set
  net: wireless: bcm4329: Skip dhd_bus_stop() if bus is already down
  net: wireless: bcmdhd: Skip dhd_bus_stop() if bus is already down
  net: wireless: bcmdhd: Improve suspend/resume processing
  net: wireless: bcmdhd: Check if FW is Ok for internal FW call
  tcp: Don't nuke connections for the wrong protocol
  ARM: common: fiq_debugger: make uart irq be no_suspend
  net: wireless: Skip connect warning for CONFIG_CFG80211_ALLOW_RECONNECT
  mm: avoid livelock on !__GFP_FS allocations
  ...

Conflicts:
	arch/arm/mm/cache-l2x0.c
	arch/arm/vfp/vfpmodule.c
	drivers/mmc/core/host.c
	kernel/power/wakelock.c
	net/bluetooth/hci_event.c

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
2011-11-16 13:52:50 -08:00
Linux Build Service Account
72a2b5ddf5 Merge "hwmon: pm8xxx-adc: Merge pm8921-adc and pm8xxx-adc" into msm-3.0 2011-11-11 21:45:05 -08:00
Guenter Roeck
24b791339f hwmon: (w83627ehf) Fix broken driver init
commit bfa02b0da66965caf46e441270af87edda4fea14 upstream.

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>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-11 09:37:00 -08:00
Jean Delvare
e3c298129b hwmon: (w83627ehf) Properly report PECI and AMD-SI sensor types
commit 2265cef2751b3441df91f85e0107f9f549e5b711 upstream.

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>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-11 09:37:00 -08:00
Jean Delvare
0fb2a32e2c hwmon: (coretemp) Fix for non-SMP builds
commit 2aba6cac2a84f3b80e11a680c34d55e7739b474d upstream.

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>
Acked-by: Durgadoss R <Durgadoss.r@intel.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-11 09:36:59 -08:00
Linux Build Service Account
89d5d6c47c Merge "hwmon: msm_adc: Calibrate HK/XOADC" into msm-3.0 2011-11-10 01:11:51 -08:00
Siddartha Mohanadoss
ae39c90df6 hwmon: pm8xxx-adc: Merge pm8921-adc and pm8xxx-adc
Merge changes from pm8921-adc to pm8xxx-adc. The
changes are modification to the BTM lookup table
to map voltage vs temperature instead of A/D word
vs temperature and reverse calibration on the
input voltage read for BTM. Fix setting the
mpp_scale value to avoid compile error.

This keeps the pm8xxx-adc and pm8921-adc
functional code as the same except for the name
change allowing future patch to remove the
pm8921-adc driver.

Change-Id: I03a0b809cd232f7fe8dff86248651c9a2593be29
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2011-11-09 22:07:10 -08:00
Vijayakumar Muthuvel Manickam
2d2a2c595a hwmon: msm_adc: Calibrate HK/XOADC
Calibration for HK/XOADC is done once at init by
msm_adc before the first ADC reading is processed.

Calibration performed for every ADC read is expensive
and not recommended. Remove support to request
calibration by ADC clients.

Add stubs for pmic8058 xoadc functions to fix
featurization

Change-Id: I7f0e165bddaa49c5daf33df5ed77428ccc1434c5
Signed-off-by: Vijayakumar Muthuvel Manickam <vmuthuve@codeaurora.org>
2011-11-08 15:52:36 -08:00
Siddartha Mohanadoss
b377415f17 hwmon: pm8921-adc: Add reverse calibration for BTM
-Change BTM threshold table to map temperature vs
input voltage instead of temperature vs A/D word.
Apply reverse calibration to convert the input
voltage to A/D word.
-Fix representing low/high threshold voltage as
a signed int.

CRs-Fixed: 313653
Change-Id: Ib565c672130f8a246a05636c1353ef0d5b373b7d
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2011-11-01 11:17:45 -07:00
Siddartha Mohanadoss
92ea87a12d hwmon: pm8921-adc: request's done late into suspend
-Add checks in the driver for suspend_noirq/resume_noirq
to prevent clients from invoking the driver for ADC requests
after suspend has begun. This will lead to interrupts being
lost since the request is done very late into suspend.
-Obtain a wakelock when an ADC request is occuring.

Change-Id: I19c9b2f22b92d2729baa8b31f14966410e39af14
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2011-10-26 16:57:21 -07:00
Jean Delvare
63e010153f hwmon: (w83627ehf) Fix negative 8-bit temperature values
commit 133d324d82e144588939ad25b732b5b6c33b03d9 upstream.

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>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-25 07:10:17 +02:00
Jean Delvare
05ffb6746c hwmon: (w83627ehf) Properly report thermal diode sensors
commit bf164c58e58328c40ebc597a8ac00cc6840f9703 upstream.

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>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-25 07:10:14 +02:00
Siddartha Mohanadoss
17607d277e hwmon: pm8xxx-adc: Add PM8018 ADC Driver
PM8921 and PM8018 have a common ADC module. Difference's
are in the channel supported on individual PMIC's and
in the MPP mapping to the ADC device.
MPP configuration on PM8018 is not required. The MPP
is directly connected to the AMUX pre-mux channel.

Change-Id: I9aed3366f20e3985962119274d8b2865b7054a79
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2011-10-18 09:22:12 -07:00
Siddartha Mohanadoss
77d106ea89 hwmon: pm8921-adc: Add sysfs interface
-Add sysfs interface to read PM8921 HK/XOADC
and thermistor temperature measurements mapped
through MPP's.
-Move PM8921 ADC from directory /drivers/mfd to
/drivers/hwmon for userspace clients to read ADC
through hwmon.

CRs-Fixed: 302365
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>

Conflicts:

	drivers/mfd/Kconfig
2011-10-04 17:14:12 -07:00
Roland Stigge
a0dbac4607 hwmon: (ds620) Fix handling of negative temperatures
commit cc41d586e8b4d76164fe7731c1c49be6cc5fc7e6 upstream.

Signed (negative) temperatures were not handled correctly.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:41:05 -07:00
Guenter Roeck
a677ecd3c4 hwmon: (max16065) Fix current calculation
commit ff71c182f461da5ae9d2d65f8a63f5a9193b9be1 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:40:12 -07:00
Bryan Huntsman
3f2bc4d6eb Initial Contribution
msm-2.6.38: tag AU_LINUX_ANDROID_GINGERBREAD.02.03.04.00.142

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
2011-10-03 09:57:10 -07:00
Julia Lawall
8282be4dd5 hwmon: (ibmaem) add missing kfree
commit 66a89b2164e2d30661edbd1953eacf0594d8203a upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-17 10:55:53 -07:00
Pavel Herrmann
d3f684f282 hwmon: (max1111) Fix race condition causing NULL pointer exception
spi_sync call uses its spi_message parameter to keep completion information,
using a drvdata structure is not thread-safe. Use a mutex to prevent
multiple access to shared driver data.

Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Cyril Hrubis <metan@ucw.cz>
Tested-by: Stanislav Brabec <utx@penguin.cz>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org
2011-07-17 18:39:19 +02:00
Jean Delvare
fa8b69758e hwmon: (it87) Fix label group removal
A copy-and-paste error caused it87_attributes_vid to be referenced
where it87_attributes_label should be. Thankfully the group is only
used for attribute removal, not attribute creation, so the effects of
this bug are limited, but let's fix it still.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-07-17 18:39:19 +02:00
Luca Tettamanti
0b8e77f12c hwmon: (asus_atk0110) Fix memory leak
The object returned by atk_gitm is dynamically allocated and must be
freed.

Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org
2011-07-17 18:39:18 +02:00
Guenter Roeck
7e97bbba62 hwmon: (adm1275) Fix coefficients per datasheet revision B
Coefficients to convert chip register values to voltage/current have been
slightly changed in revision B of the chip datasheet. Update driver coefficients
to match the coefficients in the datasheet.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2011-07-15 08:09:40 -07:00
Guenter Roeck
f450c1504d hwmon: (pmbus) Use long variables for register to data conversions
Using integer variable types for register to data conversions can cause
overflows especially for power calculations, which are in microwatt.
Use long variables instead.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 2.6.39+
2011-07-12 06:45:45 -07:00
Guenter Roeck
22e6b2312d hwmon: (pmbus) Improve auto-detection of temperature status register
It is possible that a PMBus device supports the READ_TEMPERATURE2 and/or
READ_TEMPERATURE3 registers but does not support READ_TEMPERATURE1.
Improve temperature status register detection to address this condition.

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>
Cc: stable@kernel.org # 2.6.39+
2011-07-10 08:54:29 -07:00
Guenter Roeck
0c2a40e2fe hwmon: (lm95241) Fix negative temperature results
Negative temperatures were returned in degrees C instead of milli-Degrees C.
Also, negative temperatures were reported for remote temperature sensors even
if the chip was configured for positive-only results.

Fix by detecting temperature modes, and by treating negative temperatures
similar to positive temperatures, with appropriate sign extension.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 2.6.30+
2011-07-10 08:54:15 -07:00
Guenter Roeck
27739e694a hwmon: (lm95241) Fix chip detection code
The LM95241 driver accepts every chip ID equal to or larger than 0xA4 as its
own, and other chips such as LM95245 use chip IDs in the accepted ID range.
This results in false chip detection.

Fix problem by accepting only the known LM95241 chip ID.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 2.6.30+
2011-07-08 17:52:59 -07:00
Linus Torvalds
b775c38925 Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  hwmon: (k10temp) Update documentation for Fam12h
  hwmon-vid: Fix typo in VIA CPU name
  hwmon: (f71882fg) Add support for the F71869A
  hwmon: Use <> rather than () around my e-mail address
  hwmon: (emc6w201) Properly handle all errors
2011-07-03 11:12:06 -07:00
Jean Delvare
014ab488e2 hwmon-vid: Fix typo in VIA CPU name
It's Nehemiah, not Nemiah.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-07-03 13:32:54 +02:00