History log of /linux-master/drivers/power/reset/gpio-restart.c
Revision Date Author Comments
# c04c4ebd 17-Nov-2023 Andrew Davis <afd@ti.com>

power: reset: gpio-restart: Use devm_register_sys_off_handler()

Use device life-cycle managed register function to simplify probe error
path and eliminate need for explicit remove function.

Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>


# 2ce8284c 18-Jul-2023 Rob Herring <robh@kernel.org>

power: Explicitly include correct DT includes

The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Acked-by: David Lechner <david@lechnology.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>


# aafbf04f 14-Apr-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

power: reset: gpio-restart: Convert to platform remove callback returning void

Returning an error code from a remove callback makes the driver core
emit a generic (and so little helpful) error message and after that the
error code is ignored and the device unbound.

As gpio_restart_remove() already emits an error message, suppressing the
generic error is no loss.

Then convert to .remove_new() which is equivalent to returning 0
unconditionally in .remove(). See commit 5c5a7680e67b ("platform:
Provide a remove callback that returns no value") for its rational.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>


# 24e4dba2 07-Mar-2023 Nick Alcock <nick.alcock@oracle.com>

power: reset: remove MODULE_LICENSE in non-modules

Since commit 8b41fc4454e ("kbuild: create modules.builtin without
Makefile.modbuiltin or tristate.conf"), MODULE_LICENSE declarations
are used to identify modules. As a consequence, uses of the macro
in non-modules will cause modprobe to misidentify their containing
object file as a module when it is not (false positives), and modprobe
might succeed rather than failing with a suitable error message.

So remove it in the files in this commit, none of which can be built as
modules.

Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Suggested-by: Luis Chamberlain <mcgrof@kernel.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: linux-modules@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Hitomi Hasegawa <hasegawa-hitomi@fujitsu.com>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>


# b0d0d3de 29-Oct-2019 Chris Packham <chris.packham@alliedtelesis.co.nz>

power: reset: gpio-restart: don't error on deferral

Don't generate an error message when devm_gpiod_get fails with
-EPROBE_DEFER.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>


# 0e063317 02-Sep-2019 Michal Simek <michal.simek@xilinx.com>

power: reset: gpio-restart: Fix typo when gpio reset is not found

Trivial patch which just corrects error message.

Fixes: 371bb20d6927 ("power: Add simple gpio-restart driver")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>


# 9c92ab61 29-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282

Based on 1 normalized pattern(s):

this software is licensed under the terms of the gnu general public
license version 2 as published by the free software foundation and
may be copied distributed and modified under those terms this
program is distributed in the hope that it will be useful but
without any warranty without even the implied warranty of
merchantability or fitness for a particular purpose see the gnu
general public license for more details

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 285 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190529141900.642774971@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# bcd56fe1 02-Jun-2015 Heiko Stübner <heiko@sntech.de>

power: reset: gpio-restart: increase priority slightly

gpio-restart uses a priority of 128 and currently most soc-level restart
mechanisms use the same - with some exceptions even using 192.
But while the soc-level restarts are provided by the soc itself,
gpio-restarts will most of the time be board-specfic and be used
when some special board condition makes the soc-level restart
only a second choice.

The problem at hand manifested itself on the rk3288-veyron devices.
While the soc-level restart can sucessfully restart all other rockchip
boards I have, the veyron devices use an external restart mechanism that
seems to not only reset the soc but also some external needed components.

With both restart handlers having priority 128 in my tests the soc-specific
variant took precedent in all cases. While it could restart the soc
sucessfully in all cases, firmware then got an issue when talking to an
external component, resulting in the device being put into recovery mode.

So, give the board-specific restart handler a slight push and move it
to priority 129 to make it more important than the generic soc-specific
restart-handler.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 5938ee2b 20-Oct-2014 Wolfram Sang <wsa@kernel.org>

power: reset: drop owner assignment from platform_drivers

A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>


# 371bb20d 27-Aug-2014 David Riley <davidriley@chromium.org>

power: Add simple gpio-restart driver

This driver registers a restart handler to set a GPIO line high/low
to reset a board based on devicetree bindings.

Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sebastian Reichel <sre@kernel.org>