* [PATCH] ASoC: atmel_ssc_dai: distinguish the different SSC
@ 2016-01-13 6:35 Songjun Wu
2016-01-13 15:08 ` Nicolas Ferre
2016-03-02 14:44 ` Applied "ASoC: atmel_ssc_dai: distinguish the different SSC" to the asoc tree Mark Brown
0 siblings, 2 replies; 5+ messages in thread
From: Songjun Wu @ 2016-01-13 6:35 UTC (permalink / raw)
To: broonie, nicolas.ferre
Cc: linux-arm-kernel, Songjun Wu, Arnd Bergmann, Greg Kroah-Hartman,
Liam Girdwood, Jaroslav Kysela, Takashi Iwai, linux-kernel,
alsa-devel
Cpu_dai id always equals 0, can't distinguish the
different SSC. Use platform_device id to record
and distinguish the different SSC.
Signed-off-by: Songjun Wu <songjun.wu@atmel.com>
---
drivers/misc/atmel-ssc.c | 1 +
sound/soc/atmel/atmel_ssc_dai.c | 27 ++++++++++++++++++---------
2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index e11a0bd..0516ecd 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -34,6 +34,7 @@ struct ssc_device *ssc_request(unsigned int ssc_num)
if (ssc->pdev->dev.of_node) {
if (of_alias_get_id(ssc->pdev->dev.of_node, "ssc")
== ssc_num) {
+ ssc->pdev->id = ssc_num;
ssc_valid = 1;
break;
}
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
index ba8def5..2768970 100644
--- a/sound/soc/atmel/atmel_ssc_dai.c
+++ b/sound/soc/atmel/atmel_ssc_dai.c
@@ -285,7 +285,8 @@ static int atmel_ssc_hw_rule_rate(struct snd_pcm_hw_params *params,
static int atmel_ssc_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
+ struct platform_device *pdev = to_platform_device(dai->dev);
+ struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
struct atmel_pcm_dma_params *dma_params;
int dir, dir_mask;
int ret;
@@ -346,7 +347,8 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream,
static void atmel_ssc_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
+ struct platform_device *pdev = to_platform_device(dai->dev);
+ struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
struct atmel_pcm_dma_params *dma_params;
int dir, dir_mask;
@@ -392,7 +394,8 @@ static void atmel_ssc_shutdown(struct snd_pcm_substream *substream,
static int atmel_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai,
unsigned int fmt)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
+ struct platform_device *pdev = to_platform_device(cpu_dai->dev);
+ struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
ssc_p->daifmt = fmt;
return 0;
@@ -404,7 +407,8 @@ static int atmel_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai,
static int atmel_ssc_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
int div_id, int div)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
+ struct platform_device *pdev = to_platform_device(cpu_dai->dev);
+ struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
switch (div_id) {
case ATMEL_SSC_CMR_DIV:
@@ -445,7 +449,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
- int id = dai->id;
+ struct platform_device *pdev = to_platform_device(dai->dev);
+ int id = pdev->id;
struct atmel_ssc_info *ssc_p = &ssc_info[id];
struct ssc_device *ssc = ssc_p->ssc;
struct atmel_pcm_dma_params *dma_params;
@@ -772,7 +777,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
+ struct platform_device *pdev = to_platform_device(dai->dev);
+ struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
struct atmel_pcm_dma_params *dma_params;
int dir;
@@ -795,7 +801,8 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
static int atmel_ssc_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
+ struct platform_device *pdev = to_platform_device(dai->dev);
+ struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
struct atmel_pcm_dma_params *dma_params;
int dir;
@@ -824,11 +831,12 @@ static int atmel_ssc_trigger(struct snd_pcm_substream *substream,
static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai)
{
struct atmel_ssc_info *ssc_p;
+ struct platform_device *pdev = to_platform_device(cpu_dai->dev);
if (!cpu_dai->active)
return 0;
- ssc_p = &ssc_info[cpu_dai->id];
+ ssc_p = &ssc_info[pdev->id];
/* Save the status register before disabling transmit and receive */
ssc_p->ssc_state.ssc_sr = ssc_readl(ssc_p->ssc->regs, SR);
@@ -852,12 +860,13 @@ static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai)
static int atmel_ssc_resume(struct snd_soc_dai *cpu_dai)
{
struct atmel_ssc_info *ssc_p;
+ struct platform_device *pdev = to_platform_device(cpu_dai->dev);
u32 cr;
if (!cpu_dai->active)
return 0;
- ssc_p = &ssc_info[cpu_dai->id];
+ ssc_p = &ssc_info[pdev->id];
/* restore SSC register settings */
ssc_writel(ssc_p->ssc->regs, TFMR, ssc_p->ssc_state.ssc_tfmr);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: atmel_ssc_dai: distinguish the different SSC
2016-01-13 6:35 [PATCH] ASoC: atmel_ssc_dai: distinguish the different SSC Songjun Wu
@ 2016-01-13 15:08 ` Nicolas Ferre
2016-02-16 2:54 ` Wu, Songjun
2016-03-02 14:44 ` Applied "ASoC: atmel_ssc_dai: distinguish the different SSC" to the asoc tree Mark Brown
1 sibling, 1 reply; 5+ messages in thread
From: Nicolas Ferre @ 2016-01-13 15:08 UTC (permalink / raw)
To: Songjun Wu, broonie
Cc: linux-arm-kernel, Arnd Bergmann, Greg Kroah-Hartman,
Liam Girdwood, Jaroslav Kysela, Takashi Iwai, linux-kernel,
alsa-devel
Le 13/01/2016 07:35, Songjun Wu a écrit :
> Cpu_dai id always equals 0, can't distinguish the
> different SSC. Use platform_device id to record
> and distinguish the different SSC.
>
> Signed-off-by: Songjun Wu <songjun.wu@atmel.com>
It seems okay:
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
>
> drivers/misc/atmel-ssc.c | 1 +
> sound/soc/atmel/atmel_ssc_dai.c | 27 ++++++++++++++++++---------
> 2 files changed, 19 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
> index e11a0bd..0516ecd 100644
> --- a/drivers/misc/atmel-ssc.c
> +++ b/drivers/misc/atmel-ssc.c
> @@ -34,6 +34,7 @@ struct ssc_device *ssc_request(unsigned int ssc_num)
> if (ssc->pdev->dev.of_node) {
> if (of_alias_get_id(ssc->pdev->dev.of_node, "ssc")
> == ssc_num) {
> + ssc->pdev->id = ssc_num;
> ssc_valid = 1;
> break;
> }
> diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
> index ba8def5..2768970 100644
> --- a/sound/soc/atmel/atmel_ssc_dai.c
> +++ b/sound/soc/atmel/atmel_ssc_dai.c
> @@ -285,7 +285,8 @@ static int atmel_ssc_hw_rule_rate(struct snd_pcm_hw_params *params,
> static int atmel_ssc_startup(struct snd_pcm_substream *substream,
> struct snd_soc_dai *dai)
> {
> - struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
> + struct platform_device *pdev = to_platform_device(dai->dev);
> + struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
> struct atmel_pcm_dma_params *dma_params;
> int dir, dir_mask;
> int ret;
> @@ -346,7 +347,8 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream,
> static void atmel_ssc_shutdown(struct snd_pcm_substream *substream,
> struct snd_soc_dai *dai)
> {
> - struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
> + struct platform_device *pdev = to_platform_device(dai->dev);
> + struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
> struct atmel_pcm_dma_params *dma_params;
> int dir, dir_mask;
>
> @@ -392,7 +394,8 @@ static void atmel_ssc_shutdown(struct snd_pcm_substream *substream,
> static int atmel_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai,
> unsigned int fmt)
> {
> - struct atmel_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
> + struct platform_device *pdev = to_platform_device(cpu_dai->dev);
> + struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
>
> ssc_p->daifmt = fmt;
> return 0;
> @@ -404,7 +407,8 @@ static int atmel_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai,
> static int atmel_ssc_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
> int div_id, int div)
> {
> - struct atmel_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
> + struct platform_device *pdev = to_platform_device(cpu_dai->dev);
> + struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
>
> switch (div_id) {
> case ATMEL_SSC_CMR_DIV:
> @@ -445,7 +449,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
> struct snd_pcm_hw_params *params,
> struct snd_soc_dai *dai)
> {
> - int id = dai->id;
> + struct platform_device *pdev = to_platform_device(dai->dev);
> + int id = pdev->id;
> struct atmel_ssc_info *ssc_p = &ssc_info[id];
> struct ssc_device *ssc = ssc_p->ssc;
> struct atmel_pcm_dma_params *dma_params;
> @@ -772,7 +777,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
> static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
> struct snd_soc_dai *dai)
> {
> - struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
> + struct platform_device *pdev = to_platform_device(dai->dev);
> + struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
> struct atmel_pcm_dma_params *dma_params;
> int dir;
>
> @@ -795,7 +801,8 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
> static int atmel_ssc_trigger(struct snd_pcm_substream *substream,
> int cmd, struct snd_soc_dai *dai)
> {
> - struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
> + struct platform_device *pdev = to_platform_device(dai->dev);
> + struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
> struct atmel_pcm_dma_params *dma_params;
> int dir;
>
> @@ -824,11 +831,12 @@ static int atmel_ssc_trigger(struct snd_pcm_substream *substream,
> static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai)
> {
> struct atmel_ssc_info *ssc_p;
> + struct platform_device *pdev = to_platform_device(cpu_dai->dev);
>
> if (!cpu_dai->active)
> return 0;
>
> - ssc_p = &ssc_info[cpu_dai->id];
> + ssc_p = &ssc_info[pdev->id];
>
> /* Save the status register before disabling transmit and receive */
> ssc_p->ssc_state.ssc_sr = ssc_readl(ssc_p->ssc->regs, SR);
> @@ -852,12 +860,13 @@ static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai)
> static int atmel_ssc_resume(struct snd_soc_dai *cpu_dai)
> {
> struct atmel_ssc_info *ssc_p;
> + struct platform_device *pdev = to_platform_device(cpu_dai->dev);
> u32 cr;
>
> if (!cpu_dai->active)
> return 0;
>
> - ssc_p = &ssc_info[cpu_dai->id];
> + ssc_p = &ssc_info[pdev->id];
>
> /* restore SSC register settings */
> ssc_writel(ssc_p->ssc->regs, TFMR, ssc_p->ssc_state.ssc_tfmr);
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: atmel_ssc_dai: distinguish the different SSC
2016-01-13 15:08 ` Nicolas Ferre
@ 2016-02-16 2:54 ` Wu, Songjun
2016-02-17 16:22 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Wu, Songjun @ 2016-02-16 2:54 UTC (permalink / raw)
To: Nicolas Ferre, broonie
Cc: linux-arm-kernel, Arnd Bergmann, Greg Kroah-Hartman,
Liam Girdwood, Jaroslav Kysela, Takashi Iwai, linux-kernel,
alsa-devel
Any comments on this patch?
On 1/13/2016 23:08, Nicolas Ferre wrote:
> Le 13/01/2016 07:35, Songjun Wu a écrit :
>> Cpu_dai id always equals 0, can't distinguish the
>> different SSC. Use platform_device id to record
>> and distinguish the different SSC.
>>
>> Signed-off-by: Songjun Wu <songjun.wu@atmel.com>
>
> It seems okay:
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>
>> ---
>>
>> drivers/misc/atmel-ssc.c | 1 +
>> sound/soc/atmel/atmel_ssc_dai.c | 27 ++++++++++++++++++---------
>> 2 files changed, 19 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
>> index e11a0bd..0516ecd 100644
>> --- a/drivers/misc/atmel-ssc.c
>> +++ b/drivers/misc/atmel-ssc.c
>> @@ -34,6 +34,7 @@ struct ssc_device *ssc_request(unsigned int ssc_num)
>> if (ssc->pdev->dev.of_node) {
>> if (of_alias_get_id(ssc->pdev->dev.of_node, "ssc")
>> == ssc_num) {
>> + ssc->pdev->id = ssc_num;
>> ssc_valid = 1;
>> break;
>> }
>> diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
>> index ba8def5..2768970 100644
>> --- a/sound/soc/atmel/atmel_ssc_dai.c
>> +++ b/sound/soc/atmel/atmel_ssc_dai.c
>> @@ -285,7 +285,8 @@ static int atmel_ssc_hw_rule_rate(struct snd_pcm_hw_params *params,
>> static int atmel_ssc_startup(struct snd_pcm_substream *substream,
>> struct snd_soc_dai *dai)
>> {
>> - struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
>> + struct platform_device *pdev = to_platform_device(dai->dev);
>> + struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
>> struct atmel_pcm_dma_params *dma_params;
>> int dir, dir_mask;
>> int ret;
>> @@ -346,7 +347,8 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream,
>> static void atmel_ssc_shutdown(struct snd_pcm_substream *substream,
>> struct snd_soc_dai *dai)
>> {
>> - struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
>> + struct platform_device *pdev = to_platform_device(dai->dev);
>> + struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
>> struct atmel_pcm_dma_params *dma_params;
>> int dir, dir_mask;
>>
>> @@ -392,7 +394,8 @@ static void atmel_ssc_shutdown(struct snd_pcm_substream *substream,
>> static int atmel_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai,
>> unsigned int fmt)
>> {
>> - struct atmel_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
>> + struct platform_device *pdev = to_platform_device(cpu_dai->dev);
>> + struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
>>
>> ssc_p->daifmt = fmt;
>> return 0;
>> @@ -404,7 +407,8 @@ static int atmel_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai,
>> static int atmel_ssc_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
>> int div_id, int div)
>> {
>> - struct atmel_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
>> + struct platform_device *pdev = to_platform_device(cpu_dai->dev);
>> + struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
>>
>> switch (div_id) {
>> case ATMEL_SSC_CMR_DIV:
>> @@ -445,7 +449,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
>> struct snd_pcm_hw_params *params,
>> struct snd_soc_dai *dai)
>> {
>> - int id = dai->id;
>> + struct platform_device *pdev = to_platform_device(dai->dev);
>> + int id = pdev->id;
>> struct atmel_ssc_info *ssc_p = &ssc_info[id];
>> struct ssc_device *ssc = ssc_p->ssc;
>> struct atmel_pcm_dma_params *dma_params;
>> @@ -772,7 +777,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
>> static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
>> struct snd_soc_dai *dai)
>> {
>> - struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
>> + struct platform_device *pdev = to_platform_device(dai->dev);
>> + struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
>> struct atmel_pcm_dma_params *dma_params;
>> int dir;
>>
>> @@ -795,7 +801,8 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
>> static int atmel_ssc_trigger(struct snd_pcm_substream *substream,
>> int cmd, struct snd_soc_dai *dai)
>> {
>> - struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
>> + struct platform_device *pdev = to_platform_device(dai->dev);
>> + struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
>> struct atmel_pcm_dma_params *dma_params;
>> int dir;
>>
>> @@ -824,11 +831,12 @@ static int atmel_ssc_trigger(struct snd_pcm_substream *substream,
>> static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai)
>> {
>> struct atmel_ssc_info *ssc_p;
>> + struct platform_device *pdev = to_platform_device(cpu_dai->dev);
>>
>> if (!cpu_dai->active)
>> return 0;
>>
>> - ssc_p = &ssc_info[cpu_dai->id];
>> + ssc_p = &ssc_info[pdev->id];
>>
>> /* Save the status register before disabling transmit and receive */
>> ssc_p->ssc_state.ssc_sr = ssc_readl(ssc_p->ssc->regs, SR);
>> @@ -852,12 +860,13 @@ static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai)
>> static int atmel_ssc_resume(struct snd_soc_dai *cpu_dai)
>> {
>> struct atmel_ssc_info *ssc_p;
>> + struct platform_device *pdev = to_platform_device(cpu_dai->dev);
>> u32 cr;
>>
>> if (!cpu_dai->active)
>> return 0;
>>
>> - ssc_p = &ssc_info[cpu_dai->id];
>> + ssc_p = &ssc_info[pdev->id];
>>
>> /* restore SSC register settings */
>> ssc_writel(ssc_p->ssc->regs, TFMR, ssc_p->ssc_state.ssc_tfmr);
>>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: atmel_ssc_dai: distinguish the different SSC
2016-02-16 2:54 ` Wu, Songjun
@ 2016-02-17 16:22 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2016-02-17 16:22 UTC (permalink / raw)
To: Wu, Songjun
Cc: Nicolas Ferre, linux-arm-kernel, Arnd Bergmann,
Greg Kroah-Hartman, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
linux-kernel, alsa-devel
[-- Attachment #1: Type: text/plain, Size: 534 bytes --]
On Tue, Feb 16, 2016 at 10:54:21AM +0800, Wu, Songjun wrote:
> Any comments on this patch?
Please don't send content free pings. Sending content free pings just
adds to the mail volume (if they are seen at all) and if something has
gone wrong you'll have to resend the patches anyway.
Please also don't top post, reply in line with needed context. This
allows readers to readily follow the flow of conversation and understand
what you are talking about and also helps ensure that everything in the
discussion is being addressed.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Applied "ASoC: atmel_ssc_dai: distinguish the different SSC" to the asoc tree
2016-01-13 6:35 [PATCH] ASoC: atmel_ssc_dai: distinguish the different SSC Songjun Wu
2016-01-13 15:08 ` Nicolas Ferre
@ 2016-03-02 14:44 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2016-03-02 14:44 UTC (permalink / raw)
To: Songjun Wu, Nicolas Ferre, Mark Brown; +Cc: alsa-devel
The patch
ASoC: atmel_ssc_dai: distinguish the different SSC
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From c706f2e55f04d25d212e34186521a38e8a6e459e Mon Sep 17 00:00:00 2001
From: Songjun Wu <songjun.wu@atmel.com>
Date: Wed, 2 Mar 2016 12:15:25 +0100
Subject: [PATCH] ASoC: atmel_ssc_dai: distinguish the different SSC
Cpu_dai id always equals 0, can't distinguish the
different SSC. Use platform_device id to record
and distinguish the different SSC.
Signed-off-by: Songjun Wu <songjun.wu@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/misc/atmel-ssc.c | 1 +
sound/soc/atmel/atmel_ssc_dai.c | 27 ++++++++++++++++++---------
2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index e11a0bd6c66e..0516ecda54d3 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -34,6 +34,7 @@ struct ssc_device *ssc_request(unsigned int ssc_num)
if (ssc->pdev->dev.of_node) {
if (of_alias_get_id(ssc->pdev->dev.of_node, "ssc")
== ssc_num) {
+ ssc->pdev->id = ssc_num;
ssc_valid = 1;
break;
}
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
index ba8def5665c4..276897033639 100644
--- a/sound/soc/atmel/atmel_ssc_dai.c
+++ b/sound/soc/atmel/atmel_ssc_dai.c
@@ -285,7 +285,8 @@ static int atmel_ssc_hw_rule_rate(struct snd_pcm_hw_params *params,
static int atmel_ssc_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
+ struct platform_device *pdev = to_platform_device(dai->dev);
+ struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
struct atmel_pcm_dma_params *dma_params;
int dir, dir_mask;
int ret;
@@ -346,7 +347,8 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream,
static void atmel_ssc_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
+ struct platform_device *pdev = to_platform_device(dai->dev);
+ struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
struct atmel_pcm_dma_params *dma_params;
int dir, dir_mask;
@@ -392,7 +394,8 @@ static void atmel_ssc_shutdown(struct snd_pcm_substream *substream,
static int atmel_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai,
unsigned int fmt)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
+ struct platform_device *pdev = to_platform_device(cpu_dai->dev);
+ struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
ssc_p->daifmt = fmt;
return 0;
@@ -404,7 +407,8 @@ static int atmel_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai,
static int atmel_ssc_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
int div_id, int div)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
+ struct platform_device *pdev = to_platform_device(cpu_dai->dev);
+ struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
switch (div_id) {
case ATMEL_SSC_CMR_DIV:
@@ -445,7 +449,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
- int id = dai->id;
+ struct platform_device *pdev = to_platform_device(dai->dev);
+ int id = pdev->id;
struct atmel_ssc_info *ssc_p = &ssc_info[id];
struct ssc_device *ssc = ssc_p->ssc;
struct atmel_pcm_dma_params *dma_params;
@@ -772,7 +777,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
+ struct platform_device *pdev = to_platform_device(dai->dev);
+ struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
struct atmel_pcm_dma_params *dma_params;
int dir;
@@ -795,7 +801,8 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
static int atmel_ssc_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
+ struct platform_device *pdev = to_platform_device(dai->dev);
+ struct atmel_ssc_info *ssc_p = &ssc_info[pdev->id];
struct atmel_pcm_dma_params *dma_params;
int dir;
@@ -824,11 +831,12 @@ static int atmel_ssc_trigger(struct snd_pcm_substream *substream,
static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai)
{
struct atmel_ssc_info *ssc_p;
+ struct platform_device *pdev = to_platform_device(cpu_dai->dev);
if (!cpu_dai->active)
return 0;
- ssc_p = &ssc_info[cpu_dai->id];
+ ssc_p = &ssc_info[pdev->id];
/* Save the status register before disabling transmit and receive */
ssc_p->ssc_state.ssc_sr = ssc_readl(ssc_p->ssc->regs, SR);
@@ -852,12 +860,13 @@ static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai)
static int atmel_ssc_resume(struct snd_soc_dai *cpu_dai)
{
struct atmel_ssc_info *ssc_p;
+ struct platform_device *pdev = to_platform_device(cpu_dai->dev);
u32 cr;
if (!cpu_dai->active)
return 0;
- ssc_p = &ssc_info[cpu_dai->id];
+ ssc_p = &ssc_info[pdev->id];
/* restore SSC register settings */
ssc_writel(ssc_p->ssc->regs, TFMR, ssc_p->ssc_state.ssc_tfmr);
--
2.7.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-03-02 14:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-13 6:35 [PATCH] ASoC: atmel_ssc_dai: distinguish the different SSC Songjun Wu
2016-01-13 15:08 ` Nicolas Ferre
2016-02-16 2:54 ` Wu, Songjun
2016-02-17 16:22 ` Mark Brown
2016-03-02 14:44 ` Applied "ASoC: atmel_ssc_dai: distinguish the different SSC" to the asoc tree 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).