blob: fd90add894c45fa274596668e017fcd61e113f03 [file] [log] [blame]
Jianyi Shi18eda7e2024-05-07 02:00:30 +00001/* SPDX-License-Identifier: GPL-2.0+*/
2/*
3 * Copyright (C) 2014-2022 Amlogic, Inc. All rights reserved.
4 *
5 * All information contained herein is Amlogic confidential.
6 *
7 * This software is provided to you pursuant to Software License Agreement
8 * (SLA) with Amlogic Inc ("Amlogic"). This software may be used
9 * only in accordance with the terms of this agreement.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification is strictly prohibited without prior written permission from
13 * Amlogic.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27#ifndef __PM_H__
28#define __PM_H__
29
30#include <linux/list.h>
31
32struct dev_pm_ops {
33 struct list_head link;
34 char *name;
35 int (*suspend)(void *);
36 int (*resume)(void *);
37 int (*poweroff)(void *);
38};
39
40typedef int (*FUNC_PTR) (void *);
41
42void pm_initialize(void);
43void pm_suspend(void);
44void pm_poweroff(void);
45struct dev_pm_ops *dev_register_pm(char *name, FUNC_PTR suspend,
46 FUNC_PTR resume, FUNC_PTR poweroff);
47int dev_unregister_pm(struct dev_pm_ops *arg);
48
49#endif