Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1570535 > unrolled thread
| Started by | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| First post | 2017-01-31 10:50 +0100 |
| Last post | 2017-01-31 20:00 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] iio: stx104: Add support for GPIO names Linus Walleij <linus.walleij@linaro.org> - 2017-01-31 10:50 +0100
Re: [PATCH] iio: stx104: Add support for GPIO names Jonathan Cameron <jic23@kernel.org> - 2017-01-31 20:00 +0100
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2017-01-31 10:50 +0100 |
| Subject | Re: [PATCH] iio: stx104: Add support for GPIO names |
| Message-ID | <t5Dey-7w7-29@gated-at.bofh.it> |
On Mon, Jan 30, 2017 at 6:16 PM, William Breathitt Gray
<vilhelm.gray@gmail.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@gmail.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@linaro.org>
Yours,
Linus Walleij
[toc] | [next] | [standalone]
| From | Jonathan Cameron <jic23@kernel.org> |
|---|---|
| Date | 2017-01-31 20:00 +0100 |
| Message-ID | <t5LOO-4b0-39@gated-at.bofh.it> |
| In reply to | #1570535 |
On 31/01/17 09:41, Linus Walleij wrote:
> On Mon, Jan 30, 2017 at 6:16 PM, William Breathitt Gray
> <vilhelm.gray@gmail.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@gmail.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@linaro.org>
Cool.. thanks for the info as well.
Applied to the togreg branch of iio.git. Will push out as testing in a few minutes
to let the autobuilders play with it.
Thanks,
Jonathan
>
> Yours,
> Linus Walleij
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web