Commit Graph

1552 Commits

Author SHA1 Message Date
Linux Build Service Account
fcda1ca507 Merge changes I124a4ba1,Idf7c4e53,I09411d46,I4f270a41,Icd7e6002,I56a14e86,Id91ac5e6,Ia1abd831 into msm-3.0
* 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
2012-03-31 01:14:46 -07:00
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
Rajendra Nayak
11eafc62cd regulator: pass additional of_node to regulator_register()
With device tree support for regulators, its needed that the
regulator_dev->dev device has the right of_node attached.
To be able to do this add an additional parameter to the
regulator_register() api, wherein the dt-adapted driver can
then pass this additional info onto the regulator core.

Change-Id: Idf7c4e532cc06fd00b8182b635d15dcfafb2cef9
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
[mbohan: Update regulator_register for msm regulator drivers]
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
2012-03-28 10:39:59 -07:00
Joonwoo Park
d7cf2e931c ASoC: wcd9310: Add plug detection through mechanical switch
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>
2012-03-27 18:21:44 -07:00
Joonwoo Park
0332483368 ASoC: wcd9310: Add high impedance headphone detection support
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>
2012-03-21 19:33:02 -07:00
Bhalchandra Gajare
b0f151319c ASoC: WCD9310: Enable AUX PGA loopback support
Aux PGA (Auxiliary Programmable Gain Amplifier) interface on the
audio codec is used to loopback the analog audio signal from
input (line-in) to output (line-out/HPH/EAR) only through the
analog domain of the codec. AUX PGA also supports analog gain,
which is used to control the gain of the input signal

For WCD9310, line-in5 is used as AUX PGA Left and line-in6 is
used as AUX PGA Right. Add mixer controls to enable routing
AUX PGA inputs to all possible outputs

Change-Id: I85a7865528aa3b2455c190b2617754fe22f3d24a
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2012-03-14 14:00:22 -07:00
Joonwoo Park
cb7c8920c5 ASoC: wcd9310: Update hardware version dependent register address
There are codec registers which have different addresses depending on
hardware version.  Update registers' address correctly.

CRs-fixed: 340283
Change-Id: If848f71a40d244ee900dc86608058749c334ff4b
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2012-03-12 09:42:53 -07:00
Asish Bhattacharya
1d0695304c ASoC: wcd9304: Add run-time PM to codec startup and shutdown functions
The suspend currently goes on a blocking state due to the locks.
These locks have been moved to parent device in mfd core driver
for safe codec read write and hence no need for duplicate locking.

Add the run-time PM call to wcd9304 codec so Slimbus driver
keeps Slimbus clock on when the codec driver knows there is going
to be audio streams running on the codec.

Change-Id: Id3bf6ce9da5f7bd882c8c2bf927527d16f197bc0
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
2012-03-08 11:03:24 -08:00
Kuirong Wang
0f8ade328b ASoC: wcd9310: Add the compander support to wcd9310
The compander system is intended to increase the dynamic
range of an input signal. But for the wcd9310 codec,
this feature is to use companding in a novel way in the DAC
converter path to increase the signal noise ratio.

The change is to add the compander support to wcd9310
codec. The dynamic compander enable/disable during stream
playback is not supported.

Change-Id: I916a5e4cc0a06516a691bbdcdf0103dcb7b0398c
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
2012-03-05 13:42:46 -08:00
Kuirong Wang
a545e72f19 ASoC: wcd9310: Add run-time PM to codec startup and shutdown functions.
Add the run-time PM call to wcd9310 codec so Slimbus driver keeps Slimbus
clock on when the codec driver knows there is going to be audio streams
running on the codec.

Change-Id: I1dceb27e200a87d2b5e7a60d6361b6399c1a1381
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
2012-03-02 11:57:01 -08:00
Asish Bhattacharya
b86c3477a8 ASoC: wcd9304: Add driver for Sitar codec.
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>
2012-02-29 15:31:34 -08:00
Asish Bhattacharya
b1aeae22ff ASoC: wcd9xxx: Move to a generic framework for codec core driver.
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>
2012-02-29 15:31:15 -08:00
Neema Shetty
d3a89260e1 ASoC: wcd9310: Add support for AIF2 Playback.
Audio interface 2 for playback provides access to Slimbus Rx
ports 6 and 7.

