linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Arnd Bergmann <arnd@arndb.de>,
	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: Thu, 11 Dec 2014 11:36:56 +0100	[thread overview]
Message-ID: <CACna6rwBO388iF+BJ2=nCEWrNsedag8bbBc+OZYe+pvf4zrmgw@mail.gmail.com> (raw)
In-Reply-To: <20141209091202.GS8739@lukather>

On 9 December 2014 at 10:12, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Mon, Dec 08, 2014 at 05:59:11PM +0100, Geert Uytterhoeven wrote:
>> > I think that implementing support for this extra SPI layer will
>> > actually require more code/tricks than a separated driver.
>>
>> Yes, it will require more code, as spi-gpio is more generic than your simple
>> implementation.  But the end result is more flexible and reusable.
>>
>> The only thing missing is the programmable OE and reset pins,
>> which are assumed hardwired by the gpio-74x164 driver.
>> These could be implemented using new gpio-oe and gpio-reset
>> properties.
>
> From my (very) vague memories of it, OE was actually supported by
> using it as spi-gpio's chip select.
>
> So I'd say that only the gpio-reset should be implemented.

I've tracked how spi_bitbang_transfer_one does work. Long story short it does:
bitbang->chipselect(spi, BITBANG_CS_ACTIVE);
bitbang->txrx_bufs(spi, t);
bitbang->chipselect(spi, BITBANG_CS_INACTIVE);

txrx_bufs is a pointer to one of:
bitbang_txrx_be_cpha0
bitbang_txrx_be_cpha1


Now, in cpha[01] for every register bit we call:
1) setmosi - to set data, so it's serial (SER)
2) setsck - to shift bits, so it's shift register clock (SRCLK)

Then in spi_gpio_chipselect we call:
1) cs_gpios[chip], so it's register clock (RCLK)


As you can see, we don't call OE in spi_gpio_chipselect. So currently
both input signals and unhandled: OE and SRCLR. Luckily for me, it
appears my bootloader puts them in a wanted state, but this still
should be handled somehow.

-- 
Rafał
--
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-11 10:36 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
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 [this message]
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='CACna6rwBO388iF+BJ2=nCEWrNsedag8bbBc+OZYe+pvf4zrmgw@mail.gmail.com' \
    --to=zajec5@gmail.com \
    --cc=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=maxime.ripard@free-electrons.com \
    --cc=miguel.gaio@efixo.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).