Sreedhara DS | 9a58a33 | 2010-04-26 18:13:05 +0100 | [diff] [blame] | 1 | #ifndef _ASM_X86_INTEL_SCU_IPC_H_ |
| 2 | #define _ASM_X86_INTEL_SCU_IPC_H_ |
| 3 | |
Alan Cox | 42c2544 | 2011-09-07 16:06:51 +0300 | [diff] [blame] | 4 | #include <linux/notifier.h> |
| 5 | |
Andy Shevchenko | bda7b07 | 2016-09-07 15:39:55 +0300 | [diff] [blame^] | 6 | #define IPCMSG_COLD_OFF 0x80 /* Only for Tangier */ |
| 7 | |
Jacob Pan | 48bc556 | 2011-11-16 16:07:22 +0000 | [diff] [blame] | 8 | #define IPCMSG_WARM_RESET 0xF0 |
| 9 | #define IPCMSG_COLD_RESET 0xF1 |
| 10 | #define IPCMSG_SOFT_RESET 0xF2 |
| 11 | #define IPCMSG_COLD_BOOT 0xF3 |
Feng Tang | 35f2915 | 2010-06-01 13:07:34 +0100 | [diff] [blame] | 12 | |
Jacob Pan | 48bc556 | 2011-11-16 16:07:22 +0000 | [diff] [blame] | 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 */ |
Feng Tang | 35f2915 | 2010-06-01 13:07:34 +0100 | [diff] [blame] | 17 | |
Sreedhara DS | 9a58a33 | 2010-04-26 18:13:05 +0100 | [diff] [blame] | 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 | |
Sreedhara DS | 9a58a33 | 2010-04-26 18:13:05 +0100 | [diff] [blame] | 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 | |
Alan Cox | 42c2544 | 2011-09-07 16:06:51 +0300 | [diff] [blame] | 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 | |
Sreedhara DS | 9a58a33 | 2010-04-26 18:13:05 +0100 | [diff] [blame] | 75 | #endif |