1 #ifndef _ASM_X86_INTEL_SCU_IPC_H_
2 #define _ASM_X86_INTEL_SCU_IPC_H_
4 #include <linux/notifier.h>
6 #define IPCMSG_COLD_OFF 0x80 /* Only for Tangier */
8 #define IPCMSG_WARM_RESET 0xF0
9 #define IPCMSG_COLD_RESET 0xF1
10 #define IPCMSG_SOFT_RESET 0xF2
11 #define IPCMSG_COLD_BOOT 0xF3
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 */
18 /* Read single register */
19 int intel_scu_ipc_ioread8(u16 addr
, u8
*data
);
21 /* Read two sequential registers */
22 int intel_scu_ipc_ioread16(u16 addr
, u16
*data
);
24 /* Read four sequential registers */
25 int intel_scu_ipc_ioread32(u16 addr
, u32
*data
);
28 int intel_scu_ipc_readv(u16
*addr
, u8
*data
, int len
);
30 /* Write single register */
31 int intel_scu_ipc_iowrite8(u16 addr
, u8 data
);
33 /* Write two sequential registers */
34 int intel_scu_ipc_iowrite16(u16 addr
, u16 data
);
36 /* Write four sequential registers */
37 int intel_scu_ipc_iowrite32(u16 addr
, u32 data
);
40 int intel_scu_ipc_writev(u16
*addr
, u8
*data
, int len
);
42 /* Update single register based on the mask */
43 int intel_scu_ipc_update_register(u16 addr
, u8 data
, u8 mask
);
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
);
50 int intel_scu_ipc_i2c_cntrl(u32 addr
, u32
*data
);
52 /* Update FW version */
53 int intel_scu_ipc_fw_update(u8
*buffer
, u32 length
);
55 extern struct blocking_notifier_head intel_scu_notifier
;
57 static inline void intel_scu_notifier_add(struct notifier_block
*nb
)
59 blocking_notifier_chain_register(&intel_scu_notifier
, nb
);
62 static inline void intel_scu_notifier_remove(struct notifier_block
*nb
)
64 blocking_notifier_chain_unregister(&intel_scu_notifier
, nb
);
67 static inline int intel_scu_notifier_post(unsigned long v
, void *p
)
69 return blocking_notifier_call_chain(&intel_scu_notifier
, v
, p
);
72 #define SCU_AVAILABLE 1