linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] GPIO: add single-register gpio via creg driver
@ 2018-08-23 15:00 Eugeniy Paltsev
  2018-08-23 15:00 ` [PATCH 1/2] " Eugeniy Paltsev
  2018-08-23 15:00 ` [PATCH 2/2] dt-bindings: Document the Synopsys GPIO via CREG bindings Eugeniy Paltsev
  0 siblings, 2 replies; 5+ messages in thread
From: Eugeniy Paltsev @ 2018-08-23 15:00 UTC (permalink / raw)
  To: linux-snps-arc, linux-gpio
  Cc: linux-kernel, Vineet Gupta, Alexey Brodkin, Linus Walleij,
	Rob Herring, devicetree, Mark Rutland, Eugeniy Paltsev

Add single-register MMIO gpio driver for complex cases where
only several fields in register belong to GPIO and each GPIO
owns field with different length and on/off values.

Here is the example:

31            11        8         7        5         0   < bit number
|              |        |         |        |         |
[   not used   | gpio-1 | shift-1 | gpio-0 | shift-0 ]   < 32 bit MMIO
                   ^                  ^
                (3 bit)            (2 bit)
                   |                  |
                   |                  |
                   |           write 0x2 == set output to "1" (on)
                   |           write 0x3 == set output to "0" (off)
                   |
            write 0x1 == set output to "1" (on)
            write 0x4 == set output to "0" (off)

This is different from gpio-reg, gpio-mmio and gpio-74xx-mmio:
* They all don't support cases when GPIO output register have
  more than one bit per GPIO line.
* They don't support holes in MMIO register.
* They don't support cases when GPIO lines have different on/off
  values.

This driver supports GPIOs via CREG on various Synopsys SoCs/boards.

Eugeniy Paltsev (2):
  GPIO: add single-register gpio via creg driver
  dt-bindings: Document the Synopsys GPIO via CREG bindings

 .../devicetree/bindings/gpio/snps,creg-gpio.txt    |  48 ++++
 MAINTAINERS                                        |   6 +
 drivers/gpio/Kconfig                               |   9 +
 drivers/gpio/Makefile                              |   1 +
 drivers/gpio/gpio-creg-snps.c                      | 242 +++++++++++++++++++++
 5 files changed, 306 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/snps,creg-gpio.txt
 create mode 100644 drivers/gpio/gpio-creg-snps.c

-- 
2.14.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-28 11:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-23 15:00 [PATCH 0/2] GPIO: add single-register gpio via creg driver Eugeniy Paltsev
2018-08-23 15:00 ` [PATCH 1/2] " Eugeniy Paltsev
2018-08-23 15:08   ` Randy Dunlap
2018-08-28 11:04     ` Eugeniy Paltsev
2018-08-23 15:00 ` [PATCH 2/2] dt-bindings: Document the Synopsys GPIO via CREG bindings Eugeniy Paltsev

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).