From: William Breathitt Gray <vilhelm.gray@gmail.com>
To: linus.walleij@linaro.org, gnurou@gmail.com
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
William Breathitt Gray <vilhelm.gray@gmail.com>
Subject: [PATCH v2 4/5] gpio: gpio-mm: Add support for GPIO names
Date: Mon, 30 Jan 2017 13:33:37 -0500 [thread overview]
Message-ID: <3b487a6dcdc075d7fc0414911ec8133cdff46eb1.1485800977.git.vilhelm.gray@gmail.com> (raw)
In-Reply-To: <cover.1485800977.git.vilhelm.gray@gmail.com>
This patch sets the gpio_chip names option with an array of GPIO line
names that match the manual documentation for the Diamond Systems
GPIO-MM. This should make it easier for users to identify which GPIO
line corresponds to a respective GPIO pin on the device.
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
---
drivers/gpio/gpio-gpio-mm.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-gpio-mm.c b/drivers/gpio/gpio-gpio-mm.c
index 393c8f9cf30d..bf74cc55ab44 100644
--- a/drivers/gpio/gpio-gpio-mm.c
+++ b/drivers/gpio/gpio-gpio-mm.c
@@ -230,6 +230,18 @@ static void gpiomm_gpio_set_multiple(struct gpio_chip *chip,
}
}
+#define GPIOMM_NGPIO 48
+static const char *gpiomm_names[GPIOMM_NGPIO] = {
+ "Port 1A0", "Port 1A1", "Port 1A2", "Port 1A3", "Port 1A4", "Port 1A5",
+ "Port 1A6", "Port 1A7", "Port 1B0", "Port 1B1", "Port 1B2", "Port 1B3",
+ "Port 1B4", "Port 1B5", "Port 1B6", "Port 1B7", "Port 1C0", "Port 1C1",
+ "Port 1C2", "Port 1C3", "Port 1C4", "Port 1C5", "Port 1C6", "Port 1C7",
+ "Port 2A0", "Port 2A1", "Port 2A2", "Port 2A3", "Port 2A4", "Port 2A5",
+ "Port 2A6", "Port 2A7", "Port 2B0", "Port 2B1", "Port 2B2", "Port 2B3",
+ "Port 2B4", "Port 2B5", "Port 2B6", "Port 2B7", "Port 2C0", "Port 2C1",
+ "Port 2C2", "Port 2C3", "Port 2C4", "Port 2C5", "Port 2C6", "Port 2C7",
+};
+
static int gpiomm_probe(struct device *dev, unsigned int id)
{
struct gpiomm_gpio *gpiommgpio;
@@ -250,7 +262,8 @@ static int gpiomm_probe(struct device *dev, unsigned int id)
gpiommgpio->chip.parent = dev;
gpiommgpio->chip.owner = THIS_MODULE;
gpiommgpio->chip.base = -1;
- gpiommgpio->chip.ngpio = 48;
+ gpiommgpio->chip.ngpio = GPIOMM_NGPIO;
+ gpiommgpio->chip.names = gpiomm_names;
gpiommgpio->chip.get_direction = gpiomm_gpio_get_direction;
gpiommgpio->chip.direction_input = gpiomm_gpio_direction_input;
gpiommgpio->chip.direction_output = gpiomm_gpio_direction_output;
--
2.11.0
next prev parent reply other threads:[~2017-01-30 18:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-30 18:32 [PATCH v2 0/5] gpio: Add support for GPIO names for several ISA_BUS_API drivers William Breathitt Gray
2017-01-30 18:32 ` [PATCH v2 1/5] gpio: 104-dio-48e: Add support for GPIO names William Breathitt Gray
2017-02-01 15:03 ` Linus Walleij
2017-01-30 18:33 ` [PATCH v2 2/5] gpio: 104-idi-48: " William Breathitt Gray
2017-02-01 15:04 ` Linus Walleij
2017-01-30 18:33 ` [PATCH v2 3/5] gpio: 104-idio-16: " William Breathitt Gray
2017-02-01 15:05 ` Linus Walleij
2017-01-30 18:33 ` William Breathitt Gray [this message]
2017-02-01 15:05 ` [PATCH v2 4/5] gpio: gpio-mm: " Linus Walleij
2017-01-30 18:33 ` [PATCH v2 5/5] gpio: ws16c48: " William Breathitt Gray
2017-02-01 15:06 ` 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=3b487a6dcdc075d7fc0414911ec8133cdff46eb1.1485800977.git.vilhelm.gray@gmail.com \
--to=vilhelm.gray@gmail.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@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
Powered by JetHome