dsi_v2.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* Copyright (c) 2012-2014, 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 DSI_V2_H
  14. #define DSI_V2_H
  15. #include <linux/list.h>
  16. #include <mach/scm-io.h>
  17. #include "mdss_dsi.h"
  18. #include "mdss_panel.h"
  19. #define DSI_BUF_SIZE 1024
  20. #define DSI_MRPS 0x04 /* Maximum Return Packet Size */
  21. struct dsi_interface {
  22. int (*on)(struct mdss_panel_data *pdata);
  23. int (*off)(struct mdss_panel_data *pdata);
  24. int (*cont_on)(struct mdss_panel_data *pdata);
  25. int (*clk_ctrl)(struct mdss_panel_data *pdata, int enable);
  26. void (*op_mode_config)(int mode, struct mdss_panel_data *pdata);
  27. int (*tx)(struct mdss_panel_data *pdata,
  28. struct dsi_buf *tp, struct dsi_cmd_desc *cmds, int cnt);
  29. int (*rx)(struct mdss_panel_data *pdata,
  30. struct dsi_buf *tp, struct dsi_buf *rp,
  31. struct dsi_cmd_desc *cmds, int len);
  32. int index;
  33. void *private;
  34. };
  35. int dsi_panel_device_register_v2(struct platform_device *pdev,
  36. struct mdss_dsi_ctrl_pdata *ctrl_pdata);
  37. void dsi_register_interface(struct dsi_interface *intf);
  38. int dsi_cmds_rx_v2(struct mdss_panel_data *pdata,
  39. struct dsi_buf *tp, struct dsi_buf *rp,
  40. struct dsi_cmd_desc *cmds, int len);
  41. int dsi_cmds_tx_v2(struct mdss_panel_data *pdata,
  42. struct dsi_buf *tp, struct dsi_cmd_desc *cmds,
  43. int cnt);
  44. char *dsi_buf_init(struct dsi_buf *dp);
  45. int dsi_buf_alloc(struct dsi_buf *dp, int size);
  46. int dsi_cmd_dma_add(struct dsi_buf *dp, struct dsi_cmd_desc *cm);
  47. int dsi_short_read1_resp(struct dsi_buf *rp);
  48. int dsi_short_read2_resp(struct dsi_buf *rp);
  49. int dsi_long_read_resp(struct dsi_buf *rp);
  50. void dsi_set_tx_power_mode(int mode);
  51. void dsi_ctrl_config_deinit(struct platform_device *pdev,
  52. struct mdss_dsi_ctrl_pdata *ctrl_pdata);
  53. int dsi_ctrl_config_init(struct platform_device *pdev,
  54. struct mdss_dsi_ctrl_pdata *ctrl_pdata);
  55. int dsi_ctrl_gpio_request(struct mdss_dsi_ctrl_pdata *ctrl_pdata);
  56. void dsi_ctrl_gpio_free(struct mdss_dsi_ctrl_pdata *ctrl_pdata);
  57. struct mdss_panel_cfg *mdp3_panel_intf_type(int intf_val);
  58. int mdp3_panel_get_boot_cfg(void);
  59. void msm_dsi_sw_reset(void);
  60. #endif /* DSI_V2_H */