summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/arizona.h
AgeCommit message (Collapse)AuthorFilesLines
2017-01-06ASoC: wm_adsp: Add mechanism to preload firmware on a coreCharles Keepax1-0/+1
As requirements to bring up audio paths are continuous getting tighter and the DSP download to most ADSP devices happens over an external bus it can become an important factor in the path bring up time. As such sometimes it is a reasonable trade off to download the firmware ahead of when it will be required and take a small hit on power consumption for keeping the core powered up. This "preloading" adds an additional control for each DSP core "DSPx Preload Switch" that when set to true will power up the DSP core and download the firmware currently selected in the "DSPx Firmware" control. Whilst the core is preloaded the current firmware can not be changed and the CODEC will be kept powered up and SYSCLK held on. Although future improvements may allow the SYSCLK to be powered down as well because the hardware only requires SYSCLK whilst the download is actually taking place, but this is not covered in this series. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-11-29ASoC: arizona: Remove redundant extern declarationsCharles Keepax1-42/+38
Functions are given external linkage by default making the extern's unnecessary, as such remove them. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-11-10ASoC: arizona: Move notifier functions to header and make inlineCharles Keepax1-8/+24
These functions are very thin wrappers around core functions, so they make sense as inline functions. Also making them inline avoids build issues in the case where the machine driver is built in but the CODEC is built as a module. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-26ASoC: arizona: Move request of speaker IRQs into bus probeCharles Keepax1-1/+2
It is more idiomatic to request all resources in the bus level probe, this patch moves the request of the speaker thermal event IRQs from the ASoC level probe into the bus level probe. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-24ASoC: arizona: Add gating for clock when used for direct MCLKCharles Keepax1-0/+2
Whilst ultimately we would like to move all the clocking over to the clock framework, as an intermediate step to get people going for now gating the source clocks for SYSCLK/ASYNCCLK when they are configured to come directly from an MCLK pin. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-24ASoC: wm_adsp: Make DSP preloader a supply widgetCharles Keepax1-8/+8
Currently the DSP loading is split into two widgets, the preloader that is a snd_soc_dapm_dai_link widget which starts a thread to download the firmware, and the DSP itself which is a snd_soc_dapm_out_drv and synchronises the thread back in to the DAPM sequence. This allows the firmware download to be overlapped with the rest of the path bring up. The use of a snd_soc_dapm_dai_link widget requires the preloader to be part of the audio path in DAPM, really a supply widget is a better fit for the preloader. The preloader is something that needs to be done for the DSP to function, not a part of the audio path itself. This change makes the DSP preloader widget a supply widget, which as well as probably being a better fit will also make it much simpler to power up the preloader widget to trigger firmware download to the core independently of the audio path coming up. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-24ASoC: arizona: Attach SYSCLK to DSP preloadersCharles Keepax1-0/+1
Currently SYSCLK is attached to every compressed DAI as this follows the pattern of attaching clocks to the chips inputs and outputs, however, it is really the DSP that requires the clock here. As firmware download can be a significant part of the path startup time for these devices occasionally it would be desirable to download the firmware in advance of the path being brought up. To help facilitate this early firmware loading this patch attaches the SYSCLK to the DSP preloader widget. This also saves us adding a new route to SYSCLK every time a new compressed DAI is created. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-25Merge remote-tracking branches 'asoc/topic/arizona', 'asoc/topic/atmel', ↵Mark Brown1-3/+2
'asoc/topic/bt-sco', 'asoc/topic/compress' and 'asoc/topic/cs35l33' into asoc-next
2016-06-13ASoC: wm5102: Revert manual speaker enableCharles Keepax1-3/+0
The OUT4L and OUT4R widgets are not registered PRE_PMU or POST_PMD events, as such the manual speaker enable on wm5102 does not actually ever run. Furthermore since the issue actually only affected rev B of the silicon which never shipped in volume, simply remove the work around from the code. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-31ASoC: arizona: Add data structure for voice trigger notifierCharles Keepax1-0/+4
64-bit builds would generate a warning when we passed the core number as a pointer through the notifier data: sound/soc/codecs/cs47l24.c:1091:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (void *)i); Rather than just fix this up with more casting add a data structure that holds information for the notifier chain. This will make it easier to add additional information in the future as well. Fixes: 7baa7e2490e1 ("ASoC: arizona: Add event notification on voice trigger events") Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30ASoC: arizona: Add voice trigger output widgetCharles Keepax1-0/+2
In some situations the voice control firmware will by used to only provide a trigger notification event. In this case a compressed stream will not be opened by user-space, as such we need to provide a virtual output to power on the DSP in this use-case. This patch adds a virtual output 'DSP Voice Trigger' that can be used for this, and a switch that lets it be connected to the core when required. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30ASoC: arizona: Add event notification on voice trigger eventsCharles Keepax1-0/+3
Inform the notifier chain if the DSP recognises a voice trigger. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30ASoC: arizona: Add a notifier chain for CODEC eventsCharles Keepax1-0/+10
Add a notifier chain that can be used from the machine driver to catch events generated by the CODEC. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-15ASoC: arizona: Free speaker thermal IRQs in CODEC removeCharles Keepax1-0/+2
The thermal warning IRQs for the speaker are requested in CODEC probe but never freed. This patch frees them in CODEC remove. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-05ASoC: arizona: Add support for SNDRV_PCM_RATE_KNOTCharles Keepax1-0/+2
The Arizona CODECs support several rates that do not have simple defines in ALSA. This patch adds support for SNDRV_PCM_RATE_KNOT so that users can open stream at these rates. As part of this we should always set constraints in arizona_startup, currently we only set the constraints if we already have a clock to limit rates to that family of sample rates. This patch updates this to set a constraint of all rates supported by the chip if we do not already know which family of rates to limit to. Finally we also reduce the list of rates supported in the constraints to only include those that are supported on current parts. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-29ASoC: wm5110: Add support for audio trace firmwareCharles Keepax1-1/+1
Mainly this adds DAI links for the audio trace, however, it is also necessary to update the data IRQ handler to check more cores. We have the handler check every core so it should not be necessary to update this function if more compressed firmwares are added in the future. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-23ASoC: wm5110: Provide basic hookup for voice controlCharles Keepax1-1/+1
Register a platform driver for the CODEC and add DAIs that will be used to connect a compressed record path for the voice control functionality. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-03ASoC: arizona: Correct types of mixer texts and valuesCharles Keepax1-4/+4
The core expects "const char * const" and "unsigned int" for enum controls, various places in Arizona use "const char *" and "int". This patch corrects the type of these arrays. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-19ASoC: wm5110: Add DAPM/routing hookup for the ANC blockCharles Keepax1-0/+7
The wm5110 device contains a hardware ANC block, this patch connects up controls and routing for this. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-02ASoC: wm8998: Initial WM8998 codec driverRichard Fitzgerald1-1/+6
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-02ASoC: arizona: add defines for single-input gain controlRichard Fitzgerald1-0/+5
Adds convenience defines for declaring a gain control that has an input mux. These blocks are functionally equivalent to the existing mixer blocks but can only have a single input active at once. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16ASoC: arizona: Add utility function to check if an input is analogCharles Keepax1-0/+2
We will occasionally require to take different action based on if an input is analog or digital so add a helper function to return if an input is analog. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30Merge remote-tracking branches 'asoc/topic/88pm860x', 'asoc/topic/ac97', ↵Mark Brown1-0/+19
'asoc/topic/ak4542', 'asoc/topic/arizona' and 'asoc/topic/atmel' into asoc-next
2015-08-25ASoC: arizona: Poll for FLL clock OK rather than use interruptsCharles Keepax1-1/+0
The extcon driver takes the DAPM mutex from within the interrupt thread in several places, which makes it possible to get into a situation where the interrupt thread is blocked waiting on the DAPM mutex whilst a DAPM sequence is running which is attempting to configure the FLL. In this case the FLL completion can't be completed as as the IRQ handler is ONE_SHOT, which cause the FLL lock to use the full time out (250mS) and report that the process timed out. It is not really practical to make the extcon driver not take the DAPM mutex from within the interrupt thread, at least not without extensive modification. So this patch fixes the issue by switching the wait for the FLL lock to polling. A few fast polls are done first as the FLL should lock quickly for a good quality reference clock, (indeed it hits on the first poll on my system) and it will poll every 20mS after that until it times out. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2015-07-07ASoC: arizona: Implement stability check for LHPF coefficientsCharles Keepax1-0/+9
Specifying unstable coefficients for the low/high pass filters can have a severe impact on the audio. This patchs adds a stability check on the coefficients written to the low/high pass filter block to prevent this. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-07ASoC: arizona: Implement stability check for EQ coefficientsCharles Keepax1-0/+10
Specifying unstable coefficients for the EQ can have a severe impact on the audio. This patchs adds a stability check on the coefficients written to the EQ, for this it is necessary to merge the mode control and the coefficients as some coefficients may only be unstable with a certain mode setting so it is ideal if these are always updated in sync. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-19ASoC: wm_adsp: Move DSP Rate controls into the codecRichard Fitzgerald1-0/+2
The rate controls are codec-specific, it's not possible to generically say what the range or the meaning of each control is (or even if they exist at all) - that depends on the particular codec. This is currently being handled for Arizona codecs by putting an Arizona-specific table of controls inside the wm_adsp driver. This creates a dependency between wm_adsp and arizona.c, and is an awkward solution if the ADSP is used in another family of codecs Fix this by moving the Arizona-specific rate controls into the Arizona codec drivers. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-02ASoC: arizona: Export functions to control subsystem DVFSRichard Fitzgerald1-0/+13
The WM5102 and WM8997 codecs have an internal dynamic clock booster. When this booster is active, the DCVDD voltage must be increased. If all the currently active audio paths can run with the root SYSCLK we can disable the booster, allowing us to turn down DCVDD voltage to save power. Previously this was being done by having the booster enable bit set as a side-effect of the LDO1 regulator driver, which is unexpected behaviour of a regulator and not compatible with using an external regulator. [Originally this was documented as a feature of the internal LDO -- broonie] This patch exports functions to handle the booster enable and DCVDD voltage, with each relevant subsystem flagging whether it can currently run without the booster. Note that these subsystems are stateless and none of them are nestable, so there's no need for reference counting, we only need a simple boolean for each subsystem of whether their current condition could require the booster or will allow us to turn the codec down to lower operating power. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-06ASoC: arizona: Use auto disable muxes for routingCharles Keepax1-2/+2
The mixer core on the Arizona devices is powered up whenever any routing is non-zero. This patch saves a little power and avoids a few difficult corner cases (around the mixer core being powered whilst there is no clock available), by using the autodisable mux functionality to only write out the settings for the muxes when they are powered up. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-27ASoC: arizona: Coalesce output power up delaysCharles Keepax1-0/+2
Save a bit of scheduling by coalescing all the output power up delays into a single delay. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-27ASoC: arizona: Add delay for output disableCharles Keepax1-0/+3
Give the output disable sequence a chance to fully complete, otherwise there is a danger we may remove the clock before it is finished resulting in a pop noise. The delay for each output must be cumulative and these are coalesced into a single delay. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-06-21ASoC: wm5110: Power both channels for differential mono outputCharles Keepax1-0/+1
On the wm5110 CODEC both the left and right channel must be powered when an output is being used as a mono output, although no audio is routed to the right output channel. This patch adds additional DAPM routes to link the right channel to the left in the case where an output is marked as mono. Audio must always be brought in on the left channel for mono operation. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14ASoC: arizona: Replace usage deprecated MUX/ENUM macrosLars-Peter Clausen1-2/+2
SND_SOC_DAPM_VALUE_MUX and SOC_DAPM_VALUE_ENUM are deprecated and merely an alias for SND_SOC_DAPM_MUX and SOC_DAPM_ENUM. Replace the deprecated macros so we can eventually remove their definition. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-16Merge remote-tracking branches 'asoc/topic/adsp', 'asoc/topic/atmel', ↵Mark Brown1-8/+9
'asoc/topic/bcm2835', 'asoc/topic/docs', 'asoc/topic/fsl', 'asoc/topic/generic', 'asoc/topic/kirkwood', 'asoc/topic/mc13783', 'asoc/topic/mxs', 'asoc/topic/nuc900', 'asoc/topic/sai', 'asoc/topic/sh', 'asoc/topic/ssm2602', 'asoc/topic/tlv320aic3x', 'asoc/topic/twl4030', 'asoc/topic/ux500', 'asoc/topic/width' and 'asoc/topic/x86' into for-tiwai
2014-01-08ASoC: wm_adsp: Start DSP booting earlier in the DAPM processCharles Keepax1-8/+9
Move the start of booting the DSP to earlier in the DAPM process, and move the final starting of the DSP to later in the DAPM process. This allows us to overlap some of the processing with other components of the system being brought up. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-19ASoC: wm5110: Add support for ASRC RATE 1Charles Keepax1-0/+1
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 Keepax1-0/+1
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-11-21Merge tag 'ib-asoc-1' of git://git.linaro.org/people/ljones/mfd into ↵Mark Brown1-0/+1
asoc-arizona Immutable branch for ASoC, as requested by Mark Brown
2013-11-21ASoC: wm5110: Expose input high pass filter controlsCharles Keepax1-0/+1
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: wm5110: Add extra AIF2 channelsRichard Fitzgerald1-1/+1
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-08-12ASoC: arizona: Add widget<->mux route into mux route macroCharles Keepax1-1/+2
The routes linking the widget and the input mux were being added manually, rather than by the ARIZONA_MUX_ROUTES macro. This patchs adds the routes to the macro. 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 Keepax1-0/+1
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 signal activity output for DRCCharles Keepax1-0/+1
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 Brown1-1/+2
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-26Merge tag 'arizona-extcon-asoc' of ↵Mark Brown1-0/+3
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 Brown1-0/+3
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-21ASoC: arizona: Basic support for ISRC rate selectionMark Brown1-0/+6
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: Factor out speaker widgets from CODEC driversMark Brown1-0/+5
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: Provide defines for the clock ratesMark Brown1-0/+8
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-04ASoC: arizona: Only allow input volume updates when inputs are enabledMark Brown1-0/+3
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>