diff options
author | Nicolin Chen <Guangyu.Chen@freescale.com> | 2014-01-06 03:28:51 -0500 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:47:37 -0400 |
commit | 3d184d6f16500c70699df6e9a610af74a96e3955 (patch) | |
tree | a82cbb9bd42f09bfadcfa500c4e4d826afd7d6b8 | |
parent | af2f333bccd2923b9f155a38e3b2b51afde0393a (diff) |
ENGR00295423-1 ASoC: fsl_ssi: Implement full symmetry for synchronous mode
Since we introduced symmetric_channels and symmetric_samplebits, we can
implement these new feature to SSI synchronous mode and drop the useless
code accordingly.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 174578ccf9b8..ce18518add3d 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Author: Timur Tabi <timur@freescale.com> | 4 | * Author: Timur Tabi <timur@freescale.com> |
5 | * | 5 | * |
6 | * Copyright (C) 2007-2013 Freescale Semiconductor, Inc. | 6 | * Copyright (C) 2007-2014 Freescale Semiconductor, Inc. |
7 | * | 7 | * |
8 | * This file is licensed under the terms of the GNU General Public License | 8 | * This file is licensed under the terms of the GNU General Public License |
9 | * version 2. This program is licensed "as is" without any warranty of any | 9 | * version 2. This program is licensed "as is" without any warranty of any |
@@ -118,8 +118,6 @@ void dump_reg(struct ccsr_ssi __iomem *ssi) {} | |||
118 | * @ssi: pointer to the SSI's registers | 118 | * @ssi: pointer to the SSI's registers |
119 | * @ssi_phys: physical address of the SSI registers | 119 | * @ssi_phys: physical address of the SSI registers |
120 | * @irq: IRQ of this SSI | 120 | * @irq: IRQ of this SSI |
121 | * @first_stream: pointer to the stream that was opened first | ||
122 | * @second_stream: pointer to second stream | ||
123 | * @playback: the number of playback streams opened | 121 | * @playback: the number of playback streams opened |
124 | * @capture: the number of capture streams opened | 122 | * @capture: the number of capture streams opened |
125 | * @cpu_dai: the CPU DAI for this device | 123 | * @cpu_dai: the CPU DAI for this device |
@@ -131,8 +129,6 @@ struct fsl_ssi_private { | |||
131 | struct ccsr_ssi __iomem *ssi; | 129 | struct ccsr_ssi __iomem *ssi; |
132 | dma_addr_t ssi_phys; | 130 | dma_addr_t ssi_phys; |
133 | unsigned int irq; | 131 | unsigned int irq; |
134 | struct snd_pcm_substream *first_stream; | ||
135 | struct snd_pcm_substream *second_stream; | ||
136 | unsigned int fifo_depth; | 132 | unsigned int fifo_depth; |
137 | struct snd_soc_dai_driver cpu_dai_drv; | 133 | struct snd_soc_dai_driver cpu_dai_drv; |
138 | struct device_attribute dev_attr; | 134 | struct device_attribute dev_attr; |
@@ -355,11 +351,9 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream, | |||
355 | * If this is the first stream opened, then request the IRQ | 351 | * If this is the first stream opened, then request the IRQ |
356 | * and initialize the SSI registers. | 352 | * and initialize the SSI registers. |
357 | */ | 353 | */ |
358 | if (!ssi_private->first_stream) { | 354 | if (!dai->active) { |
359 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; | 355 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; |
360 | 356 | ||
361 | ssi_private->first_stream = substream; | ||
362 | |||
363 | /* | 357 | /* |
364 | * Section 16.5 of the MPC8610 reference manual says that the | 358 | * Section 16.5 of the MPC8610 reference manual says that the |
365 | * SSI needs to be disabled before updating the registers we set | 359 | * SSI needs to be disabled before updating the registers we set |
@@ -434,8 +428,6 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream, | |||
434 | * this is bad is because at this point, the PCM driver has not | 428 | * this is bad is because at this point, the PCM driver has not |
435 | * finished initializing the DMA controller. | 429 | * finished initializing the DMA controller. |
436 | */ | 430 | */ |
437 | } else { | ||
438 | ssi_private->second_stream = substream; | ||
439 | } | 431 | } |
440 | 432 | ||
441 | return 0; | 433 | return 0; |
@@ -778,13 +770,8 @@ static void fsl_ssi_shutdown(struct snd_pcm_substream *substream, | |||
778 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 770 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
779 | struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(rtd->cpu_dai); | 771 | struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(rtd->cpu_dai); |
780 | 772 | ||
781 | if (ssi_private->first_stream == substream) | ||
782 | ssi_private->first_stream = ssi_private->second_stream; | ||
783 | |||
784 | ssi_private->second_stream = NULL; | ||
785 | |||
786 | /* If this is the last active substream, disable the interrupts. */ | 773 | /* If this is the last active substream, disable the interrupts. */ |
787 | if (!ssi_private->first_stream) { | 774 | if (!dai->active) { |
788 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; | 775 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; |
789 | 776 | ||
790 | write_ssi_mask(&ssi->sier, SIER_FLAGS, 0); | 777 | write_ssi_mask(&ssi->sier, SIER_FLAGS, 0); |
@@ -973,8 +960,11 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
973 | } | 960 | } |
974 | 961 | ||
975 | /* Are the RX and the TX clocks locked? */ | 962 | /* Are the RX and the TX clocks locked? */ |
976 | if (!of_find_property(np, "fsl,ssi-asynchronous", NULL)) | 963 | if (!of_find_property(np, "fsl,ssi-asynchronous", NULL)) { |
977 | ssi_private->cpu_dai_drv.symmetric_rates = 1; | 964 | ssi_private->cpu_dai_drv.symmetric_rates = 1; |
965 | ssi_private->cpu_dai_drv.symmetric_channels = 1; | ||
966 | ssi_private->cpu_dai_drv.symmetric_samplebits = 1; | ||
967 | } | ||
978 | 968 | ||
979 | /* Determine the FIFO depth. */ | 969 | /* Determine the FIFO depth. */ |
980 | iprop = of_get_property(np, "fsl,fifo-depth", NULL); | 970 | iprop = of_get_property(np, "fsl,fifo-depth", NULL); |