diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-29 23:27:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-29 23:27:23 -0500 |
commit | ca2a650f3dfdc30d71d21bcbb04d2d057779f3f9 (patch) | |
tree | 12e5f7f4dea5ba17cc82f2c633bbe9dbf725fb11 /sound | |
parent | e9e352e9100b98aed1a5fb9e33355c29fb07d5b1 (diff) | |
parent | 15cec530e4bc7bed3f51cde8404f96fd28a8c7c5 (diff) |
Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dma updates from Vinod Koul:
- new driver for BCM2835 used in R-pi
- new driver for MOXA ART
- dma_get_any_slave_channel API for DT based systems
- minor fixes and updates spread acrooss driver
[ The fsl-ssi dual fifo mode support addition clashed badly with the
other changes to fsl-ssi that came in through the sound merge. I did
a very rough cut at fixing up the conflict, but Nicolin Chen (author
of both sides) will need to verify and check things ]
* 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (36 commits)
dmaengine: mmp_pdma: fix mismerge
dma: pl08x: Export pl08x_filter_id
acpi-dma: align documentation with kernel-doc format
dma: fix vchan_cookie_complete() debug print
DMA: dmatest: extend the "device" module parameter to 32 characters
drivers/dma: fix error return code
dma: omap: Set debug level to debugging messages
dmaengine: fix kernel-doc style typos for few comments
dma: tegra: add support for Tegra148/124
dma: dw: use %pad instead of casting dma_addr_t
dma: dw: join split up messages
dma: dw: fix style of multiline comment
dmaengine: k3dma: fix sparse warnings
dma: pl330: Use dma_get_slave_channel() in the of xlate callback
dma: pl330: Differentiate between submitted and issued descriptors
dmaengine: sirf: Add device_slave_caps interface
DMA: Freescale: change BWC from 256 bytes to 1024 bytes
dmaengine: Add MOXA ART DMA engine driver
dmaengine: Add DMA_PRIVATE to BCM2835 driver
dma: imx-sdma: Assign a default script number for ROM firmware cases
...
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index f9090b167ad7..6404e1ef20d0 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -164,6 +164,7 @@ struct fsl_ssi_private { | |||
164 | bool baudclk_locked; | 164 | bool baudclk_locked; |
165 | bool irq_stats; | 165 | bool irq_stats; |
166 | bool offline_config; | 166 | bool offline_config; |
167 | bool use_dual_fifo; | ||
167 | u8 i2s_mode; | 168 | u8 i2s_mode; |
168 | spinlock_t baudclk_lock; | 169 | spinlock_t baudclk_lock; |
169 | struct clk *baudclk; | 170 | struct clk *baudclk; |
@@ -721,6 +722,12 @@ static int fsl_ssi_setup(struct fsl_ssi_private *ssi_private) | |||
721 | CCSR_SSI_SxCCR_DC(2)); | 722 | CCSR_SSI_SxCCR_DC(2)); |
722 | } | 723 | } |
723 | 724 | ||
725 | if (ssi_private->use_dual_fifo) { | ||
726 | write_ssi_mask(&ssi->srcr, 0, CCSR_SSI_SRCR_RFEN1); | ||
727 | write_ssi_mask(&ssi->stcr, 0, CCSR_SSI_STCR_TFEN1); | ||
728 | write_ssi_mask(&ssi->scr, 0, CCSR_SSI_SCR_TCH_EN); | ||
729 | } | ||
730 | |||
724 | return 0; | 731 | return 0; |
725 | } | 732 | } |
726 | 733 | ||
@@ -752,6 +759,15 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream, | |||
752 | spin_unlock_irqrestore(&ssi_private->baudclk_lock, flags); | 759 | spin_unlock_irqrestore(&ssi_private->baudclk_lock, flags); |
753 | } | 760 | } |
754 | 761 | ||
762 | /* When using dual fifo mode, it is safer to ensure an even period | ||
763 | * size. If appearing to an odd number while DMA always starts its | ||
764 | * task from fifo0, fifo1 would be neglected at the end of each | ||
765 | * period. But SSI would still access fifo1 with an invalid data. | ||
766 | */ | ||
767 | if (ssi_private->use_dual_fifo) | ||
768 | snd_pcm_hw_constraint_step(substream->runtime, 0, | ||
769 | SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 2); | ||
770 | |||
755 | return 0; | 771 | return 0; |
756 | } | 772 | } |
757 | 773 | ||
@@ -1370,7 +1386,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
1370 | 1386 | ||
1371 | if (hw_type == FSL_SSI_MX21 || hw_type == FSL_SSI_MX51 || | 1387 | if (hw_type == FSL_SSI_MX21 || hw_type == FSL_SSI_MX51 || |
1372 | hw_type == FSL_SSI_MX35) { | 1388 | hw_type == FSL_SSI_MX35) { |
1373 | u32 dma_events[2]; | 1389 | u32 dma_events[2], dmas[4]; |
1374 | ssi_private->ssi_on_imx = true; | 1390 | ssi_private->ssi_on_imx = true; |
1375 | 1391 | ||
1376 | ssi_private->clk = devm_clk_get(&pdev->dev, NULL); | 1392 | ssi_private->clk = devm_clk_get(&pdev->dev, NULL); |
@@ -1426,6 +1442,16 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
1426 | goto error_clk; | 1442 | goto error_clk; |
1427 | } | 1443 | } |
1428 | } | 1444 | } |
1445 | /* Should this be merge with the above? */ | ||
1446 | if (!of_property_read_u32_array(pdev->dev.of_node, "dmas", dmas, 4) | ||
1447 | && dmas[2] == IMX_DMATYPE_SSI_DUAL) { | ||
1448 | ssi_private->use_dual_fifo = true; | ||
1449 | /* When using dual fifo mode, we need to keep watermark | ||
1450 | * as even numbers due to dma script limitation. | ||
1451 | */ | ||
1452 | ssi_private->dma_params_tx.maxburst &= ~0x1; | ||
1453 | ssi_private->dma_params_rx.maxburst &= ~0x1; | ||
1454 | } | ||
1429 | 1455 | ||
1430 | shared = of_device_is_compatible(of_get_parent(np), | 1456 | shared = of_device_is_compatible(of_get_parent(np), |
1431 | "fsl,spba-bus"); | 1457 | "fsl,spba-bus"); |