[alsa-devel] [PATCH 0/2] ASoC: fix sound on mx31moboard
Hello
Theses two patches are necessary to get back the sound working on mx31moboards. The first one fix imx-ssi to work even if only the dma is available. The second one fix the audmux settings on mx31moboard boards.
Thanks,
Philippe
Philippe Rétornaz (2): ASoC: fsl: imx-ssi: fix probe on imx31 ASoC: fsl: Fix sound on mx31moboard
sound/soc/fsl/imx-mc13783.c | 2 +- sound/soc/fsl/imx-ssi.c | 23 ++++++++++++----------- sound/soc/fsl/imx-ssi.h | 2 ++ 3 files changed, 15 insertions(+), 12 deletions(-)
On imx31 with mc13783 codec the FIQ is not necessary and not enabled as DMA transfer is available. Change the probe() function to fail only if both FIQ and DMA are not available.
Signed-off-by: Philippe Rétornaz philippe.retornaz@epfl.ch --- sound/soc/fsl/imx-ssi.c | 23 ++++++++++++----------- sound/soc/fsl/imx-ssi.h | 2 ++ 2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c index f58bcd8..57d6941 100644 --- a/sound/soc/fsl/imx-ssi.c +++ b/sound/soc/fsl/imx-ssi.c @@ -600,19 +600,17 @@ static int imx_ssi_probe(struct platform_device *pdev) ssi->fiq_params.dma_params_rx = &ssi->dma_params_rx; ssi->fiq_params.dma_params_tx = &ssi->dma_params_tx;
- ret = imx_pcm_fiq_init(pdev, &ssi->fiq_params); - if (ret) - goto failed_pcm_fiq; + ssi->fiq_init = imx_pcm_fiq_init(pdev, &ssi->fiq_params); + ssi->dma_init = imx_pcm_dma_init(pdev);
- ret = imx_pcm_dma_init(pdev); - if (ret) - goto failed_pcm_dma; + if (ssi->fiq_init && ssi->dma_init) { + ret = ssi->fiq_init; + goto failed_pcm; + }
return 0;
-failed_pcm_dma: - imx_pcm_fiq_exit(pdev); -failed_pcm_fiq: +failed_pcm: snd_soc_unregister_component(&pdev->dev); failed_register: release_mem_region(res->start, resource_size(res)); @@ -628,8 +626,11 @@ static int imx_ssi_remove(struct platform_device *pdev) struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); struct imx_ssi *ssi = platform_get_drvdata(pdev);
- imx_pcm_dma_exit(pdev); - imx_pcm_fiq_exit(pdev); + if (!ssi->dma_init) + imx_pcm_dma_exit(pdev); + + if (!ssi->fiq_init) + imx_pcm_fiq_exit(pdev);
snd_soc_unregister_component(&pdev->dev);
diff --git a/sound/soc/fsl/imx-ssi.h b/sound/soc/fsl/imx-ssi.h index fb1616b..560c40f 100644 --- a/sound/soc/fsl/imx-ssi.h +++ b/sound/soc/fsl/imx-ssi.h @@ -211,6 +211,8 @@ struct imx_ssi { struct imx_dma_data filter_data_rx; struct imx_pcm_fiq_params fiq_params;
+ int fiq_init; + int dma_init; int enabled; };
Commit 42810d (ASoC: imx-mc13783: Add audmux settings for mx27pdk) broke the sound on mx31moboard. Restore back the audmux setting on such boards.
Signed-off-by: Philippe Rétornaz philippe.retornaz@epfl.ch --- sound/soc/fsl/imx-mc13783.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/fsl/imx-mc13783.c b/sound/soc/fsl/imx-mc13783.c index a3d60d4..a2fd732 100644 --- a/sound/soc/fsl/imx-mc13783.c +++ b/sound/soc/fsl/imx-mc13783.c @@ -112,7 +112,7 @@ static int imx_mc13783_probe(struct platform_device *pdev) return ret; }
- if (machine_is_mx31_3ds()) { + if (machine_is_mx31_3ds() || machine_is_mx31moboard()) { imx_audmux_v2_configure_port(MX31_AUDMUX_PORT4_SSI_PINS_4, IMX_AUDMUX_V2_PTCR_SYN, IMX_AUDMUX_V2_PDCR_RXDSEL(MX31_AUDMUX_PORT1_SSI0) |
On Tue, Oct 01, 2013 at 02:36:11PM +0200, Philippe Rétornaz wrote:
Commit 42810d (ASoC: imx-mc13783: Add audmux settings for mx27pdk) broke the sound on mx31moboard. Restore back the audmux setting on such boards.
Applied, thanks.
On Tue, Oct 01, 2013 at 02:36:10PM +0200, Philippe Rétornaz wrote:
On imx31 with mc13783 codec the FIQ is not necessary and not enabled as DMA transfer is available. Change the probe() function to fail only if both FIQ and DMA are not available.
Is this something that used to work but has been broken or is this enabling a new feture? Just wondering if this needs to be sent to Linus as a fix.
Le 03/10/2013 17:59, Mark Brown a écrit :
On Tue, Oct 01, 2013 at 02:36:10PM +0200, Philippe Rétornaz wrote:
On imx31 with mc13783 codec the FIQ is not necessary and not enabled as DMA transfer is available. Change the probe() function to fail only if both FIQ and DMA are not available.
Is this something that used to work but has been broken or is this enabling a new feture? Just wondering if this needs to be sent to Linus as a fix.
It was working but it is broken since a few release. There is no need to rush for a fix, both patches can follow the standard process. Anyway, there is a pending fix on the imx-sdma driver in order to have the sound fully working again on my board: http://lists.infradead.org/pipermail/linux-arm-kernel/2013-October/201498.ht...
Thanks !
Philippe
Hi Philippe,
On Thu, Oct 3, 2013 at 1:07 PM, Philippe Rétornaz philippe.retornaz@epfl.ch wrote:
It was working but it is broken since a few release. There is no need to rush for a fix, both patches can follow the standard process.
Thanks for the fix.
If you have a chance, it would be really nice if mx31-moboard could be converted to device tree, as this would help us towards the goal of getting rid of the sound/soc/fsl/imx-ssi.c driver, which only supports the non-dt imx parts.
We have been using sound/soc/fsl/fsl_ssi.c for the dt imx and powerpc parts, and that's probably the reason we haven't noticed this bug.
Regards,
Fabio Estevam
Hello
Le 04/10/2013 20:10, Fabio Estevam a écrit :
On Thu, Oct 3, 2013 at 1:07 PM, Philippe Rétornaz wrote
It was working but it is broken since a few release. There is no need to rush for a fix, both patches can follow the standard process.
We have been using sound/soc/fsl/fsl_ssi.c for the dt imx and powerpc parts, and that's probably the reason we haven't noticed this bug.
Well, I don't think it's fair to break boards just because they are not (yet) converted to DT ... this board was merged before the DT era on ARM.
Anyway even on DT it's broken: before the switch to the common asoc pcm code, the dma API was misused to let it think that the audio part of the SoC was doing the bus mastering, while in fact the sdma was doing it.
Regards,
Philippe
On Mon, Oct 7, 2013 at 6:07 AM, Philippe Rétornaz philippe.retornaz@epfl.ch wrote:
Well, I don't think it's fair to break boards just because they are not (yet) converted to DT ... this board was merged before the DT era on ARM.
Sure, I agree. Just trying to avoid to keep two drivers for the same hardware.
I will try to convert mx31 to use sound/soc/fsl/fsl_ssi.c when time allows.
Regards,
Fabio Estevam
On Tue, Oct 01, 2013 at 02:36:10PM +0200, Philippe Rétornaz wrote:
On imx31 with mc13783 codec the FIQ is not necessary and not enabled as DMA transfer is available. Change the probe() function to fail only if both FIQ and DMA are not available.
Applied, thanks.
participants (3)
-
Fabio Estevam
-
Mark Brown
-
Philippe Rétornaz