linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Crispin <blogic@openwrt.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org
Subject: [PATCH 3/3] pinctrl: lantiq: add a to_irq callback
Date: Mon,  4 Jan 2016 22:27:59 +0100	[thread overview]
Message-ID: <1451942879-43265-3-git-send-email-blogic@openwrt.org> (raw)
In-Reply-To: <1451942879-43265-1-git-send-email-blogic@openwrt.org>

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

  parent reply	other threads:[~2016-01-04 21:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` John Crispin [this message]
2016-01-05 10:10   ` [PATCH 3/3] pinctrl: lantiq: add a to_irq callback 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1451942879-43265-3-git-send-email-blogic@openwrt.org \
    --to=blogic@openwrt.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).