linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] pinctrl: lantiq: 2 pins have the wrong mux list
@ 2016-01-04 21:27 John Crispin
  2016-01-04 21:27 ` [PATCH 2/3] pinctrl: lantiq: set the OD bit when the pin it an output John Crispin
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: John Crispin @ 2016-01-04 21:27 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio

The latest vendor SDK contained this patch.

Signed-off-by: John Crispin <blogic@openwrt.org>
---
 drivers/pinctrl/pinctrl-xway.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c
index ae724bd..cac1fde 100644
--- a/drivers/pinctrl/pinctrl-xway.c
+++ b/drivers/pinctrl/pinctrl-xway.c
@@ -152,10 +152,10 @@ static const struct ltq_mfp_pin xway_mfp[] = {
 	MFP_XWAY(GPIO41, GPIO,	NONE,	NONE,	NONE),
 	MFP_XWAY(GPIO42, GPIO,	MDIO,	NONE,	NONE),
 	MFP_XWAY(GPIO43, GPIO,	MDIO,	NONE,	NONE),
-	MFP_XWAY(GPIO44, GPIO,	NONE,	GPHY,	SIN),
+	MFP_XWAY(GPIO44, GPIO,	MII,	SIN,	GPHY),
 	MFP_XWAY(GPIO45, GPIO,	NONE,	GPHY,	SIN),
 	MFP_XWAY(GPIO46, GPIO,	NONE,	NONE,	EXIN),
-	MFP_XWAY(GPIO47, GPIO,	NONE,	GPHY,	SIN),
+	MFP_XWAY(GPIO47, GPIO,	MII,	GPHY,	SIN),
 	MFP_XWAY(GPIO48, GPIO,	EBU,	NONE,	NONE),
 	MFP_XWAY(GPIO49, GPIO,	EBU,	NONE,	NONE),
 	MFP_XWAY(GPIO50, GPIO,	NONE,	NONE,	NONE),
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/3] pinctrl: lantiq: set the OD bit when the pin it an output
  2016-01-04 21:27 [PATCH 1/3] pinctrl: lantiq: 2 pins have the wrong mux list John Crispin
@ 2016-01-04 21:27 ` John Crispin
  2016-01-05 10:05   ` Linus Walleij
  2016-01-04 21:27 ` [PATCH 3/3] pinctrl: lantiq: add a to_irq callback John Crispin
  2016-01-05 10:03 ` [PATCH 1/3] pinctrl: lantiq: 2 pins have the wrong mux list Linus Walleij
  2 siblings, 1 reply; 15+ messages in thread
From: John Crispin @ 2016-01-04 21:27 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio

Signed-off-by: John Crispin <blogic@openwrt.org>
---
 drivers/pinctrl/pinctrl-xway.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c
index cac1fde..434567b 100644
--- a/drivers/pinctrl/pinctrl-xway.c
+++ b/drivers/pinctrl/pinctrl-xway.c
@@ -676,6 +676,10 @@ static int xway_gpio_dir_out(struct gpio_chip *chip, unsigned int pin, int val)
 {
 	struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev);
 
+	if (PORT(pin) == PORT3)
+		gpio_setbit(info->membase[0], GPIO3_OD, PORT_PIN(pin));
+	else
+		gpio_setbit(info->membase[0], GPIO_OD(pin), PORT_PIN(pin));
 	gpio_setbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin));
 	xway_gpio_set(chip, pin, val);
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/3] pinctrl: lantiq: add a to_irq callback
  2016-01-04 21:27 [PATCH 1/3] pinctrl: lantiq: 2 pins have the wrong mux list John Crispin
  2016-01-04 21:27 ` [PATCH 2/3] pinctrl: lantiq: set the OD bit when the pin it an output John Crispin
