diff options
-rw-r--r-- | Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt | 18 | ||||
-rw-r--r-- | drivers/gpio/gpio-rcar.c | 8 |
2 files changed, 8 insertions, 18 deletions
diff --git a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt index 46d76a004246..cb3dc7bcd8e6 100644 --- a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt +++ b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt | |||
@@ -16,18 +16,12 @@ Required Properties: | |||
16 | 16 | ||
17 | - gpio-controller: Marks the device node as a gpio controller. | 17 | - gpio-controller: Marks the device node as a gpio controller. |
18 | - #gpio-cells: Should be 2. The first cell is the GPIO number and the second | 18 | - #gpio-cells: Should be 2. The first cell is the GPIO number and the second |
19 | cell is used to specify optional parameters as bit flags. Only the GPIO | 19 | cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>. Only the |
20 | active low flag (bit 0) is currently supported. | 20 | GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported. |
21 | - gpio-ranges: Range of pins managed by the GPIO controller as a 4-cells | 21 | - gpio-ranges: Range of pins managed by the GPIO controller. |
22 | tuple using the following syntax. | 22 | |
23 | 23 | Please refer to gpio.txt in this directory for details of gpio-ranges property | |
24 | <[phandle of the pin controller node] | 24 | and the common GPIO bindings used by client devices. |
25 | 0 | ||
26 | [index of the first pin] | ||
27 | [number of pins]> | ||
28 | |||
29 | Please refer to gpio.txt in this directory for details of the common GPIO | ||
30 | bindings used by client devices. | ||
31 | 25 | ||
32 | Example: R8A7779 (R-Car H1) GPIO controller nodes | 26 | Example: R8A7779 (R-Car H1) GPIO controller nodes |
33 | 27 | ||
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index f3327533bfd5..6ec82f76f019 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c | |||
@@ -279,16 +279,13 @@ static struct irq_domain_ops gpio_rcar_irq_domain_ops = { | |||
279 | static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p) | 279 | static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p) |
280 | { | 280 | { |
281 | struct gpio_rcar_config *pdata = p->pdev->dev.platform_data; | 281 | struct gpio_rcar_config *pdata = p->pdev->dev.platform_data; |
282 | #ifdef CONFIG_OF | ||
283 | struct device_node *np = p->pdev->dev.of_node; | 282 | struct device_node *np = p->pdev->dev.of_node; |
284 | struct of_phandle_args args; | 283 | struct of_phandle_args args; |
285 | int ret; | 284 | int ret; |
286 | #endif | ||
287 | 285 | ||
288 | if (pdata) | 286 | if (pdata) { |
289 | p->config = *pdata; | 287 | p->config = *pdata; |
290 | #ifdef CONFIG_OF | 288 | } else if (IS_ENABLED(CONFIG_OF) && np) { |
291 | else if (np) { | ||
292 | ret = of_parse_phandle_with_args(np, "gpio-ranges", | 289 | ret = of_parse_phandle_with_args(np, "gpio-ranges", |
293 | "#gpio-range-cells", 0, &args); | 290 | "#gpio-range-cells", 0, &args); |
294 | p->config.number_of_pins = ret == 0 && args.args_count == 3 | 291 | p->config.number_of_pins = ret == 0 && args.args_count == 3 |
@@ -296,7 +293,6 @@ static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p) | |||
296 | : RCAR_MAX_GPIO_PER_BANK; | 293 | : RCAR_MAX_GPIO_PER_BANK; |
297 | p->config.gpio_base = -1; | 294 | p->config.gpio_base = -1; |
298 | } | 295 | } |
299 | #endif | ||
300 | 296 | ||
301 | if (p->config.number_of_pins == 0 || | 297 | if (p->config.number_of_pins == 0 || |
302 | p->config.number_of_pins > RCAR_MAX_GPIO_PER_BANK) { | 298 | p->config.number_of_pins > RCAR_MAX_GPIO_PER_BANK) { |