* [PATCH 01/04] Driver Core: Add platform device arch data
@ 2009-05-27 10:06 Magnus Damm
2009-05-28 21:26 ` Rafael J. Wysocki
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Magnus Damm @ 2009-05-27 10:06 UTC (permalink / raw)
To: linux-sh
From: Magnus Damm <damm@igel.co.jp>
Allow architecture specific data in struct platform_device.
Platform device data is needed by the runtime pm code. A similar
struct already exists for struct device.
The architecture specific asm/device.h file needs to provide
struct pdev_archdata if CONFIG_HAVE_PLATFORM_DEVICE_DATA is set.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
---
Optionally we can make use of struct device archdata instead,
but since the runtime device pm is limited to platform devices
it makes sense to make this data platform device specific imo.
arch/Kconfig | 3 +++
include/linux/platform_device.h | 5 +++++
2 files changed, 8 insertions(+)
--- 0001/arch/Kconfig
+++ work/arch/Kconfig 2009-05-15 14:51:35.000000000 +0900
@@ -112,3 +112,6 @@ config HAVE_DMA_API_DEBUG
config HAVE_DEFAULT_NO_SPIN_MUTEXES
bool
+
+config HAVE_PLATFORM_DEVICE_ARCHDATA
+ bool
--- 0001/include/linux/platform_device.h
+++ work/include/linux/platform_device.h 2009-05-15 16:59:01.000000000 +0900
@@ -23,6 +23,11 @@ struct platform_device {
void *platform_data;
struct platform_device_id *id_entry;
+
+#ifdef CONFIG_HAVE_PLATFORM_DEVICE_ARCHDATA
+ /* arch specific additions */
+ struct pdev_archdata archdata;
+#endif
};
#define platform_get_device_id(pdev) ((pdev)->id_entry)
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 01/04] Driver Core: Add platform device arch data
2009-05-27 10:06 [PATCH 01/04] Driver Core: Add platform device arch data Magnus Damm
@ 2009-05-28 21:26 ` Rafael J. Wysocki
2009-05-29 5:07 ` Magnus Damm
2009-05-29 5:51 ` Paul Mundt
2 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2009-05-28 21:26 UTC (permalink / raw)
To: linux-sh
On Wednesday 27 May 2009, Magnus Damm wrote:
> From: Magnus Damm <damm@igel.co.jp>
>
> Allow architecture specific data in struct platform_device.
> Platform device data is needed by the runtime pm code. A similar
> struct already exists for struct device.
>
> The architecture specific asm/device.h file needs to provide
> struct pdev_archdata if CONFIG_HAVE_PLATFORM_DEVICE_DATA is set.
>
> Signed-off-by: Magnus Damm <damm@igel.co.jp>
> ---
>
> Optionally we can make use of struct device archdata instead,
> but since the runtime device pm is limited to platform devices
> it makes sense to make this data platform device specific imo.
>
> arch/Kconfig | 3 +++
> include/linux/platform_device.h | 5 +++++
> 2 files changed, 8 insertions(+)
>
> --- 0001/arch/Kconfig
> +++ work/arch/Kconfig 2009-05-15 14:51:35.000000000 +0900
> @@ -112,3 +112,6 @@ config HAVE_DMA_API_DEBUG
>
> config HAVE_DEFAULT_NO_SPIN_MUTEXES
> bool
> +
> +config HAVE_PLATFORM_DEVICE_ARCHDATA
Hmm. Do we really need yet another CONFIG_ option for that?
> + bool
> --- 0001/include/linux/platform_device.h
> +++ work/include/linux/platform_device.h 2009-05-15 16:59:01.000000000 +0900
> @@ -23,6 +23,11 @@ struct platform_device {
> void *platform_data;
>
> struct platform_device_id *id_entry;
> +
> +#ifdef CONFIG_HAVE_PLATFORM_DEVICE_ARCHDATA
> + /* arch specific additions */
> + struct pdev_archdata archdata;
> +#endif
> };
>
> #define platform_get_device_id(pdev) ((pdev)->id_entry)
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 01/04] Driver Core: Add platform device arch data
2009-05-27 10:06 [PATCH 01/04] Driver Core: Add platform device arch data Magnus Damm
2009-05-28 21:26 ` Rafael J. Wysocki
@ 2009-05-29 5:07 ` Magnus Damm
2009-05-29 5:51 ` Paul Mundt
2 siblings, 0 replies; 4+ messages in thread
From: Magnus Damm @ 2009-05-29 5:07 UTC (permalink / raw)
To: linux-sh
2009/5/29 Rafael J. Wysocki <rjw@sisk.pl>:
> On Wednesday 27 May 2009, Magnus Damm wrote:
>> From: Magnus Damm <damm@igel.co.jp>
>>
>> Allow architecture specific data in struct platform_device.
>> Platform device data is needed by the runtime pm code. A similar
>> struct already exists for struct device.
>>
>> The architecture specific asm/device.h file needs to provide
>> struct pdev_archdata if CONFIG_HAVE_PLATFORM_DEVICE_DATA is set.
>>
>> Signed-off-by: Magnus Damm <damm@igel.co.jp>
>> ---
>>
>> Optionally we can make use of struct device archdata instead,
>> but since the runtime device pm is limited to platform devices
>> it makes sense to make this data platform device specific imo.
>>
>> arch/Kconfig | 3 +++
>> include/linux/platform_device.h | 5 +++++
>> 2 files changed, 8 insertions(+)
>>
>> --- 0001/arch/Kconfig
>> +++ work/arch/Kconfig 2009-05-15 14:51:35.000000000 +0900
>> @@ -112,3 +112,6 @@ config HAVE_DMA_API_DEBUG
>>
>> config HAVE_DEFAULT_NO_SPIN_MUTEXES
>> bool
>> +
>> +config HAVE_PLATFORM_DEVICE_ARCHDATA
>
> Hmm. Do we really need yet another CONFIG_ option for that?
I don't think we need a total of 3 different config options for the
platform device pm stuff, but I do think it makes sense to handle the
platform archdata separately. Not sure which is the best way though,
the #ifdefery is not very pretty. Maybe the best solution is just to
drop the Kconfig stuff and add empty structures to all architecture
versions of asm/device.h.
Any suggestions?
Thanks!
/ magnus
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 01/04] Driver Core: Add platform device arch data
2009-05-27 10:06 [PATCH 01/04] Driver Core: Add platform device arch data Magnus Damm
2009-05-28 21:26 ` Rafael J. Wysocki
2009-05-29 5:07 ` Magnus Damm
@ 2009-05-29 5:51 ` Paul Mundt
2 siblings, 0 replies; 4+ messages in thread
From: Paul Mundt @ 2009-05-29 5:51 UTC (permalink / raw)
To: linux-sh
On Fri, May 29, 2009 at 02:07:35PM +0900, Magnus Damm wrote:
> 2009/5/29 Rafael J. Wysocki <rjw@sisk.pl>:
> > On Wednesday 27 May 2009, Magnus Damm wrote:
> >> --- 0001/arch/Kconfig
> >> +++ work/arch/Kconfig 2009-05-15 14:51:35.000000000 +0900
> >> @@ -112,3 +112,6 @@ config HAVE_DMA_API_DEBUG
> >>
> >> ?config HAVE_DEFAULT_NO_SPIN_MUTEXES
> >> ? ? ? bool
> >> +
> >> +config HAVE_PLATFORM_DEVICE_ARCHDATA
> >
> > Hmm. ?Do we really need yet another CONFIG_ option for that?
>
> I don't think we need a total of 3 different config options for the
> platform device pm stuff, but I do think it makes sense to handle the
> platform archdata separately. Not sure which is the best way though,
> the #ifdefery is not very pretty. Maybe the best solution is just to
> drop the Kconfig stuff and add empty structures to all architecture
> versions of asm/device.h.
>
A stub in asm-generic/device.h will cover the majority of cases. That is
much cleaner than adding to the Kconfig mess.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-05-29 5:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-27 10:06 [PATCH 01/04] Driver Core: Add platform device arch data Magnus Damm
2009-05-28 21:26 ` Rafael J. Wysocki
2009-05-29 5:07 ` Magnus Damm
2009-05-29 5:51 ` Paul Mundt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox