|
2 | 2 | #ifndef _ASM_X86_INTEL_SCU_IPC_LEGACY_H_ |
3 | 3 | #define _ASM_X86_INTEL_SCU_IPC_LEGACY_H_ |
4 | 4 |
|
5 | | -#include <linux/notifier.h> |
6 | | - |
7 | | -#define IPCMSG_INDIRECT_READ 0x02 |
8 | | -#define IPCMSG_INDIRECT_WRITE 0x05 |
| 5 | +#include <linux/types.h> |
9 | 6 |
|
10 | 7 | #define IPCMSG_COLD_OFF 0x80 /* Only for Tangier */ |
11 | | - |
12 | | -#define IPCMSG_WARM_RESET 0xF0 |
13 | 8 | #define IPCMSG_COLD_RESET 0xF1 |
14 | | -#define IPCMSG_SOFT_RESET 0xF2 |
15 | | -#define IPCMSG_COLD_BOOT 0xF3 |
16 | 9 |
|
17 | 10 | /* Don't call these in new code - they will be removed eventually */ |
18 | 11 |
|
19 | | -/* Read a vector */ |
20 | | -static inline int intel_scu_ipc_readv(u16 *addr, u8 *data, int len) |
21 | | -{ |
22 | | - return intel_scu_ipc_dev_readv(NULL, addr, data, len); |
23 | | -} |
24 | | - |
25 | | -/* Write a vector */ |
26 | | -static inline int intel_scu_ipc_writev(u16 *addr, u8 *data, int len) |
27 | | -{ |
28 | | - return intel_scu_ipc_dev_writev(NULL, addr, data, len); |
29 | | -} |
30 | | - |
31 | | -/* Update single register based on the mask */ |
32 | | -static inline int intel_scu_ipc_update_register(u16 addr, u8 data, u8 mask) |
33 | | -{ |
34 | | - return intel_scu_ipc_dev_update(NULL, addr, data, mask); |
35 | | -} |
36 | | - |
37 | 12 | /* Issue commands to the SCU with or without data */ |
38 | 13 | static inline int intel_scu_ipc_simple_command(int cmd, int sub) |
39 | 14 | { |
40 | 15 | return intel_scu_ipc_dev_simple_command(NULL, cmd, sub); |
41 | 16 | } |
42 | 17 |
|
43 | | -static inline int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen, |
44 | | - u32 *out, int outlen) |
45 | | -{ |
46 | | - /* New API takes both inlen and outlen as bytes so convert here */ |
47 | | - size_t inbytes = inlen * sizeof(u32); |
48 | | - size_t outbytes = outlen * sizeof(u32); |
49 | | - |
50 | | - return intel_scu_ipc_dev_command_with_size(NULL, cmd, sub, in, inbytes, |
51 | | - inlen, out, outbytes); |
52 | | -} |
53 | | - |
54 | | -extern struct blocking_notifier_head intel_scu_notifier; |
55 | | - |
56 | | -static inline void intel_scu_notifier_add(struct notifier_block *nb) |
57 | | -{ |
58 | | - blocking_notifier_chain_register(&intel_scu_notifier, nb); |
59 | | -} |
60 | | - |
61 | | -static inline void intel_scu_notifier_remove(struct notifier_block *nb) |
62 | | -{ |
63 | | - blocking_notifier_chain_unregister(&intel_scu_notifier, nb); |
64 | | -} |
65 | | - |
66 | | -static inline int intel_scu_notifier_post(unsigned long v, void *p) |
67 | | -{ |
68 | | - return blocking_notifier_call_chain(&intel_scu_notifier, v, p); |
69 | | -} |
70 | | - |
71 | | -#define SCU_AVAILABLE 1 |
72 | | -#define SCU_DOWN 2 |
73 | | - |
74 | 18 | #endif |
0 commit comments