diff options
-rw-r--r-- | Documentation/devicetree/bindings/spi/efm32-spi.txt | 13 | ||||
-rw-r--r-- | drivers/spi/spi-efm32.c | 8 |
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 | ||
12 | Recommended properties : | 12 | Recommended 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 | ||
19 | Example: | 20 | Example: |
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 { |