linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-watchdog@vger.kernel.org,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	kernel <kernel@savoirfairelinux.com>,
	Rob Herring <robh@kernel.org>, Guenter Roeck <linux@roeck-us.net>,
	Shawn Guo <shawnguo@kernel.org>,
	Fabio Estevam <fabio.estevam@nxp.com>,
	Mark Featherston <mark@embeddedarm.com>,
	kris@embeddedarm.com
Subject: Re: [PATCH v3 4/6] bus: add driver for the Technologic Systems NBUS
Date: Thu, 11 May 2017 15:56:00 +0200	[thread overview]
Message-ID: <CACRpkda0WdJQEm5i_LMB1o+c1R9Ux1T31SOAM0NUyucCz48NXw@mail.gmail.com> (raw)
In-Reply-To: <20170505193259.16517-5-sebastien.bourdelin@savoirfairelinux.com>

On Fri, May 5, 2017 at 9:32 PM, Sebastien Bourdelin
<sebastien.bourdelin@savoirfairelinux.com> wrote:

> This driver implements a GPIOs bit-banged bus, called the NBUS by
> Technologic Systems. It is used to communicate with the peripherals in
> the FPGA on the TS-4600 SoM.
>
> Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
> ---
> Changes v2 -> v3:

This driver is pretty.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

For future development (that is not about this patch, please
merge this):

> +static int ts_nbus_read_byte(struct ts_nbus *ts_nbus, u8 *val)
> +{
> +       struct gpio_descs *gpios = ts_nbus->data;
> +       int ret, i;
> +
> +       *val = 0;
> +       for (i = 0; i < 8; i++) {
> +               ret = gpiod_get_value_cansleep(gpios->desc[i]);
> +               if (ret < 0)
> +                       return ret;
> +               if (ret)
> +                       *val |= BIT(i);
> +       }
> +
> +       return 0;
> +}

That makes it pretty obvious that we really need gpiod_get_array_cansleep()
does it not. That would just become some single register read in
this case.

If you get some time one of these days and wand to have a go at adding
it to gpiolib using this driver as a testbed, do not hesitate.

Yours,
Linus Walleij

  reply	other threads:[~2017-05-11 13:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05 19:32 [PATCH v3 0/6] Add board support for TS-4600 Sebastien Bourdelin
2017-05-05 19:32 ` [PATCH v3 1/6] of: documentation: add bindings documentation " Sebastien Bourdelin
2017-05-05 19:32 ` [PATCH v3 2/6] ARM: dts: TS-4600: add basic device tree Sebastien Bourdelin
2017-05-05 19:32 ` [PATCH v3 3/6] dt-bindings: bus: Add documentation for the Technologic Systems NBUS Sebastien Bourdelin
2017-05-11 13:50   ` Linus Walleij
2017-05-12 15:17   ` Rob Herring
2017-05-05 19:32 ` [PATCH v3 4/6] bus: add driver " Sebastien Bourdelin
2017-05-11 13:56   ` Linus Walleij [this message]
2017-05-05 19:32 ` [PATCH v3 5/6] ARM: dts: TS-4600: add NBUS support Sebastien Bourdelin
2017-05-11 13:56   ` Linus Walleij
2017-05-05 19:32 ` [PATCH v3 6/6] watchdog: ts4600: add driver for TS-4600 watchdog Sebastien Bourdelin
2017-05-08 13:27   ` Rob Herring
2017-05-11  7:22   ` Shawn Guo
2017-05-14 14:39     ` Guenter Roeck
2017-05-15  2:00       ` Shawn Guo
2017-05-15  2:30         ` Guenter Roeck
2017-05-14 14:40   ` Guenter Roeck

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=CACRpkda0WdJQEm5i_LMB1o+c1R9Ux1T31SOAM0NUyucCz48NXw@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fabio.estevam@nxp.com \
    --cc=kernel@savoirfairelinux.com \
    --cc=kris@embeddedarm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mark@embeddedarm.com \
    --cc=robh@kernel.org \
    --cc=sebastien.bourdelin@savoirfairelinux.com \
    --cc=shawnguo@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;
as well as URLs for NNTP newsgroup(s).