add SAMA5D2 PIOBU GPIO driver
Subsystems (4)
v3 cover add SAMA5D2 PIOBU GPIO driver
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).
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
v2:
- 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:
reg = PIOBU_BASE + pin * PIOBU_REG_SIZE;
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/gpio-sama5d2-piobu.c | 253 +++++++++++++++++++++ 3 files changed, 270 insertions(+), 1 deletion(-) create mode 100644 drivers/gpio/gpio-sama5d2-piobu.c
Signature · 1 line
2.7.4
PATCH v3 1/2 dt-bindings: arm: atmel: describe SECUMOD usage as a GPIO controller
This patch describes the Security Module's usage as a GPIO controller for its PIOBU pins. These pins have the special property of maintaining their voltage during suspend-to-mem.
--- Documentation/devicetree/bindings/arm/atmel-sysregs.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/arm/atmel-sysregs.txt +11 -1
@@ -158,14 +158,24 @@ Security Module (SECUMOD) The Security Module macrocell provides all necessary secure functions to avoid voltage, temperature, frequency and mechanical attacks on the chip. It also -embeds secure memories that can be scrambled +embeds secure memories that can be scrambled. + +The Security Module also offers the PIOBU pins which can be used as GPIO pins. +Note that they maintain their voltage during Backup/Self-refresh. required properties: - compatible: Should be "atmel,<chip>-secumod", "syscon". <chip> can be "sama5d2". - reg: Should contain registers location and length +- gpio-controller: Marks the port as GPIO controller. +- #gpio-cells: There are 2. The pin number is the + first, the second represents additional + parameters such as GPIO_ACTIVE_HIGH/LOW. + secumod@fc040000 { compatible = "atmel,sama5d2-secumod", "syscon"; reg = <0xfc040000 0x100>; + gpio-controller; + #gpio-cells = <2>; };
Signature · 1 line
2.7.4
PATCH v3 2/2 gpio: add driver for SAMA5D2 PIOBU pins
In reply to [email protected]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.
--- MAINTAINERS | 6 + drivers/gpio/gpio-sama5d2-piobu.c | 253 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 259 insertions(+) create mode 100644 drivers/gpio/gpio-sama5d2-piobu.c
MAINTAINERS +6 -0
@@ -9760,6 +9760,12 @@ M: Nicolas Ferre <[email protected]> S: Supported F: drivers/power/reset/at91-sama5d2_shdwc.c +MICROCHIP SAMA5D2-COMPATIBLE PIOBU GPIO +M: Andrei Stefanescu <[email protected]> +L: [email protected] (moderated for non-subscribers) +L: [email protected] +F: drivers/gpio/gpio-sama5d2-piobu.c + MICROCHIP SPI DRIVER M: Nicolas Ferre <[email protected]> S: Supported
drivers/gpio/gpio-sama5d2-piobu.c new file +253 -0
253 lines not on this page · raw message
Signature · 1 line
2.7.4