* [PATCH 1/3] pinctrl: sunxi: Add of_xlate function [not found] <1359889813-10029-1-git-send-email-maxime.ripard@free-electrons.com> @ 2013-02-03 11:10 ` Maxime Ripard 2013-02-05 16:34 ` Linus Walleij 2013-02-03 11:18 ` [PATCH 2/3] sunxi: dts: Report the pinctrl nodes as gpio-controllers Maxime Ripard 1 sibling, 1 reply; 5+ messages in thread From: Maxime Ripard @ 2013-02-03 11:10 UTC (permalink / raw) To: Linus Walleij Cc: linux-arm-kernel, Alejandro Mery, Stefan Roese, linux-kernel Since the pin controller of sunxi chips is represented as a single bank in the driver. Since this is neither convenient nor represented that way in the datasheets, define a custom of_xlate function with the layout <bank pin flag> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> --- drivers/pinctrl/pinctrl-sunxi.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/pinctrl/pinctrl-sunxi.c b/drivers/pinctrl/pinctrl-sunxi.c index e4d32c6..80b11e3 100644 --- a/drivers/pinctrl/pinctrl-sunxi.c +++ b/drivers/pinctrl/pinctrl-sunxi.c @@ -1261,6 +1261,24 @@ static void sunxi_pinctrl_gpio_set(struct gpio_chip *chip, writel((value & DATA_PINS_MASK) << index, pctl->membase + reg); } +static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc, + const struct of_phandle_args *gpiospec, + u32 *flags) +{ + int pin, base; + + base = PINS_PER_BANK * gpiospec->args[0]; + pin = base + gpiospec->args[1]; + + if (pin > (gc->base + gc->ngpio)) + return -EINVAL; + + if (flags) + *flags = gpiospec->args[2]; + + return pin; +} + static struct gpio_chip sunxi_pinctrl_gpio_chip = { .owner = THIS_MODULE, .request = sunxi_pinctrl_gpio_request, @@ -1269,6 +1287,8 @@ static struct gpio_chip sunxi_pinctrl_gpio_chip = { .direction_output = sunxi_pinctrl_gpio_direction_output, .get = sunxi_pinctrl_gpio_get, .set = sunxi_pinctrl_gpio_set, + .of_xlate = sunxi_pinctrl_gpio_of_xlate, + .of_gpio_n_cells = 3, .can_sleep = 0, }; -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] pinctrl: sunxi: Add of_xlate function 2013-02-03 11:10 ` [PATCH 1/3] pinctrl: sunxi: Add of_xlate function Maxime Ripard @ 2013-02-05 16:34 ` Linus Walleij 0 siblings, 0 replies; 5+ messages in thread From: Linus Walleij @ 2013-02-05 16:34 UTC (permalink / raw) To: Maxime Ripard Cc: linux-arm-kernel, Alejandro Mery, Stefan Roese, linux-kernel On Sun, Feb 3, 2013 at 12:10 PM, Maxime Ripard <maxime.ripard@free-electrons.com> wrote: > Since the pin controller of sunxi chips is represented as a single bank > in the driver. > Since this is neither convenient nor represented that way in the > datasheets, define a custom of_xlate function with the layout <bank pin > flag> > > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Applied to my allwinner branch. I will soon lock down this branch and merge it into devel so I mature my devel branch for the merge window. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/3] sunxi: dts: Report the pinctrl nodes as gpio-controllers [not found] <1359889813-10029-1-git-send-email-maxime.ripard@free-electrons.com> 2013-02-03 11:10 ` [PATCH 1/3] pinctrl: sunxi: Add of_xlate function Maxime Ripard @ 2013-02-03 11:18 ` Maxime Ripard 2013-02-03 11:18 ` [PATCH 3/3] sunxi: a13-olinuxino: Add user LED to the device tree Maxime Ripard 1 sibling, 1 reply; 5+ messages in thread From: Maxime Ripard @ 2013-02-03 11:18 UTC (permalink / raw) To: Linus Walleij Cc: linux-arm-kernel, Alejandro Mery, Stefan Roese, Russell King, linux-kernel Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> --- arch/arm/boot/dts/sun4i-a10.dtsi | 4 +++- arch/arm/boot/dts/sun5i-a13.dtsi | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi index f99f60d..03d2b53 100644 --- a/arch/arm/boot/dts/sun4i-a10.dtsi +++ b/arch/arm/boot/dts/sun4i-a10.dtsi @@ -18,11 +18,13 @@ }; soc { - pinctrl@01c20800 { + pio: pinctrl@01c20800 { compatible = "allwinner,sun4i-a10-pinctrl"; reg = <0x01c20800 0x400>; + gpio-controller; #address-cells = <1>; #size-cells = <0>; + #gpio-cells = <3>; uart0_pins_a: uart0@0 { allwinner,pins = "PB22", "PB23"; diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi index e112189..945bfac 100644 --- a/arch/arm/boot/dts/sun5i-a13.dtsi +++ b/arch/arm/boot/dts/sun5i-a13.dtsi @@ -19,11 +19,13 @@ }; soc { - pinctrl@01c20800 { + pio: pinctrl@01c20800 { compatible = "allwinner,sun5i-a13-pinctrl"; reg = <0x01c20800 0x400>; + gpio-controller; #address-cells = <1>; #size-cells = <0>; + #gpio-cells = <3>; uart1_pins_a: uart1@0 { allwinner,pins = "PE10", "PE11"; -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] sunxi: a13-olinuxino: Add user LED to the device tree 2013-02-03 11:18 ` [PATCH 2/3] sunxi: dts: Report the pinctrl nodes as gpio-controllers Maxime Ripard @ 2013-02-03 11:18 ` Maxime Ripard 0 siblings, 0 replies; 5+ messages in thread From: Maxime Ripard @ 2013-02-03 11:18 UTC (permalink / raw) To: Linus Walleij Cc: linux-arm-kernel, Alejandro Mery, Stefan Roese, Russell King, linux-kernel Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> --- arch/arm/boot/dts/sun5i-a13-olinuxino.dts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts index 4a1e45d..33d1c7e 100644 --- a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts +++ b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts @@ -23,10 +23,30 @@ }; soc { + pinctrl@01c20800 { + led_pins_olinuxino: led_pins@0 { + allwinner,pins = "PG9"; + allwinner,function = "gpio_out"; + allwinner,drive = <1>; + allwinner,pull = <0>; + }; + }; + uart1: uart@01c28400 { pinctrl-names = "default"; pinctrl-0 = <&uart1_pins_b>; status = "okay"; }; }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&led_pins_olinuxino>; + + power { + gpios = <&pio 6 9 0>; + default-state = "on"; + }; + }; }; -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
[parent not found: <1359313332-12305-1-git-send-email-maxime.ripard@free-electrons.com>]
* [PATCH 3/3] sunxi: a13-olinuxino: Add user LED to the device tree [not found] <1359313332-12305-1-git-send-email-maxime.ripard@free-electrons.com> @ 2013-01-27 19:02 ` Maxime Ripard 0 siblings, 0 replies; 5+ messages in thread From: Maxime Ripard @ 2013-01-27 19:02 UTC (permalink / raw) To: linux-arm-kernel Cc: Emilio Lopez, Alejandro Mery, Stefan Roese, Russell King, linux-kernel Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> --- arch/arm/boot/dts/sun5i-a13-olinuxino.dts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts index 4a1e45d..33d1c7e 100644 --- a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts +++ b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts @@ -23,10 +23,30 @@ }; soc { + pinctrl@01c20800 { + led_pins_olinuxino: led_pins@0 { + allwinner,pins = "PG9"; + allwinner,function = "gpio_out"; + allwinner,drive = <1>; + allwinner,pull = <0>; + }; + }; + uart1: uart@01c28400 { pinctrl-names = "default"; pinctrl-0 = <&uart1_pins_b>; status = "okay"; }; }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&led_pins_olinuxino>; + + power { + gpios = <&pio 6 9 0>; + default-state = "on"; + }; + }; }; -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-02-05 16:34 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <1359889813-10029-1-git-send-email-maxime.ripard@free-electrons.com> 2013-02-03 11:10 ` [PATCH 1/3] pinctrl: sunxi: Add of_xlate function Maxime Ripard 2013-02-05 16:34 ` Linus Walleij 2013-02-03 11:18 ` [PATCH 2/3] sunxi: dts: Report the pinctrl nodes as gpio-controllers Maxime Ripard 2013-02-03 11:18 ` [PATCH 3/3] sunxi: a13-olinuxino: Add user LED to the device tree Maxime Ripard [not found] <1359313332-12305-1-git-send-email-maxime.ripard@free-electrons.com> 2013-01-27 19:02 ` Maxime Ripard
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).