Commit graph

301362 commits

Author SHA1 Message Date
Eugene Seah
3dd97375e9 thermal: Don't limit CPU frequency after msm_thermal is disabled
There may be an outstanding task to check for threshold crossing
when msm_thermal is disabled and CPU is restored to maximum
frequency. This task can get scheduled after the maximum frequency
is restored, and result in another mitigation that pins CPU
frequencies to 918mHz. This happens in the case that the final
temperature was still above the max temperature threshold.
This patch ensures any outstanding tasks are cancelled and flushed
before finally restoring the CPU frequencies.

CRs-fixed: 351614
Change-Id: Ifce00b379989b78856803ac09c7403207f5c998b
Signed-off-by: Eugene Seah <eseah@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:35 -08:00
Siddartha Mohanadoss
38cdcd9de6 mdm9615: Add calibration data for TSENS
MDM9615 has identical configuration for the number
of sensors and slope with MSM8960. Add support to
enable the TSENS for calibrated parts.

Change-Id: Ieb1f118ce916ab5a4f079b18b11541d86c3a5560
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
[davidb: only drivers/thermal]
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:34 -08:00
Eugene Seah
40d58c7a0d thermal: Fix hotplug race condition leading to memory corruption.
msm_thermal module made a copy of the CPUFreq policy structure
pointer but continues to try and use it after the core has been
hotplugged (and the original structure is freed). The fix is to
use cpufreq_cpu_get/put instead of copying cpufreq pointers.

CRs-fixed: 342351
Change-Id: I312d8bccc09a5df5805f99fecdc9409d9d4ed2be
Signed-off-by: Eugene Seah <eseah@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:33 -08:00
Siddartha Mohanadoss
e5cfe133b9 thermal: msm8960_tsens: Fix string length
Increase the character buffer to support the string length for
sensor10.

Change-Id: Ib1f49cea22604267f2a7fecb1eee4ef3e9e03615
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:32 -08:00
Siddartha Mohanadoss
6d72c9b1b4 thermal: msm8960_tsens: Fix setting mode for disabled sensors
Thermal driver in kernel currently requires the main sensor
to perform mitigation. Disable all the auxiliary sensors
and update the mode of the main sensor as being enabled during
TSENS init.

Round the converted temperature to the nearest degree.
Remove unwanted register reads added for debug and reference
to magic numbers in the code.

Change-Id: Id5652ba16f9adb462dc61266600f394901eee194
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:31 -08:00
Siddartha Mohanadoss
085efea37e thermal: msm8960_tsens: Add APQ8064 support
TSENS is used by the thermal daemon for thermal management.
On APQ8064 there are 11 TSENS sensors that can be used by the
thermal daemon to monitor the temperature across the chip.

TSENS for APQ8064 supports individual slope for each of the
sensors. The offset used in the temperature from each of the
slope is used for temperature calcuation from the ADC code.

Change-Id: I00457aff8d67ab3367882ffe1077af863b90bc49
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:30 -08:00
Praveen Chidambaram
ac6e574364 msm_thermal: Remove error messages from log when core is offline
If msm_thermal is not cancelled and TSENS reports a high temperature,
it might try to limit the frequency, but since the core is offline,
the frequency limit may not happen. We need not report this error.

Change-Id: I579e2329c6fb038d53f2d207a6a832185e633785
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:29 -08:00
Jeff Ohlstein
b1add6d969 thermal: msm8960_tsens: nullify tmdev when early_init fails
The initialization code uses the tmdev variable as an indicator as to
whether or not early initialization succeeded. However, when early init
fails, it only kfrees the pointer, it doesn't set it to NULL. This
causes us to dereference the now-freed pointer.

Additionally, squash the message that prints each time we fail to read
the temperature sensor, and print a warning to the kernel log when tsens
calibration data is not present.

Change-Id: Iab400cac687cdbc36d8c69541675c29a0b82c704
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:29 -08:00
Praveen Chidambaram
b729ce4ae8 msm: thermal: Add MSM thermal sensing and limiting
Add a thermal driver to poll and detect any thermal condition at boot
and limit max cpu frequency on a thermal condition. This driver is
intended to limit cpu thermal output until the userspace thermald
kicks in. The thermald will disable this driver and take over the
cpu thermal sensing and mitigation.

