diff options
Diffstat (limited to 'arch/x86/platform/olpc/olpc_dt.c')
-rw-r--r-- | arch/x86/platform/olpc/olpc_dt.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/x86/platform/olpc/olpc_dt.c b/arch/x86/platform/olpc/olpc_dt.c index dab874647530..4ce208f885ef 100644 --- a/arch/x86/platform/olpc/olpc_dt.c +++ b/arch/x86/platform/olpc/olpc_dt.c | |||
@@ -19,7 +19,9 @@ | |||
19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
20 | #include <linux/bootmem.h> | 20 | #include <linux/bootmem.h> |
21 | #include <linux/of.h> | 21 | #include <linux/of.h> |
22 | #include <linux/of_platform.h> | ||
22 | #include <linux/of_pdt.h> | 23 | #include <linux/of_pdt.h> |
24 | #include <asm/olpc.h> | ||
23 | #include <asm/olpc_ofw.h> | 25 | #include <asm/olpc_ofw.h> |
24 | 26 | ||
25 | static phandle __init olpc_dt_getsibling(phandle node) | 27 | static phandle __init olpc_dt_getsibling(phandle node) |
@@ -181,3 +183,20 @@ void __init olpc_dt_build_devicetree(void) | |||
181 | pr_info("PROM DT: Built device tree with %u bytes of memory.\n", | 183 | pr_info("PROM DT: Built device tree with %u bytes of memory.\n", |
182 | prom_early_allocated); | 184 | prom_early_allocated); |
183 | } | 185 | } |
186 | |||
187 | /* A list of DT node/bus matches that we want to expose as platform devices */ | ||
188 | static struct of_device_id __initdata of_ids[] = { | ||
189 | { .compatible = "olpc,xo1-battery" }, | ||
190 | { .compatible = "olpc,xo1-dcon" }, | ||
191 | { .compatible = "olpc,xo1-rtc" }, | ||
192 | {}, | ||
193 | }; | ||
194 | |||
195 | static int __init olpc_create_platform_devices(void) | ||
196 | { | ||
197 | if (machine_is_olpc()) | ||
198 | return of_platform_bus_probe(NULL, of_ids, NULL); | ||
199 | else | ||
200 | return 0; | ||
201 | } | ||
202 | device_initcall(olpc_create_platform_devices); | ||