aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/codecs/arizona.c
AgeCommit message (Collapse)Author
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>
2013-01-04ASoC: arizona: Factor out rate selection codeMark Brown
In preparation for more advanced sample rate managment move the existing code out of the main hw_params() function. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-04Merge branch 'fix/arizona' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-arizona
2013-01-04ASoC: arizona: Allow runtime reconfiguration of the output modeMark Brown
Some systems use external analogue switches to connect more analogue devices to the CODEC than are supported by the device. In some systems this requires changing the switched output from single ended to differential mode dynamically at runtime. Add a new function arizona_set_output_mode() to support this. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-04ASoC: wm5102: Implement routing and power management for ISRCsMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-04ASoC: arizona: Remove DSP B and left justified AIF modesMark Brown
These are not supported. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-12-24ASoC: arizona: Do proper shift for setting AIF rateAxel Lin
ARIZONA_AIF1_RATE_MASK is 0x7800 /* AIF1_RATE - [14:11] */ Thus we need left shift ARIZONA_AIF1_RATE_SHIFT when setting aif1 rate. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-12-24ASoC: arizona: Implement tristate supportMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-24ASoC: arizona: Add noise gate hold time enumerationMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-10Merge remote-tracking branch 'asoc/topic/arizona' into asoc-nextMark Brown
2012-12-09ASoC: arizona: Add volume ramp controlsMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-07ASoC: arizona: Log the clock we're setting the DAI to useMark Brown
Useful for diagnostics. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-07ASoC: arizona: Store the DAI clock ID when settingMark Brown
So the code to suppress duplicate changes is effective. Reported-by: Kyung Kwee Ryu <Kyung-Kwee.Ryu@wolfsonmicro.comyu@wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-06ASoC: arizona: Make FLL lock timeout very highMark Brown
Provide robustness against low quality FLL sync clocks by increasing the timeout for lock to an absurdly high point; we should never get anywhere near hitting the timeout in a real system unless it is failing. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-28ASoC: arizona: Record FLL setting when disablingMark Brown
Otherwise we skip reenables. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>