Change-Id: I2710bfdeb5bf01c864437e13da835621d1b9202c
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:28 -08:00
Siddartha Mohanadoss
2aa28c379d thermal: msm8960_tsens: Read TSENS temperature
Add kernel API to read TSENS temperature for clients
in the kernel space. Currently the TSENS driver only
supports reading the TSENS temperature from the
thermal sys.

Split the TSENS initialization into two parts.
First is to perform the initial calibration that is
used to convert the raw ADC code to Degrees Celcius
and initialize the TSENS HW. Second is to register the
TSENS driver to the linux thermal framework and create
the temperature zones that will be accessed by the
Thermal daemon to set thresholds, read the temperature
and receive notifications.

Change-Id: Id2305a7aa755e1e9cfaecd8b5c1870ed05d9b5e9
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:27 -08:00
Siddartha Mohanadoss
190ef70221 thermal: tsens: Change the TSENS min threshold
TSENS does not shutdown the device when the Min/Max
thresholds are crossed. Setting the thresholds to the
lowest allowed Min threshold covers cases if there is
a threshold check in the kernel driver outside of the
TSENS driver. Thermal daemon sets the lower/upper
thresholds and the TSENS sends all notification to the
daemon to take the appropriate action.

Change-Id: Icc72e27bf0b8b9184a891e024b280fc642e7e628
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:26 -08:00
Siddartha Mohanadoss
e2d2f6ecc5 thermal: tsens: Add tsens notify callback
TSENS driver does not handle the decision to shut down
the device on critical temperature events. The thermal
daemon is notified to take appropriate action.

The thermal sys framework expects the kernel driver to
handle critical events. If the kernel driver does not
have any provision to handle such events the thermal
sys takes action to shutdown the device. Adding the
notify api is to avoid such an action from the thermal sys.

Change-Id: I4bdddb5db040246df40389d3a487a22e66b0820f
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:25 -08:00
Siddartha Mohanadoss
7aeaff8075 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>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:24 -08:00
Siddartha Mohanadoss
3350fba23e thermal: msm8960_tsens: Fix reading the correct sensor4 address
Fix reading from the correct QFPROM sensor4 address for offset
value to calculate calibration.

Change-Id: I6b044a078b3b8f88802367044d773534ae679e05
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:23 -08:00
Anirudh Ghayal
4adbe847a9 mfd: pm8058: Modify pm8058 subdevices to pm8xxx interface
Move the following  subdevices to use the pm8xxx interface -
mpp, irq, gpio, keypad, power-key, leds, othc, vibrator,
rtc, batt-alarm, thermal, upl, nfc, pwm, xoadc, regulators,
xo-buffers, charger.

This allows usage of a common driver for modules which are same
across multiple PM8XXX PMICs. It also provides flexibility
to add/remove subdevices for multiple board configurations.

Change-Id: Id9795552fc9f4a2c920c070babfaef1f4cd6ca61
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
[davidb: Only drivers/thermal]
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:23 -08:00
Siddartha Mohanadoss
93da454787 tsens: msm8960: Split write ordering for TSENS Enable
Split the writes to the TSENS controller to first enable
the CLK in the first write and enable the TSENS block in
the following write.

Change-Id: Ia5116b6b7cb3a60f8dcc40b8558112d594c63357
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:22 -08:00
Siddartha Mohanadoss
59214a411c thermal: tsens8960: Fix setting initial return value
Set initial value for rc in calib sensors routine.

Change-Id: Id75d1fd094f33597a9693f2ea10fcd96116bb9d0
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:21 -08:00
Siddartha Mohanadoss
8968ae08cd thermal: tsens: Add suspend/resume for TSENS
TSENS does not operate reliably during VDD_CX minimization.
Incorrect temperature readings are reported on some instances
when Apps processor comes out of suspend. This leads the
TSENS interrupt being triggered in critical temperature zone.

Thermal sys takes drastic action of shutting down the phone
which is not desired. Hence remove updating the thermal sys
on temperature changes as its not required.

CRs-Fixed: 309855
Change-Id: Id6186b2a6032150273bc0d74d91c72db5a077ac7
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:20 -08:00
Siddartha Mohanadoss
74c1658ff9 thermal: tsens: Use Calibration offset data from QFPROM
Current code uses default calibration offset value. Switch
over to using Calibrated offset value read from the QFPROM
to calculate the slope and offset and compensate it with the
temperature read from TSENS.

