* [PATCH] ASoC: mxs: mxs-saif: Fix the playback/record capabilities
@ 2013-06-02 16:38 Fabio Estevam
2013-06-02 19:56 ` Lars-Peter Clausen
0 siblings, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2013-06-02 16:38 UTC (permalink / raw)
To: broonie; +Cc: marex, Fabio Estevam, alsa-devel
From: Fabio Estevam <fabio.estevam@freescale.com>
Running "aplay -l" and "arecord -l" results in the following outputs:
$ 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
On mx28 there are two serial audio interface ports (SAIF0 and SAIF1) and each
one of them are unidirectional.
Create a mxs_saif_dai array containing a playback element and a record element
only in order to properly describe the dai links.
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
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
This patch also needs:
"[PATCH] ASoC: pcm: Require both CODEC and CPU support when declaring stream caps"
from Mark Brown.
sound/soc/mxs/mxs-saif.c | 38 ++++++++++++++++++++++----------------
1 file changed, 22 insertions(+), 16 deletions(-)
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
index 49d8700..7f3e67a 100644
--- a/sound/soc/mxs/mxs-saif.c
+++ b/sound/soc/mxs/mxs-saif.c
@@ -607,22 +607,28 @@ static int mxs_saif_dai_probe(struct snd_soc_dai *dai)
return 0;
}
-static struct snd_soc_dai_driver mxs_saif_dai = {
- .name = "mxs-saif",
- .probe = mxs_saif_dai_probe,
- .playback = {
- .channels_min = 2,
- .channels_max = 2,
- .rates = MXS_SAIF_RATES,
- .formats = MXS_SAIF_FORMATS,
+static struct snd_soc_dai_driver mxs_saif_dai[2] = {
+ {
+ .name = "saif0",
+ .probe = mxs_saif_dai_probe,
+ .playback = {
+ .channels_min = 2,
+ .channels_max = 2,
+ .rates = MXS_SAIF_RATES,
+ .formats = MXS_SAIF_FORMATS,
+ },
+ .ops = &mxs_saif_dai_ops,
+ }, {
+ .name = "saif1",
+ .probe = mxs_saif_dai_probe,
+ .capture = {
+ .channels_min = 2,
+ .channels_max = 2,
+ .rates = MXS_SAIF_RATES,
+ .formats = MXS_SAIF_FORMATS,
+ },
+ .ops = &mxs_saif_dai_ops,
},
- .capture = {
- .channels_min = 2,
- .channels_max = 2,
- .rates = MXS_SAIF_RATES,
- .formats = MXS_SAIF_FORMATS,
- },
- .ops = &mxs_saif_dai_ops,
};
static const struct snd_soc_component_driver mxs_saif_component = {
@@ -735,7 +741,7 @@ static int mxs_saif_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, saif);
ret = snd_soc_register_component(&pdev->dev, &mxs_saif_component,
- &mxs_saif_dai, 1);
+ &mxs_saif_dai[saif->id], 1);
if (ret) {
dev_err(&pdev->dev, "register DAI failed\n");
return ret;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] ASoC: mxs: mxs-saif: Fix the playback/record capabilities
2013-06-02 16:38 [PATCH] ASoC: mxs: mxs-saif: Fix the playback/record capabilities Fabio Estevam
@ 2013-06-02 19:56 ` Lars-Peter Clausen
2013-06-03 9:20 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Lars-Peter Clausen @ 2013-06-02 19:56 UTC (permalink / raw)
To: Fabio Estevam; +Cc: marex, Fabio Estevam, alsa-devel, broonie
On 06/02/2013 06:38 PM, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Running "aplay -l" and "arecord -l" results in the following outputs:
>
> $ 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
>
> On mx28 there are two serial audio interface ports (SAIF0 and SAIF1) and each
> one of them are unidirectional.
>
> Create a mxs_saif_dai array containing a playback element and a record element
> only in order to properly describe the dai links.
>
> 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
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Hi,
Not sure if this is the right approach, there is no limitation on either
saif0 or saif1 that it can only be used for capture or playback. Some
systems may use saif1 as playback and saif0 as capture, or both as playback
and so on...
- Lars
> ---
> This patch also needs:
> "[PATCH] ASoC: pcm: Require both CODEC and CPU support when declaring stream caps"
> from Mark Brown.
>
> sound/soc/mxs/mxs-saif.c | 38 ++++++++++++++++++++++----------------
> 1 file changed, 22 insertions(+), 16 deletions(-)
>
> diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
> index 49d8700..7f3e67a 100644
> --- a/sound/soc/mxs/mxs-saif.c
> +++ b/sound/soc/mxs/mxs-saif.c
> @@ -607,22 +607,28 @@ static int mxs_saif_dai_probe(struct snd_soc_dai *dai)
> return 0;
> }
>
> -static struct snd_soc_dai_driver mxs_saif_dai = {
> - .name = "mxs-saif",
> - .probe = mxs_saif_dai_probe,
> - .playback = {
> - .channels_min = 2,
> - .channels_max = 2,
> - .rates = MXS_SAIF_RATES,
> - .formats = MXS_SAIF_FORMATS,
> +static struct snd_soc_dai_driver mxs_saif_dai[2] = {
> + {
> + .name = "saif0",
> + .probe = mxs_saif_dai_probe,
> + .playback = {
> + .channels_min = 2,
> + .channels_max = 2,
> + .rates = MXS_SAIF_RATES,
> + .formats = MXS_SAIF_FORMATS,
> + },
> + .ops = &mxs_saif_dai_ops,
> + }, {
> + .name = "saif1",
> + .probe = mxs_saif_dai_probe,
> + .capture = {
> + .channels_min = 2,
> + .channels_max = 2,
> + .rates = MXS_SAIF_RATES,
> + .formats = MXS_SAIF_FORMATS,
> + },
> + .ops = &mxs_saif_dai_ops,
> },
> - .capture = {
> - .channels_min = 2,
> - .channels_max = 2,
> - .rates = MXS_SAIF_RATES,
> - .formats = MXS_SAIF_FORMATS,
> - },
> - .ops = &mxs_saif_dai_ops,
> };
>
> static const struct snd_soc_component_driver mxs_saif_component = {
> @@ -735,7 +741,7 @@ static int mxs_saif_probe(struct platform_device *pdev)
> platform_set_drvdata(pdev, saif);
>
> ret = snd_soc_register_component(&pdev->dev, &mxs_saif_component,
> - &mxs_saif_dai, 1);
> + &mxs_saif_dai[saif->id], 1);
> if (ret) {
> dev_err(&pdev->dev, "register DAI failed\n");
> return ret;
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] ASoC: mxs: mxs-saif: Fix the playback/record capabilities
2013-06-02 19:56 ` Lars-Peter Clausen
@ 2013-06-03 9:20 ` Mark Brown
2013-06-03 15:07 ` Lars-Peter Clausen
0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2013-06-03 9:20 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: marex, Fabio Estevam, alsa-devel, Fabio Estevam
[-- Attachment #1.1: Type: text/plain, Size: 412 bytes --]
On Sun, Jun 02, 2013 at 09:56:29PM +0200, Lars-Peter Clausen wrote:
> Not sure if this is the right approach, there is no limitation on either
> saif0 or saif1 that it can only be used for capture or playback. Some
> systems may use saif1 as playback and saif0 as capture, or both as playback
> and so on...
Is there a limitation on the CODEC side or does the CODEC side have a
single bidirectional interface?
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: mxs: mxs-saif: Fix the playback/record capabilities
2013-06-03 9:20 ` Mark Brown
@ 2013-06-03 15:07 ` Lars-Peter Clausen
2013-06-03 15:18 ` Fabio Estevam
0 siblings, 1 reply; 6+ messages in thread
From: Lars-Peter Clausen @ 2013-06-03 15:07 UTC (permalink / raw)
To: Mark Brown; +Cc: marex, Fabio Estevam, alsa-devel, Fabio Estevam
On 06/03/2013 11:20 AM, Mark Brown wrote:
> On Sun, Jun 02, 2013 at 09:56:29PM +0200, Lars-Peter Clausen wrote:
>
>> Not sure if this is the right approach, there is no limitation on either
>> saif0 or saif1 that it can only be used for capture or playback. Some
>> systems may use saif1 as playback and saif0 as capture, or both as playback
>> and so on...
>
> Is there a limitation on the CODEC side or does the CODEC side have a
> single bidirectional interface?
I think the sgtl5000 has a single bidirectional DAI, but I'd assume that it
is not the only CODEC to be ever used with the mxs-saif. In my opinion a
better solution is to add support for being able to specify if a
snd_soc_dai_link is used playback, capture or both.
- Lars
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: mxs: mxs-saif: Fix the playback/record capabilities
2013-06-03 15:07 ` Lars-Peter Clausen
@ 2013-06-03 15:18 ` Fabio Estevam
2013-06-03 15:41 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2013-06-03 15:18 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: marex, Fabio Estevam, alsa-devel, Mark Brown
On Mon, Jun 3, 2013 at 12:07 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> I think the sgtl5000 has a single bidirectional DAI, but I'd assume that it
Yes, correct.
> is not the only CODEC to be ever used with the mxs-saif. In my opinion a
> better solution is to add support for being able to specify if a
> snd_soc_dai_link is used playback, capture or both.
Yes, I think that adding a device tree property specifying the SAIF
direction could do the trick.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: mxs: mxs-saif: Fix the playback/record capabilities
2013-06-03 15:18 ` Fabio Estevam
@ 2013-06-03 15:41 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2013-06-03 15:41 UTC (permalink / raw)
To: Fabio Estevam; +Cc: marex, Fabio Estevam, alsa-devel, Lars-Peter Clausen
[-- Attachment #1.1: Type: text/plain, Size: 785 bytes --]
On Mon, Jun 03, 2013 at 12:18:16PM -0300, Fabio Estevam wrote:
> On Mon, Jun 3, 2013 at 12:07 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> > I think the sgtl5000 has a single bidirectional DAI, but I'd assume that it
> Yes, correct.
So this comes from the board wiring then.
> > is not the only CODEC to be ever used with the mxs-saif. In my opinion a
> > better solution is to add support for being able to specify if a
> > snd_soc_dai_link is used playback, capture or both.
> Yes, I think that adding a device tree property specifying the SAIF
> direction could do the trick.
No, this should be done at the board level as Lars-Peter suggests - it's
nothing to do with the SAIF driver. Probably doesn't even need to go
into device tree, just do it in the machine driver.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-06-03 15:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-02 16:38 [PATCH] ASoC: mxs: mxs-saif: Fix the playback/record capabilities Fabio Estevam
2013-06-02 19:56 ` Lars-Peter Clausen
2013-06-03 9:20 ` Mark Brown
2013-06-03 15:07 ` Lars-Peter Clausen
2013-06-03 15:18 ` Fabio Estevam
2013-06-03 15:41 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.