• Home
  • Raw
  • Download

Lines Matching refs:sender

80 static inline int wait_for_gen_fifo_empty(struct mdfld_dsi_pkg_sender *sender,  in wait_for_gen_fifo_empty()  argument
83 struct drm_device *dev = sender->dev; in wait_for_gen_fifo_empty()
84 u32 gen_fifo_stat_reg = sender->mipi_gen_fifo_stat_reg; in wait_for_gen_fifo_empty()
96 static int wait_for_all_fifos_empty(struct mdfld_dsi_pkg_sender *sender) in wait_for_all_fifos_empty() argument
98 return wait_for_gen_fifo_empty(sender, (BIT(2) | BIT(10) | BIT(18) | in wait_for_all_fifos_empty()
102 static int wait_for_lp_fifos_empty(struct mdfld_dsi_pkg_sender *sender) in wait_for_lp_fifos_empty() argument
104 return wait_for_gen_fifo_empty(sender, (BIT(10) | BIT(26))); in wait_for_lp_fifos_empty()
107 static int wait_for_hs_fifos_empty(struct mdfld_dsi_pkg_sender *sender) in wait_for_hs_fifos_empty() argument
109 return wait_for_gen_fifo_empty(sender, (BIT(2) | BIT(18))); in wait_for_hs_fifos_empty()
112 static int handle_dsi_error(struct mdfld_dsi_pkg_sender *sender, u32 mask) in handle_dsi_error() argument
114 u32 intr_stat_reg = sender->mipi_intr_stat_reg; in handle_dsi_error()
115 struct drm_device *dev = sender->dev; in handle_dsi_error()
117 dev_dbg(sender->dev->dev, "Handling error 0x%08x\n", mask); in handle_dsi_error()
134 dev_dbg(sender->dev->dev, "No Action required\n"); in handle_dsi_error()
141 dev_dbg(sender->dev->dev, "No Action required\n"); in handle_dsi_error()
149 dev_dbg(sender->dev->dev, "High/Low contention detected\n"); in handle_dsi_error()
154 wait_for_all_fifos_empty(sender); in handle_dsi_error()
157 dev_dbg(sender->dev->dev, "No Action required\n"); in handle_dsi_error()
170 dev_dbg(sender->dev->dev, "HS Gen fifo full\n"); in handle_dsi_error()
172 wait_for_hs_fifos_empty(sender); in handle_dsi_error()
175 dev_dbg(sender->dev->dev, "LP Gen fifo full\n"); in handle_dsi_error()
177 wait_for_lp_fifos_empty(sender); in handle_dsi_error()
182 dev_dbg(sender->dev->dev, "No Action required\n"); in handle_dsi_error()
187 dev_dbg(sender->dev->dev, in handle_dsi_error()
192 static int dsi_error_handler(struct mdfld_dsi_pkg_sender *sender) in dsi_error_handler() argument
194 struct drm_device *dev = sender->dev; in dsi_error_handler()
195 u32 intr_stat_reg = sender->mipi_intr_stat_reg; in dsi_error_handler()
206 dev_dbg(sender->dev->dev, "[DSI]: %s\n", dsi_errors[i]); in dsi_error_handler()
207 err = handle_dsi_error(sender, mask); in dsi_error_handler()
215 static int send_short_pkg(struct mdfld_dsi_pkg_sender *sender, u8 data_type, in send_short_pkg() argument
218 struct drm_device *dev = sender->dev; in send_short_pkg()
224 ctrl_reg = sender->mipi_hs_gen_ctrl_reg; in send_short_pkg()
228 ctrl_reg = sender->mipi_lp_gen_ctrl_reg; in send_short_pkg()
241 static int send_long_pkg(struct mdfld_dsi_pkg_sender *sender, u8 data_type, in send_long_pkg() argument
244 struct drm_device *dev = sender->dev; in send_long_pkg()
254 ctrl_reg = sender->mipi_hs_gen_ctrl_reg; in send_long_pkg()
255 data_reg = sender->mipi_hs_gen_data_reg; in send_long_pkg()
259 ctrl_reg = sender->mipi_lp_gen_ctrl_reg; in send_long_pkg()
260 data_reg = sender->mipi_lp_gen_data_reg; in send_long_pkg()
305 static int send_pkg_prepare(struct mdfld_dsi_pkg_sender *sender, u8 data_type, in send_pkg_prepare() argument
321 sender->status = MDFLD_DSI_PKG_SENDER_BUSY; in send_pkg_prepare()
336 static int send_pkg_done(struct mdfld_dsi_pkg_sender *sender, u8 data_type, in send_pkg_done() argument
353 sender->panel_mode |= MDFLD_DSI_PANEL_MODE_SLEEP; in send_pkg_done()
357 sender->panel_mode &= ~MDFLD_DSI_PANEL_MODE_SLEEP; in send_pkg_done()
365 sender->status = MDFLD_DSI_PKG_SENDER_FREE; in send_pkg_done()
370 static int send_pkg(struct mdfld_dsi_pkg_sender *sender, u8 data_type, in send_pkg() argument
376 ret = dsi_error_handler(sender); in send_pkg()
383 if (sender->status == MDFLD_DSI_PKG_SENDER_BUSY) { in send_pkg()
388 ret = send_pkg_prepare(sender, data_type, data, len); in send_pkg()
404 ret = send_short_pkg(sender, data_type, data[0], data[1], hs); in send_pkg()
408 ret = send_long_pkg(sender, data_type, data, len, hs); in send_pkg()
412 send_pkg_done(sender, data_type, data, len); in send_pkg()
419 int mdfld_dsi_send_mcs_long(struct mdfld_dsi_pkg_sender *sender, u8 *data, in mdfld_dsi_send_mcs_long() argument
424 if (!sender || !data || !len) { in mdfld_dsi_send_mcs_long()
429 spin_lock_irqsave(&sender->lock, flags); in mdfld_dsi_send_mcs_long()
430 send_pkg(sender, MIPI_DSI_DCS_LONG_WRITE, data, len, hs); in mdfld_dsi_send_mcs_long()
431 spin_unlock_irqrestore(&sender->lock, flags); in mdfld_dsi_send_mcs_long()
436 int mdfld_dsi_send_mcs_short(struct mdfld_dsi_pkg_sender *sender, u8 cmd, in mdfld_dsi_send_mcs_short() argument
443 if (!sender) { in mdfld_dsi_send_mcs_short()
458 spin_lock_irqsave(&sender->lock, flags); in mdfld_dsi_send_mcs_short()
459 send_pkg(sender, data_type, data, sizeof(data), hs); in mdfld_dsi_send_mcs_short()
460 spin_unlock_irqrestore(&sender->lock, flags); in mdfld_dsi_send_mcs_short()
465 int mdfld_dsi_send_gen_short(struct mdfld_dsi_pkg_sender *sender, u8 param0, in mdfld_dsi_send_gen_short() argument
472 if (!sender || param_num > 2) { in mdfld_dsi_send_gen_short()
495 spin_lock_irqsave(&sender->lock, flags); in mdfld_dsi_send_gen_short()
496 send_pkg(sender, data_type, data, sizeof(data), hs); in mdfld_dsi_send_gen_short()
497 spin_unlock_irqrestore(&sender->lock, flags); in mdfld_dsi_send_gen_short()
502 int mdfld_dsi_send_gen_long(struct mdfld_dsi_pkg_sender *sender, u8 *data, in mdfld_dsi_send_gen_long() argument
507 if (!sender || !data || !len) { in mdfld_dsi_send_gen_long()
512 spin_lock_irqsave(&sender->lock, flags); in mdfld_dsi_send_gen_long()
513 send_pkg(sender, MIPI_DSI_GENERIC_LONG_WRITE, data, len, hs); in mdfld_dsi_send_gen_long()
514 spin_unlock_irqrestore(&sender->lock, flags); in mdfld_dsi_send_gen_long()
519 static int __read_panel_data(struct mdfld_dsi_pkg_sender *sender, u8 data_type, in __read_panel_data() argument
523 struct drm_device *dev = sender->dev; in __read_panel_data()
528 if (!sender || !data_out || !len_out) { in __read_panel_data()
539 spin_lock_irqsave(&sender->lock, flags); in __read_panel_data()
541 REG_WRITE(sender->mipi_intr_stat_reg, BIT(29)); in __read_panel_data()
543 if ((REG_READ(sender->mipi_intr_stat_reg) & BIT(29))) in __read_panel_data()
547 send_pkg(sender, data_type, data, len, hs); in __read_panel_data()
550 while (retry && !(REG_READ(sender->mipi_intr_stat_reg) & BIT(29))) { in __read_panel_data()
556 spin_unlock_irqrestore(&sender->lock, flags); in __read_panel_data()
560 REG_WRITE(sender->mipi_intr_stat_reg, BIT(29)); in __read_panel_data()
564 gen_data_reg = sender->mipi_hs_gen_data_reg; in __read_panel_data()
566 gen_data_reg = sender->mipi_lp_gen_data_reg; in __read_panel_data()
571 spin_unlock_irqrestore(&sender->lock, flags); in __read_panel_data()
576 int mdfld_dsi_read_mcs(struct mdfld_dsi_pkg_sender *sender, u8 cmd, in mdfld_dsi_read_mcs() argument
579 if (!sender || !data || !len) { in mdfld_dsi_read_mcs()
584 return __read_panel_data(sender, MIPI_DSI_DCS_READ, &cmd, 1, in mdfld_dsi_read_mcs()
666 void mdfld_dsi_pkg_sender_destroy(struct mdfld_dsi_pkg_sender *sender) in mdfld_dsi_pkg_sender_destroy() argument
668 if (!sender || IS_ERR(sender)) in mdfld_dsi_pkg_sender_destroy()
672 kfree(sender); in mdfld_dsi_pkg_sender_destroy()