[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdbAn5QEah0oqVHcJz_-Bu-94A5ADYgXeFogZbzhuzrjnA@mail.gmail.com>
Date: Tue, 31 Jan 2017 10:41:35 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: William Breathitt Gray <vilhelm.gray@...il.com>
Cc: Jonathan Cameron <jic23@...nel.org>,
Hartmut Knaack <knaack.h@....de>,
Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald <pmeerw@...erw.net>,
"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] iio: stx104: Add support for GPIO names
On Mon, Jan 30, 2017 at 6:16 PM, William Breathitt Gray
<vilhelm.gray@...il.com> wrote:
> This patch sets the gpio_chip names option with an array of GPIO line
> names that match the manual documentation for the Apex Embedded Systems
> STX104. 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@...il.com>
(...)
> +#define STX104_NGPIO 8
> +static const char *stx104_names[STX104_NGPIO] = {
> + "DIN0", "DIN1", "DIN2", "DIN3", "DOUT0", "DOUT1", "DOUT2", "DOUT3"
> +};
(...)
> + stx104gpio->chip.ngpio = STX104_NGPIO;
> + stx104gpio->chip.names = stx104_names;
If the device has a gpio-controller tagged node in a device tree, it is better
to use gpio-line-names = "foo" ...; for this. For ACPI there is something
similar.
If it is spawn from this device without any GPIO child node or hardware
description outside of the kernel driver, such as
ISA/PCI or whatever, this is a good way.
This is an isa_driver and falls in the latter category, so:
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
Yours,
Linus Walleij
Powered by blists - more mailing lists