]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: mxs-sgtl5000: Configure the dai_links as unidirectional
authorFabio Estevam <fabio.estevam@freescale.com>
Thu, 29 Aug 2013 13:32:14 +0000 (10:32 -0300)
committerMark Brown <broonie@linaro.org>
Sun, 1 Sep 2013 15:29:27 +0000 (16:29 +0100)
On a mx28 board, running "aplay -l" and "arecord -l" results in the following:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: mxssgtl5000 [mxs_sgtl5000], device 0: Playback sgtl5000-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: mxssgtl5000 [mxs_sgtl5000], device 1: Capture sgtl5000-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: mxssgtl5000 [mxs_sgtl5000], device 0: Playback sgtl5000-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: mxssgtl5000 [mxs_sgtl5000], device 1: Capture sgtl5000-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

,which is not correct because we got a capture device listed in aplay and a
playback device listed in arecord.

On mx28 there are two serial audio interface ports (SAIF0 and SAIF1) and each
one of them are unidirectional.

Allow to specify a dai link as 'playback_only' or 'capture_only', which suits
well for this case.

After this change we can correctly report the capabilities as follows:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: mxssgtl5000 [mxs_sgtl5000], device 0: HiFi Playback sgtl5000-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: mxssgtl5000 [mxs_sgtl5000], device 1: HiFi Capture sgtl5000-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Also tested playback and capture on the mx28evk board.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/mxs/mxs-sgtl5000.c

index 1b134d72f120a60b5956032986b964c6f659ab0e..ed8a51945306956cb889c0a3108fedd6ef2112ea 100644 (file)
@@ -91,11 +91,13 @@ static struct snd_soc_dai_link mxs_sgtl5000_dai[] = {
                .stream_name    = "HiFi Playback",
                .codec_dai_name = "sgtl5000",
                .ops            = &mxs_sgtl5000_hifi_ops,
+               .playback_only  = true,
        }, {
                .name           = "HiFi Rx",
                .stream_name    = "HiFi Capture",
                .codec_dai_name = "sgtl5000",
                .ops            = &mxs_sgtl5000_hifi_ops,
+               .capture_only   = true,
        },
 };