All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Hauke Mehrtens <hauke@hauke-m.de>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Gabor Juhos <juhosg@openwrt.org>,
	Miguel Gaio <miguel.gaio@efixo.com>
Subject: Re: [PATCH] gpio: sn54hc595: new driver for GPIO shift registers chipsets
Date: Mon, 08 Dec 2014 16:41:10 +0100	[thread overview]
Message-ID: <2176453.HD1opzG9Wg@wuerfel> (raw)
In-Reply-To: <CACna6rwRR7FpS97Znyk3ewVW58dn5yYTj8OjCstsuzzX8Prg5Q@mail.gmail.com>

On Monday 08 December 2014 16:23:01 Rafał Miłecki wrote:
> On 8 December 2014 at 16:03, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > Hi Rafał,
> >
> > On Mon, Dec 8, 2014 at 3:47 PM, Rafał Miłecki <zajec5@gmail.com> wrote:
> >> On 8 December 2014 at 15:41, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> >>> On Mon, Dec 8, 2014 at 3:27 PM, Rafał Miłecki <zajec5@gmail.com> wrote:
> >>>> SN54HC595 and SN74HC595 are devices based on shift registers controlled
> >>>> with 5 input signals (serial-in) and providing 8 outputs (parallel-out).
> >>>>
> >>>> They are present on some Broadcom home router boards where manufacturer
> >>>> needed few extra GPIOs.
> >>>>
> >>>> This driver simply uses specified GPIOs to control shift registers and
> >>>> registers another GPIO chip. So you can call it a GPIO extender.
> >>>>
> >>>> Due to the hardware design only output direction is supported. Reading
> >>>> values is handled using tiny internal cache.
> >>>>
> >>>> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> >>>> ---
> >>>>  .../devicetree/bindings/gpio/gpio-sn54hc595.txt    |  35 ++++
> >>>>  drivers/gpio/Kconfig                               |  11 ++
> >>>>  drivers/gpio/Makefile                              |   1 +
> >>>>  drivers/gpio/gpio-sn54hc595.c                      | 219 +++++++++++++++++++++
> >>>
> >>> The '595 is already handled by drivers/gpio/gpio-74x164.c.
> >>
> >> gpio-74x164.c seems to be tight closely to the SPI. In my case it's
> >> GPIO-controller '595.
> >
> > Right. gpio-74x164.c uses the SPI framework, so it will work with any SPI
> > master controller, while your driver contains a very simple variant (without any
> > timing constraints) of spi-gpio.c, and is limited to connecting to GPIO pins.
> >
> >> Do you have any other idea how we could handle this?
> >
> > Your driver does provide OE support, which gpio-74x164 doesn't support.
> > Perhaps that can be added to gpio-74x164 instead?
> 
> It's not the missing OE support in gpio-74x164 that worries me, but
> the whole rest.
> 
> I would need to modify gpio-74x164 to:
> 1) Use another OF table with different entry
> 2) Use different probe function that doesn't take spi_device parameter
> and doesn't do spi setup
> 3) Extend struct gen_74x164_chip to include GPIOs
> 4) Use totally different __gen_74x164_write_config

I think the suggestion was to use the spi-gpio driver in combination
with gpio-74x164.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-12-08 15:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-08 14:27 [PATCH] gpio: sn54hc595: new driver for GPIO shift registers chipsets Rafał Miłecki
2014-12-08 14:41 ` Geert Uytterhoeven
2014-12-08 14:47   ` Rafał Miłecki
2014-12-08 15:03     ` Geert Uytterhoeven
2014-12-08 15:23       ` Rafał Miłecki
2014-12-08 15:41         ` Arnd Bergmann [this message]
2014-12-08 16:31           ` Rafał Miłecki
2014-12-08 16:56             ` Arnd Bergmann
2014-12-09  9:09               ` Maxime Ripard
2014-12-08 16:59             ` Geert Uytterhoeven
2014-12-09  9:12               ` Maxime Ripard
2014-12-11 10:36                 ` Rafał Miłecki
2014-12-11 11:03                   ` Geert Uytterhoeven

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=2176453.HD1opzG9Wg@wuerfel \
    --to=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=gnurou@gmail.com \
    --cc=hauke@hauke-m.de \
    --cc=juhosg@openwrt.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=miguel.gaio@efixo.com \
    --cc=zajec5@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.