Change-Id: Ifa839f284acb7d5bba07ff46d986eeebd2132dd2
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:19 -08:00
Siddartha Mohanadoss
2aa966117d thermal: tsens: Add support for MDM9615
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:18 -08:00
Siddartha Mohanadoss
6b2810f71d thermal: msm8960: Check for SOC version
8960 TSENS is not supported on V1 version. Enable it only
for V2 version.

Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:18 -08:00
Siddartha Mohanadoss
c965b5d997 thermal: msm: Update TSENS for 8960_V2
TSENS V2 supports reading from multiple sensors and
notifiying clients when the lower/upper thresholds
are reached. The lower/upper threshold use the last
sensors threshold that are set through the thermal sysfs.
TSENS HW is enabled only when the main sensor is requested.
The TSENS block is disabled if the main senors is disabled
irrespective of any other sensors that are being enabled.
When TSENS receives notification on temperature threshold
being reached, it checks and sends events to the sensors
that are enabled and whose thresholds are above the upper
or below the lower thresholds set in the tsens threshold
register.

Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:17 -08:00
Siddartha Mohanadoss
85c7cf8557 thermal: thermal_sys: Fix return value of trip_point_temp_set
Return the sizeof attribute as return value in place of the
return value on write to register to set the temperature.
The userspace uses the sizeof attribute as return value
to check for errors.

Change-Id: I14b023639245f2c81072d305fbfc08efb7aada1a
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:16 -08:00
Siddartha Mohanadoss
a25189bc72 thermal: thermal_sys: Add support for configurable trip points.
Add functionality for configurable hi, low and critical low.
Change the trip point attributes to allow userspace clients
with root access to set temperature for configurable hi and
low temperature.

Change-Id: I25c9c3bcfd58e44da5369187d1095559062f1860
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:15 -08:00
Abhijeet Dharmapurikar
95db9f4073 thermal: msm_tsense: fix request irq ordering
Triggering an irq might cause an update to the thermal zone device.
If the thermal zone device is not initialized then a kernel panic ensues.
Request the irq after the thermal devices have been initialized, this way
the isr will be called only after it is initialized.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
(cherry picked from commit 8e85855631a198d27d422cd680c051d0e948e276)

Change-Id: Ieaa753e870ea86d0c56860b4fe2faceba4c2451a
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:14 -08:00
Siddartha Mohanadoss
e4f930189a thermal: msm_tsens: Fix notify to userspace.
Fix notification of event to userspace on receving the
tsens interrupt on threshold temperature changes.

Change-Id: Idf818ed171f146ca38a1db2264bf2a17e55ecace
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:13 -08:00
Yan He
e4fa1d1481 thermal: msm_tsens: add calibration for Tsens
Add calibration for Tsens temperature calculation;
Rewrite the conversion functions between temperature degree and ADC code;
Set TSENS_CONFIG bits (bits 29:28 of TSENS_CNTL) to '01'
because this setting is found to be optimal.

Change-Id: Ie40abb1f11c43b60b9a5a58eb84d360b190a2d02
Signed-off-by: Yan He <yanhe@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:12 -08:00
David Collins
37855cfa03 thermal: pm8xxx: Add pm8xxx thermal management driver
Add a PMIC PM8xxx thermal management driver which handles
interrupts associated with thermal overload events and
which provides a means to read the current PMIC die
temperature.

Change-Id: I2063be9335be2971810358e82dd273e8a0acec5a
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-02-25 11:33:12 -08:00
Siddartha Mohanadoss
920345890d thermal: msm_tsens: Add temperature sensor driver
The msm_tsens driver provides temperature notification to
thermal sys driver once the set threshold temperature
is reached and supports configuring the temperature
thresholds. The thermal sys interface is used by userspace
clients to set the configurable temperature thresholds and
receive notification.

Change-Id: I4fcbd2d88a1d36b9eacaeca1925cfe2d3b72f3d9
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:11 -08:00
David Brown
14da380620 thermal: msm_popmem: Remove redundant license clause
Remove the superfluous FSF address from the license text.

Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:10 -08:00
Laura Abbott
6184204229 thermal: Add MSM POP memory thermal driver
Add msm_popmem-tm driver for monitoring the temperature of
MSM POP memory. The temperature reported is based off of
the refresh rate of the POP memory. The temperatures
are reported as follows:

Low Temperature: 25C
Normal Temperature: 50C
High (out of range) Temperature: 85C

Change-Id: Id299ac574745b2a5580ff9999dd514481468c184
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:09 -08:00
Gilad Avidov
435c79c85f spmi: pmic-arb: Don't disable arbiter interrupt when no clients use it
The GIC interrupt should not be firing when the arbiter interrupts
(peripheral interrupts) are disabled. So enabling/disabling the GIC
interrupt is not necessary. Remove those calls, and corresponding
reference counter logic.

