aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/platform/olpc/olpc_dt.c
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2011-03-13 11:10:17 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2011-03-15 17:17:23 -0400
commit45bb1674b976ef81429c1e42de05844b49d45dea (patch)
tree51030fa434bed1756d24d6b7595dfc7bb2be2f7b /arch/x86/platform/olpc/olpc_dt.c
parent25874a299ef8037df03ce4ada570bc4e42f9748f (diff)
x86, olpc: Use device tree for platform identification
Make OLPC fully depend on device tree, and use it to identify the OLPC platform details. Some nodes are exposed as platform devices where we plan to use device tree for device probing. Signed-off-by: Daniel Drake <dsd@laptop.org> Acked-by: Grant Likely <grant.likely@secretlab.ca> LKML-Reference: <20110313151017.C255F9D401E@zog.reactivated.net> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/platform/olpc/olpc_dt.c')
-rw-r--r--arch/x86/platform/olpc/olpc_dt.c19
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
25static phandle __init olpc_dt_getsibling(phandle node) 27static 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 */
188static 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
195static 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}
202device_initcall(olpc_create_platform_devices);