]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Driver Core: Add platform device arch data V3
authorMagnus Damm <damm@igel.co.jp>
Wed, 8 Jul 2009 11:21:31 +0000 (13:21 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Tue, 21 Jul 2009 22:28:38 +0000 (00:28 +0200)
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.

[rjw: This change is for power management mostly and that's why it
 goes through the suspend tree.]

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
arch/arm/include/asm/device.h
arch/ia64/include/asm/device.h
arch/microblaze/include/asm/device.h
arch/powerpc/include/asm/device.h
arch/sparc/include/asm/device.h
arch/x86/include/asm/device.h
include/asm-generic/device.h
include/linux/platform_device.h

index c61642b406033659db06494a75fcb4c8d8914477..9f390ce335cb00743cb6cd717819f0750b63b0db 100644 (file)
@@ -12,4 +12,7 @@ struct dev_archdata {
 #endif
 };
 
+struct pdev_archdata {
+};
+
 #endif
index 41ab85d66f33f8228cfa62da8ea8c88ef1888ea3..d66d446b127c5631d6cdcd2fd33e14a8342a8980 100644 (file)
@@ -15,4 +15,7 @@ struct dev_archdata {
 #endif
 };
 
+struct pdev_archdata {
+};
+
 #endif /* _ASM_IA64_DEVICE_H */
index c042830793edd79858b07771d4b58107270ce1c1..30286db27c1c2a08e94c513991deb2a4904d23c1 100644 (file)
@@ -16,6 +16,9 @@ struct dev_archdata {
        struct device_node      *of_node;
 };
 
+struct pdev_archdata {
+};
+
 #endif /* _ASM_MICROBLAZE_DEVICE_H */
 
 
index 7d2277cef09a8502b22bdea95185f132a479f7db..e3e06e0f7fc0b14d78b0205bc74a865768554305 100644 (file)
@@ -30,4 +30,7 @@ dev_archdata_get_node(const struct dev_archdata *ad)
        return ad->of_node;
 }
 
+struct pdev_archdata {
+};
+
 #endif /* _ASM_POWERPC_DEVICE_H */
index 3702e087df2c4cbcdab561f7720a2d8f23ebc543..f3b85b6b0b764796407f2e2a026a5a45163561e2 100644 (file)
@@ -32,4 +32,7 @@ dev_archdata_get_node(const struct dev_archdata *ad)
        return ad->prom_node;
 }
 
+struct pdev_archdata {
+};
+
 #endif /* _ASM_SPARC_DEVICE_H */
index 4994a20acbcbf66aee788ebcb275eac4a2edd442..cee34e9ca45bc9b74aaba7203a340c0922996277 100644 (file)
@@ -13,4 +13,7 @@ struct dma_map_ops *dma_ops;
 #endif
 };
 
+struct pdev_archdata {
+};
+
 #endif /* _ASM_X86_DEVICE_H */
index c17c9600f220c2964cb07a6076bb268ebe69f89b..d7c76bba640d7d6a02041b3b12a5c224501549b1 100644 (file)
@@ -9,4 +9,7 @@
 struct dev_archdata {
 };
 
+struct pdev_archdata {
+};
+
 #endif /* _ASM_GENERIC_DEVICE_H */
index 8dc5123b63057f3e16ca400847477282a993e892..672a698497350223dd51013962a5cbafccbe06ce 100644 (file)
@@ -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)