Change-Id: I0a31eb617812097e15991c076ea5a9d64abafd50
Signed-off-by: Neema Shetty <nshetty@codeaurora.org>
2012-02-17 12:00:15 -08:00
Kuirong Wang
cd4b6daee3 ASoC: wcd9310: Add the support to instantiate codec driver.
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>
2012-02-15 10:22:45 -08:00
Ben Romberger
0915aaeb7a ASoC: wcd9310: Fix IIR filter
Changes the IIR filter code to use snd_soc_write
instead of snd_soc_update_bits. If update bits
is used the IIR registers may not be correctly
updated.

Change-Id: Ibedfbbceb03fa663a38c8c6c47a7a5300a7daebe
CRs-fixed: 335282
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
2012-02-13 18:09:18 -07:00
Susan Gao
2b42237845 ASoC: wm8962: Fix word length configuration
commit 2b6712b19531e22455e7fa18371c5ba9eec76699 upstream.

Signed-off-by: Susan Gao <sgao@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-13 11:06:10 -08:00
Mark Brown
b855f76b5f ASoC: wm_hubs: Correct line input to line output 2 paths
commit 43b6cec27e1e50a1de3eff47e66e502f3fe7e66e upstream.

The second line output mixer has the controls for the line input bypasses
in the opposite order.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-13 11:06:10 -08:00
Mark Brown
30b4b3a54f ASoC: wm_hubs: Fix routing of input PGAs to line output mixer
commit ee76744c51ec342df9822b4a85dbbfc3887b6d60 upstream.

IN1L/R is routed to both line output mixers, we don't route IN1 to LINEOUT1
and IN2 to LINEOUT2.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-13 11:06:10 -08:00
UK KIM
a2eeb4b984 ASoC: wm_hubs: fix wrong bits for LINEOUT2 N/P mixer
commit 114395c61ad2eb5a7a5cd163fcadb2414e48245a upstream.

Signed-off-by: UK KIM <w0806.kim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-13 11:06:04 -08:00
Mark Brown
2cf7d6f297 ASoC: wm_hubs: Enable line out VMID buffer for single ended line outputs
commit 77231abe55433aa17eca712718745275853fa66d upstream.

For optimal performance the single ended line outputs require that the
line output VMID buffer be enabled.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-13 11:06:04 -08:00
Bharath Ramachandramurthy
9c79f13b0e ASoc: msm: Add support for slimbus shared channel.
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>
2012-02-12 13:48:19 -08:00
Joonwoo Park
816b8e6e04 ASoC: wcd9310: Prevent from going suspend while accessing codec registers
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>
2012-02-09 16:14:20 -08:00
Joonwoo Park
6c1ebb6226 ASoC: wcd9310: Use correct address of MICB4 registers
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>
2012-02-04 23:12:35 -08:00
Joonwoo Park
e1650a8c04 ASoC: wcd9310: Fix DCE/STA measurement sequence
Don't set MBHC register unnecessarily while measuring DCE/STA at boot time.
Fix will give more accurate measurement result.

Change-Id: Ib2681b9d588027f1e035acd46865783260416645
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2012-02-01 16:04:15 -08:00
Asish Bhattacharya
486745ae91 ASoC: wcd9310: Configure bandgap/clock block when needed.
The current code enables bandgap/clock block at boot but never
turns off these blocks when not in use. This results in higher
than expected power leakage in idle mode.

Disable bandgap and clock blocks when no audio is playing and
no headset is inserted.

CRs-Fixed: 330961
Change-Id: I1f51d99320ffe03ef1a569349405ad4cbaa9c868
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
2012-01-28 06:15:37 +05:30
Joonwoo Park
e5d3aa9db6 ASoC: wcd9310: Use calibrated threshold
Use calibrated threshold rather than hardcoded one to catch MBHC fake
button press interrupt.

Change-Id: I9b4acae81bf7e21f5282a2338269f91d78b14cf3
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2012-01-25 22:10:00 -08:00
Joonwoo Park
6b9b03f9f5 ASoC: wcd9310: Introduce MBHC multi button support
So far wcd9310 driver assumes that any headset button press is headset
button 0 press.
Change driver to measure voltage when button is pressed to discriminate and
notify button's number.

