mhl_msc.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* Copyright (c) 2013, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #ifndef __MHL_MSC_H__
  14. #define __MHL_MSC_H__
  15. #include <linux/mhl_8334.h>
  16. #define MAX_RCP_KEYS_SUPPORTED 256
  17. #define MSC_NORMAL_SEND 0
  18. #define MSC_PRIORITY_SEND 1
  19. #define TMDS_ENABLE 1
  20. #define TMDS_DISABLE 0
  21. /******************************************************************/
  22. /* the below APIs are implemented by the MSC functionality */
  23. int mhl_msc_clear(struct mhl_tx_ctrl *mhl_ctrl);
  24. int mhl_msc_command_done(struct mhl_tx_ctrl *mhl_ctrl,
  25. struct msc_command_struct *req);
  26. int mhl_msc_send_set_int(struct mhl_tx_ctrl *mhl_ctrl,
  27. u8 offset, u8 mask, u8 priority);
  28. int mhl_msc_send_write_stat(struct mhl_tx_ctrl *mhl_ctrl,
  29. u8 offset, u8 value);
  30. int mhl_msc_send_msc_msg(struct mhl_tx_ctrl *mhl_ctrl,
  31. u8 sub_cmd, u8 cmd_data);
  32. int mhl_msc_recv_set_int(struct mhl_tx_ctrl *mhl_ctrl,
  33. u8 offset, u8 set_int);
  34. int mhl_msc_recv_write_stat(struct mhl_tx_ctrl *mhl_ctrl,
  35. u8 offset, u8 value);
  36. int mhl_msc_recv_msc_msg(struct mhl_tx_ctrl *mhl_ctrl,
  37. u8 sub_cmd, u8 cmd_data);
  38. void mhl_msc_send_work(struct work_struct *work);
  39. /******************************************************************/
  40. /* Tx should implement these APIs */
  41. int mhl_send_msc_command(struct mhl_tx_ctrl *mhl_ctrl,
  42. struct msc_command_struct *req);
  43. void mhl_read_scratchpad(struct mhl_tx_ctrl *mhl_ctrl);
  44. void mhl_drive_hpd(struct mhl_tx_ctrl *mhl_ctrl, uint8_t to_state);
  45. void mhl_tmds_ctrl(struct mhl_tx_ctrl *ctrl, uint8_t on);
  46. /******************************************************************/
  47. /* MHL driver registers ctrl with MSC */
  48. void mhl_register_msc(struct mhl_tx_ctrl *ctrl);
  49. #endif /* __MHL_MSC_H__ */