Skip to content

Commit cd3fc1b

Browse files
Tomasz Figaolofj
authored andcommitted
ARM: SAMSUNG: pm: Adjust for pinctrl- and DT-enabled platforms
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 <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> [olof: add #include <linux/of.h>] Signed-off-by: Olof Johansson <[email protected]>
1 parent 7e5955d commit cd3fc1b

File tree

1 file changed

+13
-5
lines changed
  • arch/arm/plat-samsung

1 file changed

+13
-5
lines changed

arch/arm/plat-samsung/pm.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/suspend.h>
1717
#include <linux/errno.h>
1818
#include <linux/delay.h>
19+
#include <linux/of.h>
1920
#include <linux/serial_core.h>
2021
#include <linux/io.h>
2122

@@ -261,7 +262,8 @@ static int s3c_pm_enter(suspend_state_t state)
261262
* require a full power-cycle)
262263
*/
263264

264-
if (!any_allowed(s3c_irqwake_intmask, s3c_irqwake_intallow) &&
265+
if (!of_have_populated_dt() &&
266+
!any_allowed(s3c_irqwake_intmask, s3c_irqwake_intallow) &&
265267
!any_allowed(s3c_irqwake_eintmask, s3c_irqwake_eintallow)) {
266268
printk(KERN_ERR "%s: No wake-up sources!\n", __func__);
267269
printk(KERN_ERR "%s: Aborting sleep\n", __func__);
@@ -270,8 +272,11 @@ static int s3c_pm_enter(suspend_state_t state)
270272

271273
/* save all necessary core registers not covered by the drivers */
272274

273-
samsung_pm_save_gpios();
274-
samsung_pm_saved_gpios();
275+
if (!of_have_populated_dt()) {
276+
samsung_pm_save_gpios();
277+
samsung_pm_saved_gpios();
278+
}
279+
275280
s3c_pm_save_uarts();
276281
s3c_pm_save_core();
277282

@@ -310,8 +315,11 @@ static int s3c_pm_enter(suspend_state_t state)
310315

311316
s3c_pm_restore_core();
312317
s3c_pm_restore_uarts();
313-
samsung_pm_restore_gpios();
314-
s3c_pm_restored_gpios();
318+
319+
if (!of_have_populated_dt()) {
320+
samsung_pm_restore_gpios();
321+
s3c_pm_restored_gpios();
322+
}
315323

316324
s3c_pm_debug_init();
317325

0 commit comments

Comments
 (0)