@ 2016-01-04 21:27 ` John Crispin
  2016-01-05 10:10   ` Linus Walleij
  2016-01-05 10:03 ` [PATCH 1/3] pinctrl: lantiq: 2 pins have the wrong mux list Linus Walleij
  2 siblings, 1 reply; 15+ messages in thread
From: John Crispin @ 2016-01-04 21:27 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio

The callback is missing so lets add it.

Signed-off-by: John Crispin <blogic@openwrt.org>
---
 drivers/pinctrl/pinctrl-xway.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c
index 434567b..3777f2d 100644
--- a/drivers/pinctrl/pinctrl-xway.c
+++ b/drivers/pinctrl/pinctrl-xway.c
@@ -686,6 +686,18 @@ static int xway_gpio_dir_out(struct gpio_chip *chip, unsigned int pin, int val)
 	return 0;
 }
 
+static int xway_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
+{
+	struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev);
+	int i;
+
+	for (i = 0; i < info->num_exin; i++)
+		if (info->exin[i] == offset)
+			return ltq_eiu_get_irq(i);
+
+	return -1;
+}
+
 static struct gpio_chip xway_chip = {
 	.label = "gpio-xway",
 	.direction_input = xway_gpio_dir_in,
@@ -694,6 +706,7 @@ static struct gpio_chip xway_chip = {
 	.set = xway_gpio_set,
 	.request = gpiochip_generic_request,
 	.free = gpiochip_generic_free,
+	.to_irq = xway_gpio_to_irq,
 	.base = -1,
 };
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] pinctrl: lantiq: 2 pins have the wrong mux list
  2016-01-04 21:27 [PATCH 1/3] pinctrl: lantiq: 2 pins have the wrong mux list John Crispin
  2016-01-04 21:27 ` [PATCH 2/3] pinctrl: lantiq: set the OD bit when the pin it an output John Crispin
  2016-01-04 21:27 ` [PATCH 3/3] pinctrl: lantiq: add a to_irq callback John Crispin
@ 2016-01-05 10:03 ` Linus Walleij
  2016-01-05 10:10   ` John Crispin
  2 siblings, 1 reply; 15+ messages in thread
From: Linus Walleij @ 2016-01-05 10:03 UTC (permalink / raw)
  To: John Crispin; +Cc: linux-gpio@vger.kernel.org

On Mon, Jan 4, 2016 at 10:27 PM, John Crispin <blogic@openwrt.org> wrote:

> The latest vendor SDK contained this patch.
>
> Signed-off-by: John Crispin <blogic@openwrt.org>

Patch applied. Had to rebase it manually for some reason.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/3] pinctrl: lantiq: set the OD bit when the pin it an output
  2016-01-04 21:27 ` [PATCH 2/3] pinctrl: lantiq: set the OD bit when the pin it an output John Crispin
@ 2016-01-05 10:05   ` Linus Walleij
  2016-01-05 10:11     ` John Crispin
  0 siblings, 1 reply; 15+ messages in thread
From: Linus Walleij @ 2016-01-05 10:05 UTC (permalink / raw)
  To: John Crispin, Martin Schiller; +Cc: linux-gpio@vger.kernel.org

On Mon, Jan 4, 2016 at 10:27 PM, John Crispin <blogic@openwrt.org> wrote:

> Signed-off-by: John Crispin <blogic@openwrt.org>

I got the same patch from Martin Schiller earlier so already applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] pinctrl: lantiq: 2 pins have the wrong mux list
  2016-01-05 10:03 ` [PATCH 1/3] pinctrl: lantiq: 2 pins have the wrong mux list Linus Walleij
@ 2016-01-05 10:10   ` John Crispin
  2016-01-05 12:59     ` Martin Schiller
  0 siblings, 1 reply; 15+ messages in thread
From: John Crispin @ 2016-01-05 10:10 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio@vger.kernel.org



On 05/01/2016 11:03, Linus Walleij wrote:
> On Mon, Jan 4, 2016 at 10:27 PM, John Crispin <blogic@openwrt.org> wrote:
> 
>> The latest vendor SDK contained this patch.
>>
>> Signed-off-by: John Crispin <blogic@openwrt.org>
> 
> Patch applied. Had to rebase it manually for some reason.
> 
> Yours,
> Linus Walleij
> 


weird, it was generated using git on top of v4.4-rc7

thanks and sorry for the extra hassle.

	John

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/3] pinctrl: lantiq: add a to_irq callback
  2016-01-04 21:27 ` [PATCH 3/3] pinctrl: lantiq: add a to_irq callback John Crispin
