* changes:
regulator: map consumer regulator based on device tree
regulator: pass additional of_node to regulator_register()
regulator: adapt fixed regulator driver to dt
regulator: helper routine to extract regulator_init_data
regulator: Constify constraints name
regulator: Properly register dummy regulator driver
dt: add empty dt helpers for non-dt build
copper: regulator-stub: Add devices for Krait Power Control
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>
There's no need for the API to modify it and having it const makes it
easier to use with random strings the board code has.
Change-Id: Icd7e600291f281e80f60ef857c22f22cba08bfc1
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
[mbohan: port MSM regulator drivers to new const type]
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Use mechanical switch on the phone jack to detect headset/headphone
insertion and removal. Mechanical switch is beneficial to avoid fake
button press and high impedance microphone headset detection.
CRs-fixed: 341402
Change-Id: Idffba14316ab25e07736d1b7385f0edb16216089
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Add support for the new LDO regulator which was recently added to
the design of the PMIC PM8917. LDO 36 is a 50 mA PMOS LDO.
Overall regulator changes between PMIC PM8921 and PMIC PM8917:
PM8917 adds: 7 PMOS LDOs (L30-L36) and 1 boost regulator
PM8917 removes: negative charge pump (NCP), HDMI medium voltage
switch (MVS), and low voltage switch (LVS) 2
Support for other PM8917 regulators differences was been added in
a previous change.
Change-Id: I634c366d418d682f0cf3a3d8bc270063f7aee3cd
Signed-off-by: David Collins <collinsd@codeaurora.org>
If HPHL and HPHR have relatively high impedance, internal MBHC HPHL
trigger cannot trigger so results in headphone/headset detection
failure.
Utilize MIC trigger as well as HPHL trigger in order to detect headphone
and headset which have high impedance on headphone line.
CRs-fixed: 339390, 337590, 336847, 334339
Change-Id: Ibfd4ba254197233f2b5e253f5d1fa2a98c848c97
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Register a PMIC pm8xxx thermal alarm device in the pm8018-core
driver. This device will allow userspace to monitor the
temperature of the PMIC die.
Change-Id: I888c0737dd991da9eaec039b20b381a2bfd7923c
Signed-off-by: David Collins <collinsd@codeaurora.org>
This function is called from more places than just exit
functions. Also remove the _init/__exit markings from the header
file as they're not necessary in function prototypes.
WARNING: vmlinux.o(.devinit.text+0x7840): Section mismatch in
reference from the function pm8038_add_subdevices() to the
function .devexit.text:pm8xxx_irq_exit()
The function __devinit pm8038_add_subdevices() references
a function __devexit pm8xxx_irq_exit().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __devexit annotation of
pm8xxx_irq_exit() so it may be used outside an exit section.
Change-Id: I0d2e285a03958e0fe68af48df94523aa1d0476c0
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
In some targets there might not be any platform data
for PWM driver, and its a valid case. On such target
check for the NULL pointer for the platform data.
Change-Id: If534b172f916e639491256a2346dd7bdd9a7cbcd
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
PM8921 LPG banks can be configured to connect to DTESTx.
These DTEST lines can be used to observe LPG output.
Provide a feature that allows to enable DTEST modes for
a given LPG channel.
CRs-fixed: 337902
Change-Id: If881eb089aea2a66f7324af8ac906405eef4f81a
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
Add support for 5 RX and 4 TX Slimbus channel support.
Headphone/Earphone/4 DMIX/2 AMIC and IIR1 support
Change-Id: I1b7ad5e5fd9d87aab80d6533503371e63df8cc0a
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
The current core assumes TABLA as the only codec driver registering.
To support single binary for multiple targets its essential that
we remove this restriction and move to a generic framework
to support multiple codec. This can be done by moving all codec
specific code to dedicated codec driver and use core driver to probe
the codec based on slimbus device id and do generic setup for the
codec. This also helps to have same boards with different flavours
of codec variants.
The WCD9XXX family of codecs share the initial codec register
mapping which holds the Slimbus device id to identify the
codec existing on the target.Core driver now registers the
codec device based on this check.
Change-Id: I4c43d5f04c20696f4f5138411460681ec7879d34
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
Remove TABLA reset GPIO configuration from CODEC Driver since it is
now added to the board-8960-pmic table & board-8064-pmic table.
Change-Id: I1d2839baa9270c6343b5ad8ffb6013be1e53cfc3
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
WARNING: drivers/mfd/built-in.o(.text+0x3750): Section mismatch
in reference from the function pm8901_probe() to the function
.devinit.text:pm8xxx_irq_init()
The function pm8901_probe() references
the function __devinit pm8xxx_irq_init().
This is often because pm8901_probe lacks a __devinit
annotation or the annotation of pm8xxx_irq_init is wrong.
Change-Id: I4d6ea52fdacad73bed80e3f5be3e9e08cc49be65
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Add support for the new regulators available on PMIC PM8917
beyond those present on PMIC PM8921.
Regulator changes between PMIC PM8921 and PMIC PM8917:
PM8917 adds: 6 PMOS LDOs (L30-L35), 1 boost regulator
PM8917 removes: negative charge pump (NCP)
Change-Id: I663c61277fb42301724230b73e93f819e55b08c4
Signed-off-by: David Collins <collinsd@codeaurora.org>
Rx share channel can be configured if slave port reaches the max value
(SB_PGD_RX_PORT_MULTI_CHANNEL_0_END_PORT_ID).
Change-Id: Iaf227e6c36e505b68823d1b4a822c3d9ca719573
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
The current mask and mask_ack callbacks assume that if config entry
for an interrupt is 0, then it must be a rogue interrupt.
This is not true because an interrupt number that is a multiple of 8
and is a RISING and FALLING edge triggered, will have a config entry
of 0. The driver incorrectly identifies such an interrupt as a rogue
interrupt and prints a warning.
Fix this by using the PM_IRQF_WRITE flag to indicate a requested
interrupt.
Change-Id: I187276a19a4f74712498a7c799dba27858ca784b
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
This call configures the XO to the MP3 clocks. These
clocks route over PMIC gpios and are used as an independent
clock source for MP3, haptics.
Change-Id: Ib95f277eae8bcb9a7e9da12fc5fe2baec4e72493
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
Dereference of tabla structure's content without checking if tabla
is NULL will cause a crash.
Jumping to label fail will cause tabla to be not freed and hence
a memory leak.
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
Change-Id: I4ad10f5ef4d051dc2f881dc385ae2690c590d042
Add the support to instantiate the Codec driver for a given
version of WCD9310 Codec device.
CRs-fixed: 329058
Change-Id: Id1389fba46578ed290105752e16becd5fc731201
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
For PMIC PM8917, the PMIC_REV_2 register will read back 0x0C, not
0x12. Correct this in the pm8921-core driver so that PM8917
chips are detected properly.
Change-Id: I3c6a52097488b20bbd7a90286fa230bc4cb4d1b2
Signed-off-by: David Collins <collinsd@codeaurora.org>
pm8xxx_smpl_control currently sets power-off register values in
both the power-off and reset code paths for PM8018 and PM8921.
Correct this so that reset on sudden momentary power loss
(SMPL) works properly.
Change-Id: I1560a0f2d143c47056c14f6bc5fba21158d7fe39
CRs-Fixed: 336620
Signed-off-by: David Collins <collinsd@codeaurora.org>
Previously, DSP used to setup the data path towards the
codec via slimbus. Now, the data path setup is broken into
two parts - one half of the path setup between apps to slimbus
and the other half from DSP. This configuration mode is
required to reduce overflow or underflow errors. Also this is
required to handle a configuration where mdm can talk
directly to codec.
Change-Id: Ic9f20b8a2f8a8eb355c07565ec80ec947a7a7337
Signed-off-by: Bharath Ramachandramurthy <bramacha@codeaurora.org>
The wcd9310 codec driver which is slimbus slave can access codec
registers when slimbus is suspended.
This can cause register read/write failure.
Fix to make sure slimbus is awake before accessing wcd9310 codec's
registers through slimbus.
CRs-fixed: 331338
Change-Id: Iddbdb1614c18dab4bee4f0cc7951884f34cb7173
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Add leds as a sub device to pmic 8038. This will also
take care of filling platform data for leds driver
which comes as part of pmic pdata.
Change-Id: I3814a0f36f79612684e4a2305e3c5c19dc64cb00
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
Update PMIC version macro with the right value.
Change-Id: I48391ca0a3745d5b04d5d4c7dd6e7ccad250fafb
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
Unlike Tabla 1.x, Tabla 2.0 codec has different address of micbias 4
registers.
Check hardware version and access proper address when accessing
micbias 4 registers.
CRs-fixed: 330357
Change-Id: I5e12a6b15e82b00d2e238c21d795fdc189ead6a5
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Specify the SSBI test register address for each of the voltage
switches in PMIC 8018, 8038, and 8921 core drivers. This will
allow for future handling of over current protection (OCP) in
the pm8xxx-regulator driver.
Also define the OCP IRQs associated with each of the switches
on these PMICs.
Change-Id: Icfc51c01680e6e95b4348051c764f16cb91b4916
Signed-off-by: David Collins <collinsd@codeaurora.org>
PM8921 family provides a pullup enable bit to support USB ID.
Add the API for such support.
Change-Id: Id3056af070080c1c12f27720020ae718fc6f34f6
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
Adapt the driver to take into consideration LPG
architecture of pmic 8038 and 8922. It does not
support 7-bit mode yet.
Change-Id: Ibfca90aae6fd9c90025af5364e1dcaf4a8bb3033
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
Add pre-divide=6 and update the max period based on new pre-divide.
Also update pre-divide related macros for better readability.
Change-Id: I5298c373c78f8723dab9a735e4d94f89798800d5
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
When a non requested interrupt triggers, the genirq ends up calling
mask or mask_ack callback. This callback is expected to mask that
interrupt so it doesn't trigger us further.
There is a bug in the pm8xxx-irq driver where config[] entry for an
unrequested irq remains empty. So the mask or the mask_ack callback
ends up masking 0th interrupt.
Fix the mask and mask_ack callback to check if config[] is empty, if
so fill it in right then and mask the irq.
Change-Id: I85d3bfff92c52a1c3eb8123a9c3757660e20fac6
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
The PMIC PM8917 chip is very similar to the PM8921 chip. Modify
the pm8921-core driver so that it can also handle PM8917 chip
which has different number of gpios and mpps, and no LPG/PWM,
no LEDs and no vibrator.
Change-Id: I252adc2ddc4bcd9bb8b8fb5113444356ba7c969e
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
Add a new API, pm8xxx_preload_dVdd, which will preload the dVdd
regulator on PMIC PM8901 chips during off state. This can help
to reduce fluctuations in the dVdd voltage during startup at the
cost of additional off state current draw.
This API should only be called if dVdd startup issues are
suspected.
Change-Id: Ic7ee60539de37a761bb9ca6c5200327a7b99da89
CRs-Fixed: 326086
Signed-off-by: David Collins <collinsd@codeaurora.org>
Enable charger and bms devices to make sure they are probed
on 8930.
Change-Id: I4917de40a672628bab868260b280cfb580668e4e
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
Compare each search result (cur_err) directly with the best
result (best_err) without using local result in the loop for m.
This simplifies the code and makes it cleaner.
Change-Id: Icb6d19e1a14662b00bf7172ca6a7413fbe969cbc
Signed-off-by: Willie Ruan <wruan@codeaurora.org>