Skip to content

Commit

Permalink
Merge tag 'renesas-gpio-rcar2-for-v3.11' of git://git.kernel.org/pub/…
Browse files Browse the repository at this point in the history
…scm/linux/kernel/git/horms/renesas into next/drivers

From Simon Horman:

Second Round of Renesas ARM based SoC GPIO R-Car updates for v3.11

Documentation enhancement and code cleanup by Laurent Pinchart.

* tag 'renesas-gpio-rcar2-for-v3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  gpio-rcar: Remove #ifdef CONFIG_OF around OF-specific sections
  gpio-rcar: Reference core gpio documentation in the DT bindings

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Arnd Bergmann committed Jun 21, 2013
2 parents d405534 + e305062 commit e7692e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
18 changes: 6 additions & 12 deletions Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,12 @@ Required Properties:

- gpio-controller: Marks the device node as a gpio controller.
- #gpio-cells: Should be 2. The first cell is the GPIO number and the second
cell is used to specify optional parameters as bit flags. Only the GPIO
active low flag (bit 0) is currently supported.
- gpio-ranges: Range of pins managed by the GPIO controller as a 4-cells
tuple using the following syntax.

<[phandle of the pin controller node]
0
[index of the first pin]
[number of pins]>

Please refer to gpio.txt in this directory for details of the common GPIO
bindings used by client devices.
cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>. Only the
GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.
- gpio-ranges: Range of pins managed by the GPIO controller.

Please refer to gpio.txt in this directory for details of gpio-ranges property
and the common GPIO bindings used by client devices.

Example: R8A7779 (R-Car H1) GPIO controller nodes

Expand Down
8 changes: 2 additions & 6 deletions drivers/gpio/gpio-rcar.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,24 +279,20 @@ static struct irq_domain_ops gpio_rcar_irq_domain_ops = {
static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p)
{
struct gpio_rcar_config *pdata = p->pdev->dev.platform_data;
#ifdef CONFIG_OF
struct device_node *np = p->pdev->dev.of_node;
struct of_phandle_args args;
int ret;
#endif

if (pdata)
if (pdata) {
p->config = *pdata;
#ifdef CONFIG_OF
else if (np) {
} else if (IS_ENABLED(CONFIG_OF) && np) {
ret = of_parse_phandle_with_args(np, "gpio-ranges",
"#gpio-range-cells", 0, &args);
p->config.number_of_pins = ret == 0 && args.args_count == 3
? args.args[2]
: RCAR_MAX_GPIO_PER_BANK;
p->config.gpio_base = -1;
}
#endif

if (p->config.number_of_pins == 0 ||
p->config.number_of_pins > RCAR_MAX_GPIO_PER_BANK) {
Expand Down

0 comments on commit e7692e2

Please sign in to comment.