All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: pxa: ssp: provide platform_device_id for PXA3xx
@ 2014-08-13 19:59 Daniel Mack
  2014-08-13 19:59 ` [PATCH 2/2] ARM: pxa3xx: provide specific platform_devices for all ssp ports Daniel Mack
  2014-08-14  2:08 ` [PATCH 1/2] ARM: pxa: ssp: provide platform_device_id for PXA3xx Haojian Zhuang
  0 siblings, 2 replies; 8+ messages in thread
From: Daniel Mack @ 2014-08-13 19:59 UTC (permalink / raw)
  To: linux-arm-kernel

Provide an explicit match string for PXA3xx SSP ports.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 arch/arm/plat-pxa/ssp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index 3ea0290..1f5ee17 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -258,6 +258,7 @@ static const struct platform_device_id ssp_id_table[] = {
 	{ "pxa25x-ssp",		PXA25x_SSP },
 	{ "pxa25x-nssp",	PXA25x_NSSP },
 	{ "pxa27x-ssp",		PXA27x_SSP },
+	{ "pxa3xx-ssp",		PXA3xx_SSP },
 	{ "pxa168-ssp",		PXA168_SSP },
 	{ "pxa910-ssp",		PXA910_SSP },
 	{ },
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] ARM: pxa3xx: provide specific platform_devices for all ssp ports
  2014-08-13 19:59 [PATCH 1/2] ARM: pxa: ssp: provide platform_device_id for PXA3xx Daniel Mack
@ 2014-08-13 19:59 ` Daniel Mack
  2014-08-14  2:08 ` [PATCH 1/2] ARM: pxa: ssp: provide platform_device_id for PXA3xx Haojian Zhuang
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel Mack @ 2014-08-13 19:59 UTC (permalink / raw)
  To: linux-arm-kernel

Currently, devices for SSP ports 1, 2 and 3 are registered as compatible
devices to pxa27x-ssp. While the actual IP core is comparable, there are
some subtle differences which users of the SSP ports address by looking at
the 'type' field.

By registering devices of type 'pxa27x-ssp', this 'type' field is
incorrectly set to PXA27x_SSP which confuses the users.

To fix this, provide specific ssp port plaform devices which use
'pxa3xx-ssp' as driver name, an instantiate them from pxa3xx.c.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 arch/arm/mach-pxa/devices.c | 42 ++++++++++++++++++++++++++++++++++++++++--
 arch/arm/mach-pxa/devices.h |  3 +++
 arch/arm/mach-pxa/pxa3xx.c  | 14 +++++++-------
 3 files changed, 50 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index 78b7181..d1d8ea0 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -1099,9 +1099,47 @@ static struct resource pxa3xx_resource_ssp4[] = {
 	},
 };
 
