History log of /linux-master/drivers/power/reset/gpio-poweroff.c
Revision Date Author Comments
# d03d2a8c 06-Oct-2023 Stefan Eichenberger <stefan.eichenberger@toradex.com>

power: reset: gpio-poweroff: make sys handler priority configurable

Add a priority property equal to gpio-restart to allow increasing the
priority of the gpio-poweroff handler.

Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Link: https://lore.kernel.org/r/20231006130428.11259-5-francesco@dolcini.it
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>


# b16d9f49 06-Oct-2023 Stefan Eichenberger <stefan.eichenberger@toradex.com>

power: reset: gpio-poweroff: use sys-off handler API

Use the new sys-off handler API for gpio-poweroff. This allows us to
have more than one poweroff handler and prioritise them.

Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Link: https://lore.kernel.org/r/20231006130428.11259-3-francesco@dolcini.it
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>


# 13b4c696 06-Oct-2023 Stefan Eichenberger <stefan.eichenberger@toradex.com>

power: reset: gpio-poweroff: use a struct to store the module variables

Use a struct to store the module variables. This is required to later
move to notifier_blocks where we can have several instances.

Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Link: https://lore.kernel.org/r/20231006130428.11259-2-francesco@dolcini.it
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>


# 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>


# ed3443fb 07-May-2021 Bixuan Cui <cuibixuan@huawei.com>

power: reset: gpio-poweroff: add missing MODULE_DEVICE_TABLE

This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>


# 5a1c9565 03-Jun-2020 Luca Ceresoli <luca@lucaceresoli.net>

power: reset: gpio-poweroff: add missing '\n' in dev_err()

dev_err() needs a terminating newline.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>


# d2912cb1 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

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

Based on 2 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

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

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 76ee875c 11-Nov-2018 Heiko Stuebner <heiko.stuebner@bq.com>

power: reset: gpio-poweroff: add ability to specific active and inactive delays

Similar to gpio-reset allow to specify active and inactive delays
while keeping the 100ms defaults that were used previously all the time.

The dt-properties are named the same as in gpio-reset but get an "-ms"
suffix as properties should contain such a suffix specifying its unit.

Signed-off-by: Heiko Stuebner <heiko.stuebner@bq.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>


# 77142a61 24-Apr-2018 Mike Looijmans <mike.looijmans@topic.nl>

gpio-poweroff: Use gpiod_set_value_cansleep

The power-off call is done in a context that must be able to sleep, so
use gpiod_set_value_cansleep instead of the atomic gpiod_set_value call.

This fixes a kernel warning at shutdown when the gpio is controlled
through an IO expander for example.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>


# d85b4f7b 22-Feb-2018 Moritz Fischer <mdf@kernel.org>

power: reset: gpio-poweroff: Support for timeout from device property

Add support for reading a timeout value from device property.
Fall back to previous default of 3s if nothing is specified.

Signed-off-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# a34c0a8b 18-May-2015 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

power: reset: gpio-poweroff: let devm_gpiod_get set direction of gpio

Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
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>


# 86336ba4 06-Jul-2014 Linus Walleij <linus.walleij@linaro.org>

power: poweroff: gpio: convert to use descriptors

This switches the GPIO poweroff driver to use GPIO descriptors
rather than numeral GPIOs. We get rid of the specific inversion
handling as GPIO descriptors know if they are active low or
high and can assert the line properly, so we do not need to
check the flag OF_GPIO_ACTIVE_LOW returned from the old call
of_get_gpio_flags() anymore.

Also convert to use managed resources and use dev_* message
printing while we're at it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 5343527b 06-Jan-2013 Andrew Lunn <andrew@lunn.ch>

Power: gpio-poweroff: Fix documentation and gpio_is_valid

Improve the documentation to clarify level vs edge triggered power off.
Improve the comments for level vs edge triggered power off.
Make use of gpio_is_valid().

Reported-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>


# 6d2cea4f 21-Dec-2012 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Drivers: power: remove __dev* attributes.

CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
markings need to be removed.

This change removes the use of __devinit, __devexit_p, __devinitconst,
and __devexit from these drivers.

Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Jamie Lentin <jm@lentin.co.uk>
Cc: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 96ff0f5c 17-Nov-2012 Jamie Lentin <jm@lentin.co.uk>

power: Add simple poweroff-gpio driver

Given appropriate devicetree bindings, this driver registers a
pm_power_off function to set a GPIO line high/low to power down
your board.

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by:Simon Baatz <gmbnomis@gmail.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>