diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-18 12:28:29 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-18 12:28:29 -0700 |
commit | f2b1e0f6385d4487a81871eb47809a1375af527f (patch) | |
tree | 139060c67cf9c8b2f7ba2f8b23eb4068f82f7372 /drivers | |
parent | f61a657fdf221403d99e6f0d4c6d24762920d4a9 (diff) | |
parent | 2e629ebc24d463ffb6c17b15daf908e6f968a1de (diff) |
Merge tag 'armsoc-cleanups-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC cleanups and fixes from Arnd Bergmann:
"Traditionally we've had two separate branches for cleanups and
non-critical bug fixes, but both of these got smaller with each
release and the differences are rather unclear now, so it seems more
appropriate to have a combined branch.
The most notable change is for OMAP, which gets a small rework to
simplify handling of the AUXDATA mechanism used on machines that are
not completely DT based yet, along with other work that is used as
preparation for dropping the legacy board files"
* tag 'armsoc-cleanups-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
ARM: dts: exynos: Add interrupt line to MAX8997 PMIC on exynos4210-trats
ARM: dts: exynos: Fix regulator name to avoid forbidden character on exynos4210-trats
ARM: dts: exynos: Add MFC memory banks for Peach boards
ARM: OMAP2+: n900 needs MMC slot names for legacy user space
ARM: OMAP2+: Add more functions to pwm pdata for ir-rx51
ARM: debug: remove extraneous DEBUG_HI3716_UART option
ARM: OMAP2+: Simplify auxdata by using the generic match
of/platform: Allow secondary compatible match in of_dev_lookup
ARM: davinci: use IRQCHIP_DECLARE for cp_intc
ARM: davinci: remove unused DA8XX_NUM_UARTS
ARM: davinci: simplify call to of populate
ARM: DaVinci USB: removed deprecated properties from MUSB config
ARM: rockchip: Fix use of plain integer as NULL pointer
ARM: realview: hide unused 'pmu_device' object
soc: versatile: dynamically detect RealView HBI numbers
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/of/platform.c | 28 | ||||
-rw-r--r-- | drivers/soc/versatile/soc-realview.c | 19 |
2 files changed, 27 insertions, 20 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 8d103e4968be..16e8daffac06 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -297,19 +297,37 @@ static struct amba_device *of_amba_device_create(struct device_node *node, static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *lookup, struct device_node *np) { + const struct of_dev_auxdata *auxdata; struct resource res; + int compatible = 0; if (!lookup) return NULL; - for(; lookup->compatible != NULL; lookup++) { - if (!of_device_is_compatible(np, lookup->compatible)) + auxdata = lookup; + for (; auxdata->compatible; auxdata++) { + if (!of_device_is_compatible(np, auxdata->compatible)) continue; + compatible++; if (!of_address_to_resource(np, 0, &res)) - if (res.start != lookup->phys_addr) + if (res.start != auxdata->phys_addr) continue; - pr_debug("%s: devname=%s\n", np->full_name, lookup->name); - return lookup; + pr_debug("%s: devname=%s\n", np->full_name, auxdata->name); + return auxdata; + } + + if (!compatible) + return NULL; + + /* Try compatible match if no phys_addr and name are specified */ + auxdata = lookup; + for (; auxdata->compatible; auxdata++) { + if (!of_device_is_compatible(np, auxdata->compatible)) + continue; + if (!auxdata->phys_addr && !auxdata->name) { + pr_debug("%s: compatible match\n", np->full_name); + return auxdata; + } } return NULL; diff --git a/drivers/soc/versatile/soc-realview.c b/drivers/soc/versatile/soc-realview.c index c337764de867..282e371378ce 100644 --- a/drivers/soc/versatile/soc-realview.c +++ b/drivers/soc/versatile/soc-realview.c @@ -31,18 +31,6 @@ static const struct of_device_id realview_soc_of_match[] = { static u32 realview_coreid; -static const char *realview_board_str(u32 id) -{ - switch ((id >> 16) & 0xfff) { - case 0x0147: - return "HBI-0147"; - case 0x0159: - return "HBI-0159"; - default: - return "Unknown"; - } -} - static const char *realview_arch_str(u32 id) { switch ((id >> 8) & 0xf) { @@ -69,7 +57,7 @@ static ssize_t realview_get_board(struct device *dev, struct device_attribute *attr, char *buf) { - return sprintf(buf, "%s\n", realview_board_str(realview_coreid)); + return sprintf(buf, "HBI-%03x\n", ((realview_coreid >> 16) & 0xfff)); } static struct device_attribute realview_board_attr = @@ -133,8 +121,9 @@ static int realview_soc_probe(struct platform_device *pdev) device_create_file(soc_device_to_device(soc_dev), &realview_arch_attr); device_create_file(soc_device_to_device(soc_dev), &realview_build_attr); - dev_info(&pdev->dev, "RealView Syscon Core ID: 0x%08x\n", - realview_coreid); + dev_info(&pdev->dev, "RealView Syscon Core ID: 0x%08x, HBI-%03x\n", + realview_coreid, + ((realview_coreid >> 16) & 0xfff)); /* FIXME: add attributes for SoC to sysfs */ return 0; } |