Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1420761 > unrolled thread

Re: [PATCH v2] iio: stx104: Add GPIO support for the Apex Embedded Systems STX104

Started byLinus Walleij <linus.walleij@linaro.org>
First post2016-06-13 14:20 +0200
Last post2016-06-13 14:40 +0200
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.


Contents

  Re: [PATCH v2] iio: stx104: Add GPIO support for the Apex Embedded  Systems STX104 Linus Walleij <linus.walleij@linaro.org> - 2016-06-13 14:20 +0200
    Re: [PATCH v2] iio: stx104: Add GPIO support for the Apex Embedded  Systems STX104 William Breathitt Gray <vilhelm.gray@gmail.com> - 2016-06-13 14:40 +0200

#1420761 — Re: [PATCH v2] iio: stx104: Add GPIO support for the Apex Embedded Systems STX104

FromLinus Walleij <linus.walleij@linaro.org>
Date2016-06-13 14:20 +0200
SubjectRe: [PATCH v2] iio: stx104: Add GPIO support for the Apex Embedded Systems STX104
Message-ID<rJz0t-69B-7@gated-at.bofh.it>
On Fri, Jun 3, 2016 at 7:42 PM, William Breathitt Gray
<vilhelm.gray@gmail.com> wrote:

> The Apex Embedded Systems STX104 device features eight lines of digital
> I/O (four digital inputs and four digital outputs). This patch adds GPIO
> support for these eight lines of digital I/O via GPIOLIB.
>
> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
> ---
> Changes in v2:
>   - Change GPIOLIB Kconfig selection to a dependency for the STX104 Kconfig
>     option; STX104 should only be available to systems configured for GPIOLIB

Are you sure? I just changed the GPIOLIB Kconfig so any arch/thing can
select GPIOLIB, if this driver needs it, it can just select it now.

> +static int stx104_gpio_get_direction(struct gpio_chip *chip,
> +       unsigned int offset)
> +{
> +       if (offset < 4)
> +               return 1;
> +
> +       return 0;
> +}

If this looks so...

> +static int stx104_gpio_direction_input(struct gpio_chip *chip,
> +       unsigned int offset)
> +{
> +       return 0;
> +}
> +
> +static int stx104_gpio_direction_output(struct gpio_chip *chip,
> +       unsigned int offset, int value)
> +{
> +       return 0;
> +}

These should return -EINVAL or -EIO or something if you try to
set the direction to something the line does not support.

Other than that it looks good.

Yours,
Linus Walleij

[toc] | [next] | [standalone]


#1420783

FromWilliam Breathitt Gray <vilhelm.gray@gmail.com>
Date2016-06-13 14:40 +0200
Message-ID<rJzjQ-6gW-37@gated-at.bofh.it>
In reply to#1420761
On Mon, Jun 13, 2016 at 02:15:43PM +0200, Linus Walleij wrote:
>On Fri, Jun 3, 2016 at 7:42 PM, William Breathitt Gray
><vilhelm.gray@gmail.com> wrote:
>
>> The Apex Embedded Systems STX104 device features eight lines of digital
>> I/O (four digital inputs and four digital outputs). This patch adds GPIO
>> support for these eight lines of digital I/O via GPIOLIB.
>>
>> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
>> ---
>> Changes in v2:
>>   - Change GPIOLIB Kconfig selection to a dependency for the STX104 Kconfig
>>     option; STX104 should only be available to systems configured for GPIOLIB
>
>Are you sure? I just changed the GPIOLIB Kconfig so any arch/thing can
>select GPIOLIB, if this driver needs it, it can just select it now.

I did find it strange to get a Kconfig dependency warning message from
the kbuild bot for the m68k arch build. I shall revert back to select
GPIOLIB, since that was my original intention.

>> +static int stx104_gpio_get_direction(struct gpio_chip *chip,
>> +       unsigned int offset)
>> +{
>> +       if (offset < 4)
>> +               return 1;
>> +
>> +       return 0;
>> +}
>
>If this looks so...
>
>> +static int stx104_gpio_direction_input(struct gpio_chip *chip,
>> +       unsigned int offset)
>> +{
>> +       return 0;
>> +}
>> +
>> +static int stx104_gpio_direction_output(struct gpio_chip *chip,
>> +       unsigned int offset, int value)
>> +{
>> +       return 0;
>> +}
>
>These should return -EINVAL or -EIO or something if you try to
>set the direction to something the line does not support.

Thanks for the find, I'll fix this up and resubmit.

William Breathitt Gray

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web