In order to have better detection performance, default measurement
samples are shortened.

CRs-fixed: 327081
Change-Id: Ic0e2a5297974e1858684f0ef2a0b424141ee7464
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2012-01-25 22:09:26 -08:00
Joonwoo Park
c067239399 ASoC: wcd9310: Parameterize MBHC nReady
The MBHC parameter nReady is already in calibration data.
However, CODEC driver currently does not make use of nReady value
in calibration data.
Change CODEC driver to use nReady value instead of hard coded value.

Increase default nReady to support capacitance variance on the micbias
line.

Change-Id: I1acb927a64be78574785eb4c67a50b145e5f72de
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2012-01-25 22:06:49 -08:00
Joonwoo Park
107edf0be4 ASoC: wcd9310: Use correct ACDB value for MBHC with MCLK 9.6Mhz
wcd9210 codec MBHC driver has hard-coded codes that assumes MCLK is
always 12.288Mhz.
Make codec driver to use correct value from ACDB data.

Change-Id: I1d1cd5ff4d4331d119e481a1c173625edcaa0fd3
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2012-01-25 22:06:01 -08:00
Bhalchandra Gajare
b95fb59163 ASoC: WCD9310: Fix sequence for clock source change
For scenarios that need changing the clock source to the codec,
the sequence for switching the clock source was not done
correctly, causing the wrong clock to be selected.

If the correct clock is not selected, it is possible that playback
of audio might cause codec overflow issues due to mismatch in
rate at which the codec can consume data and rate at which data is
made availabe to the codec.
Fix the sequence for switching the clock source, this avoids
possible overflow issue during audio playback.

CRs-fixed: 329223
Change-Id: I410a4dd65cc236c28b788bc5b02db5237157ea6b
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2012-01-21 11:09:22 -07:00
Joonwoo Park
433149a415 ASoC: wcd9310: Address occasional DCE failures
MBHC block requires time for settling aftet resetting.
Give delay after resetting MBHC block.
Also calculate DCE/STA wait more accurately.

Change-Id: Ib3150a921720ed56d6e684281a6f2ae5fe600631
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2012-01-19 14:47:44 -07:00
Patrick Lai
64b43261ea ASoC: WCD9310: Read MBHC Firmware data for calibration
The MBHC headset specific calibration data is stored in the filesystem
as a firmware file. Read this data during initializing MBHC and
perform calibration. If this data is not found, fallback to using
default data provided by the machine driver.

Change-Id: I1cabfb2bb19ef379cdce14ed6b1af8a62e34c790
Signed-off-by: Patrick Lai <plai@codeaurora.org>
2012-01-18 18:22:37 -08:00
Kiran Kandi
3426e51986 ASoC: wcd9310: Update Tabla Tx DAI to support 4 channels
FluencePro and surround sound need more than 2 channels in TX path.
Update Tabla TX DAI to support 4 channels in TX path.

Change-Id: Id5d9a4d2ed7dfb76201409ca32492989c044231c
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>
2012-01-15 14:12:31 -08:00
Joonwoo Park
925914cae0 ASoC: wcd9310: Unset MBHC override bit after measurement
MBHC override bit needs to be set only while doing standalone DCE/STA.
Unset it after finishing DCE/STA measurement.

Change-Id: I21d96a0555882958b03e924557056fef6e293439
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2012-01-10 14:38:31 -08:00
Joonwoo Park
f4267c24e6 ASoC: wcd9310: Enhance MBHC fake insert detection
Currently once we detect an insertion and check the microphone
voltage, if mic voltage is above a threshold (v_ins_hu) we say that it
was a fake insertion and we switch fake insertion detection to micbias
trigger right away.
This is too aggressive and causing other side effects.
Make delay and reduce default value of t_ins_complete from 1000ms to 250ms

CRs-fixed: 318771
Change-Id: I5288f1bb841284320d16a174de371cc35ac673b4
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2012-01-10 14:38:25 -08:00
Joonwoo Park
0976d01960 ASoC: wcd9310: Add MBHC Calibration support.
The MBHC portion of hardware on WCD9310 needs to be calibrated
in order to preform accurate operations on different types of
headset. Add logic to parametrize the codec driver to use
calibration data. The default data is provided by machine driver.