@ 2016-01-05 10:10   ` Linus Walleij
  2016-01-05 12:59     ` Martin Schiller
  0 siblings, 1 reply; 15+ messages in thread
From: Linus Walleij @ 2016-01-05 10:10 UTC (permalink / raw)
  To: John Crispin; +Cc: linux-gpio@vger.kernel.org

On Mon, Jan 4, 2016 at 10:27 PM, John Crispin <blogic@openwrt.org> wrote:

> The callback is missing so lets add it.
>
> Signed-off-by: John Crispin <blogic@openwrt.org>

Thanks!

> +       return -1;
> +}

I changed this to return 0 because of this:
http://lwn.net/Articles/470820/

Patch applied with the above change.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/3] pinctrl: lantiq: set the OD bit when the pin it an output
  2016-01-05 10:05   ` Linus Walleij
@ 2016-01-05 10:11     ` John Crispin
  2016-01-05 10:18       ` Linus Walleij
  0 siblings, 1 reply; 15+ messages in thread
From: John Crispin @ 2016-01-05 10:11 UTC (permalink / raw)
  To: Linus Walleij, Martin Schiller; +Cc: linux-gpio@vger.kernel.org



On 05/01/2016 11:05, Linus Walleij wrote:
> On Mon, Jan 4, 2016 at 10:27 PM, John Crispin <blogic@openwrt.org> wrote:
> 
>> Signed-off-by: John Crispin <blogic@openwrt.org>
> 
> I got the same patch from Martin Schiller earlier so already applied.
> 
> Yours,
> Linus Walleij
> 

opps, have to get used to the fact that after 7 years i am no longer the
only one working on the lantiq target ;)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/3] pinctrl: lantiq: set the OD bit when the pin it an output
  2016-01-05 10:11     ` John Crispin
@ 2016-01-05 10:18       ` Linus Walleij
  0 siblings, 0 replies; 15+ messages in thread
From: Linus Walleij @ 2016-01-05 10:18 UTC (permalink / raw)
  To: John Crispin; +Cc: Martin Schiller, linux-gpio@vger.kernel.org

On Tue, Jan 5, 2016 at 11:11 AM, John Crispin <blogic@openwrt.org> wrote:

> opps, have to get used to the fact that after 7 years i am no longer the
> only one working on the lantiq target ;)

Hehe overall I'm just very happy that the patches from OpenWRT
are finding their way into the kernel proper so no worries.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH 1/3] pinctrl: lantiq: 2 pins have the wrong mux list
  2016-01-05 10:10   ` John Crispin
@ 2016-01-05 12:59     ` Martin Schiller
  2016-01-05 13:19       ` Linus Walleij
  0 siblings, 1 reply; 15+ messages in thread
From: Martin Schiller @ 2016-01-05 12:59 UTC (permalink / raw)
  To: John Crispin, Linus Walleij; +Cc: linux-gpio@vger.kernel.org

On 01/05/2016 at 11:10 AM, John Crispin wrote:
>
>
> On 05/01/2016 11:03, Linus Walleij wrote:
> > On Mon, Jan 4, 2016 at 10:27 PM, John Crispin <blogic@openwrt.org>
> wrote:
> >
> >> The latest vendor SDK contained this patch.
> >>
> >> Signed-off-by: John Crispin <blogic@openwrt.org>
> >
> > Patch applied. Had to rebase it manually for some reason.
> >
> > Yours,
> > Linus Walleij
> >
>
>
> weird, it was generated using git on top of v4.4-rc7