+/*
+ * PXA3xx SSP is basically equivalent to PXA27x.
+ * However, we need to register the device by the correct name in order to
+ * make the driver set the correct internal type, hence we provide specific
+ * platform_devices for each of them.
+ */
+struct platform_device pxa3xx_device_ssp1 = {
+	.name		= "pxa3xx-ssp",
+	.id		= 0,
+	.dev		= {
+		.dma_mask = &pxa27x_ssp1_dma_mask,
+		.coherent_dma_mask = DMA_BIT_MASK(32),
+	},
+	.resource	= pxa27x_resource_ssp1,
+	.num_resources	= ARRAY_SIZE(pxa27x_resource_ssp1),
+};
+
+struct platform_device pxa3xx_device_ssp2 = {
+	.name		= "pxa3xx-ssp",
+	.id		= 1,
+	.dev		= {
+		.dma_mask = &pxa27x_ssp2_dma_mask,
+		.coherent_dma_mask = DMA_BIT_MASK(32),
+	},
+	.resource	= pxa27x_resource_ssp2,
+	.num_resources	= ARRAY_SIZE(pxa27x_resource_ssp2),
+};
+
+struct platform_device pxa3xx_device_ssp3 = {
+	.name		= "pxa3xx-ssp",
+	.id		= 2,
+	.dev		= {
+		.dma_mask = &pxa27x_ssp3_dma_mask,
+		.coherent_dma_mask = DMA_BIT_MASK(32),
+	},
+	.resource	= pxa27x_resource_ssp3,
+	.num_resources	= ARRAY_SIZE(pxa27x_resource_ssp3),
+};
+
 struct platform_device pxa3xx_device_ssp4 = {
-	/* PXA3xx SSP is basically equivalent to PXA27x */
-	.name		= "pxa27x-ssp",
+	.name		= "pxa3xx-ssp",
 	.id		= 3,
 	.dev		= {
 		.dma_mask = &pxa3xx_ssp4_dma_mask,
diff --git a/arch/arm/mach-pxa/devices.h b/arch/arm/mach-pxa/devices.h
index 19906c9..298caea 100644
--- a/arch/arm/mach-pxa/devices.h
+++ b/arch/arm/mach-pxa/devices.h
@@ -28,6 +28,9 @@ extern struct platform_device pxa25x_device_assp;
 extern struct platform_device pxa27x_device_ssp1;
 extern struct platform_device pxa27x_device_ssp2;
 extern struct platform_device pxa27x_device_ssp3;
+extern struct platform_device pxa3xx_device_ssp1;
+extern struct platform_device pxa3xx_device_ssp2;
+extern struct platform_device pxa3xx_device_ssp3;
 extern struct platform_device pxa3xx_device_ssp4;
 
 extern struct platform_device pxa25x_device_pwm0;
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index 7675a5d..0c20bcf 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -84,10 +84,10 @@ static struct clk_lookup pxa3xx_clkregs[] = {
 	INIT_CLKREG(&clk_pxa3xx_usbh, "pxa27x-ohci", NULL),
 	INIT_CLKREG(&clk_pxa3xx_u2d, "pxa3xx-u2d", NULL),
 	INIT_CLKREG(&clk_pxa3xx_keypad, "pxa27x-keypad", NULL),
-	INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa27x-ssp.0", NULL),
-	INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa27x-ssp.1", NULL),
-	INIT_CLKREG(&clk_pxa3xx_ssp3, "pxa27x-ssp.2", NULL),
-	INIT_CLKREG(&clk_pxa3xx_ssp4, "pxa27x-ssp.3", NULL),
+	INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa3xx-ssp.0", NULL),
+	INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa3xx-ssp.1", NULL),
+	INIT_CLKREG(&clk_pxa3xx_ssp3, "pxa3xx-ssp.2", NULL),
+	INIT_CLKREG(&clk_pxa3xx_ssp4, "pxa3xx-ssp.3", NULL),
 	INIT_CLKREG(&clk_pxa3xx_pwm0, "pxa27x-pwm.0", NULL),
 	INIT_CLKREG(&clk_pxa3xx_pwm1, "pxa27x-pwm.1", NULL),
 	INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL),
@@ -456,9 +456,9 @@ static struct platform_device *devices[] __initdata = {
 	&pxa_device_asoc_platform,
 	&sa1100_device_rtc,
 	&pxa_device_rtc,
-	&pxa27x_device_ssp1,
-	&pxa27x_device_ssp2,
-	&pxa27x_device_ssp3,
+	&pxa3xx_device_ssp1,
+	&pxa3xx_device_ssp2,
+	&pxa3xx_device_ssp3,
 	&pxa3xx_device_ssp4,
 	&pxa27x_device_pwm0,
 	&pxa27x_device_pwm1,
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ARM: pxa: ssp: provide platform_device_id for PXA3xx
  2014-08-13 19:59 [PATCH 1/2] ARM: pxa: ssp: provide platform_device_id for PXA3xx Daniel Mack
  2014-08-13 19:59 ` [PATCH 2/2] ARM: pxa3xx: provide specific platform_devices for all ssp ports Daniel Mack
@ 2014-08-14  2:08 ` Haojian Zhuang
  2014-08-14  8:35   ` Daniel Mack
  1 sibling, 1 reply; 8+ messages in thread
From: Haojian Zhuang @ 2014-08-14  2:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 14, 2014 at 3:59 AM, Daniel Mack <zonque@gmail.com> wrote:
> Provide an explicit match string for PXA3xx SSP ports.
>
> Signed-off-by: Daniel Mack <zonque@gmail.com>
> ---
>  arch/arm/plat-pxa/ssp.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
> index 3ea0290..1f5ee17 100644
> --- a/arch/arm/plat-pxa/ssp.c
> +++ b/arch/arm/plat-pxa/ssp.c
> @@ -258,6 +258,7 @@ static const struct platform_device_id ssp_id_table[] = {
>         { "pxa25x-ssp",         PXA25x_SSP },
>         { "pxa25x-nssp",        PXA25x_NSSP },
>         { "pxa27x-ssp",         PXA27x_SSP },
> +       { "pxa3xx-ssp",         PXA3xx_SSP },
>         { "pxa168-ssp",         PXA168_SSP },
>         { "pxa910-ssp",         PXA910_SSP },
>         { },
> --
> 2.0.4
>
I don't agree on this. SSP1,SSP2,SSP3 on pxa3xx are same with pxa27x.
So we reuse the name.
For the new SSP4, we create pxa3xx_device_ssp4.

We just want to reuse these code.

Regards
Haojian

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ARM: pxa: ssp: provide platform_device_id for PXA3xx
  2014-08-14  2:08 ` [PATCH 1/2] ARM: pxa: ssp: provide platform_device_id for PXA3xx Haojian Zhuang
@ 2014-08-14  8:35   ` Daniel Mack
  2014-08-15  8:33     ` Haojian Zhuang
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Mack @ 2014-08-14  8:35 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Haojian,

On 08/14/2014 04:08 AM, Haojian Zhuang wrote:
> On Thu, Aug 14, 2014 at 3:59 AM, Daniel Mack <zonque@gmail.com> wrote:
>> Provide an explicit match string for PXA3xx SSP ports.
>>
>> Signed-off-by: Daniel Mack <zonque@gmail.com>
>> ---
>>  arch/arm/plat-pxa/ssp.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
>> index 3ea0290..1f5ee17 100644
>> --- a/arch/arm/plat-pxa/ssp.c
>> +++ b/arch/arm/plat-pxa/ssp.c
>> @@ -258,6 +258,7 @@ static const struct platform_device_id ssp_id_table[] = {
>>         { "pxa25x-ssp",         PXA25x_SSP },
>>         { "pxa25x-nssp",        PXA25x_NSSP },
>>         { "pxa27x-ssp",         PXA27x_SSP },
>> +       { "pxa3xx-ssp",         PXA3xx_SSP },
>>         { "pxa168-ssp",         PXA168_SSP },
>>         { "pxa910-ssp",         PXA910_SSP },
>>         { },
>> --

> I don't agree on this. SSP1,SSP2,SSP3 on pxa3xx are same with pxa27x.
> So we reuse the name.
> For the new SSP4, we create pxa3xx_device_ssp4.

Well, the problem is that the code in sound/soc/pxa/pxa-ssp.c is full of
checks like "ssp->type == PXA3xx_SSP", but unless the devices are
instantiated via DT, this value is never set appropriately, not even for
ssp4.

That's a regression caused by 972a55b62 ("ASoC: fix pxa-ssp compiling
issue under mach-mmp"), btw, that added the PXA3xx_SSP enum value but
forgot to make sure it is actually used.

Hence, this commit could even get a stable tag for 3.5+.


Thanks,
Daniel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ARM: pxa: ssp: provide platform_device_id for PXA3xx
  2014-08-14  8:35   ` Daniel Mack
@ 2014-08-15  8:33     ` Haojian Zhuang
  2014-08-15  8:41       ` Daniel Mack
  2014-08-20  8:32       ` Daniel Mack
  0 siblings, 2 replies; 8+ messages in thread
From: Haojian Zhuang @ 2014-08-15  8:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 14, 2014 at 4:35 PM, Daniel Mack <zonque@gmail.com> wrote:
> Hi Haojian,
>
> On 08/14/2014 04:08 AM, Haojian Zhuang wrote:
>> On Thu, Aug 14, 2014 at 3:59 AM, Daniel Mack <zonque@gmail.com> wrote:
>>> Provide an explicit match string for PXA3xx SSP ports.
>>>
>>> Signed-off-by: Daniel Mack <zonque@gmail.com>
>>> ---
>>>  arch/arm/plat-pxa/ssp.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
>>> index 3ea0290..1f5ee17 100644
>>> --- a/arch/arm/plat-pxa/ssp.c
>>> +++ b/arch/arm/plat-pxa/ssp.c
>>> @@ -258,6 +258,7 @@ static const struct platform_device_id ssp_id_table[] = {
>>>         { "pxa25x-ssp",         PXA25x_SSP },
>>>         { "pxa25x-nssp",        PXA25x_NSSP },
>>>         { "pxa27x-ssp",         PXA27x_SSP },
>>> +       { "pxa3xx-ssp",         PXA3xx_SSP },
>>>         { "pxa168-ssp",         PXA168_SSP },
>>>         { "pxa910-ssp",         PXA910_SSP },
>>>         { },
>>> --
>
>> I don't agree on this. SSP1,SSP2,SSP3 on pxa3xx are same with pxa27x.
>> So we reuse the name.
>> For the new SSP4, we create pxa3xx_device_ssp4.
>
> Well, the problem is that the code in sound/soc/pxa/pxa-ssp.c is full of
> checks like "ssp->type == PXA3xx_SSP", but unless the devices are
> instantiated via DT, this value is never set appropriately, not even for
> ssp4.
>
> That's a regression caused by 972a55b62 ("ASoC: fix pxa-ssp compiling
> issue under mach-mmp"), btw, that added the PXA3xx_SSP enum value but
> forgot to make sure it is actually used.
>
> Hence, this commit could even get a stable tag for 3.5+.
>
>
Yes, you're right. We should append this string.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ARM: pxa: ssp: provide platform_device_id for PXA3xx
  2014-08-15  8:33     ` Haojian Zhuang
@ 2014-08-15  8:41       ` Daniel Mack
  2014-08-20  8:32       ` Daniel Mack
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel Mack @ 2014-08-15  8:41 UTC (permalink / raw)
  To: linux-arm-kernel

On 08/15/2014 10:33 AM, Haojian Zhuang wrote:
> On Thu, Aug 14, 2014 at 4:35 PM, Daniel Mack <zonque@gmail.com> wrote:

>> That's a regression caused by 972a55b62 ("ASoC: fix pxa-ssp compiling
>> issue under mach-mmp"), btw, that added the PXA3xx_SSP enum value but
>> forgot to make sure it is actually used.
>>
>> Hence, this commit could even get a stable tag for 3.5+.
>>
>>
> Yes, you're right. We should append this string.

The stable@ tag you mean? Well, OTOH, it went unnoticed since 3.5, so we
can as well just apply it for 3.17 :)


Thanks,
Daniel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ARM: pxa: ssp: provide platform_device_id for PXA3xx
  2014-08-15  8:33     ` Haojian Zhuang
  2014-08-15  8:41       ` Daniel Mack
@ 2014-08-20  8:32       ` Daniel Mack
  2014-08-25  7:18         ` Haojian Zhuang
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Mack @ 2014-08-20  8:32 UTC (permalink / raw)
  To: linux-arm-kernel

On 08/15/2014 10:33 AM, Haojian Zhuang wrote:
> On Thu, Aug 14, 2014 at 4:35 PM, Daniel Mack <zonque@gmail.com> wrote:
>> Hi Haojian,
>>
>> On 08/14/2014 04:08 AM, Haojian Zhuang wrote:
>>> On Thu, Aug 14, 2014 at 3:59 AM, Daniel Mack <zonque@gmail.com> wrote:
>>>> Provide an explicit match string for PXA3xx SSP ports.
>>>>
>>>> Signed-off-by: Daniel Mack <zonque@gmail.com>
>>>> ---
>>>>  arch/arm/plat-pxa/ssp.c | 1 +
>>>>  1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
>>>> index 3ea0290..1f5ee17 100644
>>>> --- a/arch/arm/plat-pxa/ssp.c
>>>> +++ b/arch/arm/plat-pxa/ssp.c
>>>> @@ -258,6 +258,7 @@ static const struct platform_device_id ssp_id_table[] = {
>>>>         { "pxa25x-ssp",         PXA25x_SSP },
>>>>         { "pxa25x-nssp",        PXA25x_NSSP },
>>>>         { "pxa27x-ssp",         PXA27x_SSP },
>>>> +       { "pxa3xx-ssp",         PXA3xx_SSP },
>>>>         { "pxa168-ssp",         PXA168_SSP },
>>>>         { "pxa910-ssp",         PXA910_SSP },
>>>>         { },
>>>> --
>>
>>> I don't agree on this. SSP1,SSP2,SSP3 on pxa3xx are same with pxa27x.
>>> So we reuse the name.
>>> For the new SSP4, we create pxa3xx_device_ssp4.
>>
>> Well, the problem is that the code in sound/soc/pxa/pxa-ssp.c is full of
>> checks like "ssp->type == PXA3xx_SSP", but unless the devices are
>> instantiated via DT, this value is never set appropriately, not even for
>> ssp4.
>>
>> That's a regression caused by 972a55b62 ("ASoC: fix pxa-ssp compiling
>> issue under mach-mmp"), btw, that added the PXA3xx_SSP enum value but
>> forgot to make sure it is actually used.
>>
>> Hence, this commit could even get a stable tag for 3.5+.
>>
>>
> Yes, you're right. We should append this string.

Would this go through your tree or will Arnd or Eric pick those patches?


Thanks,
Daniel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ARM: pxa: ssp: provide platform_device_id for PXA3xx
  2014-08-20  8:32       ` Daniel Mack
@ 2014-08-25  7:18         ` Haojian Zhuang
  0 siblings, 0 replies; 8+ messages in thread
From: Haojian Zhuang @ 2014-08-25  7:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Aug 20, 2014 at 4:32 PM, Daniel Mack <zonque@gmail.com> wrote:
> On 08/15/2014 10:33 AM, Haojian Zhuang wrote:
>> On Thu, Aug 14, 2014 at 4:35 PM, Daniel Mack <zonque@gmail.com> wrote:
>>> Hi Haojian,
>>>
>>> On 08/14/2014 04:08 AM, Haojian Zhuang wrote:
>>>> On Thu, Aug 14, 2014 at 3:59 AM, Daniel Mack <zonque@gmail.com> wrote:
>>>>> Provide an explicit match string for PXA3xx SSP ports.
>>>>>
>>>>> Signed-off-by: Daniel Mack <zonque@gmail.com>
>>>>> ---
>>>>>  arch/arm/plat-pxa/ssp.c | 1 +
>>>>>  1 file changed, 1 insertion(+)
>>>>>
>>>>> diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
>>>>> index 3ea0290..1f5ee17 100644
>>>>> --- a/arch/arm/plat-pxa/ssp.c
>>>>> +++ b/arch/arm/plat-pxa/ssp.c
>>>>> @@ -258,6 +258,7 @@ static const struct platform_device_id ssp_id_table[] = {
>>>>>         { "pxa25x-ssp",         PXA25x_SSP },
>>>>>         { "pxa25x-nssp",        PXA25x_NSSP },
>>>>>         { "pxa27x-ssp",         PXA27x_SSP },
>>>>> +       { "pxa3xx-ssp",         PXA3xx_SSP },
>>>>>         { "pxa168-ssp",         PXA168_SSP },
>>>>>         { "pxa910-ssp",         PXA910_SSP },
>>>>>         { },
>>>>> --
>>>
>>>> I don't agree on this. SSP1,SSP2,SSP3 on pxa3xx are same with pxa27x.
>>>> So we reuse the name.
>>>> For the new SSP4, we create pxa3xx_device_ssp4.
>>>
>>> Well, the problem is that the code in sound/soc/pxa/pxa-ssp.c is full of
>>> checks like "ssp->type == PXA3xx_SSP", but unless the devices are
>>> instantiated via DT, this value is never set appropriately, not even for
>>> ssp4.
>>>
>>> That's a regression caused by 972a55b62 ("ASoC: fix pxa-ssp compiling
>>> issue under mach-mmp"), btw, that added the PXA3xx_SSP enum value but
>>> forgot to make sure it is actually used.
>>>
>>> Hence, this commit could even get a stable tag for 3.5+.
>>>
>>>
>> Yes, you're right. We should append this string.
>
> Would this go through your tree or will Arnd or Eric pick those patches?
>
>
> Thanks,
> Daniel

Sure, I'll send the pull request to Arnd.

Regards
Haojian

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-08-25  7:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-13 19:59 [PATCH 1/2] ARM: pxa: ssp: provide platform_device_id for PXA3xx Daniel Mack
2014-08-13 19:59 ` [PATCH 2/2] ARM: pxa3xx: provide specific platform_devices for all ssp ports Daniel Mack
2014-08-14  2:08 ` [PATCH 1/2] ARM: pxa: ssp: provide platform_device_id for PXA3xx Haojian Zhuang
2014-08-14  8:35   ` Daniel Mack
2014-08-15  8:33     ` Haojian Zhuang
2014-08-15  8:41       ` Daniel Mack
2014-08-20  8:32       ` Daniel Mack
2014-08-25  7:18         ` Haojian Zhuang

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.