sysreset: Add support for gpio-restart
authorMichal Simek <michal.simek@xilinx.com>
Fri, 13 Jul 2018 09:04:56 +0000 (11:04 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 19 Jul 2018 08:49:55 +0000 (10:49 +0200)
commit0d832b322109e76953bc58e4d2723d2c73dfb604
tree39b8280cee5607447505728a07dcad51e205dc5d
parent501fc50a2964210412cb39679d0ac8e994c40ef8
sysreset: Add support for gpio-restart

The Linux kernel has binding for gpio-restart node.
This patch is adding basic support without supporting any optional
properties.
This driver was tested on Microblaze system where gpio is connected to
SoC reset logic.
Output value is handled via gpios cells values.

In gpio_reboot_request() set_value is writing 1 because
dm_gpio_set_value() is capable to changing it when it is ACTIVE_LOW.
...
if (desc->flags & GPIOD_ACTIVE_LOW)
value = !value;
...

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
MAINTAINERS
drivers/sysreset/Kconfig
drivers/sysreset/Makefile
drivers/sysreset/sysreset_gpio.c [new file with mode: 0644]