aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/codecs/arizona.c
AgeCommit message (Collapse)Author
2013-12-19ASoC: wm5110: Add support for ASRC RATE 1Charles Keepax
Add support for configuring the sample rate on the SYSCLK side of the ASRC. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-19ASoC: wm5110: Add FSH for ISRCsCharles Keepax
Currently, the driver only supports configuration of the lower sample rate (FSL) on the ISRCs. With the higher rate being fixed a SYSCLK, this patch adds support for configuring the higher sample rate (FSH). Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-17ASoC: arizona: Use async writesMark Brown
Where possible write to the device asynchronously, allowing better performance when used with a bus like SPI which supports this by minimising the need to context switch back to the driver to get the next bit of data. Signed-off-by: Mark Brown <broonie@linaro.org> Tested-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
2013-11-24Merge tag 'v3.13-rc1' into asoc-arizonaMark Brown
Linux 3.13-rc1
2013-11-21Merge tag 'ib-asoc-1' of git://git.linaro.org/people/ljones/mfd into ↵Mark Brown
asoc-arizona Immutable branch for ASoC, as requested by Mark Brown
2013-11-21ASoC: wm5110: Expose input high pass filter controlsCharles Keepax
Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-11-20ASoC: arizona: Set FLL to free-run before disablingRichard Fitzgerald
The FLL must be placed into free-run mode before disabling to allow it to entirely shut down. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
2013-11-20ASoC: wm5110: Add extra AIF2 channelsRichard Fitzgerald
Signed-off-by: D.J. Barrow <dbarrow@wolfsonmicro.com> Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-17ASoC: arizona: Improve handling of setting REFCLK to 0Charles Keepax
This patch suppresses calculation of REFCLK parameters when the REFCLK source frequency is set to zero, additionally it will consider a source frequency of zero as the REFCLK being disabled and switch to using the SYNCCLK. Reported-by: Kyung Kwee Ryu <Kyung-Kwee.Ryu@wolfsonmicro.com> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-13ASoC: wm8997: Initial CODEC driverCharles Keepax
The wm8997 is a compact, high-performance audio hub CODEC with SLIMbus interfacing, for smartphones, tablets and other portable audio devices based on the Arizona platform. This patch adds the wm8997 CODEC driver. [Fixed some interface churn from bitrot due to the patch not going via the MFD tree as expected -- broonie] Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-06ASoC: wm5110: Correct input OSR bits for wm5110Charles Keepax
The input OSR bits are specified differently for wm5110 than for current revs of wm5102. This patch corrects support for this on wm5110. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-15ASoC: arizona: Add default case to silence build warningCharles Keepax
Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-15ASoC: arizona: Add signal activity output for DRCCharles Keepax
When doing signal activity detection, the only output from the DRC will often be a GPIO pin. This patch adds a signal activity output that is activated when a GPIO is configured to output the DRC signal activity detection. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-05-20ASoC: arizona: Provide simple DAI ops for autoconfiguring interfacesMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-26ASoC: arizona: Add delay after powering up line level outputsMark Brown
Ensure that the outputs are fully enabled before we begin passing audio through them. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-26Merge tag 'arizona-extcon-asoc' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc into asoc-arizona ASoC/extcon: arizona: Fix interaction between HPDET and headphone outputs This patch series covers both ASoC and extcon subsystems and fixes an interaction between the HPDET function and the headphone outputs - we really shouldn't run HPDET while the headphone is active. The first patch is a refactoring to make the extcon side easier.
2013-03-26ASoC: arizona: Fix interaction between headphone outputs and identificationMark Brown
Running HPDET while the headphone outputs are enabled can disrupt the operation of HPDET. In order to avoid this HPDET needs to disable the headphone outputs and ASoC needs to not enable them while HPDET is running. Do the ASoC side of this by storing the enable state in the core driver structure and only writing to the device if a flag indicating that the accessory detection side is in a state where it can have the headphone output stage enabled. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-26ASoC: arizona: remove duplicated include from arizona.cWei Yongjun
Remove duplicated include. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-21ASoC: arizona: Basic support for ISRC rate selectionMark Brown
Since ASoC does not yet really have the framework features needed to support propagating sample rates through the device well yet implement basic support for the ISRCs equivalent to that we currently have for the ASRCs. The user can opt for 8kHz or 16kHz as the rate for the DSP blocks in addition to the main audio rate, these being the primary use cases. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-21ASoC: arizona: Suppress speaker enable if thermal shutdown is flaggedMark Brown
Ensure that the device state does not diverge from the state we have set in the register map in order to make the behaviour clearer. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-21ASoC: arizona: Log thermal eventsMark Brown
Help with debuggability. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-21ASoC: arizona: Factor out speaker widgets from CODEC driversMark Brown
Some system designs have been identified which repurpose portions of the speaker driver circuits for other functions which will require that they not be managed using DAPM. Prepare for this by factoring out the creation of the speaker widgets into the core driver, the widgets will be replaced by dummy ones when the additional functions are enabled. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-13ASoC: arizona: Ensure we clock two channels for I2S modeMark Brown
I2S requires stereo clocking even for mono data. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-13ASoC: arizona: Provide defines for the clock ratesMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-08ASoC: arizona: Suppress reference calculations when setting REFCLK to 0Mark Brown
Allow users to keep on specifying their output frequency when disabling the reference clock. Reported-by: Kyung Kwee Ryu <Kyung-Kwee.Ryu@wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-08ASoC: arizona: Ensure synchroniser is disabled when not neededMark Brown
When live configuring a FLL configuration with no synchroniser disable the synchroniser in case the previous configuration used one. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-06ASoC: arizona: Optimise FLL loop gainsMark Brown
For optimal performance the FLL loop gain should be adjusted depending on the frequency of the input clock for the loop. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-06ASoC: arizona: Increase FLL synchroniser bandwidth for high frequenciesMark Brown
If we are using a high freqency SYNCCLK then increasing the bandwidth of the synchroniser improves performance. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-05ASoC: arizona: If we only have a clock to synchronise with make it REFCLKMark Brown
If there is only one clock active the FLL should use REFCLK rather than SYNCCLK as the clock to synchronise with since REFCLK is always required. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-04ASoC: arizona: Don't enable FLL on REFCLK configurationCharles Keepax
Enabling the FLL when REFCLK is being configured is not what the user would expect and can cause issues if SYNCCLK has no specified frequency. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-04ASoC: arizona: Only allow input volume updates when inputs are enabledMark Brown
Since we are automatically managing the mutes we may as well also manage the volume update bits, disabling volume updates while none of the inputs are active. Since we are doing this we may as well allow the volumes to ramp together so only enable volume updates once at the end of power up. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-04ASoC: arizona: Add convience define for clearing SYNCCLKCharles Keepax
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-04ASoC: arizona: Add support for directly setting the FLL REFCLKCharles Keepax
This patch allows the REFCLK to be set directly allowing much greater flexibility in how the FLLs are configured. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-04ASoC: arizona: Improve suppression of noop FLL updatesCharles Keepax
Previously updates that only changes FLL source would be missed, this patch corrects this. We also ensures that both REFCLK and SYNCCLK frequency changes are considered, in preparation for future updates. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-04ASoC: arizona: Factor out FLL enableCharles Keepax
In preparation for additional features on the FLL this patch factors out the code for enabling an FLL into a seperate function. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-04ASoC: arizona: Factor out FLL disableCharles Keepax
In preparation for additional features on the FLL this patch factors out the code for disabling an FLL into a seperate function. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-04ASoC: arizona: Factor out check for enabled FLLCharles Keepax
In preparation for additional features on the FLL this patch factors out the code which checks if an FLL is currently enabled into a seperate function. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-04ASoC: arizona: Tidy up SYNCCLK selection and cache valuesCharles Keepax
This patch caches the current SYNCCLK settings in the arizona_fll struct and uses these to simplify the code which determines which source should be used for the REFCLK and SYNCCLK inputs. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-04ASoC: arizona: Move selection of FLL REFCLK into initCharles Keepax
In preparation for additional features on the FLL this patch moves the code selecting the REFCLK source based on the 32kHz clock into the FLL initialisation function. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-02-12ASoC: arizona: Automatically manage input mutesMark Brown
For optimal performance the inputs should be kept muted until after power up. Since there are few use cases for muting inputs during capture move the mutes to automatic control. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-02-11Merge remote-tracking branch 'asoc/topic/arizona' into asoc-nextMark Brown
2013-02-07ASoC: arizona: Fix debug logging level for FLLs and AIFsMark Brown
Use _dbg for debug messages. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-02-04ASoC: arizona: Fixed a bug in FLL fractional calculationRyo Tsutsui
Previously arizona_calc_fll() was checking if the target frequency is exactly divisible by reference frequency, but should have been product of the ratio and the reference frequency. Also scale down the Lamba and Theta coefficients be under 16-bits in order to match the registers. Signed-off-by: Ryo Tsutsui <ryo.tsutsui@wolfsonmicro.com> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2013-01-21ASoC: arizona: Allow number of channels clocked to be restrictedMark Brown
Place a cap on the number of channels clocks are generated for. This is intended for use with systems which have the WM5102 master an I2S bus with multiple data lines. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-21ASoC: arizona: Support clearing clocksMark Brown
Some systems may wish to support switching between telephony and CD audio clock rates but this is restricted by enforcement of constraints on the current DAI clock. Support setting clocks to zero and don't enforce any constraints in that case in order to facilitate this use case. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-17Merge remote-tracking branch 'asoc/fix/arizona' into asoc-arizonaMark Brown
Conflicts: sound/soc/codecs/arizona.c
2013-01-17ASoC: arizona: Use actual rather than desired BCLK when calculating LRCLKMark Brown
Otherwise we'll get the wrong LRCLK if we need to pick a higher BCLK than is required. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2013-01-16ASoC: arizona: Don't request FLL lock IRQMark Brown
We only log the result and since the interrupt triggers on loss of lock during shutdown this may lead to spurious interrupts during shutdown delaying the process. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-13Merge remote-tracking branch 'asoc/fix/arizona' into asoc-arizonaMark Brown
2013-01-08ASoC: arizona: Disable free-running mode on FLL1Charles Keepax
The free running mode can cause problems when attempting to bring up the FLL running from a defined clock source. This patch disables free-running mode. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>