WIP FPC-III support
[linux/fpc-iii.git] / arch / arm / include / asm / firmware.h
blob23fe0bd405c708378292fc6bb988f00a8ab8f0e3
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Copyright (C) 2012 Samsung Electronics.
4 * Kyungmin Park <kyungmin.park@samsung.com>
5 * Tomasz Figa <t.figa@samsung.com>
6 */
8 #ifndef __ASM_ARM_FIRMWARE_H
9 #define __ASM_ARM_FIRMWARE_H
11 #include <linux/bug.h>
14 * struct firmware_ops
16 * A structure to specify available firmware operations.
18 * A filled up structure can be registered with register_firmware_ops().
20 struct firmware_ops {
22 * Inform the firmware we intend to enter CPU idle mode
24 int (*prepare_idle)(unsigned long mode);
26 * Enters CPU idle mode
28 int (*do_idle)(unsigned long mode);
30 * Sets boot address of specified physical CPU
32 int (*set_cpu_boot_addr)(int cpu, unsigned long boot_addr);
34 * Gets boot address of specified physical CPU
36 int (*get_cpu_boot_addr)(int cpu, unsigned long *boot_addr);
38 * Boots specified physical CPU
40 int (*cpu_boot)(int cpu);
42 * Initializes L2 cache
44 int (*l2x0_init)(void);
46 * Enter system-wide suspend.
48 int (*suspend)(void);
50 * Restore state of privileged hardware after system-wide suspend.
52 int (*resume)(void);
55 /* Global pointer for current firmware_ops structure, can't be NULL. */
56 extern const struct firmware_ops *firmware_ops;
59 * call_firmware_op(op, ...)
61 * Checks if firmware operation is present and calls it,
62 * otherwise returns -ENOSYS
64 #define call_firmware_op(op, ...) \
65 ((firmware_ops->op) ? firmware_ops->op(__VA_ARGS__) : (-ENOSYS))
68 * register_firmware_ops(ops)
70 * A function to register platform firmware_ops struct.
72 static inline void register_firmware_ops(const struct firmware_ops *ops)
74 BUG_ON(!ops);
76 firmware_ops = ops;
79 #endif