Driver Core: Add platform device arch data V3
Subsystems (6)
PATCH 1/1 Driver Core: Add platform device arch data V3
From: Magnus Damm <[email protected]>
Allow architecture specific data in struct platform_device V3.
With this patch struct pdev_archdata is added to struct platform_device, similar to struct dev_archdata in found in struct device. Useful for architecture code that needs to keep extra data associated with each platform device.
Struct pdev_archdata is different from dev.platform_data, the convention is that dev.platform_data points to driver-specific data. It may or may not be required by the driver. The format of this depends on driver but is the same across architectures.
The structure pdev_archdata is a place for architecture specific data. This data is handled by architecture specific code (for example runtime PM), and since it is architecture specific it should _never_ be touched by device driver code. Exactly like struct dev_archdata but for platform devices.
---
Applies to next-20090610.
Changes since V2:
- updated commit message, thanks to Rafael for feedback
Changes since V1:
- post to lkml, keep linux-pm cc:ed
- add struct pdev_archdata to asm-generic
- add struct pdev_archdata to non-generic architectures
- drop Kconfig bits
arch/arm/include/asm/device.h | 3 +++ arch/ia64/include/asm/device.h | 3 +++ arch/microblaze/include/asm/device.h | 3 +++ arch/powerpc/include/asm/device.h | 3 +++ arch/sparc/include/asm/device.h | 3 +++ arch/x86/include/asm/device.h | 3 +++ include/asm-generic/device.h | 3 +++ include/linux/platform_device.h | 3 +++ 8 files changed, 24 insertions(+)
arch/arm/include/asm/device.h +3 -0
@@ -12,4 +12,7 @@ struct dev_archdata { #endif }; +struct pdev_archdata { +}; +#endif
arch/ia64/include/asm/device.h +3 -0
@@ -15,4 +15,7 @@ struct dev_archdata { #endif }; +struct pdev_archdata { +}; +#endif /* _ASM_IA64_DEVICE_H */
arch/microblaze/include/asm/device.h +3 -0
@@ -16,6 +16,9 @@ struct dev_archdata { struct device_node *of_node; }; +struct pdev_archdata { +}; +#endif /* _ASM_MICROBLAZE_DEVICE_H */
arch/powerpc/include/asm/device.h +3 -0
@@ -30,4 +30,7 @@ dev_archdata_get_node(const struct dev_a return ad->of_node; } +struct pdev_archdata { +}; +#endif /* _ASM_POWERPC_DEVICE_H */
arch/sparc/include/asm/device.h +3 -0
@@ -32,4 +32,7 @@ dev_archdata_get_node(const struct dev_a return ad->prom_node; } +struct pdev_archdata { +}; +#endif /* _ASM_SPARC_DEVICE_H */
arch/x86/include/asm/device.h +3 -0
@@ -13,4 +13,7 @@ struct dma_map_ops *dma_ops; #endif }; +struct pdev_archdata { +}; +#endif /* _ASM_X86_DEVICE_H */
include/asm-generic/device.h +3 -0
@@ -9,4 +9,7 @@struct dev_archdata { }; +struct pdev_archdata { +}; +#endif /* _ASM_GENERIC_DEVICE_H */
include/linux/platform_device.h +3 -0
@@ -22,6 +22,9 @@ struct platform_device {struct resource * resource;struct platform_device_id *id_entry; + +/* arch specific additions */ +struct pdev_archdata archdata; };#define platform_get_device_id (pdev) ((pdev)->id_entry)
Quoted 14 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Allow architecture specific data in struct
platform_deviceV3.With this patch struct
pdev_archdatais added to structplatform_device, similar to structdev_archdatain found in struct device. Useful for architecture code that needs to keep extra data associated with each platform device.Struct
pdev_archdatais different from dev.platform_data, the convention is that dev.platform_data points to driver-specific data. It may or may not be required by the driver. The format of this depends on driver but is the same across architectures.
Quoted 7 lines
The structure
pdev_archdatais a place for architecture specific data. This data is handled by architecture specific code (for example runtime PM), and since it is architecture specific it should _never_ be touched by device driver code. Exactly like structdev_archdatabut for platform devices.Signed-off-by Magnus Damm <[email protected]>
Since there is no 'Feature-desired-by:' tag, I'll addd
For PM on ARM in general, and OMAP in particular we definitely need a generic way to handle arch-specific data per platform_device.
Kevin
Quoted 106 lines
Applies to next-20090610.
Changes since V2:
- updated commit message, thanks to Rafael for feedbackChanges since V1:
- post to lkml, keep linux-pm cc:ed
- add structpdev_archdatato asm-generic
- add structpdev_archdatato non-generic architectures
- dropKconfigbitsarch/arm/include/asm/device.h | 3 +++ arch/ia64/include/asm/device.h | 3 +++ arch/microblaze/include/asm/device.h | 3 +++ arch/powerpc/include/asm/device.h | 3 +++ arch/sparc/include/asm/device.h | 3 +++ arch/x86/include/asm/device.h | 3 +++ include/asm-generic/device.h | 3 +++ include/linux/platform_device.h | 3 +++ 8 files changed, 24 insertions(+)arch/arm/include/asm/device.h +3
-0@@ -12,4 +12,7 @@ struct dev_archdata { #endif }; +struct pdev_archdata { +}; +#endif arch/ia64/include/asm/device.h +3
-0@@ -15,4 +15,7 @@ struct dev_archdata { #endif }; +struct pdev_archdata { +}; +#endif /* _ASM_IA64_DEVICE_H */ arch/microblaze/include/asm/device.h +3
-0@@ -16,6 +16,9 @@ struct dev_archdata { struct device_node *of_node; }; +struct pdev_archdata { +}; +#endif /* _ASM_MICROBLAZE_DEVICE_H */ arch/powerpc/include/asm/device.h +3
-0@@ -30,4 +30,7 @@ dev_archdata_get_node(const struct dev_a return ad->of_node; } +struct pdev_archdata { +}; +#endif /* _ASM_POWERPC_DEVICE_H */ arch/sparc/include/asm/device.h +3
-0@@ -32,4 +32,7 @@ dev_archdata_get_node(const struct dev_a return ad->prom_node; } +struct pdev_archdata { +}; +#endif /* _ASM_SPARC_DEVICE_H */ arch/x86/include/asm/device.h +3
-0@@ -13,4 +13,7 @@ struct dma_map_ops *dma_ops; #endif }; +struct pdev_archdata { +}; +#endif /* _ASM_X86_DEVICE_H */ include/asm-generic/device.h +3
-0@@ -9,4 +9,7 @@struct dev_archdata { }; +struct pdev_archdata { +}; +#endif /* _ASM_GENERIC_DEVICE_H */ include/linux/platform_device.h +3
-0@@ -22,6 +22,9 @@ struct platform_device {struct resource * resource;struct platform_device_id *id_entry; + +/* arch specific additions */ +struct pdev_archdata archdata; };#define platform_get_device_id (pdev) ((pdev)->id_entry)
Quoted 22 lines · Kevin Hilman
Quoted 20 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Allow architecture specific data in struct
platform_deviceV3.With this patch struct
pdev_archdatais added to structplatform_device, similar to structdev_archdatain found in struct device. Useful for architecture code that needs to keep extra data associated with each platform device.Struct
pdev_archdatais different from dev.platform_data, the convention is that dev.platform_data points to driver-specific data. It may or may not be required by the driver. The format of this depends on driver but is the same across architectures.The structure
pdev_archdatais a place for architecture specific data. This data is handled by architecture specific code (for example runtime PM), and since it is architecture specific it should _never_ be touched by device driver code. Exactly like structdev_archdatabut for platform devices.
Quoted 8 lines
Quoted 1 line
Signed-off-by Magnus Damm <[email protected]>Since there is no 'Feature-desired-by:' tag, I'll addd
Acked-by Kevin Hilman <[email protected]>For PM on ARM in general, and OMAP in particular we definitely need a generic way to handle arch-specific data per
platform_device.
Thanks, Kevin! So ARM in general or at least OMAP wants this, and so does SuperH.
Rafael, you kindly gave feedback on earlier versions, are you ok with this version?
Cheers,
/ magnus
Quoted 30 lines · Magnus Damm
Quoted 28 lines · Kevin Hilman
Quoted 14 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Allow architecture specific data in struct
platform_deviceV3.With this patch struct
pdev_archdatais added to structplatform_device, similar to structdev_archdatain found in struct device. Useful for architecture code that needs to keep extra data associated with each platform device.Struct
pdev_archdatais different from dev.platform_data, the convention is that dev.platform_data points to driver-specific data. It may or may not be required by the driver. The format of this depends on driver but is the same across architectures.Quoted 7 lines
The structure
pdev_archdatais a place for architecture specific data. This data is handled by architecture specific code (for example runtime PM), and since it is architecture specific it should _never_ be touched by device driver code. Exactly like structdev_archdatabut for platform devices.Signed-off-by Magnus Damm <[email protected]>Since there is no 'Feature-desired-by:' tag, I'll addd
Acked-by Kevin Hilman <[email protected]>
Quoted 8 lines
Quoted 2 lines
For PM on ARM in general, and OMAP in particular we definitely need a generic way to handle arch-specific data per
platform_device.Thanks, Kevin! So ARM in general or at least OMAP wants this, and so does SuperH.
Rafael, you kindly gave feedback on earlier versions, are you ok with this version?
Yes, I am. I'm planning to include it into my linux-next branch for 2.6.32, if no one objects.
Best,
Rafael
Quoted 30 lines · Magnus Damm
Quoted 28 lines · Kevin Hilman
Quoted 14 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Allow architecture specific data in struct
platform_deviceV3.With this patch struct
pdev_archdatais added to structplatform_device, similar to structdev_archdatain found in struct device. Useful for architecture code that needs to keep extra data associated with each platform device.Struct
pdev_archdatais different from dev.platform_data, the convention is that dev.platform_data points to driver-specific data. It may or may not be required by the driver. The format of this depends on driver but is the same across architectures.Quoted 7 lines
The structure
pdev_archdatais a place for architecture specific data. This data is handled by architecture specific code (for example runtime PM), and since it is architecture specific it should _never_ be touched by device driver code. Exactly like structdev_archdatabut for platform devices.Signed-off-by Magnus Damm <[email protected]>Since there is no 'Feature-desired-by:' tag, I'll addd
Acked-by Kevin Hilman <[email protected]>
Quoted 8 lines
Quoted 2 lines
For PM on ARM in general, and OMAP in particular we definitely need a generic way to handle arch-specific data per
platform_device.Thanks, Kevin! So ARM in general or at least OMAP wants this, and so does SuperH.
Rafael, you kindly gave feedback on earlier versions, are you ok with this version?
Yes, I am. I'm planning to include it into my linux-next branch for 2.6.32, if no one objects.
Best,
Rafael
Quoted 34 lines · Rafael J. Wysocki
Quoted 33 lines · Magnus Damm
Quoted 30 lines · Kevin Hilman
Quoted 14 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Allow architecture specific data in struct
platform_deviceV3.With this patch struct
pdev_archdatais added to structplatform_device, similar to structdev_archdatain found in struct device. Useful for architecture code that needs to keep extra data associated with each platform device.Struct
pdev_archdatais different from dev.platform_data, the convention is that dev.platform_data points to driver-specific data. It may or may not be required by the driver. The format of this depends on driver but is the same across architectures.Quoted 7 lines
The structure
pdev_archdatais a place for architecture specific data. This data is handled by architecture specific code (for example runtime PM), and since it is architecture specific it should _never_ be touched by device driver code. Exactly like structdev_archdatabut for platform devices.Signed-off-by Magnus Damm <[email protected]>Since there is no 'Feature-desired-by:' tag, I'll addd
Acked-by Kevin Hilman <[email protected]>For PM on ARM in general, and OMAP in particular we definitely need a generic way to handle arch-specific data per
platform_device.
Quoted 8 lines
Quoted 5 lines
Thanks, Kevin! So ARM in general or at least OMAP wants this, and so does SuperH.
Rafael, you kindly gave feedback on earlier versions, are you ok with this version?
Yes, I am. I'm planning to include it into my linux-next branch for 2.6.32, if no one objects.
Do you have any specific reason for not including this one in 2.6.31? I guess you were thinking of keeping it together with your Runtime PM patches targeted for 2.6.32?
IMO, this patch is decoupled from Runtime PM. It will of course be used for Runtime PM on SuperH, but it can for instance also be used together with the clock framework. On top of that, the patch is only adding code so it's very unlikely to cause any breakage.
If possible, I'd like this to be merged as early as possible since a lot of processor specific changes will depend on it. With this included in 2.6.31 I can easily build arch specific code for 2.6.32. Anything I can do to make that happen?
My top priority is Runtime PM for SuperH on top of your code, and I intend to post a prototype for SuperH before the PM Summit. It would be great to minimize the dependencies though, and including this in 2.6.31 would certainly help.
Thanks!
/ magnus
Quoted 38 lines · Magnus Damm
Quoted 37 lines · Rafael J. Wysocki
Quoted 36 lines · Magnus Damm
Quoted 22 lines · Kevin Hilman
Quoted 20 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Allow architecture specific data in struct
platform_deviceV3.With this patch struct
pdev_archdatais added to structplatform_device, similar to structdev_archdatain found in struct device. Useful for architecture code that needs to keep extra data associated with each platform device.Struct
pdev_archdatais different from dev.platform_data, the convention is that dev.platform_data points to driver-specific data. It may or may not be required by the driver. The format of this depends on driver but is the same across architectures.The structure
pdev_archdatais a place for architecture specific data. This data is handled by architecture specific code (for example runtime PM), and since it is architecture specific it should _never_ be touched by device driver code. Exactly like structdev_archdatabut for platform devices.Quoted 8 lines
Quoted 1 line
Signed-off-by Magnus Damm <[email protected]>Since there is no 'Feature-desired-by:' tag, I'll addd
Acked-by Kevin Hilman <[email protected]>For PM on ARM in general, and OMAP in particular we definitely need a generic way to handle arch-specific data per
platform_device.Thanks, Kevin! So ARM in general or at least OMAP wants this, and so does SuperH.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Rafael, you kindly gave feedback on earlier versions, are you ok with this version?
Yes, I am. I'm planning to include it into my linux-next branch for 2.6.32, if no one objects.
Do you have any specific reason for not including this one in 2.6.31?
Basically, it was too late for the merge window.
I think changes of this kind should really go in at the beginning of a merge window, after spending a few weeks in linux-next so that no one is surprised.
It also needs an ACK from Greg.
Quoted 13 lines
I guess you were thinking of keeping it together with your Runtime PM patches targeted for 2.6.32?
IMO, this patch is decoupled from Runtime PM. It will of course be used for Runtime PM on SuperH, but it can for instance also be used together with the clock framework. On top of that, the patch is only adding code so it's very unlikely to cause any breakage.
If possible, I'd like this to be merged as early as possible since a lot of processor specific changes will depend on it. With this included in 2.6.31 I can easily build arch specific code for 2.6.32. Anything I can do to make that happen?
Quoted 4 lines
My top priority is Runtime PM for SuperH on top of your code, and I intend to post a prototype for SuperH before the PM Summit. It would be great to minimize the dependencies though, and including this in 2.6.31 would certainly help.
I'm going to add this patch to my linux-next branch shortly and if your 2.6.32 development is based on that branch (I'd recommend that anyway), there shouldn't be any problems during the 2.6.32 merge window.
Thanks,
Rafael
Quoted 22 lines · Kevin Hilman
Quoted 20 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Allow architecture specific data in struct
platform_deviceV3.With this patch struct
pdev_archdatais added to structplatform_device, similar to structdev_archdatain found in struct device. Useful for architecture code that needs to keep extra data associated with each platform device.Struct
pdev_archdatais different from dev.platform_data, the convention is that dev.platform_data points to driver-specific data. It may or may not be required by the driver. The format of this depends on driver but is the same across architectures.The structure
pdev_archdatais a place for architecture specific data. This data is handled by architecture specific code (for example runtime PM), and since it is architecture specific it should _never_ be touched by device driver code. Exactly like structdev_archdatabut for platform devices.
Quoted 8 lines
Quoted 1 line
Signed-off-by Magnus Damm <[email protected]>Since there is no 'Feature-desired-by:' tag, I'll addd
Acked-by Kevin Hilman <[email protected]>For PM on ARM in general, and OMAP in particular we definitely need a generic way to handle arch-specific data per
platform_device.
Greg, is this patch fine with you?
Best,
Rafael
Quoted 105 lines
Quoted 105 lines
Applies to next-20090610.
Changes since V2:
- updated commit message, thanks to Rafael for feedbackChanges since V1:
- post to lkml, keep linux-pm cc:ed
- add structpdev_archdatato asm-generic
- add structpdev_archdatato non-generic architectures
- dropKconfigbitsarch/arm/include/asm/device.h | 3 +++ arch/ia64/include/asm/device.h | 3 +++ arch/microblaze/include/asm/device.h | 3 +++ arch/powerpc/include/asm/device.h | 3 +++ arch/sparc/include/asm/device.h | 3 +++ arch/x86/include/asm/device.h | 3 +++ include/asm-generic/device.h | 3 +++ include/linux/platform_device.h | 3 +++ 8 files changed, 24 insertions(+)arch/arm/include/asm/device.h +3
-0@@ -12,4 +12,7 @@ struct dev_archdata { #endif }; +struct pdev_archdata { +}; +#endif arch/ia64/include/asm/device.h +3
-0@@ -15,4 +15,7 @@ struct dev_archdata { #endif }; +struct pdev_archdata { +}; +#endif /* _ASM_IA64_DEVICE_H */ arch/microblaze/include/asm/device.h +3
-0@@ -16,6 +16,9 @@ struct dev_archdata { struct device_node *of_node; }; +struct pdev_archdata { +}; +#endif /* _ASM_MICROBLAZE_DEVICE_H */ arch/powerpc/include/asm/device.h +3
-0@@ -30,4 +30,7 @@ dev_archdata_get_node(const struct dev_a return ad->of_node; } +struct pdev_archdata { +}; +#endif /* _ASM_POWERPC_DEVICE_H */ arch/sparc/include/asm/device.h +3
-0@@ -32,4 +32,7 @@ dev_archdata_get_node(const struct dev_a return ad->prom_node; } +struct pdev_archdata { +}; +#endif /* _ASM_SPARC_DEVICE_H */ arch/x86/include/asm/device.h +3
-0@@ -13,4 +13,7 @@ struct dma_map_ops *dma_ops; #endif }; +struct pdev_archdata { +}; +#endif /* _ASM_X86_DEVICE_H */ include/asm-generic/device.h +3
-0@@ -9,4 +9,7 @@struct dev_archdata { }; +struct pdev_archdata { +}; +#endif /* _ASM_GENERIC_DEVICE_H */ include/linux/platform_device.h +3
-0@@ -22,6 +22,9 @@ struct platform_device {struct resource * resource;struct platform_device_id *id_entry; + +/* arch specific additions */ +struct pdev_archdata archdata; };#define platform_get_device_id (pdev) ((pdev)->id_entry)
Greg KH
Acked-byQuoted 25 lines · Rafael J. Wysocki
Quoted 24 lines · Kevin Hilman
Quoted 21 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Allow architecture specific data in struct
platform_deviceV3.With this patch struct
pdev_archdatais added to structplatform_device, similar to structdev_archdatain found in struct device. Useful for architecture code that needs to keep extra data associated with each platform device.Struct
pdev_archdatais different from dev.platform_data, the convention is that dev.platform_data points to driver-specific data. It may or may not be required by the driver. The format of this depends on driver but is the same across architectures.The structure
pdev_archdatais a place for architecture specific data. This data is handled by architecture specific code (for example runtime PM), and since it is architecture specific it should _never_ be touched by device driver code. Exactly like structdev_archdatabut for platform devices.Signed-off-by Magnus Damm <[email protected]>
Quoted 8 lines
Quoted 6 lines
Since there is no 'Feature-desired-by:' tag, I'll addd
Acked-by Kevin Hilman <[email protected]>For PM on ARM in general, and OMAP in particular we definitely need a generic way to handle arch-specific data per
platform_device.Greg, is this patch fine with you?
Yes:
thanks,
greg k-h
Greg KH
Acked-byQuoted 25 lines · Rafael J. Wysocki
Quoted 24 lines · Kevin Hilman
Quoted 21 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Allow architecture specific data in struct
platform_deviceV3.With this patch struct
pdev_archdatais added to structplatform_device, similar to structdev_archdatain found in struct device. Useful for architecture code that needs to keep extra data associated with each platform device.Struct
pdev_archdatais different from dev.platform_data, the convention is that dev.platform_data points to driver-specific data. It may or may not be required by the driver. The format of this depends on driver but is the same across architectures.The structure
pdev_archdatais a place for architecture specific data. This data is handled by architecture specific code (for example runtime PM), and since it is architecture specific it should _never_ be touched by device driver code. Exactly like structdev_archdatabut for platform devices.Signed-off-by Magnus Damm <[email protected]>
Quoted 8 lines
Quoted 6 lines
Since there is no 'Feature-desired-by:' tag, I'll addd
Acked-by Kevin Hilman <[email protected]>For PM on ARM in general, and OMAP in particular we definitely need a generic way to handle arch-specific data per
platform_device.Greg, is this patch fine with you?
Yes:
thanks,
greg k-h
Quoted 6 lines · Rafael J. Wysocki
Quoted 5 lines · Magnus Damm
If possible, I'd like this to be merged as early as possible since a lot of processor specific changes will depend on it. With this included in 2.6.31 I can easily build arch specific code for 2.6.32. Anything I can do to make that happen?
Quoted 9 lines
Quoted 4 lines
My top priority is Runtime PM for SuperH on top of your code, and I intend to post a prototype for SuperH before the PM Summit. It would be great to minimize the dependencies though, and including this in 2.6.31 would certainly help.
I'm going to add this patch to my linux-next branch shortly and if your 2.6.32 development is based on that branch (I'd recommend that anyway), there shouldn't be any problems during the 2.6.32 merge window.
Yes, I was already planning on creating a topic branch based off of this so that we can start getting things ready in the sh tree, so this is not a problem.. as long as you don't rebase ;-)
Quoted 6 lines · Rafael J. Wysocki
Quoted 5 lines · Magnus Damm
If possible, I'd like this to be merged as early as possible since a lot of processor specific changes will depend on it. With this included in 2.6.31 I can easily build arch specific code for 2.6.32. Anything I can do to make that happen?
Quoted 9 lines
Quoted 4 lines
My top priority is Runtime PM for SuperH on top of your code, and I intend to post a prototype for SuperH before the PM Summit. It would be great to minimize the dependencies though, and including this in 2.6.31 would certainly help.
I'm going to add this patch to my linux-next branch shortly and if your 2.6.32 development is based on that branch (I'd recommend that anyway), there shouldn't be any problems during the 2.6.32 merge window.
Yes, I was already planning on creating a topic branch based off of this so that we can start getting things ready in the sh tree, so this is not a problem.. as long as you don't rebase ;-)
Quoted 25 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Allow architecture specific data in struct
platform_deviceV3.With this patch struct
pdev_archdatais added to structplatform_device, similar to structdev_archdatain found in struct device. Useful for architecture code that needs to keep extra data associated with each platform device.Struct
pdev_archdatais different from dev.platform_data, the convention is that dev.platform_data points to driver-specific data. It may or may not be required by the driver. The format of this depends on driver but is the same across architectures.The structure
pdev_archdatais a place for architecture specific data. This data is handled by architecture specific code (for example runtime PM), and since it is architecture specific it should _never_ be touched by device driver code. Exactly like structdev_archdatabut for platform devices.Signed-off-by Magnus Damm <[email protected]>---
Applies to next-20090610.
Quoted 8 lines
Changes since V2:
- updated commit message, thanks to Rafael for feedbackChanges since V1:
- post to lkml, keep linux-pm cc:ed
- add structpdev_archdatato asm-generic
- add structpdev_archdatato non-generic architectures
- dropKconfigbits
The patch is now in the linux-next branch of the suspend-2.6 tree. I'll move it into the for-linus branch, which is not rebased, if it's not reported to cause any problems in the next few days.
Best,
Rafael