Separate out generic data to the machine driver, whereas WCD9310
specific data exists in the codec driver.

CRs-fixed: 327078
Change-Id: I4db74863c46e8cfbb35c859d520541ad12e6c93a
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2012-01-10 14:38:15 -08:00
Kiran Kandi
9a2c62a88a ASoC: WCD9310: set initialization bit for TXFE
TXFE init function bit lowers turn on time for both capless and legacy
input modes with out causing any click and pops. TxFE init function bit
should be set before enabling the TXFE and unset after enabling TXFE.
In the case of capless mode, the init function gets rid of the DC offset
between the two inputs (positive and negative). In legacy mode, it gets
rid of the transient decay time from external capacitors.

CRs-fixed: 322078
Change-Id: I66fceb64fa1ce65b218d3b412829a4bb7a5a17cf
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>
2012-01-04 12:07:17 -08:00
Krishnankutty Kolathappilly
31169f47b2 ASoC: WCD9310: Set the sleep time to 16ms after lineout PA enable.
-The wcd9310 hardware specification requires 64ms of sleep after
 the lineout PA's are enabled. Since there are four PA's (16 * 4)
 will add to 64ms of sleep time.
-This reduces the cold playback latency.

Change-Id: I5be1248baf6b937ddb854c0b44e32a8ffc497982
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
2012-01-02 22:43:41 -08:00
Patrick Lai
c7cae889ce ASoC: wcd9310: address over current condition due to headset removal
During headphone/headset removal, there is a short moment that
headphone left and right are shorted to ground. This is a universal
problem due to nature of jack design. Undesirable over current
condition can happen if user removes headphone/headset slowly
while audio is going through headphone path. CODEC will make
sure headphone PAs are locked upon detecting over current
condition and notify codec driver. However, this condition
is temporary and should not be reported to application.
Change OCP detection run and wait cycles to maximum and
only propagate OCP event when number of attempts exceeds
pre-defined threshold.

CRs-fixed: 318980
Change-Id: I629a5d5f88fd40a48deba9f0fb3efcb6ae91d7b3
Signed-off-by: Patrick Lai <plai@codeaurora.org>
2011-12-22 10:01:30 -08:00
Joonwoo Park
a94444543f ASoC: wcd9310: Sync headphone/headset PA state
Upon headphone/headset removal, CODEC driver goes ahead disable
PA and RDAC to avoid fake insertion detection.
If userspace receives headphone/headset removal event followed
by insertion event quickly, user can miss earlier removal event so
it thinks later insertion event is also meaningless.
As a result PA and DAC are never turned on by user again.
Fixes to catch if previous removal event was handled by userspace to
enable PA and DAC from kernel if it wasn't.

CRs-Fixed: 318567
Change-Id: I8101bf18b4d42ebeee00b85be061083af2abbb04
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2011-12-22 10:01:25 -08:00
Joonwoo Park
8b1f09804f ASoC: wcd9310: Ensure system is awake while accessing CODEC registers
If Tabla ISRs are called when system is in suspended state,
there are chances that Tabla and underlying bus are not awake.
Fix ISRs to wait until devices are awaken and prevent system from
suspending while accessing bus is completed.

CRs-Fixed: 318992
Change-Id: Idc358dc351c16c79420d7bee15a4a6fde9f1602a
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2011-12-22 10:01:16 -08:00
Patrick Lai
92032bef2f ASoC: wcd9310: address unbalanced enable IRQ warning
When CODEC driver requests for OCPHL and OCPR interrupts,
interrupts are already enabled. When machine driver
informs CODEC driver to start accessory detection,
enable irq calls would be made again. Kernel warning
is printed as interrupts are already enabled.

CRs-fixed: 325368
Change-Id: I29837210fb8cdbf945ff970f515dae652ce052ba
Signed-off-by: Patrick Lai <plai@codeaurora.org>
2011-12-22 00:40:49 -07:00
Jordan Crouse
239d841e99 ASoC: wcd9310: Return on an invalid switch value
In tabla_get_mbhc_micbias_regs the switch statement for the calibration
bias should never get to the default clause, but if it does return out
of the function and avoid a possible compiler warning.