I think that's because of the changes submitted by me, which are not in
the official v4.4-rc7 so far:

https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-pinctrl.git/commit/drivers/pinctrl/pinctrl-xway.c?h=devel&id=be14811c03cf20c793fd176a347625335110b0e6

>
> thanks and sorry for the extra hassle.
>
> John
> --
> To unsubscribe from this list: send the line "unsubscribe linux-gpio"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH 3/3] pinctrl: lantiq: add a to_irq callback
  2016-01-05 10:10   ` Linus Walleij
@ 2016-01-05 12:59     ` Martin Schiller
  2016-01-05 14:19       ` Linus Walleij
  0 siblings, 1 reply; 15+ messages in thread
From: Martin Schiller @ 2016-01-05 12:59 UTC (permalink / raw)
  To: Linus Walleij, John Crispin; +Cc: linux-gpio@vger.kernel.org

On 01/05/2016 at 11:10 AM, Linus Walleij wrote:
> On Mon, Jan 4, 2016 at 10:27 PM, John Crispin <blogic@openwrt.org>
> wrote:
>
> > The callback is missing so lets add it.
> >
> > Signed-off-by: John Crispin <blogic@openwrt.org>
>
> Thanks!
>
> > +       return -1;
> > +}
>
> I changed this to return 0 because of this:
> http://lwn.net/Articles/470820/
>
> Patch applied with the above change.
>
> Yours,
> Linus Walleij

@Linus:
As I submitted this change a few weeks ago, you already applied this in the linux-gpio tree here:
https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-gpio.git/commit/drivers/pinctrl/pinctrl-xway.c?h=devel&id=3e640743fee6e6a82ead1f163737755b2a965712


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] pinctrl: lantiq: 2 pins have the wrong mux list
  2016-01-05 12:59     ` Martin Schiller
@ 2016-01-05 13:19       ` Linus Walleij
  0 siblings, 0 replies; 15+ messages in thread
From: Linus Walleij @ 2016-01-05 13:19 UTC (permalink / raw)
  To: Martin Schiller; +Cc: John Crispin, linux-gpio@vger.kernel.org

On Tue, Jan 5, 2016 at 1:59 PM, Martin Schiller <mschiller@tdt.de> wrote:
> On 01/05/2016 at 11:10 AM, John Crispin wrote:
>>
>>
>> On 05/01/2016 11:03, Linus Walleij wrote:
>> > On Mon, Jan 4, 2016 at 10:27 PM, John Crispin <blogic@openwrt.org>
>> wrote:
>> >
>> >> The latest vendor SDK contained this patch.
>> >>
>> >> Signed-off-by: John Crispin <blogic@openwrt.org>
>> >
>> > Patch applied. Had to rebase it manually for some reason.
>> >
>> > Yours,
>> > Linus Walleij
>> >
>>
>>
>> weird, it was generated using git on top of v4.4-rc7
>
> I think that's because of the changes submitted by me, which are not in
> the official v4.4-rc7 so far:
>
> https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-pinctrl.git/commit/drivers/pinctrl/pinctrl-xway.c?h=devel&id=be14811c03cf20c793fd176a347625335110b0e6

I found the mess, of course it's my own fault. I merged some patches
into the pin control tree and some into the GPIO tree and that combined
with my massive refactorings is a mess.

I did some reverting and moving patches between the trees and
now it should merge up in linux-next all right.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/3] pinctrl: lantiq: add a to_irq callback
  2016-01-05 12:59     ` Martin Schiller
@ 2016-01-05 14:19       ` Linus Walleij
  2016-03-31  4:44         ` Martin Schiller
  0 siblings, 1 reply; 15+ messages in thread
