linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: William Breathitt Gray <vilhelm.gray@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] iio: stx104: Add GPIO support for the Apex Embedded Systems STX104
Date: Mon, 13 Jun 2016 14:15:43 +0200	[thread overview]
Message-ID: <CACRpkda+5LmMSFia=R8P=xqd8Hh6h-gvTqjaxqr0OqJH5pkFuw@mail.gmail.com> (raw)
In-Reply-To: <1464975762-24052-1-git-send-email-vilhelm.gray@gmail.com>

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

  parent reply	other threads:[~2016-06-13 12:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-03 17:42 [PATCH v2] iio: stx104: Add GPIO support for the Apex Embedded Systems STX104 William Breathitt Gray
2016-06-11 16:43 ` Jonathan Cameron
2016-06-13 12:15 ` Linus Walleij [this message]
2016-06-13 12:39   ` William Breathitt Gray

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='CACRpkda+5LmMSFia=R8P=xqd8Hh6h-gvTqjaxqr0OqJH5pkFuw@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=vilhelm.gray@gmail.com \
    /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).