diff options
-rw-r--r-- | Documentation/devicetree/bindings/gpio/gpio.txt | 6 | ||||
-rw-r--r-- | arch/arm/boot/dts/spear1310.dtsi | 4 | ||||
-rw-r--r-- | arch/arm/boot/dts/spear1340.dtsi | 4 | ||||
-rw-r--r-- | arch/arm/boot/dts/spear310.dtsi | 4 | ||||
-rw-r--r-- | arch/arm/boot/dts/spear320.dtsi | 4 | ||||
-rw-r--r-- | drivers/gpio/gpiolib-of.c | 15 |
6 files changed, 13 insertions, 24 deletions
diff --git a/Documentation/devicetree/bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt index a33628759d36..d933af370697 100644 --- a/Documentation/devicetree/bindings/gpio/gpio.txt +++ b/Documentation/devicetree/bindings/gpio/gpio.txt | |||
@@ -98,7 +98,7 @@ announce the pinrange to the pin ctrl subsystem. For example, | |||
98 | compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank"; | 98 | compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank"; |
99 | reg = <0x1460 0x18>; | 99 | reg = <0x1460 0x18>; |
100 | gpio-controller; | 100 | gpio-controller; |
101 | gpio-ranges = <&pinctrl1 20 10>, <&pinctrl2 50 20>; | 101 | gpio-ranges = <&pinctrl1 0 20 10>, <&pinctrl2 10 50 20>; |
102 | 102 | ||
103 | } | 103 | } |
104 | 104 | ||
@@ -107,8 +107,8 @@ where, | |||
107 | 107 | ||
108 | Next values specify the base pin and number of pins for the range | 108 | Next values specify the base pin and number of pins for the range |
109 | handled by 'qe_pio_e' gpio. In the given example from base pin 20 to | 109 | handled by 'qe_pio_e' gpio. In the given example from base pin 20 to |
110 | pin 29 under pinctrl1 and pin 50 to pin 69 under pinctrl2 is handled | 110 | pin 29 under pinctrl1 with gpio offset 0 and pin 50 to pin 69 under |
111 | by this gpio controller. | 111 | pinctrl2 with gpio offset 10 is handled by this gpio controller. |
112 | 112 | ||
113 | The pinctrl node must have "#gpio-range-cells" property to show number of | 113 | The pinctrl node must have "#gpio-range-cells" property to show number of |
114 | arguments to pass with phandle from gpio controllers node. | 114 | arguments to pass with phandle from gpio controllers node. |
diff --git a/arch/arm/boot/dts/spear1310.dtsi b/arch/arm/boot/dts/spear1310.dtsi index 1513c1927cc8..122ae94076c8 100644 --- a/arch/arm/boot/dts/spear1310.dtsi +++ b/arch/arm/boot/dts/spear1310.dtsi | |||
@@ -89,7 +89,7 @@ | |||
89 | pinmux: pinmux@e0700000 { | 89 | pinmux: pinmux@e0700000 { |
90 | compatible = "st,spear1310-pinmux"; | 90 | compatible = "st,spear1310-pinmux"; |
91 | reg = <0xe0700000 0x1000>; | 91 | reg = <0xe0700000 0x1000>; |
92 | #gpio-range-cells = <2>; | 92 | #gpio-range-cells = <3>; |
93 | }; | 93 | }; |
94 | 94 | ||
95 | apb { | 95 | apb { |
@@ -212,7 +212,7 @@ | |||
212 | interrupt-controller; | 212 | interrupt-controller; |
213 | gpio-controller; | 213 | gpio-controller; |
214 | #gpio-cells = <2>; | 214 | #gpio-cells = <2>; |
215 | gpio-ranges = <&pinmux 0 246>; | 215 | gpio-ranges = <&pinmux 0 0 246>; |
216 | status = "disabled"; | 216 | status = "disabled"; |
217 | 217 | ||
218 | st-plgpio,ngpio = <246>; | 218 | st-plgpio,ngpio = <246>; |
diff --git a/arch/arm/boot/dts/spear1340.dtsi b/arch/arm/boot/dts/spear1340.dtsi index 34da11aa6795..c511c4772efd 100644 --- a/arch/arm/boot/dts/spear1340.dtsi +++ b/arch/arm/boot/dts/spear1340.dtsi | |||
@@ -63,7 +63,7 @@ | |||
63 | pinmux: pinmux@e0700000 { | 63 | pinmux: pinmux@e0700000 { |
64 | compatible = "st,spear1340-pinmux"; | 64 | compatible = "st,spear1340-pinmux"; |
65 | reg = <0xe0700000 0x1000>; | 65 | reg = <0xe0700000 0x1000>; |
66 | #gpio-range-cells = <2>; | 66 | #gpio-range-cells = <3>; |
67 | }; | 67 | }; |
68 | 68 | ||
69 | pwm: pwm@e0180000 { | 69 | pwm: pwm@e0180000 { |
@@ -127,7 +127,7 @@ | |||
127 | interrupt-controller; | 127 | interrupt-controller; |
128 | gpio-controller; | 128 | gpio-controller; |
129 | #gpio-cells = <2>; | 129 | #gpio-cells = <2>; |
130 | gpio-ranges = <&pinmux 0 252>; | 130 | gpio-ranges = <&pinmux 0 0 252>; |
131 | status = "disabled"; | 131 | status = "disabled"; |
132 | 132 | ||
133 | st-plgpio,ngpio = <250>; | 133 | st-plgpio,ngpio = <250>; |
diff --git a/arch/arm/boot/dts/spear310.dtsi b/arch/arm/boot/dts/spear310.dtsi index ab45b8c81982..95372080eea6 100644 --- a/arch/arm/boot/dts/spear310.dtsi +++ b/arch/arm/boot/dts/spear310.dtsi | |||
@@ -25,7 +25,7 @@ | |||
25 | pinmux: pinmux@b4000000 { | 25 | pinmux: pinmux@b4000000 { |
26 | compatible = "st,spear310-pinmux"; | 26 | compatible = "st,spear310-pinmux"; |
27 | reg = <0xb4000000 0x1000>; | 27 | reg = <0xb4000000 0x1000>; |
28 | #gpio-range-cells = <2>; | 28 | #gpio-range-cells = <3>; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | fsmc: flash@44000000 { | 31 | fsmc: flash@44000000 { |
@@ -102,7 +102,7 @@ | |||
102 | interrupt-controller; | 102 | interrupt-controller; |
103 | gpio-controller; | 103 | gpio-controller; |
104 | #gpio-cells = <2>; | 104 | #gpio-cells = <2>; |
105 | gpio-ranges = <&pinmux 0 102>; | 105 | gpio-ranges = <&pinmux 0 0 102>; |
106 | status = "disabled"; | 106 | status = "disabled"; |
107 | 107 | ||
108 | st-plgpio,ngpio = <102>; | 108 | st-plgpio,ngpio = <102>; |
diff --git a/arch/arm/boot/dts/spear320.dtsi b/arch/arm/boot/dts/spear320.dtsi index caa5520b1fd4..ffea342aeec9 100644 --- a/arch/arm/boot/dts/spear320.dtsi +++ b/arch/arm/boot/dts/spear320.dtsi | |||
@@ -24,7 +24,7 @@ | |||
24 | pinmux: pinmux@b3000000 { | 24 | pinmux: pinmux@b3000000 { |
25 | compatible = "st,spear320-pinmux"; | 25 | compatible = "st,spear320-pinmux"; |
26 | reg = <0xb3000000 0x1000>; | 26 | reg = <0xb3000000 0x1000>; |
27 | #gpio-range-cells = <2>; | 27 | #gpio-range-cells = <3>; |
28 | }; | 28 | }; |
29 | 29 | ||
30 | clcd@90000000 { | 30 | clcd@90000000 { |
@@ -130,7 +130,7 @@ | |||
130 | interrupt-controller; | 130 | interrupt-controller; |
131 | gpio-controller; | 131 | gpio-controller; |
132 | #gpio-cells = <2>; | 132 | #gpio-cells = <2>; |
133 | gpio-ranges = <&pinmux 0 102>; | 133 | gpio-ranges = <&pinmux 0 0 102>; |
134 | status = "disabled"; | 134 | status = "disabled"; |
135 | 135 | ||
136 | st-plgpio,ngpio = <102>; | 136 | st-plgpio,ngpio = <102>; |
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index a71a54a3e3f7..892040ad0095 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c | |||
@@ -203,22 +203,11 @@ static void of_gpiochip_add_pin_range(struct gpio_chip *chip) | |||
203 | if (!pctldev) | 203 | if (!pctldev) |
204 | break; | 204 | break; |
205 | 205 | ||
206 | /* | ||
207 | * This assumes that the n GPIO pins are consecutive in the | ||
208 | * GPIO number space, and that the pins are also consecutive | ||
209 | * in their local number space. Currently it is not possible | ||
210 | * to add different ranges for one and the same GPIO chip, | ||
211 | * as the code assumes that we have one consecutive range | ||
212 | * on both, mapping 1-to-1. | ||
213 | * | ||
214 | * TODO: make the OF bindings handle multiple sparse ranges | ||
215 | * on the same GPIO chip. | ||
216 | */ | ||
217 | ret = gpiochip_add_pin_range(chip, | 206 | ret = gpiochip_add_pin_range(chip, |
218 | pinctrl_dev_get_devname(pctldev), | 207 | pinctrl_dev_get_devname(pctldev), |
219 | 0, /* offset in gpiochip */ | ||
220 | pinspec.args[0], | 208 | pinspec.args[0], |
221 | pinspec.args[1]); | 209 | pinspec.args[1], |
210 | pinspec.args[2]); | ||
222 | 211 | ||
223 | if (ret) | 212 | if (ret) |
224 | break; | 213 | break; |