summaryrefslogtreecommitdiff
path: root/arch/arm/plat-samsung/pm.c
AgeCommit message (Collapse)Author
2015-12-01ARM: s3c64xx: allow building without board supportArnd Bergmann
Most of the code for the s3c64xx platform is only used when booting with ATAGS based board files, but not when using device-tree. This tries to identify all the s3c64xx specific code that is unneeded when CONFIG_ATAGS is not set, so we can build a smaller DT-only kernel if configured that way. All board support is still left intact but now depends on the CONFIG_ATAGS symbol that users may intentionally disable. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2015-02-27ARM: S3C24XX: fix header file inclusionsArnd Bergmann
The pm-core.h file does not include all the necessary headers, and has a static declaration for a function that is not defined in the same file, causing SAMSUNG_PM_DEBUG to break on s3c24xx: arch/arm/mach-s3c24xx/include/mach/pm-core.h:50:91: warning: 's3c_pm_show_resume_irqs' used but never defined arch/arm/mach-s3c24xx/include/mach/pm-core.h: In function 's3c_pm_debug_init_uart': arch/arm/mach-s3c24xx/include/mach/pm-core.h:16:34: error: 'S3C2410_CLKCON' undeclared (first use in this function) unsigned long tmp = __raw_readl(S3C2410_CLKCON); ^ This moves the code around slightly to avoid the errors. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kukjin Kim <kgene@kernel.org>
2014-03-29Merge tag 'samsung-pm-2' of ↵Arnd Bergmann
git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/cleanup3 Merge "Samsung PM related 2nd updates for v3.15" from Kukjin Kim: From Tomasz Figa <t.figa@samsung.com>: Current Samsung PM code is heavily unprepared for multiplatform systems. The design implies accessing functions and global variables defined in particular mach- subdirectory from common code in plat-, which is not allowed when building ARCH_MULTIPLATFORM. In addition there is a lot of forced code unification, which makes common function handle any possible quirks of all supported SoCs. In the end this design turned out to not work too well, ending with a lot of empty functions exported from mach-, just because code in common pm.c calls them. Moreover, recent trend of moving lower level suspend/resume code to proper drivers, like pinctrl or clk, made a lot of code there redundant, especially on DT-only platforms like Exynos. Note that this branch is based on previous tags/samsung-pm-1 and merge tags/samsung-cleanup-2 because of fix build error from recent changes of <linux/serial_s3c.h> * tag 'samsung-pm-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung: ARM: EXYNOS: Fix compilation error in cpuidle.c ARM: S5P64X0: Explicitly include linux/serial_s3c.h in mach/pm-core.h ARM: S3C64XX: Fix build for implicit serial_s3c.h inclusion serial: s3c: Fix build of header without serial_core.h preinclusion ARM: EXYNOS: Allow wake-up using GIC interrupts ARM: EXYNOS: Stop using legacy Samsung PM code ARM: EXYNOS: Remove PM initcalls and useless indirection ARM: EXYNOS: Fix abuse of CONFIG_PM ARM: SAMSUNG: Move s3c_pm_check_* prototypes to plat/pm-common.h ARM: SAMSUNG: Move common save/restore helpers to separate file ARM: SAMSUNG: Move Samsung PM debug code into separate file ARM: SAMSUNG: Consolidate PM debug functions ARM: SAMSUNG: Use debug_ll_addr() to get UART base address ARM: SAMSUNG: Save UART DIVSLOT register based on SoC type ARM: SAMSUNG: Add soc_is_s3c2410() helper ARM: EXYNOS: Do not resume l2x0 if not enabled before suspend Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2014-03-21ARM: SAMSUNG: Remove hardware.h inclusionSachin Kamat
The contents of this header file are not referenced anywhere in the included .c files except in devs.c. Remove its inclusion. For devs.c, explicitly include sizes.h header for SZ_* macros. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2014-03-21ARM: SAMSUNG: Move common save/restore helpers to separate fileTomasz Figa
To separate legacy PM code from generic helpers, this patch moves the generic register save/restore helpers to a new file called pm-common.c that is compiled always when CONFIG_PM_SLEEP is enabled, to allow platforms that do not want to use the legacy PM code use the generic helpers. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2014-03-21ARM: SAMSUNG: Move Samsung PM debug code into separate fileTomasz Figa
Not all Samsung SoC platforms are going to use the legacy Samsung PM code enabled by CONFIG_SAMSUNG_PM_DEBUG. To allow using Samsung PM debug helpers on such platforms, related code is moved to separate file and a plat/pm-common.h header is added to separate legacy and generic code. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2014-03-21ARM: SAMSUNG: Consolidate PM debug functionsTomasz Figa
This patch removes one-line functions that was used just to pass constant arguments to lower level functions. After previous patches the need for those constants has been eliminated, so the main functions can be called directly. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2014-03-21ARM: SAMSUNG: Use debug_ll_addr() to get UART base addressTomasz Figa
This patch modifies Samsung PM debug helpers to use a multiplatform friendly way of getting base address of debug UART port, so instead of using a per-mach static macro, a generic debug_ll_addr() helper is used. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2014-03-21ARM: SAMSUNG: Save UART DIVSLOT register based on SoC typeTomasz Figa
The only SoC that does not have DIVSLOT register is S3C2410, so instead of exporting a variable for platforms to set if DIVSLOT register should be preserved, it's enough to simply check whether we are running on a S3C2410 instead. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2014-02-14ARM: SAMSUNG: Replace inclusion of plat/regs-serial.h header fileTushar Behera
regs-serial.h only includes linux/serial_s3c.h. Include this header directly to remove unnecessary platform dependency. Signed-off-by: Tushar Behera <tushar.behera@linaro.org> [broonie@linaro.org: Acked for S3C64XX related changes] Acked-by: Mark Brown <broonie@linaro.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2013-12-19ARM: EXYNOS: remove <mach/regs-clock.h> for exynosKukjin Kim
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2013-12-19ARM: EXYNOS: cleanup <mach/regs-irq.h>Kukjin Kim
Remove useless inclusion <mach/regs-irq.h> for exynos. Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2013-12-12ARM: SAMSUNG: Let s3c_pm_do_restore_*() take const sleep_saveDaniel Kurtz
The restore functions do not modify the passed in struct sleep_save, so that parameter can be const. This allows us to pass in const struct. This allows us to use const structs sleep_save to define system registers that will always be restored to a constant value. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2013-07-24ARM: SAMSUNG: Save/restore only selected uart's registersYadwinder Singh Brar
Basically this code gets executed only during debugging i.e when DEBUG_LL & SAMSUNG_PM_DEBUG is on, so required only for UART used for debugging. Since we are removing static iodesc entries for UARTs, so now only the selected (CONFIG_DEBUG_S3C_UART) UART will be ioremapped by the debug_ll_io_init() for DEBUG_LL, so save/restore uart registers only for selected uart. Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2013-06-20Merge tag 'remove-nondt-exynos-3' of ↵Arnd Bergmann
git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/soc From Kukjin Kim: cleanup and removing dead code for only support DT for exynos - remove board file for exynos - remove legacy files which are not used anymore - decouple ARCH_EXYNOS from PLAT_S5P * tag 'remove-nondt-exynos-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung: (35 commits) ARM: EXYNOS: Remove remaining dead code after non-DT support removal ARM: EXYNOS: Remove legacy L2X0 initialization ARM: EXYNOS: Use exynos_init_io() as map_io callback ARM: EXYNOS: Remove custom init_irq callbacks ARM: EXYNOS: Remove mach/regs-usb-phy.h header thermal: exynos: Support both EXYNOS4X12 SoCs ARM: EXYNOS: Remove unused base addresses from mach/map.h header ARM: EXYNOS: Remove mach/irqs.h header ARM: EXYNOS: Select SPARSE_IRQ for Exynos ARM: SAMSUNG: Make legacy MFC support code depend on SAMSUNG_ATAGS ARM: EXYNOS: Remove mach/regs-gpio.h header ARM: EXYNOS: Remove mach/gpio.h ARM: EXYNOS: Remove setup-i2c0.c ARM: EXYNOS: Do not select legacy Kconfig symbols any more ARM: SAMSUNG: Include most of mach/ headers conditionally ARM: EXYNOS: Decouple ARCH_EXYNOS from PLAT_S5P USB: Check for ARCH_EXYNOS separately platform: Check for ARCH_EXYNOS separately ARM: SAMSUNG: Compile legacy IRQ and GPIO PM code only with ATAGS support ARM: EXYNOS: Provide compatibility stubs for PM code in pm-core.h header ... Conflicts: arch/arm/mach-exynos/Kconfig Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2013-06-19ARM: SAMSUNG: Include most of mach/ headers conditionallyTomasz Figa
Since it is illegal to include mach/ headers from source files outside of respective mach-* directory and DT-only Samsung platforms might not have all of them anyway, this patches makes inclusion of them conditional, based on CONFIG_SAMSUNG_ATAGS. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2013-06-11ARM: SAMSUNG: pm: Adjust for pinctrl- and DT-enabled platformsTomasz Figa
This patch makes legacy code on suspend/resume path being executed conditionally, on non-DT platforms only, to fix suspend/resume of DT-enabled systems, for which the code is inappropriate. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> [olof: add #include <linux/of.h>] Signed-off-by: Olof Johansson <olof@lixom.net>
2013-04-19ARM: exynos: prepare for sparse IRQArnd Bergmann
When we enable CONFIG_SPARSE_IRQ, we have to set the value of NR_IRQS in the machine_desc for legacy IRQ domains, and any file referring to the number of interrupts or a specific number must include the mach/irqs.h header file explicitly. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2013-01-30ARM: SAMSUNG: Gracefully exit on suspend failureAbhilash Kesavan
As per the Exynos5250 User Manual: When there are pending interrupt events, WFI/WFE instruction are ignored. To cancel the power-down sequence follow these steps: 1) Disable system power-down using CENTRAL_SEQ_CONFIGURATION register 2) Clear WAKEUP_STAT register 3) Enable interrupt service routine for CPU Code for early wakeup for exynos already exists. Remove the panic on suspend failure, clear the wakeup state register and return 1 from cpu_suspend to indicate a failed suspend (to a user daemon). Older Samsung SoCs have similar panics and I have removed them all. Haven't touched the S3C2410 sleep code. Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2013-01-30ARM: SAMSUNG: using vsnprintf instead of vsprintf for the limit buffer ↵Chen Gang
length 256 the buff is 256 limited, so need use vsnprintf instead of vsprintf Signed-off-by: Chen Gang <gang.chen@asianux.com> Cc: Ben Dooks <ben@fluff.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2012-08-08ARM: Samsung: Make uart_save static in pm.c fileSachin Kamat
Fixes the following sparse warning: arch/arm/plat-samsung/pm.c:77:21: warning: symbol 'uart_save' was not declared. Should it be static? Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2011-09-21ARM: SAMSUNG: Update the name of regarding Samsung GPIOKukjin Kim
According to gpio-samsung.c, this patch updates the name of regarding Samsung GPIO. Basically the samsung_xxx prefix is used in gpio-samsung.c instead of s3c_xxx, because unified name can reduce its complexity. Note: some s3c_xxx stil remains because it is used widely. It will be updated next time. Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2011-07-26Merge branch 'next/devel' of ↵Linus Torvalds
ssh://master.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc * 'next/devel' of ssh://master.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc: (128 commits) ARM: S5P64X0: External Interrupt Support ARM: EXYNOS4: Enable MFC on Samsung NURI ARM: EXYNOS4: Enable MFC on universal_c210 ARM: S5PV210: Enable MFC on Goni ARM: S5P: Add support for MFC device ARM: EXYNOS4: Add support FIMD on SMDKC210 ARM: EXYNOS4: Add platform device and helper functions for FIMD ARM: EXYNOS4: Add resource definition for FIMD ARM: EXYNOS4: Change devname for FIMD clkdev ARM: SAMSUNG: Add IRQ_I2S0 definition ARM: SAMSUNG: Add platform device for idma ARM: EXYNOS4: Add more registers to be saved and restored for PM ARM: EXYNOS4: Add more register addresses of CMU ARM: EXYNOS4: Add platform device for dwmci driver ARM: EXYNOS4: configure rtc-s3c on NURI ARM: EXYNOS4: configure MAX8903 secondary charger on NURI ARM: EXYNOS4: configure ADC on NURI ARM: EXYNOS4: configure MAX17042 fuel gauge on NURI ARM: EXYNOS4: configure regulators and PMIC(MAX8997) on NURI ARM: EXYNOS4: Increase NR_IRQS for devices with more IRQs ... Fix up tons of silly conflicts: - arch/arm/mach-davinci/include/mach/psc.h - arch/arm/mach-exynos4/Kconfig - arch/arm/mach-exynos4/mach-smdkc210.c - arch/arm/mach-exynos4/pm.c - arch/arm/mach-imx/mm-imx1.c - arch/arm/mach-imx/mm-imx21.c - arch/arm/mach-imx/mm-imx25.c - arch/arm/mach-imx/mm-imx27.c - arch/arm/mach-imx/mm-imx31.c - arch/arm/mach-imx/mm-imx35.c - arch/arm/mach-mx5/mm.c - arch/arm/mach-s5pv210/mach-goni.c - arch/arm/mm/Kconfig
2011-07-20ARM: SAMSUNG: Add support for pre-sleep/post-restore gpio controlBen Dooks
Add a callback so that per-arch can do pre-sleep and post-resume gpio configuration so that for the S3C64XX, the GPIO configuration is restored before the sleep mode is cleared. For the S3C64XX case, it means that the GPIOs get set back to normal operation after the restore code puts the original configurations back in after the Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2011-07-02ARM: pm: allow suspend finisher to return error codesRussell King
There are SoCs where attempting to enter a low power state is ignored, and the CPU continues executing instructions with all state preserved. It is over-complex at that point to disable the MMU just to call the resume path. Instead, allow the suspend finisher to return error codes to abort suspend in this circumstance, where the cpu_suspend internals will then unwind the saved state on the stack. Also omit the tlb flush as no changes to the page tables will have happened. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-06-24ARM: pm: hide 1st and 2nd arguments to cpu_suspend from platform codeRussell King
The first and second arguments shouldn't concern platform code, so hide them from each platforms caller. Tested-by: Kevin Hilman <khilman@ti.com> Acked-by: Jean Pihet <j-pihet@ti.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-06-24ARM: pm: samsung: move cpu_suspend into C codeRussell King
Move the call to cpu_suspend into C code, and noticing that all the s3c_cpu_save implementations are now identical, we can move this into the common samsung code. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-06-24ARM: pm: move cpu_init() call into core codeRussell King
As we have core code dealing with CPU suspend/resume, we can re-initialize the CPUs exception banked registers via that code rather than having platforms deal with that level of detail. So, move the call to cpu_init() out of platform code into core code. Tested-by: Kevin Hilman <khilman@ti.com> Acked-by: Jean Pihet <j-pihet@ti.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-04-14ARM: SAMSUNG: Fix warning 's3c_pm_show_resume_irqs' defined but not usedMaurus Cuelenaere
s3c_pm_show_resume_irqs() is used by some s3c_pm_arch_show_resume_irqs() implementations, which get included through mach/pm-core.h. Add __maybe_unused to silence warnings when it isn't used (e.g. on S3C64XX platforms). Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2011-02-22ARM: pm: convert samsung platforms to generic suspend/resume supportRussell King
Tested-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-15Merge branch 'devel-stable' of master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds
* 'devel-stable' of master.kernel.org:/home/rmk/linux-2.6-arm: (161 commits) ARM: pxa: fix building issue of missing physmap.h ARM: mmp: PXA910 drive strength FAST using wrong value ARM: mmp: MMP2 drive strength FAST using wrong value ARM: pxa: fix recursive calls in pxa_low_gpio_chip AT91: Support for gsia18s board AT91: Acme Systems FOX Board G20 board files AT91: board-sam9m10g45ek.c: Remove duplicate inclusion of mach/hardware.h ARM: pxa: fix suspend/resume array index miscalculation ARM: pxa: use cpu_has_ipr() consistently in irq.c ARM: pxa: remove unused variable in clock-pxa3xx.c ARM: pxa: fix warning in zeus.c ARM: sa1111: fix typo in sa1111_retrigger_lowirq() ARM mxs: clkdev related compile fixes ARM i.MX mx31_3ds: Fix MC13783 regulator names ARM: plat-stmp3xxx: irq_data conversion. ARM: plat-spear: irq_data conversion. ARM: plat-orion: irq_data conversion. ARM: plat-omap: irq_data conversion. ARM: plat-nomadik: irq_data conversion. ARM: plat-mxc: irq_data conversion. ... Fix up trivial conflict in arch/arm/plat-omap/gpio.c (Lennert Buytenhek's irq_data conversion clashing with some omap irq updates)
2010-12-30ARM: SAMSUNG: Convert s3c_irqext_wake() to new irq_ interrupt methodsMark Brown
Kernel 2.6.37 adds new interrupt methods which take a struct irq_data rather than an irq number. Begin converting Samsung platforms over to these methods by converting s3c_irqext_wake() with a simple textual substitution. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2010-11-16suspend: constify platform_suspend_opsLionel Debroux
While at it, fix two checkpatch errors. Several non-const struct instances constified by this patch were added after the introduction of platform_suspend_ops in checkpatch.pl's list of "should be const" structs (79404849e90a41ea2109bd0e2f7c7164b0c4ce73). Patch against mainline. Inspired by hunks of the grsecurity patch, updated for newer kernels. Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-23ARM: SAMSUNG: Move pm.c to plat-samsungBen Dooks
Move pm.c to plat-samsung, it should be usable by all Samsung systems Signed-off-by: Ben Dooks <ben-linux@fluff.org>