* [PATCH 1/2] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation
@ 2013-12-03 10:27 Lee Jones
2013-12-03 10:27 ` [PATCH 2/2] ASoC: ux500: Dynamically fill DAI driver data on probe Lee Jones
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Lee Jones @ 2013-12-03 10:27 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel, broonie
Cc: linus.walleij, Lee Jones, alsa-devel
If booting with full DT support (i.e. DMA too, the last piece of the
puzzle), then we don't need to use the compatible_request_channel call
back or require some of the historical bumph which probably isn't
required by a platform data start-up now either. This will also be
ripped out in upcoming commits.
Cc: alsa-devel@alsa-project.org
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
sound/soc/ux500/ux500_pcm.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c
index 2f1bdb7..ad0d420 100644
--- a/sound/soc/ux500/ux500_pcm.c
+++ b/sound/soc/ux500/ux500_pcm.c
@@ -134,15 +134,24 @@ static const struct snd_dmaengine_pcm_config ux500_dmaengine_pcm_config = {
.prepare_slave_config = ux500_pcm_prepare_slave_config,
};
+static const struct snd_dmaengine_pcm_config ux500_dmaengine_of_pcm_config = {
+ .prepare_slave_config = ux500_pcm_prepare_slave_config,
+};
+
int ux500_pcm_register_platform(struct platform_device *pdev)
{
+ const struct snd_dmaengine_pcm_config *pcm_config;
+ struct device_node *np = pdev->dev.of_node;
int ret;
- ret = snd_dmaengine_pcm_register(&pdev->dev,
- &ux500_dmaengine_pcm_config,
- SND_DMAENGINE_PCM_FLAG_NO_RESIDUE |
- SND_DMAENGINE_PCM_FLAG_COMPAT |
- SND_DMAENGINE_PCM_FLAG_NO_DT);
+ if (np)
+ pcm_config = &ux500_dmaengine_of_pcm_config;
+ else
+ pcm_config = &ux500_dmaengine_pcm_config;
+
+ ret = snd_dmaengine_pcm_register(&pdev->dev, pcm_config,
+ SND_DMAENGINE_PCM_FLAG_NO_RESIDUE |
+ SND_DMAENGINE_PCM_FLAG_COMPAT);
if (ret < 0) {
dev_err(&pdev->dev,
"%s: ERROR: Failed to register platform '%s' (%d)!\n",
--
1.8.3.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] ASoC: ux500: Dynamically fill DAI driver data on probe
2013-12-03 10:27 [PATCH 1/2] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation Lee Jones
@ 2013-12-03 10:27 ` Lee Jones
2013-12-03 11:55 ` [alsa-devel] [PATCH 1/2] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation Lars-Peter Clausen
2013-12-03 15:07 ` Mark Brown
2 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2013-12-03 10:27 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel, broonie
Cc: linus.walleij, Lee Jones, alsa-devel
We no longer have a means to differentiate between MSP devices at probe
time, mainly because we don't really have to. So rather than have an over-
sized static data structure in place, where the only difference between
devices is the ID and name (which are unused), we'll just create one
succinct, statically assigned and shared one instead.
Cc: alsa-devel@alsa-project.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
sound/soc/ux500/ux500_msp_dai.c | 96 ++++++-----------------------------------
1 file changed, 14 insertions(+), 82 deletions(-)
diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c
index 8d1b01f..8a7ae45 100644
--- a/sound/soc/ux500/ux500_msp_dai.c
+++ b/sound/soc/ux500/ux500_msp_dai.c
@@ -718,87 +718,19 @@ static struct snd_soc_dai_ops ux500_msp_dai_ops[] = {
}
};
-static struct snd_soc_dai_driver ux500_msp_dai_drv[UX500_NBR_OF_DAI] = {
- {
- .name = "ux500-msp-i2s.0",
- .probe = ux500_msp_dai_probe,
- .id = 0,
- .suspend = NULL,
- .resume = NULL,
- .playback = {
- .channels_min = UX500_MSP_MIN_CHANNELS,
- .channels_max = UX500_MSP_MAX_CHANNELS,
- .rates = UX500_I2S_RATES,
- .formats = UX500_I2S_FORMATS,
- },
- .capture = {
- .channels_min = UX500_MSP_MIN_CHANNELS,
- .channels_max = UX500_MSP_MAX_CHANNELS,
- .rates = UX500_I2S_RATES,
- .formats = UX500_I2S_FORMATS,
- },
- .ops = ux500_msp_dai_ops,
- },
- {
- .name = "ux500-msp-i2s.1",
- .probe = ux500_msp_dai_probe,
- .id = 1,
- .suspend = NULL,
- .resume = NULL,
- .playback = {
- .channels_min = UX500_MSP_MIN_CHANNELS,
- .channels_max = UX500_MSP_MAX_CHANNELS,
- .rates = UX500_I2S_RATES,
- .formats = UX500_I2S_FORMATS,
- },
- .capture = {
- .channels_min = UX500_MSP_MIN_CHANNELS,
- .channels_max = UX500_MSP_MAX_CHANNELS,
- .rates = UX500_I2S_RATES,
- .formats = UX500_I2S_FORMATS,
- },
- .ops = ux500_msp_dai_ops,
- },
- {
- .name = "ux500-msp-i2s.2",
- .id = 2,
- .probe = ux500_msp_dai_probe,
- .suspend = NULL,
- .resume = NULL,
- .playback = {
- .channels_min = UX500_MSP_MIN_CHANNELS,
- .channels_max = UX500_MSP_MAX_CHANNELS,
- .rates = UX500_I2S_RATES,
- .formats = UX500_I2S_FORMATS,
- },
- .capture = {
- .channels_min = UX500_MSP_MIN_CHANNELS,
- .channels_max = UX500_MSP_MAX_CHANNELS,
- .rates = UX500_I2S_RATES,
- .formats = UX500_I2S_FORMATS,
- },
- .ops = ux500_msp_dai_ops,
- },
- {
- .name = "ux500-msp-i2s.3",
- .probe = ux500_msp_dai_probe,
- .id = 3,
- .suspend = NULL,
- .resume = NULL,
- .playback = {
- .channels_min = UX500_MSP_MIN_CHANNELS,
- .channels_max = UX500_MSP_MAX_CHANNELS,
- .rates = UX500_I2S_RATES,
- .formats = UX500_I2S_FORMATS,
- },
- .capture = {
- .channels_min = UX500_MSP_MIN_CHANNELS,
- .channels_max = UX500_MSP_MAX_CHANNELS,
- .rates = UX500_I2S_RATES,
- .formats = UX500_I2S_FORMATS,
- },
- .ops = ux500_msp_dai_ops,
- },
+static struct snd_soc_dai_driver ux500_msp_dai_drv = {
+ .probe = ux500_msp_dai_probe,
+ .suspend = NULL,
+ .resume = NULL,
+ .playback.channels_min = UX500_MSP_MIN_CHANNELS,
+ .playback.channels_max = UX500_MSP_MAX_CHANNELS,
+ .playback.rates = UX500_I2S_RATES,
+ .playback.formats = UX500_I2S_FORMATS,
+ .capture.channels_min = UX500_MSP_MIN_CHANNELS,
+ .capture.channels_max = UX500_MSP_MAX_CHANNELS,
+ .capture.rates = UX500_I2S_RATES,
+ .capture.formats = UX500_I2S_FORMATS,
+ .ops = ux500_msp_dai_ops,
};
static const struct snd_soc_component_driver ux500_msp_component = {
@@ -864,7 +796,7 @@ static int ux500_msp_drv_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, drvdata);
ret = snd_soc_register_component(&pdev->dev, &ux500_msp_component,
- &ux500_msp_dai_drv[drvdata->msp->id], 1);
+ &ux500_msp_dai_drv, 1);
if (ret < 0) {
dev_err(&pdev->dev, "Error: %s: Failed to register MSP%d!\n",
__func__, drvdata->msp->id);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [alsa-devel] [PATCH 1/2] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation
2013-12-03 10:27 [PATCH 1/2] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation Lee Jones
2013-12-03 10:27 ` [PATCH 2/2] ASoC: ux500: Dynamically fill DAI driver data on probe Lee Jones
@ 2013-12-03 11:55 ` Lars-Peter Clausen
2013-12-03 12:04 ` Lee Jones
2013-12-03 15:07 ` Mark Brown
2 siblings, 1 reply; 8+ messages in thread
From: Lars-Peter Clausen @ 2013-12-03 11:55 UTC (permalink / raw)
To: Lee Jones
Cc: linux-arm-kernel, linux-kernel, broonie, linus.walleij,
alsa-devel
On 12/03/2013 11:27 AM, Lee Jones wrote:
> If booting with full DT support (i.e. DMA too, the last piece of the
> puzzle), then we don't need to use the compatible_request_channel call
> back or require some of the historical bumph which probably isn't
> required by a platform data start-up now either. This will also be
> ripped out in upcoming commits.
>
> Cc: alsa-devel@alsa-project.org
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Strictly speaking you do not need the second config, but well considering
that this will all hopefully be removed soon anyway it should be fine.
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [alsa-devel] [PATCH 1/2] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation
2013-12-03 11:55 ` [alsa-devel] [PATCH 1/2] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation Lars-Peter Clausen
@ 2013-12-03 12:04 ` Lee Jones
2013-12-03 12:15 ` Lars-Peter Clausen
0 siblings, 1 reply; 8+ messages in thread
From: Lee Jones @ 2013-12-03 12:04 UTC (permalink / raw)
To: Lars-Peter Clausen
Cc: linux-arm-kernel, linux-kernel, broonie, linus.walleij,
alsa-devel
On Tue, 03 Dec 2013, Lars-Peter Clausen wrote:
> On 12/03/2013 11:27 AM, Lee Jones wrote:
> > If booting with full DT support (i.e. DMA too, the last piece of the
> > puzzle), then we don't need to use the compatible_request_channel call
> > back or require some of the historical bumph which probably isn't
> > required by a platform data start-up now either. This will also be
> > ripped out in upcoming commits.
> >
> > Cc: alsa-devel@alsa-project.org
> > Acked-by: Linus Walleij <linus.walleij@linaro.org>
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
>
> Strictly speaking you do not need the second config, but well considering
> that this will all hopefully be removed soon anyway it should be fine.
That's true it will, but why don't we need the second config? I won't
want the compat function to be called in the DT case.
> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation
2013-12-03 12:04 ` Lee Jones
@ 2013-12-03 12:15 ` Lars-Peter Clausen
2013-12-03 12:24 ` [alsa-devel] " Lars-Peter Clausen
0 siblings, 1 reply; 8+ messages in thread
From: Lars-Peter Clausen @ 2013-12-03 12:15 UTC (permalink / raw)
To: Lee Jones
Cc: alsa-devel, broonie, linus.walleij, linux-arm-kernel,
linux-kernel
On 12/03/2013 01:04 PM, Lee Jones wrote:
> On Tue, 03 Dec 2013, Lars-Peter Clausen wrote:
>
>> On 12/03/2013 11:27 AM, Lee Jones wrote:
>>> If booting with full DT support (i.e. DMA too, the last piece of the
>>> puzzle), then we don't need to use the compatible_request_channel call
>>> back or require some of the historical bumph which probably isn't
>>> required by a platform data start-up now either. This will also be
>>> ripped out in upcoming commits.
>>>
>>> Cc: alsa-devel@alsa-project.org
>>> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>>
>> Strictly speaking you do not need the second config, but well considering
>> that this will all hopefully be removed soon anyway it should be fine.
>
> That's true it will, but why don't we need the second config? I won't
> want the compat function to be called in the DT case.
It will only be called if it was not possible to request the DMA channel
from the DT.
- Lars
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [alsa-devel] [PATCH 1/2] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation
2013-12-03 12:15 ` Lars-Peter Clausen
@ 2013-12-03 12:24 ` Lars-Peter Clausen
2013-12-03 12:29 ` Lee Jones
0 siblings, 1 reply; 8+ messages in thread
From: Lars-Peter Clausen @ 2013-12-03 12:24 UTC (permalink / raw)
To: Lee Jones
Cc: alsa-devel, broonie, linus.walleij, linux-arm-kernel,
linux-kernel
On 12/03/2013 01:15 PM, Lars-Peter Clausen wrote:
> On 12/03/2013 01:04 PM, Lee Jones wrote:
>> On Tue, 03 Dec 2013, Lars-Peter Clausen wrote:
>>
>>> On 12/03/2013 11:27 AM, Lee Jones wrote:
>>>> If booting with full DT support (i.e. DMA too, the last piece of the
>>>> puzzle), then we don't need to use the compatible_request_channel call
>>>> back or require some of the historical bumph which probably isn't
>>>> required by a platform data start-up now either. This will also be
>>>> ripped out in upcoming commits.
>>>>
>>>> Cc: alsa-devel@alsa-project.org
>>>> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>>>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>>>
>>> Strictly speaking you do not need the second config, but well considering
>>> that this will all hopefully be removed soon anyway it should be fine.
>>
>> That's true it will, but why don't we need the second config? I won't
>> want the compat function to be called in the DT case.
>
> It will only be called if it was not possible to request the DMA channel
> from the DT.
The logic used to request the channel is basically this (in pseudo code).
chan = NULL.
if (of_node && !(flags & NO_DT))
chan = dma_request_slave_channel(...)
if (!chan && (flags & COMPAT))
chan = dma_request_channel(compat_filter_fn, compat_filter_data);
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [alsa-devel] [PATCH 1/2] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation
2013-12-03 12:24 ` [alsa-devel] " Lars-Peter Clausen
@ 2013-12-03 12:29 ` Lee Jones
0 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2013-12-03 12:29 UTC (permalink / raw)
To: Lars-Peter Clausen
Cc: alsa-devel, broonie, linus.walleij, linux-arm-kernel,
linux-kernel
On Tue, 03 Dec 2013, Lars-Peter Clausen wrote:
> On 12/03/2013 01:15 PM, Lars-Peter Clausen wrote:
> > On 12/03/2013 01:04 PM, Lee Jones wrote:
> >> On Tue, 03 Dec 2013, Lars-Peter Clausen wrote:
> >>
> >>> On 12/03/2013 11:27 AM, Lee Jones wrote:
> >>>> If booting with full DT support (i.e. DMA too, the last piece of the
> >>>> puzzle), then we don't need to use the compatible_request_channel call
> >>>> back or require some of the historical bumph which probably isn't
> >>>> required by a platform data start-up now either. This will also be
> >>>> ripped out in upcoming commits.
> >>>>
> >>>> Cc: alsa-devel@alsa-project.org
> >>>> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> >>>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> >>>
> >>> Strictly speaking you do not need the second config, but well considering
> >>> that this will all hopefully be removed soon anyway it should be fine.
> >>
> >> That's true it will, but why don't we need the second config? I won't
> >> want the compat function to be called in the DT case.
> >
> > It will only be called if it was not possible to request the DMA channel
> > from the DT.
>
> The logic used to request the channel is basically this (in pseudo code).
>
> chan = NULL.
>
> if (of_node && !(flags & NO_DT))
> chan = dma_request_slave_channel(...)
>
> if (!chan && (flags & COMPAT))
> chan = dma_request_channel(compat_filter_fn, compat_filter_data);
Okay, fair enough.
But as you say, this should be fine for now. I'll tend to the
left-over cruft when I convert the driver to DT only.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation
2013-12-03 10:27 [PATCH 1/2] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation Lee Jones
2013-12-03 10:27 ` [PATCH 2/2] ASoC: ux500: Dynamically fill DAI driver data on probe Lee Jones
2013-12-03 11:55 ` [alsa-devel] [PATCH 1/2] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation Lars-Peter Clausen
@ 2013-12-03 15:07 ` Mark Brown
2 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2013-12-03 15:07 UTC (permalink / raw)
To: Lee Jones; +Cc: linus.walleij, alsa-devel, linux-kernel, linux-arm-kernel
[-- Attachment #1.1: Type: text/plain, Size: 397 bytes --]
On Tue, Dec 03, 2013 at 10:27:06AM +0000, Lee Jones wrote:
> If booting with full DT support (i.e. DMA too, the last piece of the
> puzzle), then we don't need to use the compatible_request_channel call
> back or require some of the historical bumph which probably isn't
> required by a platform data start-up now either. This will also be
> ripped out in upcoming commits.
Applied both, thanks.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-12-03 15:07 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-03 10:27 [PATCH 1/2] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation Lee Jones
2013-12-03 10:27 ` [PATCH 2/2] ASoC: ux500: Dynamically fill DAI driver data on probe Lee Jones
2013-12-03 11:55 ` [alsa-devel] [PATCH 1/2] ASoC: ux500_pcm: Differentiate between pdata and DT initialisation Lars-Peter Clausen
2013-12-03 12:04 ` Lee Jones
2013-12-03 12:15 ` Lars-Peter Clausen
2013-12-03 12:24 ` [alsa-devel] " Lars-Peter Clausen
2013-12-03 12:29 ` Lee Jones
2013-12-03 15:07 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).