Change-Id: Ic0dedbadf889a8e4ef9de0a906da0f97bc0f6a6d
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-12-12 15:16:31 -07:00
Mark Brown
6dbe15f453 ASoC: Ensure WM8731 register cache is synced when resuming from disabled
commit ed3e80c4c991a52f9fce3421536a78e331ae0949 upstream.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 08:52:26 -08:00
Timo Juhani Lindfors
e879974c3f ASoC: wm8753: Skip noop reconfiguration of DAI mode
commit 2391a0e06789a3f1718dee30b282562f7ed28c87 upstream.

This patch makes it possible to set DAI mode to its currently applied
value even if codec is active. This is necessary to allow

aplay -t raw -r 44100 -f S16_LE -c 2 < /dev/urandom &
alsactl store -f backup.state
alsactl restore -f backup.state

to work without returning errors. This patch is based on a patch sent
by Klaus Kurzmann <mok@fluxnetz.de>.

Signed-off-by: Timo Juhani Lindfors <timo.lindfors@iki.fi>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 08:52:26 -08:00
Patrick Lai
72aa4da1df ASoC: wcd9310: clear headphone status bit upon headphone removal
When headphone removal is detected, headphone status bit should be
cleared instead of headset status bit.

CRs-fixed: 322063
Change-Id: Ia178267242a15a03216bb0990b3dc44b0e668bc5
Signed-off-by: Patrick Lai <plai@codeaurora.org>
2011-12-08 12:40:36 -08:00
Bhalchandra Gajare
5ea376d909 ASoC: WCD9310: Turn off HPH DAC's before accessory insertion
The HPH PA's are turned OFF while setting up MBHC hardware for
insertion detection. It is also required to turn off the DAC's for
both HPH Left and Right channels.
Turning off HPH DAC's avoids probable fake insertion interrupts.

Change-Id: I73290a01739bd0872d8d3eaddf8666c43aa087a2
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2011-12-07 12:13:11 -08:00
Bhalchandra Gajare
c1e19c4437 ASoC: WCD9310: Pause headset polling before switching MBHC Mic Bias
With headset inserted and no recording, the MIC BIAS is switched to
VDDIO to avoid noise on Headphone due to button polling. When this
switch happens, it is required to pause the headset polling before
the switch and restart it again when the switch is done

This will make the MIC BIAS switch smooth and will avoid click/pop
noise that may happen during the switch

Change-Id: I092d1915b379173b88a38584bf1701cce833c9ae
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2011-12-07 12:12:54 -08:00
Bhalchandra Gajare
9494fa269e ASoC: WCD9310: Fix continous fake interrupt while partial headset insertion
When the headset is inserted more than three quarter inside, the tip
of headset plug just touches the HPH Left line on Headset jack. This
causes an interrupt, but is identified as fake insertion interrupt,
since the headset is still not completely inserted and the microphone
voltage has not settled. This happens continously because after detecting
fake insert, the current logic re-enables insertion detection interrupt.

Once the fake insert interrupt is triggered, the HPH left schmitt trigger
is turned OFF and the MIC line schmitt trigger is turned ON. Hence the
continous interrupts do not occur anymore. Further detection happens
based on MIC line schmitt trigger until the headset is either
completely inserted or completely removed.

CRs-Fixed: 317673
Change-Id: I58f0cd5c6e5ee56348013e585fbb455d4d73efaa
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2011-12-07 12:12:38 -08:00
Bhalchandra Gajare
19d9c133d5 ASoC: WCD9310: Switch CFILT mode based on Microphone Bias
CFILT can be configured either to be in fast mode or in slow
mode. It is required that CFILT to be in fast mode for headset
insertion /removal to be detected properly. Whereas it is required
for CFILT to be in slow mode when recording is in progress.

Add logic to decipher when CFILT used for MBHC is getting turned on for
recording purpose and change the CFILT modes dynamically.

CRs-Fixed: 317473
CRs-Fixed: 317479
Change-Id: I4b6446d1c3bbf36507f83c89e492d28354a169d5
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2011-12-06 08:54:11 -08:00