aboutsummaryrefslogtreecommitdiff
path: root/drivers/power/reset/gpio-poweroff.c
AgeCommit message (Collapse)AuthorFilesLines
2023-10-13power: reset: gpio-poweroff: make sys handler priority configurableStefan Eichenberger1-2/+7
Add a priority property equal to gpio-restart to allow increasing the priority of the gpio-poweroff handler. Signed-off-by: Stefan Eichenberger <[email protected]> Signed-off-by: Francesco Dolcini <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2023-10-13power: reset: gpio-poweroff: use sys-off handler APIStefan Eichenberger1-25/+12
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 <[email protected]> Signed-off-by: Francesco Dolcini <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2023-10-13power: reset: gpio-poweroff: use a struct to store the module variablesStefan Eichenberger1-17/+31
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 <[email protected]> Signed-off-by: Francesco Dolcini <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2023-07-19power: Explicitly include correct DT includesRob Herring1-1/+2
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 <[email protected]> Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2023-04-13power: reset: remove MODULE_LICENSE in non-modulesNick Alcock1-1/+0
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 <[email protected]> Suggested-by: Luis Chamberlain <[email protected]> Cc: Luis Chamberlain <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Hitomi Hasegawa <[email protected]> Cc: Sebastian Reichel <[email protected]> Cc: [email protected] Signed-off-by: Luis Chamberlain <[email protected]>
2021-06-04power: reset: gpio-poweroff: add missing MODULE_DEVICE_TABLEBixuan Cui1-0/+1
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 <[email protected]> Signed-off-by: Bixuan Cui <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2020-06-06power: reset: gpio-poweroff: add missing '\n' in dev_err()Luca Ceresoli1-1/+1
dev_err() needs a terminating newline. Signed-off-by: Luca Ceresoli <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-5/+1
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 <[email protected]> Reviewed-by: Enrico Weigelt <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Reviewed-by: Allison Randal <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-12-05power: reset: gpio-poweroff: add ability to specific active and inactive delaysHeiko Stuebner1-2/+8
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 <[email protected]> Reviewed-by: Rob Herring <[email protected]> Reviewed-by: Moritz Fischer <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2018-04-25gpio-poweroff: Use gpiod_set_value_cansleepMike Looijmans1-2/+2
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2018-03-09power: reset: gpio-poweroff: Support for timeout from device propertyMoritz Fischer1-2/+6
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2015-05-23power: reset: gpio-poweroff: let devm_gpiod_get set direction of gpioUwe Kleine-König1-17/+8
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 <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2014-10-20power: reset: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <[email protected]>
2014-07-18power: poweroff: gpio: convert to use descriptorsLinus Walleij1-33/+19
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 <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2013-01-08Merge tag 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds1-18/+15
Pull ARM SoC fixes from Olof Johansson: "People are back from the holiday breaks, and it shows. Here are a bunch of fixes for a number of platforms: - A couple of small fixes for Nomadik - A larger set of changes for kirkwood/mvebu - uart driver selection, dt clocks, gpio-poweroff fixups, a few __init annotation fixes and some error handling improvement in their xor dma driver. - i.MX had a couple of minor fixes (and a critical one for flexcan2 clock setup) - MXS has a small board fix and a framebuffer bugfix - A set of fixes for Samsung Exynos, fixing default bootargs and some Exynos5440 clock issues - A set of OMAP changes including PM fixes and a few sparse warning fixups All in all a bit more positive code delta than we'd ideally want to see here, mostly from the OMAP PM changes, but nothing overly crazy." * tag 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (44 commits) ARM: clps711x: Fix bad merge of clockevents setup ARM: highbank: save and restore L2 cache and GIC on suspend ARM: highbank: add a power request clear ARM: highbank: fix secondary boot and hotplug ARM: highbank: fix typos with hignbank in power request functions ARM: dts: fix highbank cpu mpidr values ARM: dts: add device_type prop to cpu nodes on Calxeda platforms ARM: mx5: Fix MX53 flexcan2 clock ARM: OMAP2+: am33xx-hwmod: Fix wrongly terminated am33xx_usbss_mpu_irqs array pinctrl: mvebu: make pdma clock on dove mandatory ARM: Dove: Add pinctrl clock to DT dma: mv_xor: fix error handling for clocks dma: mv_xor: fix error handling of mv_xor_channel_add() arm: mvebu: Add missing ; for cpu node. arm: mvebu: Armada XP MV78230 has only three Ethernet interfaces arm: mvebu: Armada XP MV78230 has two cores, not one clk: mvebu: Remove inappropriate __init tagging ARM: Kirkwood: Use fixed-regulator instead of board gpio call ARM: Kirkwood: Fix missing sdio clock ARM: Kirkwood: Switch TWSI1 of 88f6282 to DT clock providers ...
2013-01-06Power: gpio-poweroff: Fix documentation and gpio_is_validAndrew Lunn1-18/+15
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 <[email protected]> Signed-off-by: Andrew Lunn <[email protected]> Signed-off-by: Jason Cooper <[email protected]>
2013-01-03Drivers: power: remove __dev* attributes.Greg Kroah-Hartman1-3/+3
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 <[email protected]> Cc: Anton Vorontsov <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Andrew Lunn <[email protected]> Cc: Jamie Lentin <[email protected]> Cc: Jason Cooper <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-24power: Add simple poweroff-gpio driverJamie Lentin1-0/+129
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 <[email protected]> Signed-off-by: Andrew Lunn <[email protected]> Tested-by:Simon Baatz <[email protected]> Signed-off-by: Jason Cooper <[email protected]>