aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2014-07-11 04:17:57 -0400
committerMark Brown <broonie@linaro.org>2014-07-11 08:39:36 -0400
commit10ed7e9847b62043ab488dbb3ff6cd9f26038568 (patch)
tree0f66802db478bda73015bf75f63ae114428ed37e
parent7171511eaec5bf23fb06078f59784a3a0626b38f (diff)
spi: efm32: correct namespacing of location property
Olof Johansson pointed out that usually the company name is picked as namespace prefix to specific properties. So expect "energymicro,location" but fall back to the previously introduced name "efm32,location". Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--Documentation/devicetree/bindings/spi/efm32-spi.txt13
-rw-r--r--drivers/spi/spi-efm32.c8
2 files changed, 14 insertions, 7 deletions
diff --git a/Documentation/devicetree/bindings/spi/efm32-spi.txt b/Documentation/devicetree/bindings/spi/efm32-spi.txt
index 130cd17e3680..750e29aff9bc 100644
--- a/Documentation/devicetree/bindings/spi/efm32-spi.txt
+++ b/Documentation/devicetree/bindings/spi/efm32-spi.txt
@@ -10,11 +10,12 @@ Required properties:
10- cs-gpios: see spi-bus.txt 10- cs-gpios: see spi-bus.txt
11 11
12Recommended properties : 12Recommended properties :
13- efm32,location: Value to write to the ROUTE register's LOCATION bitfield to 13- energymicro,location: Value to write to the ROUTE register's LOCATION
14 configure the pinmux for the device, see datasheet for values. 14 bitfield to configure the pinmux for the device, see
15 If "efm32,location" property is not provided, keeping what is 15 datasheet for values.
16 already configured in the hardware, so its either the reset 16 If this property is not provided, keeping what is
17 default 0 or whatever the bootloader did. 17 already configured in the hardware, so its either the
18 reset default 0 or whatever the bootloader did.
18 19
19Example: 20Example:
20 21
@@ -26,7 +27,7 @@ spi1: spi@0x4000c400 { /* USART1 */
26 interrupts = <15 16>; 27 interrupts = <15 16>;
27 clocks = <&cmu 20>; 28 clocks = <&cmu 20>;
28 cs-gpios = <&gpio 51 1>; // D3 29 cs-gpios = <&gpio 51 1>; // D3
29 efm32,location = <1>; 30 energymicro,location = <1>;
30 status = "ok"; 31 status = "ok";
31 32
32 ks8851@0 { 33 ks8851@0 {
diff --git a/drivers/spi/spi-efm32.c b/drivers/spi/spi-efm32.c
index be44a3eeb5e8..6caeb1cac0f3 100644
--- a/drivers/spi/spi-efm32.c
+++ b/drivers/spi/spi-efm32.c
@@ -294,10 +294,16 @@ static void efm32_spi_probe_dt(struct platform_device *pdev,
294 u32 location; 294 u32 location;
295 int ret; 295 int ret;
296 296
297 ret = of_property_read_u32(np, "efm32,location", &location); 297 ret = of_property_read_u32(np, "energymicro,location", &location);
298
299 if (ret)
300 /* fall back to wrongly namespaced property */
301 ret = of_property_read_u32(np, "efm32,location", &location);
302
298 if (ret) 303 if (ret)
299 /* fall back to old and (wrongly) generic property "location" */ 304 /* fall back to old and (wrongly) generic property "location" */
300 ret = of_property_read_u32(np, "location", &location); 305 ret = of_property_read_u32(np, "location", &location);
306
301 if (!ret) { 307 if (!ret) {
302 dev_dbg(&pdev->dev, "using location %u\n", location); 308 dev_dbg(&pdev->dev, "using location %u\n", location);
303 } else { 309 } else {