mbox series

[v4,0/2] add SAMA5D2 PIOBU GPIO driver

Message ID 1544615784-29331-1-git-send-email-andrei.stefanescu@microchip.com
Headers show
Series add SAMA5D2 PIOBU GPIO driver | expand


Andrei.Stefanescu@microchip.com Dec. 12, 2018, 11:56 a.m. UTC
On SAMA5D2 SoC the PIOBU pins do not lose their
voltage during Backup/Self-refresh mode. This can
be useful, for example, when the voltage must remain
positive for a peripheral during Backup/Self-refresh
mode (suspend-to ram is the Linux equivalent state).

- readd Makefile and Kconfig changes which are missing in v3

- change driver's compatible to atmel,sama5d2-secumod
- get syscon using syscon_node_to_regmap(pdev->dev.of_node)
- document how to use SECUMOD as a gpio-controller

- make driver be a subnode of the syscon node
- change Kconfig to depend on MFD_SYSCON and select GPIO_SYSCON
- change include header from linux/gpio.h to linux/gpio/driver.h
- include linux/bits.h header
- change intrusion in comment to tamper
- fix kerneldoc of functions
- replace GPIOF_DIR_* flags with 0/1
- replace ?: statement with if-else
- remove the use of sama5d2_piobu_template_chip
- retrieve syscon via syscon_node_to_regmap(pdev->dev.parent->of_node);

Note that PIOBU_REG_SIZE is used to determine the register to write to
with regmap:

Also, no irq capability implemented.

Andrei Stefanescu (2):
  dt-bindings: arm: atmel: describe SECUMOD usage as a GPIO controller
  gpio: add driver for SAMA5D2 PIOBU pins

 .../devicetree/bindings/arm/atmel-sysregs.txt      |  12 +-
 MAINTAINERS                                        |   6 +
 drivers/gpio/Kconfig                               |  11 +
 drivers/gpio/Makefile                              |   1 +
 drivers/gpio/gpio-sama5d2-piobu.c                  | 253 +++++++++++++++++++++
 5 files changed, 282 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpio/gpio-sama5d2-piobu.c


Linus Walleij Dec. 21, 2018, 9:57 a.m. UTC | #1
On Wed, Dec 12, 2018 at 12:57 PM <Andrei.Stefanescu@microchip.com> wrote:

> PIOBU pins do not lose their voltage during Backup/Self-refresh.
> This patch adds a simple GPIO controller for them and a
> maintainer for the driver.
> This driver adds support for using the pins as GPIO
> offering the possibility to read/set the voltage.
> Signed-off-by: Andrei Stefanescu <andrei.stefanescu@microchip.com>

Patch applied for v4.21, sorry for taking so long to reply!

Good work on this driver Andrei, it looks really nice now.

Linus Walleij