From: Linus Walleij @ 2016-01-05 14:19 UTC (permalink / raw)
  To: Martin Schiller; +Cc: John Crispin, linux-gpio@vger.kernel.org

On Tue, Jan 5, 2016 at 1:59 PM, Martin Schiller <mschiller@tdt.de> wrote:

> As I submitted this change a few weeks ago, you already applied this in the linux-gpio tree here:
> https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-gpio.git/commit/drivers/pinctrl/pinctrl-xway.c?h=devel&id=3e640743fee6e6a82ead1f163737755b2a965712

Yeah I noticed.... hehe it blew up in my face when I tried to merge
the pin control and GPIO trees to see what happens in Linux-next.
I think I figured it out now...

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH 3/3] pinctrl: lantiq: add a to_irq callback
  2016-01-05 14:19       ` Linus Walleij
@ 2016-03-31  4:44         ` Martin Schiller
  2016-04-01 13:22           ` Linus Walleij
  0 siblings, 1 reply; 15+ messages in thread
From: Martin Schiller @ 2016-03-31  4:44 UTC (permalink / raw)
  To: Linus Walleij; +Cc: John Crispin, linux-gpio@vger.kernel.org

Hi Linus,

On 01/05/2016 at 3:19 PM, Linus Walleij wrote:
> On Tue, Jan 5, 2016 at 1:59 PM, Martin Schiller <mschiller@tdt.de> wrote:
>
> > As I submitted this change a few weeks ago, you already applied this in the
> linux-gpio tree here:
> > https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-
> gpio.git/commit/drivers/pinctrl/pinctrl-
> xway.c?h=devel&id=3e640743fee6e6a82ead1f163737755b2a965712
>
> Yeah I noticed.... hehe it blew up in my face when I tried to merge
> the pin control and GPIO trees to see what happens in Linux-next.
> I think I figured it out now...

I think there still went something wrong with this commit:

In the commit log you can see that this changes are added on 2015-12-10 and
then reverted on 2016-01-05.

- Martin


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/3] pinctrl: lantiq: add a to_irq callback
  2016-03-31  4:44         ` Martin Schiller
@ 2016-04-01 13:22           ` Linus Walleij
  0 siblings, 0 replies; 15+ messages in thread
From: Linus Walleij @ 2016-04-01 13:22 UTC (permalink / raw)
  To: Martin Schiller; +Cc: John Crispin, linux-gpio@vger.kernel.org

On Thu, Mar 31, 2016 at 6:44 AM, Martin Schiller <mschiller@tdt.de> wrote:

> I think there still went something wrong with this commit:
>
> In the commit log you can see that this changes are added on 2015-12-10 and
> then reverted on 2016-01-05.

You're right, I just screw everything up, sorry :(

I have reverted the revert for pin control fixes so
it goes into v4.6 as a fix.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-04-01 13:22 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-04 21:27 [PATCH 1/3] pinctrl: lantiq: 2 pins have the wrong mux list John Crispin
2016-01-04 21:27 ` [PATCH 2/3] pinctrl: lantiq: set the OD bit when the pin it an output John Crispin
2016-01-05 10:05   ` Linus Walleij
2016-01-05 10:11     ` John Crispin
2016-01-05 10:18       ` Linus Walleij
2016-01-04 21:27 ` [PATCH 3/3] pinctrl: lantiq: add a to_irq callback John Crispin
2016-01-05 10:10   ` Linus Walleij
2016-01-05 12:59     ` Martin Schiller
2016-01-05 14:19       ` Linus Walleij
2016-03-31  4:44         ` Martin Schiller
2016-04-01 13:22           ` Linus Walleij
2016-01-05 10:03 ` [PATCH 1/3] pinctrl: lantiq: 2 pins have the wrong mux list Linus Walleij
2016-01-05 10:10   ` John Crispin
2016-01-05 12:59     ` Martin Schiller
2016-01-05 13:19       ` 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).