From 42c49fc425f2664f0decffaca5e9e9d47ef51971 Mon Sep 17 00:00:00 2001 From: Danny Huang Date: Thu, 14 Mar 2013 08:48:40 +0800 Subject: [PATCH] --- yaml --- r: 370607 b: refs/heads/master c: d591fdf8e23ef2abf57bdfbc4b596bf1a43d15b4 h: refs/heads/master i: 370605: 373003c9b40029d465a6d5b7f3aa448e4c5a5b19 370603: 6c1eaf858f7c11b5764df9b52fb035f64a145965 370599: 5c0815bb963462cd7ffce1a06b66a8b52661ff1b 370591: ac9655e4c98245b4645a65c33e94fa30ea4c3f42 v: v3 --- [refs] | 2 +- trunk/arch/arm/Kconfig | 1 + trunk/arch/arm/mach-tegra/tegra.c | 29 ++++++++++++++++++++++++++++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index acb10d5eb0e3..c9e360729afb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e562b86581d2ccf3faaf55b1235b4e6438cb7712 +refs/heads/master: d591fdf8e23ef2abf57bdfbc4b596bf1a43d15b4 diff --git a/trunk/arch/arm/Kconfig b/trunk/arch/arm/Kconfig index 5b714695b01b..59b7be794582 100644 --- a/trunk/arch/arm/Kconfig +++ b/trunk/arch/arm/Kconfig @@ -675,6 +675,7 @@ config ARCH_TEGRA select HAVE_CLK select HAVE_SMP select MIGHT_HAVE_CACHE_L2X0 + select SOC_BUS select SPARSE_IRQ select USE_OF help diff --git a/trunk/arch/arm/mach-tegra/tegra.c b/trunk/arch/arm/mach-tegra/tegra.c index 27232c901a22..84deeab23ee7 100644 --- a/trunk/arch/arm/mach-tegra/tegra.c +++ b/trunk/arch/arm/mach-tegra/tegra.c @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include #include @@ -42,6 +44,7 @@ #include "board.h" #include "common.h" +#include "fuse.h" #include "iomap.h" static struct tegra_ehci_platform_data tegra_ehci1_pdata = { @@ -80,12 +83,36 @@ static struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = { static void __init tegra_dt_init(void) { + struct soc_device_attribute *soc_dev_attr; + struct soc_device *soc_dev; + struct device *parent = NULL; + + soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + if (!soc_dev_attr) + goto out; + + soc_dev_attr->family = kasprintf(GFP_KERNEL, "Tegra"); + soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%d", tegra_revision); + soc_dev_attr->soc_id = kasprintf(GFP_KERNEL, "%d", tegra_chip_id); + + soc_dev = soc_device_register(soc_dev_attr); + if (IS_ERR(soc_dev)) { + kfree(soc_dev_attr->family); + kfree(soc_dev_attr->revision); + kfree(soc_dev_attr->soc_id); + kfree(soc_dev_attr); + goto out; + } + + parent = soc_device_to_device(soc_dev); + /* * Finished with the static registrations now; fill in the missing * devices */ +out: of_platform_populate(NULL, of_default_bus_match_table, - tegra20_auxdata_lookup, NULL); + tegra20_auxdata_lookup, parent); } static void __init trimslice_init(void)