Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1307718

[PATCH 1/2] ASoC: fsl: imx-sgtl5000: make audmux optional for imx sound driver

From Lothar Waßmann <LW@KARO-electronics.de>
Newsgroups linux.kernel
Subject [PATCH 1/2] ASoC: fsl: imx-sgtl5000: make audmux optional for imx sound driver
Date 2016-01-12 19:20 +0100
Message-ID <qQbHX-4HB-1@gated-at.bofh.it> (permalink)
References <qQbHY-4HB-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


i.MX6UL does not have the audio multiplexer (AUDMUX) like e.g. i.MX6Q,
but apart from that can use the same audio driver. Make audmux
optional for the imx-sgtl5000 driver, so it can be used on i.MX6UL
too. Also i.MX6UL requires use of the SAI interface rather than SSI.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 sound/soc/fsl/imx-sgtl5000.c | 70 +++++++++++++++++++++++---------------------
 1 file changed, 36 insertions(+), 34 deletions(-)

diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c
index b99e0b5..7cefb40 100644
--- a/sound/soc/fsl/imx-sgtl5000.c
+++ b/sound/soc/fsl/imx-sgtl5000.c
@@ -65,40 +65,42 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
 	int int_port, ext_port;
 	int ret;
 
-	ret = of_property_read_u32(np, "mux-int-port", &int_port);
-	if (ret) {
-		dev_err(&pdev->dev, "mux-int-port missing or invalid\n");
-		return ret;
-	}
-	ret = of_property_read_u32(np, "mux-ext-port", &ext_port);
-	if (ret) {
-		dev_err(&pdev->dev, "mux-ext-port missing or invalid\n");
-		return ret;
-	}
-
-	/*
-	 * The port numbering in the hardware manual starts at 1, while
-	 * the audmux API expects it starts at 0.
-	 */
-	int_port--;
-	ext_port--;
-	ret = imx_audmux_v2_configure_port(int_port,
-			IMX_AUDMUX_V2_PTCR_SYN |
-			IMX_AUDMUX_V2_PTCR_TFSEL(ext_port) |
-			IMX_AUDMUX_V2_PTCR_TCSEL(ext_port) |
-			IMX_AUDMUX_V2_PTCR_TFSDIR |
-			IMX_AUDMUX_V2_PTCR_TCLKDIR,
-			IMX_AUDMUX_V2_PDCR_RXDSEL(ext_port));
-	if (ret) {
-		dev_err(&pdev->dev, "audmux internal port setup failed\n");
-		return ret;
-	}
-	ret = imx_audmux_v2_configure_port(ext_port,
-			IMX_AUDMUX_V2_PTCR_SYN,
-			IMX_AUDMUX_V2_PDCR_RXDSEL(int_port));
-	if (ret) {
-		dev_err(&pdev->dev, "audmux external port setup failed\n");
-		return ret;
+	if (!of_property_read_bool(np, "fsl,no-audmux")) {
+		ret = of_property_read_u32(np, "mux-int-port", &int_port);
+		if (ret) {
+			dev_err(&pdev->dev, "mux-int-port missing or invalid\n");
+			return ret;
+		}
+		ret = of_property_read_u32(np, "mux-ext-port", &ext_port);
+		if (ret) {
+			dev_err(&pdev->dev, "mux-ext-port missing or invalid\n");
+			return ret;
+		}
+
+		/*
+		 * The port numbering in the hardware manual starts at 1, while
+		 * the audmux API expects it starts at 0.
+		 */
+		int_port--;
+		ext_port--;
+		ret = imx_audmux_v2_configure_port(int_port,
+				IMX_AUDMUX_V2_PTCR_SYN |
+				IMX_AUDMUX_V2_PTCR_TFSEL(ext_port) |
+				IMX_AUDMUX_V2_PTCR_TCSEL(ext_port) |
+				IMX_AUDMUX_V2_PTCR_TFSDIR |
+				IMX_AUDMUX_V2_PTCR_TCLKDIR,
+				IMX_AUDMUX_V2_PDCR_RXDSEL(ext_port));
+		if (ret) {
+			dev_err(&pdev->dev, "audmux internal port setup failed\n");
+			return ret;
+		}
+		ret = imx_audmux_v2_configure_port(ext_port,
+				IMX_AUDMUX_V2_PTCR_SYN,
+				IMX_AUDMUX_V2_PDCR_RXDSEL(int_port));
+		if (ret) {
+			dev_err(&pdev->dev, "audmux external port setup failed\n");
+			return ret;
+		}
 	}
 
 	ssi_np = of_parse_phandle(pdev->dev.of_node, "ssi-controller", 0);
-- 
2.1.4

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] ASoC: fsl: imx-sgtl5000: make audmux optional for imx sound driver Lothar Waßmann <LW@KARO-electronics.de> - 2016-01-12 19:20 +0100
  [PATCH 2/2] ASoC: fsl: select SND_SOC_FSL_SAI or SND_SOC_FSL_SSI depending on SoC type Lothar Waßmann <LW@KARO-electronics.de> - 2016-01-12 19:20 +0100
    Re: [PATCH 2/2] ASoC: fsl: select SND_SOC_FSL_SAI or SND_SOC_FSL_SSI  depending on SoC type Timur Tabi <timur@tabi.org> - 2016-01-12 19:30 +0100
      Re: [PATCH 2/2] ASoC: fsl: select SND_SOC_FSL_SAI or  SND_SOC_FSL_SSI depending on SoC type Lothar Waßmann <LW@KARO-electronics.de> - 2016-01-13 13:40 +0100
        Re: [PATCH 2/2] ASoC: fsl: select SND_SOC_FSL_SAI or SND_SOC_FSL_SSI  depending on SoC type Timur Tabi <timur@tabi.org> - 2016-01-13 15:20 +0100
    Re: [alsa-devel] [PATCH 2/2] ASoC: fsl: select SND_SOC_FSL_SAI or  SND_SOC_FSL_SSI depending on SoC type Fabio Estevam <festevam@gmail.com> - 2016-01-13 14:10 +0100
      Re: [alsa-devel] [PATCH 2/2] ASoC: fsl: select SND_SOC_FSL_SAI or  SND_SOC_FSL_SSI depending on SoC type Lothar Waßmann <LW@KARO-electronics.de> - 2016-01-13 15:10 +0100
  Re: [PATCH 1/2] ASoC: fsl: imx-sgtl5000: make audmux optional for  imx sound driver Mark Brown <broonie@kernel.org> - 2016-01-12 19:30 +0100
    Re: [PATCH 1/2] ASoC: fsl: imx-sgtl5000: make audmux optional for  imx sound driver Lothar Waßmann <LW@KARO-electronics.de> - 2016-01-13 12:20 +0100

csiph-web