aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/soc/davinci/davinci-mcasp.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-12-18ASoC: ti: Merge davinci and omap directoriesPeter Ujfalusi1-306/+0
Create new directory to contain all Texas Instruments specific DAI, platform and machine drivers instead of scattering them under davinci and omap directories. There is already inter dependency between the two directories becasue of McASP (on dra7x it is serviced by sDMA, not EDMA). With the upcoming AM654 we will need to introduce new platform driver for UDMA and it does not fit under davinci, nor under omap. With the move I have restructured the Kconfig to be more usable in the era of simple-sound-card: CPU DAIs can be selected individually and they will select the platform driver they can be served with. To avoid breakage, I have moved over deprecated Kconfig options so defconfig builds will work without regression. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> For sound/soc/{omap => ti}: Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-28ASoC: davinci-mcasp: Implement configurable dismod handlingPeter Ujfalusi1-0/+1
If the dismod is specified in the DT node, use the specified custom value to configure the drive on state of the inactive TX slots. If the dismod is not present or booted in legacy mode, the dismod is set to low as it was the original behavior. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-28ASoC: davinci-mcasp: Update PDIR (pin direction) register handlingPeter Ujfalusi1-19/+10
When McASP is master and the PDIR for the clock pins are configured as outputs before the clocking is configured it will output whatever clock is generated at the moment internally. The clock will switch to the correct rate only when the we start the clock generators. To avoid this we must only set the pin as output after the clock is configured and enabled. AXR pins configured as outputs behaves somehow interesting as well: when McASP is not enabled and the pin is selected as output it will not honor the DISMOD settings for the inactive state, but will pull the pin down. Add a new bitfield and mark the pins there which needs to be output and set the pins only at the time when they will behave correctly. On stream stop configure the pins back to input which makes them to obey the global pin configuration regarding to pull up/down. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-02ASoC: davinci-mcasp: Fix dra7 DMA offset when using CFG portPeter Ujfalusi1-2/+2
The TX and RX offset is different for each serializers when using the CFG port for DMA access. When using the CFG port only one serializer can be used per direction so print error message and only configure the first serializer's offset. Reported-by: Misael Lopez Cruz <misael.lopez@ti.com> Suggested-by: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-09ASoC: davinci-mcasp: Use defines for clkdiv IDsPeter Ujfalusi1-0/+5
Instead of hardwired IDs add defines for the available dividers. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-08ASoC: davinci-mcasp: Logic low for inactive output slotsMisael Lopez Cruz1-1/+4
The default state when serializers are in inactive slots is Hi-Z. In some cases, there are no additional components driving the data lines to a safe state so they might have noise. While in inactive slots, the McASP AXR pins configured as outputs can be driven low through the serializer pin drive mode setting (DISMOD) to prevent such noise. Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-12ASoC: davinci-mcasp: Add overrun/underrun event handlingMisael Lopez Cruz1-0/+11
An underrun (playback) event occurs when the serializer transfer data from the XRBUF buffer to the XRSR shift register, but the XRBUF hasn't been filled. Similarly, the overrun (capture) event occurs when data from the XRSR shift register is transferred to the XRBUF but it hasn't been read yet. These events are handled as XRUN events that cause the pcm to stop. The stream has to be explicitly restarted by the userspace which ensures that after stopping/starting McASP the data transfer is aligned with DMA. The other possibility was to internally stop and start McASP without DMA even knowing about it. Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-29ASoC: davinci-mcasp: Correct TX start sequencePeter Ujfalusi1-0/+6
Follow the sequence described in the TRMs when starting TX. This sequence will make sure that we are not facing with initial channel swap caused by no data available in McASP for transmit. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-04-14ASoC: davinci-mcasp: Simplify and clean up the AFIFO configuration codePeter Ujfalusi1-0/+1
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>
2013-12-10ASoC: davinci-mcasp: Simplify FIFO configuration codePeter Ujfalusi1-8/+8
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>
2013-12-10ASoC: davinci-mcasp: Move private struct definition to source filePeter Ujfalusi1-35/+0
Since it is a private struct strictly used by the davinci-mcasp driver it can be moved from header file to the source file. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10ASoC: davinci-mcasp: Move register definitions to header filePeter Ujfalusi1-0/+267
It is better for readability to have the register definitions out from the source file. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10ASoC: davinci-mcasp: Remove unused DAVINCI_MCASP_I2S/DIT_DAI definesPeter Ujfalusi1-3/+0
These are not used, probably leftovers from the past. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10ASoC: davinci-mcasp: Move DAVINCI_MCASP_RATE from header to source filePeter Ujfalusi1-1/+0
It is not used outside of the .c file. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-03ASoC: davinci-mcasp: add support for suspend and resumeDaniel Mack1-0/+12
When the system returns from suspend, it looses its configuration. Most of it is restored by running a normal audio stream startup, but the DAI format is left unset as that's configured on the audio device creation. Hence, it suffices here to care for the registers which are touched by davinci_mcasp_set_dai_fmt() and restore them when the system is resumed. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-04-23ASoC: davinci-mcasp: Add Support BCLK-to-LRCLK ratio for TDM modesMichal Bachraty1-1/+1
For TDM mode, BCLK-to-LCLK ratio is computed as (tdm_slots) x (word_length). I2S mode is only subset of TDM mode with specific tdm_slots = 2 channels. Also bclk_lrclk_ratio can be greater than 255, therefore u16 need to be used. Signed-off-by: Michal Bachraty <michal.bachraty@streamunlimited.com> Acked-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-07ASoC: McASP: implement a way to force BCLK/LRCLK ratiosDaniel Mack1-0/+1
Depending on the Codec, the the BCLK/LRCLK ratio might not be freely chosen by the CPU DAI. For example, some Codec might want to be supplied with 32-bit samples for both its channels regardless of the actual audio word size the CPU sends. In such cases, the rest of the bits on the data lines must be padded with zeros: _______________________________ LRCLK / \ --' `---------- ..... BCLK ||||||||||||||||||||||||||||||||||||||||||||||| ..... DATA ____||||||||||||||||_________________|||||||||| ..... |<-- data -->|<-- pads --> | This patch adds a new clock divider to configure the BCLK/LRCLK ratio. If the machine code uses that divider, the driver uses the specified value, instead of deriving that information from the audio word size. Otherwise, the original behaviour is retained. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-07ASoC: McASP: calculate values for channel sizeDaniel Mack1-10/+0
Change davinci_config_channel_size() to derive the values for XSSZ and XROT in DAVINCI_MCASP_[RT]XFMT_REG from the configured word length rather than hard-coding them in a switch/case block. Also, by directly passing the word length to davinci_config_channel_size(), we can get rid of the DAVINCI_AUDIO_WORD_* enum. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-07ASoC: McASP: remove unused variablesDaniel Mack1-2/+0
codec_fmt and sample_rate variables are unused in both snd_platform_data and davinci_audio_dev, so drop them. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-15ASoC: enable 192KHz support for McASPDaniel Mack1-1/+1
Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-27ASoC/ARM: Davinci: McASP: split asp header into platform and audio specificHebbar, Gururaja1-1/+2
Davinci McASP header & driver are shared by few OMAP platforms (like TI81xx, AM335x). Splitting asp header into Davinci platform specific header and Audio specific header helps to share them across platforms. Audio specific defines is moved to to common <linux/platform_data/davinci_asp.h> so that the header can be accessed by all related platforms. While here, correct the header usage (remove multiple header re-definitions and unused headers) and remove platform names from structures comments and enum. Also some some coding style errors. Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com> Acked-by: Vaibhav Bedia <vaibhav.bedia@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-09ASoC: McASP: Convert driver to use Runtime PM APIHebbar, Gururaja1-2/+1
* Add Runtime PM support to McASP host controller. * Use Runtime PM API to enable/disable McASP clock. This was tested on AM18x Board using suspend/resume Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-12ASoC: multi-component - ASoC Multi-Component SupportLiam Girdwood1-2/+0
This patch extends the ASoC API to allow sound cards to have more than one CODEC and more than one platform DMA controller. This is achieved by dividing some current ASoC structures that contain both driver data and device data into structures that only either contain device data or driver data. i.e. struct snd_soc_codec ---> struct snd_soc_codec (device data) +-> struct snd_soc_codec_driver (driver data) struct snd_soc_platform ---> struct snd_soc_platform (device data) +-> struct snd_soc_platform_driver (driver data) struct snd_soc_dai ---> struct snd_soc_dai (device data) +-> struct snd_soc_dai_driver (driver data) struct snd_soc_device ---> deleted This now allows ASoC to be more tightly aligned with the Linux driver model and also means that every ASoC codec, platform and (platform) DAI is a kernel device. ASoC component private data is now stored as device private data. The ASoC sound card struct snd_soc_card has also been updated to store lists of it's components rather than a pointer to a codec and platform. The PCM runtime struct soc_pcm_runtime now has pointers to all its components. This patch adds DAPM support for ASoC multi-component and removes struct snd_soc_socdev from DAPM core. All DAPM calls are now made on a card, codec or runtime PCM level basis rather than using snd_soc_socdev. Other notable multi-component changes:- * Stream operations now de-reference less structures. * close_delayed work() now runs on a DAI basis rather than looping all DAIs in a card. * PM suspend()/resume() operations can now handle N CODECs and Platforms per sound card. * Added soc_bind_dai_link() to bind the component devices to the sound card. * Added soc_dai_link_probe() and soc_dai_link_remove() to probe and remove DAI link components. * sysfs entries can now be registered per component per card. * snd_soc_new_pcms() functionailty rolled into dai_link_probe(). * snd_soc_register_codec() now does all the codec list and mutex init. This patch changes the probe() and remove() of the CODEC drivers as follows:- o Make CODEC driver a platform driver o Moved all struct snd_soc_codec list, mutex, etc initialiasation to core. o Removed all static codec pointers (drivers now support > 1 codec dev) o snd_soc_register_pcms() now done by core. o snd_soc_register_dai() folded into snd_soc_register_codec(). CS4270 portions: Acked-by: Timur Tabi <timur@freescale.com> Some TLV320aic23 and Cirrus platform fixes. Signed-off-by: Ryan Mallon <ryan@bluewatersys.com> TI CODEC and OMAP fixes Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Samsung platform and misc fixes :- Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Reviewed-by: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Seungwhan Youn <sw.youn@samsung.com> MPC8610 and PPC fixes. Signed-off-by: Timur Tabi <timur@freescale.com> i.MX fixes and some core fixes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> J4740 platform fixes:- Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> CC: Tony Lindgren <tony@atomide.com> CC: Nicolas Ferre <nicolas.ferre@atmel.com> CC: Kevin Hilman <khilman@deeprootsystems.com> CC: Sascha Hauer <s.hauer@pengutronix.de> CC: Atsushi Nemoto <anemo@mba.ocn.ne.jp> CC: Kuninori Morimoto <morimoto.kuninori@renesas.com> CC: Daniel Gloeckner <dg@emlix.com> CC: Manuel Lauss <mano@roarinelk.homelinux.net> CC: Mike Frysinger <vapier.adi@gmail.com> CC: Arnaud Patard <apatard@mandriva.com> CC: Wan ZongShun <mcuos.com@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-12-04ASoC: DaVinci: Update suspend/resume support for McASP driverChaithrika U S1-0/+1
Add clock enable and disable calls to resume and suspend respectively. Also add a member to the audio device data structure which tracks the clock status. Tested on DA850/OMAP-L138 EVM. For the purpose of testing, the patches[1] which add suspend-to-RAM support to DA850/OMAP-L138 SoC were applied. [1] http://linux.davincidsp.com/pipermail/davinci-linux-open-source/ 2009-November/016958.html Signed-off-by: Chaithrika U S <chaithrika@ti.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-11-18ASoC: DaVinci: remove requirement that dma_params is 1st in structureTroy Kisky1-5/+0
Remove requirement that dma_params is 1st in the structures davinci_audio_dev and davinci_mcbsp_dev. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-09-23ASoC: Davinci: Fix race with cpu_dai->dma_dataTroy Kisky1-1/+6
This patch removes references to cpu_dai->dma_data. It makes struct davinci_pcm_dma_params part of struct davinci_mcbsp_dev or struct davinci_audio_dev. It removes the unused name variable from davinci_pcm_dma_params. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-13ASoC: DaVinci: McASP driver enhacementsChaithrika U S1-0/+5
On DA830/OMAP-L137 and DA850/OMAP-L138 SoCs, the McASP peripheral has FIFO support. This FIFO provides additional data buffering. It also provides tolerance to variation in host/DMA controller response times. The read and write FIFO sizes are 256 bytes each. If FIFO is enabled, the DMA events from McASP are sent to the FIFO which in turn sends DMA requests to the host CPU according to the thresholds programmed. More details of the FIFO operation can be found at http://focus.ti.com/general/docs/lit/getliterature.tsp?literatureNumber= sprufm1&fileType=pdf This patch adds support for FIFO configuration. The platform data has a version field which differentiates the McASP on different SoCs. Signed-off-by: Chaithrika U S <chaithrika@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-07ASoC: Add mcasp support for DM646xChaithrika U S1-0/+55
Adds driver support for the two instances of McASP on TI's DM646x. The multichannel audio serial port (McASP) functions as a general-purpose audio serial port optimized for the needs of multichannel audio application. (http://www.ti.com/litv/pdf/spruer1b). There are two instances of McASP on DM646x. The McASP0 module includes up to 4 serializers that can be individually enabled to either transmit or receive in different modes. The McASP1 module is limited with only 1 pinned-out serializer that can be enabled to only transmit in DIT mode (neither receiving in any mode nor transmitting in either Burst or TDM mode is supported). McASP0 consists of transmit and receive sections that may operate synchronized, or completely independently with separate master clocks, bit clocks, and frame syncs, and using different transmit modes with different bit-stream formats. Signed-off-by: Steve Chen <schen@mvista.com> Signed-off-by: Pavel Kiryukhin <pkiryukhin@ru.mvista.com> Signed-off-by: Naresh Medisetty <naresh@ti.com> Signed-off-by: Chaithrika U S <chaithrika@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>