summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm_adsp.c
AgeCommit message (Collapse)AuthorFilesLines
2014-01-16Merge remote-tracking branches 'asoc/topic/adsp', 'asoc/topic/atmel', ↵Mark Brown1-78/+121
'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-09ASoC: wm_adsp: Mark wm_adsp2_boot_work as staticCharles Keepax1-1/+1
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-08ASoC: wm_adsp: Start DSP booting earlier in the DAPM processCharles Keepax1-3/+21
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>
2014-01-08ASoC: wm_adsp: Factor out ADSP2 boot proceedureCharles Keepax1-78/+103
Move the ADSP2 boot proceedure into a work structure in preparation for running it asynchronously with the reset of the audio path bring up. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-02Merge remote-tracking branches 'asoc/topic/ad1836', 'asoc/topic/ad193x', ↵Mark Brown1-10/+10
'asoc/topic/adav80x', 'asoc/topic/adsp', 'asoc/topic/ak4641', 'asoc/topic/ak4642', 'asoc/topic/arizona', 'asoc/topic/atmel', 'asoc/topic/au1x', 'asoc/topic/axi', 'asoc/topic/bcm2835', 'asoc/topic/blackfin', 'asoc/topic/cs4271', 'asoc/topic/cs42l52', 'asoc/topic/da7210', 'asoc/topic/davinci', 'asoc/topic/ep93xx', 'asoc/topic/fsl', 'asoc/topic/fsl-mxs', 'asoc/topic/generic', 'asoc/topic/hdmi', 'asoc/topic/jack', 'asoc/topic/jz4740', 'asoc/topic/max98090', 'asoc/topic/mxs', 'asoc/topic/omap', 'asoc/topic/pxa', 'asoc/topic/rcar', 'asoc/topic/s6000', 'asoc/topic/sai', 'asoc/topic/samsung', 'asoc/topic/sgtl5000', 'asoc/topic/spear', 'asoc/topic/ssm2518', 'asoc/topic/ssm2602', 'asoc/topic/tegra', 'asoc/topic/tlv320aic3x', 'asoc/topic/twl6040', 'asoc/topic/txx9', 'asoc/topic/uda1380', 'asoc/topic/width', 'asoc/topic/wm8510', 'asoc/topic/wm8523', 'asoc/topic/wm8580', 'asoc/topic/wm8711', 'asoc/topic/wm8728', 'asoc/topic/wm8731', 'asoc/topic/wm8741', 'asoc/topic/wm8750', 'asoc/topic/wm8753', 'asoc/topic/wm8776', 'asoc/topic/wm8804', 'asoc/topic/wm8900', 'asoc/topic/wm8901', 'asoc/topic/wm8940', 'asoc/topic/wm8962', 'asoc/topic/wm8974', 'asoc/topic/wm8985', 'asoc/topic/wm8988', 'asoc/topic/wm8990', 'asoc/topic/wm8991', 'asoc/topic/wm8994', 'asoc/topic/wm8995', 'asoc/topic/wm9081' and 'asoc/topic/x86' into asoc-next
2013-12-18ASoC: wm_adsp: Add small delay while polling DSP RAM startCharles Keepax1-3/+7
Some devices are getting very close to the limit whilst polling the RAM start, this patch adds a small delay to this loop to give a longer startup timeout. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
2013-12-18ASoC: wm_adsp: Remove duplicate info message for DSP RAM readyCharles Keepax1-1/+0
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-04ASoC: adsp: Use async writes where possibleMark Brown1-9/+9
This will allow a marginal speed improvement when used with a bus that supports async I/O by reducing the amount of context thrashing between writes, allowing the bus to be more fully utilised. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-28ASoC: wm_adsp: Stop region iteration when the desired region is foundCharles Keepax1-0/+1
When locating the memory region relating to a coefficient block written through a bin file we keep processing the list of regions even after we have found the region we require. This patch adds a break, so we don't process redundant list items. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-08Merge remote-tracking branch 'asoc/topic/warn' into asoc-nextMark Brown1-11/+6
2013-11-08Merge remote-tracking branch 'asoc/topic/adsp' into asoc-nextMark Brown1-7/+20
2013-11-07ASoC: wm_adsp: Fix BUG_ON() and WARN_ON() usagesTakashi Iwai1-11/+6
This patch does: - Move the sanity check with WARN_ON() in wm_adsp_region_to_reg() and remove the checks in the callers, - Fix wrong WARN_ON() usages, replaced with WARN(), - Fix unreachable or wrong BUG_ON() usages and replace with WARN_ON(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-04ASoC: wm_adsp: Interpret ADSP memory region lengths as 32 bit wordsNariman Poushin1-0/+5
Pad the ADSP word (3 bytes) to 4 bytes in the kernel and calculate lengths based on padded ADSP words instead of treating them as bytes Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com> Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
2013-11-01ASoC: wm_adsp: Print out the firmware versionDimitris Papastamos1-0/+1
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-01ASoC: wm_adsp: Remove and free algorithm regions for ADSP1Dimitris Papastamos1-0/+9
Do it in a similar fashion as we do for ADSP2. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-01ASoC: wm_adsp: Add debug info on get()/put() transfersDimitris Papastamos1-0/+2
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-01ASoC: wm_adsp: Release firmware on memory allocation failureDimitris Papastamos1-1/+2
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-01ASoC: wm_adsp: Print error when regmap reads/writes failDimitris Papastamos1-6/+6
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-01ASoC: wm_adsp: Sanitize parameter passingDimitris Papastamos1-15/+16
No need to hold on to the `codec' pointer. We can use the `dsp' pointer and grab all the information we need from there. This makes the parameters for the functions a bit more sane and idiomatic. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29ASoC: wm_adsp: Simplify kcontrol handlingDimitris Papastamos1-72/+31
Get rid off the wm_coeff struct and the wm_coeff_add_kcontrol() function. We are now using the snd_soc_card_kcontrol() function to get the kcontrol pointers. No need to call into ALSA code to register the kcontrols. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-17Merge remote-tracking branch 'asoc/topic/adsp' into asoc-nextMark Brown1-7/+452
2013-06-14ASoC: wm5110: Correct rate control for DSP4Charles Keepax1-1/+1
Reported-by: Dennis May <dennis.may@wolfsonmicro.com> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-05-28ASoC: wm_adsp: Ensure set controls are synced on each bootDimitris Papastamos1-10/+9
Rename `dirty' to `set' as it is a bit more descriptive. A set control is any control that has been set by the user. We need to ensure that everytime we boot the DSP we sync out any controls that were set. We could at some point start keeping track of the default values of the controls to suppress some of the device I/O. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-14ASoC: wm_adsp: memory leak in wm_adsp_create_control()Dan Carpenter1-2/+4
There are two return paths which don't kfree(name). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-12ASoC: wm_adsp: Expose coefficient blocks as ALSA binary controlsDimitris Papastamos1-7/+451
Add initial support for runtime tuning for the ADSP cores. This is achieved by exposing the coefficient configuration blocks as ALSA binary controls. The current code assumes that no controls on the DSP are volatile. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-12Merge remote-tracking branch 'asoc/topic/arizona' into asoc-nextMark Brown1-2/+38
2013-04-12Merge remote-tracking branch 'asoc/topic/adsp' into asoc-nextMark Brown1-9/+75
2013-04-11ASoC: wm_adsp: Add support for firmware wide coefficient blocksMark Brown1-0/+40
Firmwares may provide some firmware wide configuration regions which can be configured by the coefficient files using the firmware ID as the algorithm ID, include these in the algorithm list. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-29ASoC: wm_adsp: Split ADSP1 and ADSP2 firmware controlsMark Brown1-7/+19
Now that we have regular register mapped controls we should be splitting the control sets for ADSP1 and ADSP2 as the register maps are not identical. Do that. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-29ASoC: wm_adsp: Provide defines for firmwaresMark Brown1-5/+13
For future work to have specific handling for some firmwares. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-21ASoC: arizona: Basic support for ISRC rate selectionMark Brown1-0/+24
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-13ASoC: wm_adsp: Handle old .bin filesMark Brown1-4/+22
Older .bin files report the global coefficients as absolute address writes to zero; maintain compatibility with them. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-12ASoC: wm_adsp: fix possible memory leak in wm_adsp_load_coeff()Wei Yongjun1-2/+3
'file' is malloced in wm_adsp_load_coeff() and should be freed before leaving from the error handling cases, otherwise it will cause memory leak. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-02-11ASoC: wm_adsp: round to 4-byte boundary for coeff file blocksChris Rattray1-1/+7
Signed-off-by: Chris Rattray <crattray@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-02-04ASoC: wm_adsp: Use asynchronous I/O to write firmware and coefficientsMark Brown1-16/+66
Allow the regmap API to use asynchronous I/O where supported to minimise the delay between transfers, reducing firmware download times. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-30ASoC: wm_adsp: Fix support for firmware switching on DSP2 and higherMark Brown1-1/+1
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-29Merge remote-tracking branch 'asoc/fix/adsp' into asoc-adspMark Brown1-4/+12
Conflicts: sound/soc/codecs/wm_adsp.c
2013-01-29ASoC: wm_adsp: Ensure ADSP2 DMAs are quiesced when DSP is haltedMark Brown1-3/+11
Maximise robustness for the widest range of firmwares by ensuring the DSP is in a consistent state when halted. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-26ASoC: wm_adsp: Accept 0 as a parameter block addressMark Brown1-50/+35
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-26ASoC: wm_adsp: Add speaker Tx as a firmware optionMark Brown1-2/+3
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-24ASoC: wm_adsp: Correct handling of some coefficeint blocksMark Brown1-1/+2
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-22ASoC: wm_adsp: Release firmware on errorCharles Keepax1-1/+1
This patch correctly releases the firmware if the magic string in the firmware header does not match. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-21ASoC: wm_adsp: Provide explicit trace of coefficient writesMark Brown1-0/+3
Helpful for debugging. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-21Merge remote-tracking branch 'asoc/fix/adsp' into asoc-adspMark Brown1-1/+22
2013-01-20ASoC: wm_adsp: Use GFP_DMA for algorithm readbackMark Brown1-1/+1
Normally kmalloc() returns things that are DMA safe so not visible on all platforms but we do need to explicitly request DMA safe memory. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-20ASoC: wm_adsp: Use GFP_DMA for things that may be DMAedMark Brown1-2/+2
Normally kmalloc() returns things that are DMA safe so not visible on all platforms but we do need to explicitly request DMA safe memory. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-20ASoC: wm_adsp: Make region identification errors more informativeMark Brown1-1/+2
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-18ASoC: wm_adsp: Set ADSP1 clock rate to match sys clockChris Rattray1-0/+33
Sets the ADSP1 clock rate to match the system clock rate. To support this the codec driver provides details of register containing the system clock control bits. Signed-off-by: Chris Rattray <crattray@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-18ASoC: wm_adsp: Implement support for coefficeint file format 1Mark Brown1-5/+15
Implement support for a new revision of the coefficeint file format for ADSP cores. Since coefficient file format 0 has not been widely deployed and is very unlikely to ever be used with this driver code support for it has been removed. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-16ASoC: wm_adsp: Add initialisation function for ADSP1Mark Brown1-0/+8
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>