Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Pargmann <mpa@pengutronix.de>
To: David Jander <david@protonic.nl>
Cc: alsa-devel@alsa-project.org, Shawn Guo <shawn.guo@linaro.org>,
	Sascha Hauer <kernel@pengutronix.de>
Subject: Re: [PATCH] ASoC: imx-sgtl5000.c: Add support for specifying PDCR_TXRXEN
Date: Thu, 24 Apr 2014 10:46:30 +0200	[thread overview]
Message-ID: <20140424084630.GD7361@pengutronix.de> (raw)
In-Reply-To: <1398268218-31897-1-git-send-email-david@protonic.nl>


[-- Attachment #1.1: Type: text/plain, Size: 3544 bytes --]

Hi,

On Wed, Apr 23, 2014 at 05:50:18PM +0200, David Jander wrote:
> This enables effectively swapping RX/TX pins on the external audio port
> 
> Signed-off-by: David Jander <david@protonic.nl>
> ---
>  Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt | 4 ++++
>  sound/soc/fsl/imx-sgtl5000.c                                   | 5 ++++-
>  2 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt b/Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt
> index e4acdd8..3afea85 100644
> --- a/Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt
> +++ b/Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt
> @@ -29,6 +29,10 @@ Required properties:
>  - mux-int-port : The internal port of the i.MX audio muxer (AUDMUX)
>  - mux-ext-port : The external port of the i.MX audio muxer
>  
> +Optional properties:
> +- ext-port-txrxen : Flag. Set to swap RX/TX signals on external port (set the
> +  IMX_AUDMUX_V2_PDCR_TXRXEN bit in the PDC register of the external port)
> +
>  Note: The AUDMUX port numbering should start at 1, which is consistent with
>  hardware manual.

You could also try to use the simple sound card and use DT properties to
setup audmux.

This is a configuration example for the audmux:
&audmux {
        status = "okay";

        aud4 {
                fsl,audmux-port = <MX31_AUDMUX_PORT4_SSI_PINS_4>;
                fsl,port-config = <
                        (IMX_AUDMUX_V2_PTCR_SYN |
                                IMX_AUDMUX_V2_PTCR_TFSDIR |
                                IMX_AUDMUX_V2_PTCR_TFSEL(MX31_AUDMUX_PORT1_SSI0) |
                                IMX_AUDMUX_V2_PTCR_TCLKDIR |
                                IMX_AUDMUX_V2_PTCR_TCSEL(MX31_AUDMUX_PORT1_SSI0))
                        IMX_AUDMUX_V2_PDCR_RXDSEL(MX31_AUDMUX_PORT1_SSI0)
                >;
        };
};

Regards,

Markus

>  
> diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c
> index 1cb22dd..b543fa6 100644
> --- a/sound/soc/fsl/imx-sgtl5000.c
> +++ b/sound/soc/fsl/imx-sgtl5000.c
> @@ -63,6 +63,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
>  	struct i2c_client *codec_dev;
>  	struct imx_sgtl5000_data *data = NULL;
>  	int int_port, ext_port;
> +	unsigned int ext_txrxen = 0;
>  	int ret;
>  
>  	ret = of_property_read_u32(np, "mux-int-port", &int_port);
> @@ -75,6 +76,8 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
>  		dev_err(&pdev->dev, "mux-ext-port missing or invalid\n");
>  		return ret;
>  	}
> +	if (of_property_read_bool(np, "ext-port-txrxen"))
> +		ext_txrxen = IMX_AUDMUX_V2_PDCR_TXRXEN;
>  
>  	/*
>  	 * The port numbering in the hardware manual starts at 1, while
> @@ -95,7 +98,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
>  	}
>  	ret = imx_audmux_v2_configure_port(ext_port,
>  			IMX_AUDMUX_V2_PTCR_SYN,
> -			IMX_AUDMUX_V2_PDCR_RXDSEL(int_port));
> +			IMX_AUDMUX_V2_PDCR_RXDSEL(int_port) | ext_txrxen);
>  	if (ret) {
>  		dev_err(&pdev->dev, "audmux external port setup failed\n");
>  		return ret;
> -- 
> 1.9.1
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  parent reply	other threads:[~2014-04-24  8:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1398268218-31897-1-git-send-email-david@protonic.nl>
2014-04-24  5:56 ` [PATCH] ASoC: imx-sgtl5000.c: Add support for specifying PDCR_TXRXEN Shawn Guo
2014-04-24  8:46 ` Markus Pargmann [this message]
2014-04-24  9:09   ` David Jander
2014-04-24  9:32     ` Markus Pargmann
2014-04-24 13:35       ` David Jander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140424084630.GD7361@pengutronix.de \
    --to=mpa@pengutronix.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=david@protonic.nl \
    --cc=kernel@pengutronix.de \
    --cc=shawn.guo@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox