Commit d7aacadd authored by Magnus Damm's avatar Magnus Damm Committed by Rafael J. Wysocki

Driver Core: Add platform device arch data V3

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: default avatarMagnus Damm <damm@igel.co.jp>
Acked-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent aea1f796
...@@ -12,4 +12,7 @@ struct dev_archdata { ...@@ -12,4 +12,7 @@ struct dev_archdata {
#endif #endif
}; };
struct pdev_archdata {
};
#endif #endif
...@@ -15,4 +15,7 @@ struct dev_archdata { ...@@ -15,4 +15,7 @@ struct dev_archdata {
#endif #endif
}; };
struct pdev_archdata {
};
#endif /* _ASM_IA64_DEVICE_H */ #endif /* _ASM_IA64_DEVICE_H */
...@@ -16,6 +16,9 @@ struct dev_archdata { ...@@ -16,6 +16,9 @@ struct dev_archdata {
struct device_node *of_node; struct device_node *of_node;
}; };
struct pdev_archdata {
};
#endif /* _ASM_MICROBLAZE_DEVICE_H */ #endif /* _ASM_MICROBLAZE_DEVICE_H */
...@@ -30,4 +30,7 @@ dev_archdata_get_node(const struct dev_archdata *ad) ...@@ -30,4 +30,7 @@ dev_archdata_get_node(const struct dev_archdata *ad)
return ad->of_node; return ad->of_node;
} }
struct pdev_archdata {
};
#endif /* _ASM_POWERPC_DEVICE_H */ #endif /* _ASM_POWERPC_DEVICE_H */
...@@ -32,4 +32,7 @@ dev_archdata_get_node(const struct dev_archdata *ad) ...@@ -32,4 +32,7 @@ dev_archdata_get_node(const struct dev_archdata *ad)
return ad->prom_node; return ad->prom_node;
} }
struct pdev_archdata {
};
#endif /* _ASM_SPARC_DEVICE_H */ #endif /* _ASM_SPARC_DEVICE_H */
...@@ -13,4 +13,7 @@ struct dma_map_ops *dma_ops; ...@@ -13,4 +13,7 @@ struct dma_map_ops *dma_ops;
#endif #endif
}; };
struct pdev_archdata {
};
#endif /* _ASM_X86_DEVICE_H */ #endif /* _ASM_X86_DEVICE_H */
...@@ -9,4 +9,7 @@ ...@@ -9,4 +9,7 @@
struct dev_archdata { struct dev_archdata {
}; };
struct pdev_archdata {
};
#endif /* _ASM_GENERIC_DEVICE_H */ #endif /* _ASM_GENERIC_DEVICE_H */
...@@ -22,6 +22,9 @@ struct platform_device { ...@@ -22,6 +22,9 @@ struct platform_device {
struct resource * resource; struct resource * resource;
struct platform_device_id *id_entry; struct platform_device_id *id_entry;
/* arch specific additions */
struct pdev_archdata archdata;
}; };
#define platform_get_device_id(pdev) ((pdev)->id_entry) #define platform_get_device_id(pdev) ((pdev)->id_entry)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment