162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright (C) 2013 Samsung Electronics Co., Ltd. 462306a36Sopenharmony_ci * Tomasz Figa <t.figa@samsung.com> 562306a36Sopenharmony_ci * Copyright (c) 2004 Simtec Electronics 662306a36Sopenharmony_ci * http://armlinux.simtec.co.uk/ 762306a36Sopenharmony_ci * Written by Ben Dooks, <ben@simtec.co.uk> 862306a36Sopenharmony_ci */ 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#ifndef __PLAT_SAMSUNG_PM_COMMON_H 1162306a36Sopenharmony_ci#define __PLAT_SAMSUNG_PM_COMMON_H __FILE__ 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci#include <linux/irq.h> 1462306a36Sopenharmony_ci#include <linux/soc/samsung/s3c-pm.h> 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci/* sleep save info */ 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci/** 1962306a36Sopenharmony_ci * struct sleep_save - save information for shared peripherals. 2062306a36Sopenharmony_ci * @reg: Pointer to the register to save. 2162306a36Sopenharmony_ci * @val: Holder for the value saved from reg. 2262306a36Sopenharmony_ci * 2362306a36Sopenharmony_ci * This describes a list of registers which is used by the pm core and 2462306a36Sopenharmony_ci * other subsystem to save and restore register values over suspend. 2562306a36Sopenharmony_ci */ 2662306a36Sopenharmony_cistruct sleep_save { 2762306a36Sopenharmony_ci void __iomem *reg; 2862306a36Sopenharmony_ci unsigned long val; 2962306a36Sopenharmony_ci}; 3062306a36Sopenharmony_ci 3162306a36Sopenharmony_ci#define SAVE_ITEM(x) \ 3262306a36Sopenharmony_ci { .reg = (x) } 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci/* helper functions to save/restore lists of registers. */ 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ciextern void s3c_pm_do_save(struct sleep_save *ptr, int count); 3762306a36Sopenharmony_ciextern void s3c_pm_do_restore(const struct sleep_save *ptr, int count); 3862306a36Sopenharmony_ciextern void s3c_pm_do_restore_core(const struct sleep_save *ptr, int count); 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ci#endif 41