From f8b02bf658c479e5999511eb1f309dd232708347 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 19 Nov 2008 17:11:07 +0000 Subject: fix-fiq-child-attach-callback.patch As part of the device tree stuff, some things are basically children of FIQ. Allow a callback in the machine-specific code to attach the children when the FIQ device has been instantiated Signed-off-by: Andy Green --- arch/arm/mach-s3c2440/fiq_c_isr.c | 8 ++++++++ arch/arm/mach-s3c2440/fiq_c_isr.h | 11 +++++++++++ 2 files changed, 19 insertions(+) (limited to 'arch/arm/mach-s3c2440') diff --git a/arch/arm/mach-s3c2440/fiq_c_isr.c b/arch/arm/mach-s3c2440/fiq_c_isr.c index 924f1f926cf..148850582b7 100644 --- a/arch/arm/mach-s3c2440/fiq_c_isr.c +++ b/arch/arm/mach-s3c2440/fiq_c_isr.c @@ -230,6 +230,14 @@ static int __init sc32440_fiq_probe(struct platform_device *pdev) if (ret) return ret; + /* + * if wanted, users can defer registration of devices + * that depend on FIQ 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); + fiq_ready = 1; return 0; diff --git a/arch/arm/mach-s3c2440/fiq_c_isr.h b/arch/arm/mach-s3c2440/fiq_c_isr.h index a3a2622b81d..e92b103cdfb 100644 --- a/arch/arm/mach-s3c2440/fiq_c_isr.h +++ b/arch/arm/mach-s3c2440/fiq_c_isr.h @@ -2,12 +2,23 @@ #define _LINUX_FIQ_C_ISR_H #include +#include extern unsigned long _fiq_count_fiqs; extern u32 _fiq_ack_mask; extern int _fiq_timer_index; extern u16 _fiq_timer_divisor; +/* platform data */ + +struct sc32440_fiq_platform_data { + /* + * give an opportunity to use us as parent for + * devices that depend on us + */ + void (*attach_child_devices)(struct device *parent_device); +}; + /* This CANNOT be implemented in a module -- it has to be used in code * included in the monolithic kernel */ -- cgit v1.2.3