Change-Id: Ice8d76ef255ec6c154c546dbd17807012558fe84
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:08 -08:00
David Brown
b97a84ef1c spmi: Add explicit module.h includes
Include module.h explicitly to allow compilation on 3.4.

Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:07 -08:00
Mahesh Sivasubramanian
e05ea771aa spmi: Fix compilation error when CONFIG_PM_RUNTIME is defined
<linux/pm_runtime.h> should be included to fix any compilation errors
associated with enabling the PM_RUNTIME config.

Change-Id: Ided562e1351ccb5eef8957c305060275a5679d42
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:06 -08:00
Michael Bohan
26044f088a of: spmi: Verify that nodes are available before creating devices
Device Tree allows for devices to be specified as disabled.
This is useful to override SoC specific configuration on boards
that may not have this device.

Change-Id: I77490f6d2f2634c526cf01a2b0da029ff0d51ef0
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:06 -08:00
Michael Bohan
2f929fdd57 of: spmi: Remove excessive loop in dev-container traversal
This factors out some code that is executed twice for no reason.

Change-Id: I562f41b05656dc6d8621859ef5b598869a61c28e
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:05 -08:00
Sagar Dharia
648766e533 slimbus: Add Device Tree support for SLIMBUS
Slave devices can be added by listing them as child of a SLIMBUS
controller of_node in the Device Tree.
It is required to specify elemental address, and name of the slave
device.

Change-Id: Ie1b2f8fe58988f0237547a84f1bbb14ce4733eff
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:04 -08:00
Michael Bohan
9a48a536f5 msm: qpnp: Make MSM_QPNP_INT depend on MSM_QPNP
MSM_QPNP provides the qpnp_get_irq() API that is used by
client drivers using QPNP interrupts.

Change-Id: I4556b07a2c6b8dfeda860ebac57be6eb14f216b1
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:03 -08:00
Michael Bohan
317a4316b4 of: of_spmi: Add support for spmi-dev-container binding
The spmi-dev-container binding is intended for SPMI
configurations that have multiple device nodes associated with
only one spmi_device. By default, if this flag is not specified,
each device node will create a new spmi_device.

Sometimes having multiple spmi_devices for SPMI device nodes is
superfluous. One example of this is gpios. In some architectures,
a single gpio is treated as a unique device. But from a gpio_chip
perspective, the chip is comprised of many gpios. Beyond wasting
memory allocating a unique spmi_device per gpio, the implication
of not coalescing spmi_devices is that the clients probe() routine
would be called N number of times. But this sort of behavior makes
it difficult to realize when a gpio_chip starts and stops. If we
assume that one gpio_chip represents one call to probe(), then
this problem is solved, since all gpios in that chip will be
passed as resources.

In order to support multiple device nodes per spmi_device, we
also need to extend the data structures for spmi_resources.

This change also makes an effort to cleanup some of the error
handling for illegal combinations of device bindings, as well as
adding some additional documentation.

Change-Id: If3ce2aaaa07bdf79e0d9fdedf16419e74a00fbec
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:02 -08:00
Michael Bohan
eca47776b5 of: of_spmi: Change name of spmi-dev-container
This binding is currently used to indicate all devices existing
in the same slave. Let's change the name to be more meaningful.
The real motivation here is that we want to introduce a new
binding to specify all qpnp devices existing in the same
spmi_device. So spmi-dev-container is a more meaningful name for
that usecase, and spmi-slave-container better describes the
former.

Change-Id: I48f834b9cff9ea90d05f5e958ca21bef0ab56a86
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:02 -08:00
Michael Bohan
158567a134 msm: Add QPNP interrupt support
QPNP is a Qualcomm SPMI based implementation that specifies 256
devices per SPMI slave ID, with up to 8 interrupts per device.
This brings the theoretical max interrupt support to 32768 per
bus for this architecture.

This driver implements the standard irq chip interfaces to
support QPNP. The chip driver is informed of Device Tree
configuration through a notifier interface. Once informed of an
interrupt, it will allocate resources on the fly. In order to
support this large logical interrupt range, we require SPARSE_IRQ
to be enabled.

This driver supports Device Tree interrupt specs with a cell size
of three. These are comprised of the the slave ID, peripheral ID
and irq number.

