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 044bda5b3174..d39f63d017d2 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) |
@@ -180,3 +182,20 @@ void __init olpc_dt_build_devicetree(void) | |||
180 | pr_info("PROM DT: Built device tree with %u bytes of memory.\n", | 182 | pr_info("PROM DT: Built device tree with %u bytes of memory.\n", |
181 | prom_early_allocated); | 183 | prom_early_allocated); |
182 | } | 184 | } |
185 | |||
186 | /* A list of DT node/bus matches that we want to expose as platform devices */ | ||
187 | static struct of_device_id __initdata of_ids[] = { | ||
188 | { .compatible = "olpc,xo1-battery" }, | ||
189 | { .compatible = "olpc,xo1-dcon" }, | ||
190 | { .compatible = "olpc,xo1-rtc" }, | ||
191 | {}, | ||
192 | }; | ||
193 | |||
194 | static int __init olpc_create_platform_devices(void) | ||
195 | { | ||
196 | if (machine_is_olpc()) | ||
197 | return of_platform_bus_probe(NULL, of_ids, NULL); | ||
198 | else | ||
199 | return 0; | ||
200 | } | ||
201 | device_initcall(olpc_create_platform_devices); | ||