Merge remote-tracking branch 'tip/auto-latest'
[deliverable/linux.git] / arch / x86 / include / asm / intel_scu_ipc.h
1 #ifndef _ASM_X86_INTEL_SCU_IPC_H_
2 #define _ASM_X86_INTEL_SCU_IPC_H_
3
4 #include <linux/notifier.h>
5
6 #define IPCMSG_COLD_OFF 0x80 /* Only for Tangier */
7
8 #define IPCMSG_WARM_RESET 0xF0
9 #define IPCMSG_COLD_RESET 0xF1
10 #define IPCMSG_SOFT_RESET 0xF2
11 #define IPCMSG_COLD_BOOT 0xF3
12
13 #define IPCMSG_VRTC 0xFA /* Set vRTC device */
14 /* Command id associated with message IPCMSG_VRTC */
15 #define IPC_CMD_VRTC_SETTIME 1 /* Set time */
16 #define IPC_CMD_VRTC_SETALARM 2 /* Set alarm */
17
18 /* Read single register */
19 int intel_scu_ipc_ioread8(u16 addr, u8 *data);
20
21 /* Read two sequential registers */
22 int intel_scu_ipc_ioread16(u16 addr, u16 *data);
23
24 /* Read four sequential registers */
25 int intel_scu_ipc_ioread32(u16 addr, u32 *data);
26
27 /* Read a vector */
28 int intel_scu_ipc_readv(u16 *addr, u8 *data, int len);
29
30 /* Write single register */
31 int intel_scu_ipc_iowrite8(u16 addr, u8 data);
32
33 /* Write two sequential registers */
34 int intel_scu_ipc_iowrite16(u16 addr, u16 data);
35
36 /* Write four sequential registers */
37 int intel_scu_ipc_iowrite32(u16 addr, u32 data);
38
39 /* Write a vector */
40 int intel_scu_ipc_writev(u16 *addr, u8 *data, int len);
41
42 /* Update single register based on the mask */
43 int intel_scu_ipc_update_register(u16 addr, u8 data, u8 mask);
44
45 /* Issue commands to the SCU with or without data */
46 int intel_scu_ipc_simple_command(int cmd, int sub);
47 int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen,
48 u32 *out, int outlen);
49 /* I2C control api */
50 int intel_scu_ipc_i2c_cntrl(u32 addr, u32 *data);
51
52 /* Update FW version */
53 int intel_scu_ipc_fw_update(u8 *buffer, u32 length);
54
55 extern struct blocking_notifier_head intel_scu_notifier;
56
57 static inline void intel_scu_notifier_add(struct notifier_block *nb)
58 {
59 blocking_notifier_chain_register(&intel_scu_notifier, nb);
60 }
61
62 static inline void intel_scu_notifier_remove(struct notifier_block *nb)
63 {
64 blocking_notifier_chain_unregister(&intel_scu_notifier, nb);
65 }
66
67 static inline int intel_scu_notifier_post(unsigned long v, void *p)
68 {
69 return blocking_notifier_call_chain(&intel_scu_notifier, v, p);
70 }
71
72 #define SCU_AVAILABLE 1
73 #define SCU_DOWN 2
74
75 #endif
This page took 0.036081 seconds and 5 git commands to generate.