summaryrefslogtreecommitdiffstats
path: root/sound/soc/davinci
Commit message (Collapse)AuthorAgeFilesLines
*-. Merge remote-tracking branches 'asoc/topic/omap' and 'asoc/topic/rcar' into ↵Mark Brown2014-06-031-1/+1
|\ \ | | | | | | | | | asoc-next
| * | ASoC: omap-pcm: Move omap-pcm under include/soundJyri Sarha2014-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Make including the omap-pcm.h outside sound/soc/omap more convenient. Signed-off-by: Jyri Sarha <jsarha@ti.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | ASoC: davinci-evm: Replace instances of rtd->codec->card with rtd->cardLars-Peter Clausen2014-05-261-5/+4Star
|/ / | | | | | | | | | | | | | | | | No need to go via the CODEC to get a pointer to the card. This will help to eventually remove the card field from the snd_soc_codec struct. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci: add dependencies for SND_SOC_TLV320AIC3XArnd Bergmann2014-05-011-5/+5
| | | | | | | | | | | | | | | | | | This codec requires I2C to be enabled, so any other option that selects it should also depend on I2C. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-mcasp: Convert to use devm_snd_soc_register_component()Peter Ujfalusi2014-04-221-10/+7Star
| | | | | | | | | | | | | | It allows to remove code from the cleanup paths. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-pcm: Convert to use devm_snd_soc_register_platform()Peter Ujfalusi2014-04-225-28/+1Star
| | | | | | | | | | | | | | | | Remove the cleanup code related to the platform from the DAI drivers at the same time to avoid breakage. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-mcasp: Update MCASP_VERSION_4 platform driver registrationPeter Ujfalusi2014-04-181-6/+31
| | | | | | | | | | | | | | | | Version 4 of McASP is using omap-pcm as platform driver and the omap-pcm platform need to be registered using the cpu dai's device. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-mcasp: Do not touch 0x04 register above McASP_VERSION_2Peter Ujfalusi2014-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This register is not defined in TI81xx and on AM335x/AM437x it is the SYSCONFIG register which should not be touched by drivers since it is related to PM and handled by the generic PM code. This register write was there since the first time the davinci-mcasp driver was appeared in the kernel. The reason why it did not caused any issues on AM335x/AM437x is that it sets bit 1 in SYSCONFIG register which in turn will enable the smart-idle mode. This is the default mode and this is the mode McASP should be in also when in use. On TI81xx the register is not defined. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-mcasp: Remove excess empty lines from davinci_mcasp_set_dai_fmt()Peter Ujfalusi2014-04-141-8/+0Star
| | | | | | | | | | | | | | To make the code look uniform. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-mcasp: Support for LEFT_J formatPeter Ujfalusi2014-04-141-0/+7
| | | | | | | | | | | | | | Configuration for LEFT_J format. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-mcasp: Add support for I2S formatPeter Ujfalusi2014-04-141-1/+10
| | | | | | | | | | | | | | | | | | | | The FS needs to be inverted in McASP compared to other supported formats. Use a flag to indicate if the FS needs to be inverted. At the same time fail when non supported format is asked since the default case was anyways configuring McASP to a not valid format. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-mcasp: Move the FS polarity change out from the switch casePeter Ujfalusi2014-04-141-13/+14
| | | | | | | | | | | | | | | | | | | | FS polarity can be either rising or falling edge in McASP. Instead of accessing the registers in every switch/case set a flag and write the registers after the switch for the invert configuration. This change will help when adding support for more formats also. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-mcasp: Support for DSP_A formatPeter Ujfalusi2014-04-141-0/+7
| | | | | | | | | | | | | | DSP_A is like DSP_B mode but with one bit delay after the FS. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-mcasp: Format data delay configuration enhancementPeter Ujfalusi2014-04-141-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | Use intermediate variable for the data delay needed for the specific format and write the register after the format configuration at once. This will help to control the number of lines as support for more formats going to be added. Also fixes a case when we switch between two formats with different delay requirements. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-mcasp: Fine tune and correct the DMA burst configurationPeter Ujfalusi2014-04-141-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | When the AFIFO is not enabled but more than one serializers are used the DMA need to transfer number of words equal to active serializers when a DMA request is generated. When configuring the burst for the DMA avoid using value '1' for the burst since it is going to enable additional logic in the DMA drivers. Burst '1' means that the DMA should send/receive one word per DMA requests. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinic-mcasp: Adopt the AFIFO/DMA configuration to the stream ↵Peter Ujfalusi2014-04-141-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (dynamic depth) Configure the AFIFO numevt parameter based on the requested tx/rx_numevt, active serializers and period size in words. In this way McASP can adopt it's (and the DMA) configuration runtime and can pick the most optimal setup which satisfy the parameters. This way we do not need to place any constraint on the stream itself, allowing application greater freedom on how they want to set up ALSA. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-mcasp: Configure the AFIFO and DMA burst size at the same placePeter Ujfalusi2014-04-141-17/+13Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the dma_params->fifo_level and dma_data->maxburst configuration to the mcasp_common_hw_param() function where we configure the AFIFO registers. It makes the code regarding to AFIFO and DMA configuration more easy to follow since it is now clear how the AFIFO and how the DMA is going to be configured. Previously this has been done in two functions using a bit different calculation form - which ended up with the same result in both case at the end, but it was confusing. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-mcasp: Simplify and clean up the AFIFO configuration codePeter Ujfalusi2014-04-142-24/+25
| | | | | | | | | | | | | | | | We can have more linear code flow by using variables in mcasp_common_hw_param() related to the AFIFO configuration. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-mcasp: Fix debug typo in davinci_mcasp_hw_params()Peter Ujfalusi2014-04-141-1/+1
| | | | | | | | | | | | | | requred -> required Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-mcasp: Assign the dma_data earlier in dai_probe callbackPeter Ujfalusi2014-04-141-15/+21
| | | | | | | | | | | | | | | | | | Set up the playback_dma_data/capture_dma_data for the dai at probe time since the generic dmaengine PCM stack needs to have access to this information early. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-pcm: Add empty functions for !CONFIG_SND_DAVINCI_SOC buildsPeter Ujfalusi2014-04-141-0/+10
|/ | | | | | | | To save drivers using davinci-pcm and edma-pcm the need to fiddle with !CONFIG_SND_DAVINCI_SOC in their code. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Fix bit clock polarity settingsPeter Ujfalusi2014-04-081-3/+3
| | | | | | | | IB_NF, NB_IF and IB_IF configured the bc polarity incorrectly. The receive polarity was set to the same edge as the TX in these cases. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Provide correct filter_data for dmaengine for non-DT bootPeter Ujfalusi2014-03-171-5/+16
| | | | | | | | | | When we boot with non-DT mode the damengine will need the channel number and a filter function in order to get the channel. The filter_data is filled in the DAI driver while the filter_function will be provided by the edma-pcm driver. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci: Add edma dmaengine platform driverPeter Ujfalusi2014-03-172-0/+82
| | | | | | | | | | | Platform driver glue for SoC using eDMA3 to use dmaengine PCM. The maximum number of periods need to be limited to 19 since the edma dmaengine driver limits the paRAM slot use for audio at in cyclic mode. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-evm: Register machine level DAPM elements with the cardLars-Peter Clausen2014-03-131-14/+8Star
| | | | | | | | | | | | | Machine level DAPM widgets and routes should be registered in the card's DAPM context, rather than in the CODEC's context. While we are at it also drop the snd_soc_dapm_enable_pin() calls, since pins are enabled by default and also turn the snd_soc_dapm_disable_pin() calls into snd_soc_dapm_nc_pin() calls for unconnected pins. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Rename the pointer to davinci dma_params as dma_paramsPeter Ujfalusi2014-03-091-22/+22
| | | | | | | | It is quite confusing to name the pointer to davinci_pcm_dma_params as dma_data. Rename the pointer to avoid confusion. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Remove long lines from suspend/resume callbacksPeter Ujfalusi2014-02-031-24/+28
| | | | | | | | Move the context register storage behind of a struct and use a pointer to it in the suspend/resume callbacks to remove the long lines. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Rename platform data structPeter Ujfalusi2014-02-031-8/+8
| | | | | | | | | | | | Rename the struct for the platform data: snd_platform_data -> davinci_mcasp_pdata Since we have users under arch/arm/mach-davinci/ for this struct add temporary define to avoid breakage. The arch code can be updated later to use the new struct name. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Code cleanup in davinci_mcasp_hw_params()Peter Ujfalusi2014-02-031-12/+8Star
| | | | | | | Rearrange the code in the function for readability. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Move pm callbacks from platform device to soc_dai_driverPeter Ujfalusi2014-01-311-37/+37
| | | | | | | Handle the PM callbacks via the ASoC core instead of device core. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Return value handling cleanup for mcasp_common_hw_param()Peter Ujfalusi2014-01-311-2/+4
| | | | | | | | Take the return value from mcasp_common_hw_param() and use that in case of error. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge branch 'fix/davinci' of ↵Mark Brown2014-01-312-45/+39Star
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into HEAD
| * ASoC: davinci-evm: Add pm callbacks to platform driverPeter Ujfalusi2014-01-311-0/+1
| | | | | | | | | | | | | | Set snd_soc_pm_ops for the pm ops. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: davinci-mcasp: Consolidate pm_runtime_get/put() use in the driverPeter Ujfalusi2014-01-311-14/+9Star
| | | | | | | | | | | | | | | | | | The use of pm_runtime in trigger() callback is not correct and it will lead to unbalanced power.usage_count. The only place which might need to call pm_runtime is the set_fmt callback. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: davinci-mcasp: Configure xxTDM, xxFMT and xxFMCT registers synchronouslyPeter Ujfalusi2014-01-311-29/+27Star
| | | | | | | | | | | | | | | | | | | | | | | | These registers can be configured synchronously for playback and capture. Furthermore when McASP is in master and sync mode the capture operation needs the TX path to be configured in order to be able to provide the needed clocks for the bus. xxFMT and xxFMCT registers has been already configured for both TX and RX other places in the driver. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: davinci-mcasp: Harmonize the sub hw_params function namesPeter Ujfalusi2014-01-311-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of davinci_hw_common_param - for common, I2S/DIT mode settings davinci_hw_dit_param - for DIT protocol configuration davinci_hw_param - for I2S (and compatible protocols) Use the following names: mcasp_common_hw_param, mcasp_dit_hw_param and mcasp_i2s_hw_param. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-mcasp: Set BCLK divider if McASP is BCLK masterJyri Sarha2014-01-271-0/+20
| | | | | | | | | | | | | | | | Make BCLK divider setting implicite in hw_params call if McASP device is the bit clock master on the audio serial bus. Signed-off-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: davinci-evm: Add named clock reference to DT bindingsJyri Sarha2014-01-271-2/+56
|/ | | | | | | | | | The referenced clock is used to get codec clock rate and the clock is disabled and enabled in startup and shutdown snd_soc_ops call backs. The change is also documented in DT bindigs document. Signed-off-by: Jyri Sarha <jsarha@ti.com> cc: bcousson@baylibre.com Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci: Don't set unused struct snd_pcm_hardware fieldsLars-Peter Clausen2013-12-241-28/+0Star
| | | | | | | | | | | | The ASoC core assumes that the PCM component of the ASoC card transparently moves data around and does not impose any restrictions on the memory layout or the transfer speed. It ignores all fields from the snd_pcm_hardware struct for the PCM driver that are related to this. Setting these fields in the PCM driver might suggest otherwise though, so rather not set them. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Support for fck reparentingPeter Ujfalusi2013-12-101-0/+44
| | | | | | | | Optional DT property to specify the desired parent clock for the McASP fck clock. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Correct am33xx snd_platform_data namePeter Ujfalusi2013-12-101-2/+2
| | | | | | | | | An earlier patch overlooked this when the compatible has been changed from omap2 -> am33x. Rename omap2_mcasp_pdata to am33xx_mcasp_pdata. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Change IO functions parameter listPeter Ujfalusi2013-12-101-175/+161Star
| | | | | | | | | | | Instead of passing __iomem address (mcasp->base + register_offset) pass the main mcasp structure and only access the mcasp->base in the low level IO functions. In most cases this helps with code readability and it will make it easier to switch over to regmap in the future. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Support for McASP version found in DRA7xxPeter Ujfalusi2013-12-101-7/+45
| | | | | | | | | | | | The IP in DRA7xx is similar to the IP found in TI81xxAM3xxx/AM4xxx type of SoCs but it is is integrated with sDMA instead of eDMA. The suitable pcm driver for DRA7xx is the omap-pcm driver which is using dmaengine. In the driver we can configure both dma related structures used for eDMA and sDMA. The only thing we need to make sure that we set the correct dma_data at startup with snd_soc_dai_set_dma_data() Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Fix synchronous master receive modePeter Ujfalusi2013-12-101-1/+47
| | | | | | | | | In synchronous mode both transmit and receive sections are using the TX clocks. In setup like this the TX clocks need to be enabled when capture is running. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Data source (bus) selection supportPeter Ujfalusi2013-12-101-10/+28
| | | | | | | | | | | | The audio data to/from McASP can be sent/received via two method: Via the data port (preferred) or via the configuration bus. Currently the driver assumes that all data communication will be done via the data port. This patch adds support for selecting the configuration port as data interface. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Simplify FIFO configuration codePeter Ujfalusi2013-12-102-79/+38Star
| | | | | | | | | | | The FIFO registers base address is different in dm646x compared to newer SoCs with McASP IP. Instead of using two paths (switch/case) to handle the difference we can simply pick the correct base address beforehand and use offsets to address the register we need to configure. With this change the indentation depth can be reduced as well. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Be consistent with the use of base in ↵Peter Ujfalusi2013-12-101-6/+6
| | | | | | | | | | davinci_mcasp_set_dai_fmt Replace mcasp->base use with plain base in the davinci_mcasp_set_dai_fmt() function since it has been already used by the remaining part of the function. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Rename private struct and it's users (dev -> mcasp)Peter Ujfalusi2013-12-101-209/+209
| | | | | | | | | | | | Rename the private struct from davinci_audio_dev to davinci_mcasp. Change the local use of the pointer to this struct from *dev to *mcasp. The aim is to have better readable code for the first look since having dev->xxxx in the code when using the local private struct is a bit surprising. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Do not inline the mcasp_set_ctl_reg functionPeter Ujfalusi2013-12-101-1/+1
| | | | | | | It brings no benefit to inline this function due to it's size and function. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: davinci-mcasp: Remove unused DAVINCI_MCASP_NUM_SERIALIZER definePeter Ujfalusi2013-12-101-2/+0Star
| | | | | | | It is not used in the code. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>