diff options
author | Benoit Cousson <b-cousson@ti.com> | 2011-08-12 07:52:50 -0400 |
---|---|---|
committer | Benoit Cousson <b-cousson@ti.com> | 2011-10-04 16:29:38 -0400 |
commit | d039c5b9fb2315ef942944439da6f0fbaf2f1941 (patch) | |
tree | e9c7429812c04fd897ad557d89589bd09a9e9008 /arch/arm | |
parent | a7cbb9b15d55dff0488b1a6d93929c2386d8632b (diff) |
ARM: OMAP2+: l3-noc: Add support for device-tree
Add device-tree support for the l3-noc driver.
Use platform_driver_register to defer the probing at device init
time.
Add documentation for the l3-noc bindings.
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/omap_l3_noc.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/omap_l3_noc.c b/arch/arm/mach-omap2/omap_l3_noc.c index 07a3d3ede768..c8b1bef92e5a 100644 --- a/arch/arm/mach-omap2/omap_l3_noc.c +++ b/arch/arm/mach-omap2/omap_l3_noc.c | |||
@@ -127,7 +127,7 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3) | |||
127 | return IRQ_HANDLED; | 127 | return IRQ_HANDLED; |
128 | } | 128 | } |
129 | 129 | ||
130 | static int __init omap4_l3_probe(struct platform_device *pdev) | 130 | static int __devinit omap4_l3_probe(struct platform_device *pdev) |
131 | { | 131 | { |
132 | static struct omap4_l3 *l3; | 132 | static struct omap4_l3 *l3; |
133 | struct resource *res; | 133 | struct resource *res; |
@@ -218,7 +218,7 @@ err0: | |||
218 | return ret; | 218 | return ret; |
219 | } | 219 | } |
220 | 220 | ||
221 | static int __exit omap4_l3_remove(struct platform_device *pdev) | 221 | static int __devexit omap4_l3_remove(struct platform_device *pdev) |
222 | { | 222 | { |
223 | struct omap4_l3 *l3 = platform_get_drvdata(pdev); | 223 | struct omap4_l3 *l3 = platform_get_drvdata(pdev); |
224 | 224 | ||
@@ -232,16 +232,29 @@ static int __exit omap4_l3_remove(struct platform_device *pdev) | |||
232 | return 0; | 232 | return 0; |
233 | } | 233 | } |
234 | 234 | ||
235 | #if defined(CONFIG_OF) | ||
236 | static const struct of_device_id l3_noc_match[] = { | ||
237 | {.compatible = "ti,omap4-l3-noc", }, | ||
238 | {}, | ||
239 | } | ||
240 | MODULE_DEVICE_TABLE(of, l3_noc_match); | ||
241 | #else | ||
242 | #define l3_noc_match NULL | ||
243 | #endif | ||
244 | |||
235 | static struct platform_driver omap4_l3_driver = { | 245 | static struct platform_driver omap4_l3_driver = { |
236 | .remove = __exit_p(omap4_l3_remove), | 246 | .probe = omap4_l3_probe, |
237 | .driver = { | 247 | .remove = __devexit_p(omap4_l3_remove), |
238 | .name = "omap_l3_noc", | 248 | .driver = { |
249 | .name = "omap_l3_noc", | ||
250 | .owner = THIS_MODULE, | ||
251 | .of_match_table = l3_noc_match, | ||
239 | }, | 252 | }, |
240 | }; | 253 | }; |
241 | 254 | ||
242 | static int __init omap4_l3_init(void) | 255 | static int __init omap4_l3_init(void) |
243 | { | 256 | { |
244 | return platform_driver_probe(&omap4_l3_driver, omap4_l3_probe); | 257 | return platform_driver_register(&omap4_l3_driver); |
245 | } | 258 | } |
246 | postcore_initcall_sync(omap4_l3_init); | 259 | postcore_initcall_sync(omap4_l3_init); |
247 | 260 | ||