summaryrefslogtreecommitdiff
path: root/drivers/power/reset/at91-poweroff.c
AgeCommit message (Collapse)Author
2018-12-06power: reset: at91-poweroff: move shdwc related data to one structureClaudiu Beznea
Move SHDWC realted data to only one structure to have them grouped. Inspired from commit 9be74f0d39c1 ("power: reset: at91-poweroff: make mpddrc_base part of struct shdwc"). Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-12-05power: reset: at91-poweroff: remove at91_ramc_of_matchClaudiu.Beznea@microchip.com
Remove at91_ramc_of_match[] since it is not used anywhere in this code. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-12-05power: reset: at91-poweroff: use one poweroff function for at91-poweroffClaudiu.Beznea@microchip.com
Use only one poweroff function and adapt it to work for both scenarios (with LPDDR or not). The assignement of pm_power_off was moved at the end of probe after all initializations are OK. This patch adapt the idea from commit 4e018c1e9b05 ("power: reset: at91-poweroff: use only one poweroff function"). Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-03-19power: reset: at91-poweroff: Remove redundant dev_err call in ↵Ladislav Michl
at91_poweroff_probe() There is an error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundancy. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-19power: reset: at91-poweroff: Switch from the pr_*() to the dev_*() logging ↵Ladislav Michl
functions Use dev_info() instead of pr_info(). Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-06-08power: reset: at91-poweroff: fix clobber listAlexandre Belloni
Assembly in at91_lpddr_poweroff has r0 in the clobber list but uses r6. Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2017-01-16power: reset: at91-poweroff: timely shutdown LPDDR memoriesAlexandre Belloni
LPDDR memories can only handle up to 400 uncontrolled power off. Ensure the proper power off sequence is used before shutting down the platform. Cc: <stable@vger.kernel.org> # 4.4+ Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-10-19power: reset: at91-poweroff: Fix module autoloadJavier Martinez Canillas
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/power/reset/at91-poweroff.ko | grep alias $ After this patch: $ modinfo drivers/power/reset/at91-poweroff.ko | grep alias alias: of:N*T*Catmel,at91sam9x5-shdwcC* alias: of:N*T*Catmel,at91sam9x5-shdwc alias: of:N*T*Catmel,at91sam9rl-shdwcC* alias: of:N*T*Catmel,at91sam9rl-shdwc alias: of:N*T*Catmel,at91sam9260-shdwcC* alias: of:N*T*Catmel,at91sam9260-shdwc Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-09-22power/reset: at91-poweroff: get and use slow clockAlexandre Belloni
Commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system hang") added a workaround for the slow clock as it is not properly handled by its users. Get and use the slow clock as it is necessary for the at91 shutdown controller. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-09-22power/reset: at91-poweroff: allow compiling as a moduleAlexandre Belloni
It was not possible to compile at91-poweroff as a module. Implement .remove() to allow it. Also switch to module_platform_driver_probe() as it is not hotpluggable. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-03-20power: constify of_device_id arrayFabian Frederick
of_device_id is always used as const. (See driver.of_match_table and open firmware functions) Signed-off-by: Fabian Frederick <fabf@skynet.be> [for vexpress] Acked-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-01-21power/reset: at91-poweroff: Fix error handling and other compiler warningsGuenter Roeck
at91_poweroff_get_wakeup_mode can return a negative error code and should therefore not return an enum type. Similar, its result should not be assigned to an enum type. Otherwise, the returned value is never negative, resulting in a compiler warning and a missed error condition, which in turn results in writing bad values into a chip register. Also fix other compiler warnings which can be easily avoided. drivers/power/reset/at91-poweroff.c:74:24: warning: type qualifiers ignored on function return type drivers/power/reset/at91-poweroff.c:74:24: warning: no previous prototype for 'at91_poweroff_get_wakeup_mode' drivers/power/reset/at91-poweroff.c:83:16: warning: comparison between signed and unsigned integer expressions drivers/power/reset/at91-poweroff.c:97:2: warning: comparison of unsigned expression < 0 is always false Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2014-09-01power: reset: at91-poweroff: fix wakeup status register indexNicolas Ferre
The wakeup status is read from Shutdown Status Register and not the SHDW_CR which is the one at address 0. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2014-07-15power: reset: Add AT91 poweroff driverMaxime Ripard
Add a driver to handle the shutdown of the Atmel SoCs. This code used to be (and still is) in arch/arm/mach-at91. We didn't remove it yet so that we can convert all the boards to using this driver, before removing it entirely in a separate patch. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>