Change-Id: Ic7847bafe6598a84ab3650df7c95bb605aefbe62
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:01 -08:00
Michael Bohan
467d4fc6e4 msm: Add QPNP support routines
QPNP is a SPMI based PMIC architecture developed by Qualcomm.
This library constitutes routines that should be necessary for
most, if not all QPNP based devices. The goal is to minimize the
amount of code duplication.

Change-Id: I0fddfcef88416bba488480d790d1cf361d9e67ac
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:00 -08:00
Gilad Avidov
90f31c1a5d SPMI: new format for device tree data
reduce memory by compressing two values into one 32 bit integer.

Change-Id: I7c0bf7007df082fac53c1138ba45f1ecf77b2f83
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:32:59 -08:00
Kenneth Heitke
ece3ce45c6 spmi: Add MSM PMIC Arbiter SPMI controller
Qualcomm's PMIC Arbiter SPMI controller functions as a bus master and
is used to communication with one or more PMIC (slave) devices on the
SPMI bus.  The PMIC Arbiter is actually a hardware wrapper around the
SPMI controller that provides concurrent and autonomous PMIC access
to various entities that need to communicate with the PMIC.

The SPMI controller hardware handles all of the SPMI bus activity (bus
arbitration, sequence start condition, transmission of frames, etc).
This software driver uses the PMIC Arbiter register interface to
initiate command sequences on the SPMI bus.  The status register is
read to determine when the command sequence has completed and whether
or not it completed successfully.

Request Capable Slave (RCS) devices can initiate a master write
command sequence on the SPMI bus that the can be decoded by the
bus master and used to generate interrupts.

Change-Id: I037fefc946ccb5b8e0b04da856a3a96effe1c7e4
Signed-off-by: Kenneth Heitke <kheitke@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:32:58 -08:00
Kenneth Heitke
b2b4c69ecd spmi: Linux driver framework for SPMI
SPMI (System Power Management Interface) is a specification
developed by the MIPI (Mobile Industry Process Interface) Alliance
optimized for the real time control of Power Management ICs (PMIC).

SPMI is a two-wire serial interface that supports up to 4 master
devices and up to 16 logical slaves.  A physical PMIC device may
consist of multiple logical slave interfaces.

The framework supports message APIs, multiple busses (1 controller
per bus) and multiple clients/slave devices per controller.

Change-Id: Ib6319047b4ab9cea6dfb0879312c4c1f63462439
Signed-off-by: Kenneth Heitke <kheitke@codeaurora.org>
2013-02-25 11:32:57 -08:00
Michael Bohan
bb75acd691 of: Add Device Tree support for SPMI
This change adds SPMI Device Tree parsing. The
of_spmi_register_devices() API should be called from the probe()
routine of each SPMI controller to parse the subtree and add the
respective SPMI devices.

The SPMI subtree is nested up to two levels deep. The first level
is the most basic and treats the address as the SPMI slave ID.
This should be used for simple devices that has no notion of
segmented SPMI address spaces.

An optional second level specifies the address as an offset
within the outer layer's slave ID. This is used to specify
multiple devices on the same slave ID that have different address
ranges. In fact, it's reasonable to specify any number of address
ranges at this level.

Devices can also specify any number of interrupts that's decoding
is done by an external interrupt device.

Sections of this code were taken from drivers/of/platform.c.

Change-Id: Ib9f06764a9bd85e3b2aab43b72aa7132885aa044
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:32:57 -08:00
David Brown
3db739bbbc slimbus: Add Qualcomm Slimbus driver
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:32:56 -08:00
Harini Jayaraman
96e12bb8c8 spidev: Unregister SPI device on spidev exit
The spidev module is not being removed cleanly since
the SPI device is not being unregistered.

Change-Id: I1f97163b3eef585b420a474cdd2aacc7657e6254
Signed-off-by: Harini Jayaraman <harinij@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:32:55 -08:00
Harini Jayaraman
b78487fdc5 spidev: Return suitable error code when a new SPI device cannot be created
Change-Id: I4d5d611a64d8fac4c643e8eb454056ab939eff99
Signed-off-by: Harini Jayaraman <harinij@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:32:54 -08:00
Harini Jayaraman
c3fcc5ece6 spidev: Fixing bug with rx buffer
Adding a seperate rx buffer for spidev. This allows errors
in transmission to be noticed.

Change-Id: I02258bccf1a4a5543b94c30f51294185498c3c40
Signed-off-by: Harini Jayaraman <harinij@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:32:53 -08:00