* [PATCH v2 0/2] pinctrl: sunxi: r_pio irq fixes @ 2015-10-16 7:46 Hans de Goede 2015-10-16 7:46 ` [PATCH v2 1/2] pinctrl: sunxi: Fix irq_of_xlate for the r_pio pinctrl block Hans de Goede 2015-10-16 7:46 ` [PATCH v2 2/2] pinctrl: sunxi: Add irq pinmuxing to sun6i "r" pincontroller Hans de Goede 0 siblings, 2 replies; 9+ messages in thread From: Hans de Goede @ 2015-10-16 7:46 UTC (permalink / raw) To: linux-arm-kernel Hi All, Here is a v2 of this patch-set which actually compiles (problem with the second patch in v1). After testing that everything worked I extended the irq mapping to not just cover PL5 (the pin I actually tested with) but also all the other pins which have an irq function. I botched up the copy paste (in some cases the irq mux is the last function so I needed to also move a brace), and then to make things worse I also forgot to do a compile after adding the irq muxing to the other pins. This version has the braces moved to the proper place fixing the compile error, otherwise it is unchanged. Regards, Hans ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 1/2] pinctrl: sunxi: Fix irq_of_xlate for the r_pio pinctrl block 2015-10-16 7:46 [PATCH v2 0/2] pinctrl: sunxi: r_pio irq fixes Hans de Goede @ 2015-10-16 7:46 ` Hans de Goede 2015-10-16 7:57 ` Chen-Yu Tsai ` (2 more replies) 2015-10-16 7:46 ` [PATCH v2 2/2] pinctrl: sunxi: Add irq pinmuxing to sun6i "r" pincontroller Hans de Goede 1 sibling, 3 replies; 9+ messages in thread From: Hans de Goede @ 2015-10-16 7:46 UTC (permalink / raw) To: linux-arm-kernel The r_pio gpio / pin controller has a pin_base of non 0, we need to adjust for this before calling sunxi_pinctrl_desc_find_function_by_pin. Signed-off-by: Hans de Goede <hdegoede@redhat.com> --- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index 38e0c7b..96a58e4 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c @@ -716,6 +716,7 @@ static int sunxi_pinctrl_irq_of_xlate(struct irq_domain *d, unsigned long *out_hwirq, unsigned int *out_type) { + struct sunxi_pinctrl *pctl = d->host_data; struct sunxi_desc_function *desc; int pin, base; @@ -723,10 +724,9 @@ static int sunxi_pinctrl_irq_of_xlate(struct irq_domain *d, return -EINVAL; base = PINS_PER_BANK * intspec[0]; - pin = base + intspec[1]; + pin = pctl->desc->pin_base + base + intspec[1]; - desc = sunxi_pinctrl_desc_find_function_by_pin(d->host_data, - pin, "irq"); + desc = sunxi_pinctrl_desc_find_function_by_pin(pctl, pin, "irq"); if (!desc) return -EINVAL; -- 2.5.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 1/2] pinctrl: sunxi: Fix irq_of_xlate for the r_pio pinctrl block 2015-10-16 7:46 ` [PATCH v2 1/2] pinctrl: sunxi: Fix irq_of_xlate for the r_pio pinctrl block Hans de Goede @ 2015-10-16 7:57 ` Chen-Yu Tsai 2015-10-16 14:27 ` Maxime Ripard 2015-10-23 8:12 ` Linus Walleij 2 siblings, 0 replies; 9+ messages in thread From: Chen-Yu Tsai @ 2015-10-16 7:57 UTC (permalink / raw) To: linux-arm-kernel On Fri, Oct 16, 2015 at 3:46 PM, Hans de Goede <hdegoede@redhat.com> wrote: > The r_pio gpio / pin controller has a pin_base of non 0, we need to > adjust for this before calling sunxi_pinctrl_desc_find_function_by_pin. > > Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Thanks! ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 1/2] pinctrl: sunxi: Fix irq_of_xlate for the r_pio pinctrl block 2015-10-16 7:46 ` [PATCH v2 1/2] pinctrl: sunxi: Fix irq_of_xlate for the r_pio pinctrl block Hans de Goede 2015-10-16 7:57 ` Chen-Yu Tsai @ 2015-10-16 14:27 ` Maxime Ripard 2015-10-23 8:12 ` Linus Walleij 2 siblings, 0 replies; 9+ messages in thread From: Maxime Ripard @ 2015-10-16 14:27 UTC (permalink / raw) To: linux-arm-kernel On Fri, Oct 16, 2015 at 09:46:11AM +0200, Hans de Goede wrote: > The r_pio gpio / pin controller has a pin_base of non 0, we need to > adjust for this before calling sunxi_pinctrl_desc_find_function_by_pin. > > Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Thanks! Maxime -- Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151016/0609b168/attachment-0001.sig> ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 1/2] pinctrl: sunxi: Fix irq_of_xlate for the r_pio pinctrl block 2015-10-16 7:46 ` [PATCH v2 1/2] pinctrl: sunxi: Fix irq_of_xlate for the r_pio pinctrl block Hans de Goede 2015-10-16 7:57 ` Chen-Yu Tsai 2015-10-16 14:27 ` Maxime Ripard @ 2015-10-23 8:12 ` Linus Walleij 2 siblings, 0 replies; 9+ messages in thread From: Linus Walleij @ 2015-10-23 8:12 UTC (permalink / raw) To: linux-arm-kernel On Fri, Oct 16, 2015 at 9:46 AM, Hans de Goede <hdegoede@redhat.com> wrote: > The r_pio gpio / pin controller has a pin_base of non 0, we need to > adjust for this before calling sunxi_pinctrl_desc_find_function_by_pin. > > Signed-off-by: Hans de Goede <hdegoede@redhat.com> Patch applied with Chen-Yu's and Maxime's ACKs. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 2/2] pinctrl: sunxi: Add irq pinmuxing to sun6i "r" pincontroller 2015-10-16 7:46 [PATCH v2 0/2] pinctrl: sunxi: r_pio irq fixes Hans de Goede 2015-10-16 7:46 ` [PATCH v2 1/2] pinctrl: sunxi: Fix irq_of_xlate for the r_pio pinctrl block Hans de Goede @ 2015-10-16 7:46 ` Hans de Goede 2015-10-16 7:57 ` Chen-Yu Tsai ` (2 more replies) 1 sibling, 3 replies; 9+ messages in thread From: Hans de Goede @ 2015-10-16 7:46 UTC (permalink / raw) To: linux-arm-kernel Add pinmuxing for external interrupt functionality through the sun6i "r" pincontroller. Signed-off-by: Hans de Goede <hdegoede@redhat.com> --- Changes in v2: -Fix compile error introduced by last minute changes before sending out the patch (note to self: always do a recompile in such a case) --- drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c b/drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c index 9596b0a3..d4bc4f0 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c +++ b/drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c @@ -47,45 +47,57 @@ static const struct sunxi_desc_pin sun6i_a31_r_pins[] = { SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 5), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), + SUNXI_FUNCTION_IRQ_BANK(0x2, 0, 0), /* PL_EINT0 */ SUNXI_FUNCTION(0x3, "s_jtag")), /* MS */ SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 6), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), + SUNXI_FUNCTION_IRQ_BANK(0x2, 0, 1), /* PL_EINT1 */ SUNXI_FUNCTION(0x3, "s_jtag")), /* CK */ SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 7), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), + SUNXI_FUNCTION_IRQ_BANK(0x2, 0, 2), /* PL_EINT2 */ SUNXI_FUNCTION(0x3, "s_jtag")), /* DO */ SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 8), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), + SUNXI_FUNCTION_IRQ_BANK(0x2, 0, 3), /* PL_EINT3 */ SUNXI_FUNCTION(0x3, "s_jtag")), /* DI */ /* Hole */ SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 0), SUNXI_FUNCTION(0x0, "gpio_in"), - SUNXI_FUNCTION(0x1, "gpio_out")), + SUNXI_FUNCTION(0x1, "gpio_out"), + SUNXI_FUNCTION_IRQ_BANK(0x2, 1, 0)), /* PM_EINT0 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 1), SUNXI_FUNCTION(0x0, "gpio_in"), - SUNXI_FUNCTION(0x1, "gpio_out")), + SUNXI_FUNCTION(0x1, "gpio_out"), + SUNXI_FUNCTION_IRQ_BANK(0x2, 1, 1)), /* PM_EINT1 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 2), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), + SUNXI_FUNCTION_IRQ_BANK(0x2, 1, 2), /* PM_EINT2 */ SUNXI_FUNCTION(0x3, "1wire")), SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 3), SUNXI_FUNCTION(0x0, "gpio_in"), - SUNXI_FUNCTION(0x1, "gpio_out")), + SUNXI_FUNCTION(0x1, "gpio_out"), + SUNXI_FUNCTION_IRQ_BANK(0x2, 1, 3)), /* PM_EINT3 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 4), SUNXI_FUNCTION(0x0, "gpio_in"), - SUNXI_FUNCTION(0x1, "gpio_out")), + SUNXI_FUNCTION(0x1, "gpio_out"), + SUNXI_FUNCTION_IRQ_BANK(0x2, 1, 4)), /* PM_EINT4 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 5), SUNXI_FUNCTION(0x0, "gpio_in"), - SUNXI_FUNCTION(0x1, "gpio_out")), + SUNXI_FUNCTION(0x1, "gpio_out"), + SUNXI_FUNCTION_IRQ_BANK(0x2, 1, 5)), /* PM_EINT5 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 6), SUNXI_FUNCTION(0x0, "gpio_in"), - SUNXI_FUNCTION(0x1, "gpio_out")), + SUNXI_FUNCTION(0x1, "gpio_out"), + SUNXI_FUNCTION_IRQ_BANK(0x2, 1, 6)), /* PM_EINT6 */ SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 7), SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), + SUNXI_FUNCTION_IRQ_BANK(0x2, 1, 7), /* PM_EINT7 */ SUNXI_FUNCTION(0x3, "rtc")), /* CLKO */ }; -- 2.5.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 2/2] pinctrl: sunxi: Add irq pinmuxing to sun6i "r" pincontroller 2015-10-16 7:46 ` [PATCH v2 2/2] pinctrl: sunxi: Add irq pinmuxing to sun6i "r" pincontroller Hans de Goede @ 2015-10-16 7:57 ` Chen-Yu Tsai 2015-10-16 14:28 ` Maxime Ripard 2015-10-23 8:14 ` Linus Walleij 2 siblings, 0 replies; 9+ messages in thread From: Chen-Yu Tsai @ 2015-10-16 7:57 UTC (permalink / raw) To: linux-arm-kernel On Fri, Oct 16, 2015 at 3:46 PM, Hans de Goede <hdegoede@redhat.com> wrote: > Add pinmuxing for external interrupt functionality through the > sun6i "r" pincontroller. > > Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Thanks! > --- > Changes in v2: > -Fix compile error introduced by last minute changes before sending out > the patch (note to self: always do a recompile in such a case) Sorry I didn't catch that either. ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 2/2] pinctrl: sunxi: Add irq pinmuxing to sun6i "r" pincontroller 2015-10-16 7:46 ` [PATCH v2 2/2] pinctrl: sunxi: Add irq pinmuxing to sun6i "r" pincontroller Hans de Goede 2015-10-16 7:57 ` Chen-Yu Tsai @ 2015-10-16 14:28 ` Maxime Ripard 2015-10-23 8:14 ` Linus Walleij 2 siblings, 0 replies; 9+ messages in thread From: Maxime Ripard @ 2015-10-16 14:28 UTC (permalink / raw) To: linux-arm-kernel On Fri, Oct 16, 2015 at 09:46:12AM +0200, Hans de Goede wrote: > Add pinmuxing for external interrupt functionality through the > sun6i "r" pincontroller. > > Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Thanks! Maxime -- Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151016/de79d6f9/attachment.sig> ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 2/2] pinctrl: sunxi: Add irq pinmuxing to sun6i "r" pincontroller 2015-10-16 7:46 ` [PATCH v2 2/2] pinctrl: sunxi: Add irq pinmuxing to sun6i "r" pincontroller Hans de Goede 2015-10-16 7:57 ` Chen-Yu Tsai 2015-10-16 14:28 ` Maxime Ripard @ 2015-10-23 8:14 ` Linus Walleij 2 siblings, 0 replies; 9+ messages in thread From: Linus Walleij @ 2015-10-23 8:14 UTC (permalink / raw) To: linux-arm-kernel On Fri, Oct 16, 2015 at 9:46 AM, Hans de Goede <hdegoede@redhat.com> wrote: > Add pinmuxing for external interrupt functionality through the > sun6i "r" pincontroller. > > Signed-off-by: Hans de Goede <hdegoede@redhat.com> > --- > Changes in v2: > -Fix compile error introduced by last minute changes before sending out > the patch (note to self: always do a recompile in such a case) Patch applied with Chen-Yu's and Maxime's ACKs. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-10-23 8:14 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-10-16 7:46 [PATCH v2 0/2] pinctrl: sunxi: r_pio irq fixes Hans de Goede 2015-10-16 7:46 ` [PATCH v2 1/2] pinctrl: sunxi: Fix irq_of_xlate for the r_pio pinctrl block Hans de Goede 2015-10-16 7:57 ` Chen-Yu Tsai 2015-10-16 14:27 ` Maxime Ripard 2015-10-23 8:12 ` Linus Walleij 2015-10-16 7:46 ` [PATCH v2 2/2] pinctrl: sunxi: Add irq pinmuxing to sun6i "r" pincontroller Hans de Goede 2015-10-16 7:57 ` Chen-Yu Tsai 2015-10-16 14:28 ` Maxime Ripard 2015-10-23 8:14 ` Linus Walleij
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).