diff options
-rw-r--r-- | drivers/power/gta02_hdq.c | 14 | ||||
-rw-r--r-- | include/linux/gta02_hdq.h | 10 |
2 files changed, 22 insertions, 2 deletions
diff --git a/drivers/power/gta02_hdq.c b/drivers/power/gta02_hdq.c index 89fd3fa8b4f..ac52ea8be4c 100644 --- a/drivers/power/gta02_hdq.c +++ b/drivers/power/gta02_hdq.c @@ -16,6 +16,7 @@ #include <linux/delay.h> #include <linux/platform_device.h> #include <mach/hardware.h> +#include <linux/gta02_hdq.h> #include <asm/mach-types.h> #include <mach/gta02.h> #include <mach/fiq_ipc_gta02.h> @@ -205,8 +206,9 @@ static int __init gta02hdq_probe(struct platform_device *pdev) { struct resource *r = platform_get_resource(pdev, 0, 0); int ret; - - if (!machine_is_neo1973_gta02()) + struct gta02_hdq_platform_data *pdata = pdev->dev.platform_data; + + if (!machine_is_neo1973_gta02()) return -EIO; if (!r) @@ -233,6 +235,14 @@ static int __init gta02hdq_probe(struct platform_device *pdev) fiq_ipc.hdq_probed = 1; /* we are ready to do stuff now */ + /* + * if wanted, users can defer registration of devices + * that depend on HDQ until after we register, and can use our + * device as parent so suspend-resume ordering is correct + */ + if (pdata->attach_child_devices) + (pdata->attach_child_devices)(&pdev->dev); + return 0; } diff --git a/include/linux/gta02_hdq.h b/include/linux/gta02_hdq.h index 2f43a62e1f0..ae0c70e24eb 100644 --- a/include/linux/gta02_hdq.h +++ b/include/linux/gta02_hdq.h @@ -1,6 +1,16 @@ #ifndef __GTA02HDQ_H__ #define __GTA02HDQ_H__ +/* platform data */ + +struct gta02_hdq_platform_data { + /* + * give an opportunity to use us as parent for + * devices that depend on us + */ + void (*attach_child_devices)(struct device *parent_device); +}; + int gta02hdq_read(int address); int gta02hdq_write(int address, u8 data); int gta02hdq_initialized(void); |