From: Lothar Waßmann Date: Fri, 4 Dec 2015 12:40:30 +0000 (+0100) Subject: ASoC: fsl: make audmux optional for i.MX6UL support X-Git-Tag: KARO-TXUL-2015-12-04~6 X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-linux.git;a=commitdiff_plain;h=b90fc6a4a4fd0a4620f36dea9d6200939890f710 ASoC: fsl: make audmux optional for i.MX6UL support --- diff --git a/Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt b/Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt index 2f89db88fd57..fd46671070b7 100644 --- a/Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt +++ b/Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt @@ -6,7 +6,7 @@ Required properties: - model : The user-visible name of this sound complex - - ssi-controller : The phandle of the i.MX SSI controller + - ssi-controller : The phandle of the i.MX SSI (or SAI) controller - audio-codec : The phandle of the SGTL5000 audio codec @@ -39,6 +39,16 @@ Required properties: Note: The AUDMUX port numbering should start at 1, which is consistent with hardware manual. +Optional properties: + - fsl,no-audmux : boolean + Required for i.MX6UL (and maybe other SoCs) + which don't have an AUDMUX, but still + feature the same audio subsystem otherwise. + +Note: Setting this property will make mux-int-port and mux-ext-port +obsolete. + + Example: sound { @@ -54,3 +64,17 @@ sound { mux-int-port = <1>; mux-ext-port = <3>; }; + +or (e.g. for i.MX6UL): +sound { + compatible = "karo,imx6ul-tx6ul-sgtl5000", + "fsl,imx-audio-sgtl5000"; + model = "imx6ul-tx6ul-sgtl5000"; + ssi-controller = <&sai2>; + audio-codec = <&sgtl5000>; + audio-routing = + "MIC_IN", "Mic Jack", + "Mic Jack", "Mic Bias", + "Headphone Jack", "HP_OUT"; + fsl,no-audmux; +}; diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c index b99e0b5e00e9..7cefb4065266 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);