summaryrefslogtreecommitdiffstats
path: root/arch/x86/platform/olpc/olpc_dt.c
diff options
context:
space:
mode:
authorDaniel Drake2011-03-13 16:10:17 +0100
committerH. Peter Anvin2011-03-15 22:17:23 +0100
commit45bb1674b976ef81429c1e42de05844b49d45dea (patch)
tree51030fa434bed1756d24d6b7595dfc7bb2be2f7b /arch/x86/platform/olpc/olpc_dt.c
parentx86: Clean up apic.c and apic.h (diff)
downloadkernel-qcow2-linux-45bb1674b976ef81429c1e42de05844b49d45dea.tar.gz
kernel-qcow2-linux-45bb1674b976ef81429c1e42de05844b49d45dea.tar.xz
kernel-qcow2-linux-45bb1674b976ef81429c1e42de05844b49d45dea.zip
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 @@
#include <linux/kernel.h>
#include <linux/bootmem.h>
#include <linux/of.h>
+#include <linux/of_platform.h>
#include <linux/of_pdt.h>
+#include <asm/olpc.h>
#include <asm/olpc_ofw.h>
static phandle __init olpc_dt_getsibling(phandle node)
@@ -181,3 +183,20 @@ void __init olpc_dt_build_devicetree(void)
pr_info("PROM DT: Built device tree with %u bytes of memory.\n",
prom_early_allocated);
}
+
+/* A list of DT node/bus matches that we want to expose as platform devices */
+static struct of_device_id __initdata of_ids[] = {
+ { .compatible = "olpc,xo1-battery" },
+ { .compatible = "olpc,xo1-dcon" },
+ { .compatible = "olpc,xo1-rtc" },
+ {},
+};
+
+static int __init olpc_create_platform_devices(void)
+{
+ if (machine_is_olpc())
+ return of_platform_bus_probe(NULL, of_ids, NULL);
+ else
+ return 0;
+}
+device_initcall(olpc_create_platform_devices);