intel_scu_ipc.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef _ASM_X86_INTEL_SCU_IPC_H_
  2. #define _ASM_X86_INTEL_SCU_IPC_H_
  3. #include <linux/notifier.h>
  4. #define IPCMSG_WARM_RESET 0xF0
  5. #define IPCMSG_COLD_RESET 0xF1
  6. #define IPCMSG_SOFT_RESET 0xF2
  7. #define IPCMSG_COLD_BOOT 0xF3
  8. #define IPCMSG_VRTC 0xFA /* Set vRTC device */
  9. /* Command id associated with message IPCMSG_VRTC */
  10. #define IPC_CMD_VRTC_SETTIME 1 /* Set time */
  11. #define IPC_CMD_VRTC_SETALARM 2 /* Set alarm */
  12. /* Read single register */
  13. int intel_scu_ipc_ioread8(u16 addr, u8 *data);
  14. /* Read two sequential registers */
  15. int intel_scu_ipc_ioread16(u16 addr, u16 *data);
  16. /* Read four sequential registers */
  17. int intel_scu_ipc_ioread32(u16 addr, u32 *data);
  18. /* Read a vector */
  19. int intel_scu_ipc_readv(u16 *addr, u8 *data, int len);
  20. /* Write single register */
  21. int intel_scu_ipc_iowrite8(u16 addr, u8 data);
  22. /* Write two sequential registers */
  23. int intel_scu_ipc_iowrite16(u16 addr, u16 data);
  24. /* Write four sequential registers */
  25. int intel_scu_ipc_iowrite32(u16 addr, u32 data);
  26. /* Write a vector */
  27. int intel_scu_ipc_writev(u16 *addr, u8 *data, int len);
  28. /* Update single register based on the mask */
  29. int intel_scu_ipc_update_register(u16 addr, u8 data, u8 mask);
  30. /* Issue commands to the SCU with or without data */
  31. int intel_scu_ipc_simple_command(int cmd, int sub);
  32. int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen,
  33. u32 *out, int outlen);
  34. /* I2C control api */
  35. int intel_scu_ipc_i2c_cntrl(u32 addr, u32 *data);
  36. /* Update FW version */
  37. int intel_scu_ipc_fw_update(u8 *buffer, u32 length);
  38. extern struct blocking_notifier_head intel_scu_notifier;
  39. static inline void intel_scu_notifier_add(struct notifier_block *nb)
  40. {
  41. blocking_notifier_chain_register(&intel_scu_notifier, nb);
  42. }
  43. static inline void intel_scu_notifier_remove(struct notifier_block *nb)
  44. {
  45. blocking_notifier_chain_unregister(&intel_scu_notifier, nb);
  46. }
  47. static inline int intel_scu_notifier_post(unsigned long v, void *p)
  48. {
  49. return blocking_notifier_call_chain(&intel_scu_notifier, v, p);
  50. }
  51. #define SCU_AVAILABLE 1
  52. #define SCU_DOWN 2
  53. #endif