Loading drivers/gpu/drm/msm/dp/dp_aux.c +12 −3 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ struct dp_aux_private { struct aux_buf rxp; u32 aux_error_num; bool cmd_busy; u8 txbuf[256]; u8 rxbuf[256]; Loading Loading @@ -82,6 +83,7 @@ static void dp_aux_buf_init(struct aux_buf *buf, u8 *data, u32 size) static void dp_aux_buf_set(struct dp_aux_private *aux) { init_completion(&aux->comp); aux->cmd_busy = false; mutex_init(&aux->mutex); dp_aux_buf_init(&aux->txp, aux->txbuf, sizeof(aux->txbuf)); Loading Loading @@ -235,7 +237,7 @@ static u32 dp_cmd_fifo_rx(struct dp_aux_private *aux, u32 len) static void dp_aux_native_handler(struct dp_aux_private *aux) { u32 isr = aux->catalog->isr1; u32 isr = aux->catalog->isr; if (isr & DP_INTR_AUX_I2C_DONE) aux->aux_error_num = DP_AUX_ERR_NONE; Loading @@ -251,7 +253,7 @@ static void dp_aux_native_handler(struct dp_aux_private *aux) static void dp_aux_i2c_handler(struct dp_aux_private *aux) { u32 isr = aux->catalog->isr1; u32 isr = aux->catalog->isr; if (isr & DP_INTR_AUX_I2C_DONE) { if (isr & (DP_INTR_I2C_NACK | DP_INTR_I2C_DEFER)) Loading Loading @@ -285,7 +287,10 @@ static void dp_aux_isr(struct dp_aux *dp_aux) aux = container_of(dp_aux, struct dp_aux_private, dp_aux); aux->catalog->get_irq(aux->catalog); aux->catalog->get_irq(aux->catalog, aux->cmd_busy); if (!aux->cmd_busy) return; if (aux->cmds->tx_mode == AUX_NATIVE) dp_aux_native_handler(aux); Loading Loading @@ -318,6 +323,7 @@ static int dp_aux_write(struct dp_aux_private *aux) } reinit_completion(&aux->comp); aux->cmd_busy = true; len = dp_aux_cmd_fifo_tx(aux); Loading @@ -333,6 +339,7 @@ static int dp_aux_write(struct dp_aux_private *aux) else ret = aux->aux_error_num; aux->cmd_busy = false; mutex_unlock(&aux->mutex); return ret; } Loading Loading @@ -367,6 +374,7 @@ static int dp_aux_read(struct dp_aux_private *aux) } reinit_completion(&aux->comp); aux->cmd_busy = true; dp_aux_cmd_fifo_tx(aux); Loading @@ -383,6 +391,7 @@ static int dp_aux_read(struct dp_aux_private *aux) ret = aux->aux_error_num; aux->cmds->buf = rp->data; aux->cmd_busy = false; mutex_unlock(&aux->mutex); Loading drivers/gpu/drm/msm/dp/dp_catalog.c +23 −16 Original line number Diff line number Diff line Loading @@ -310,8 +310,6 @@ static int dp_catalog_aux_write_trans(struct dp_catalog_aux *aux) dp_catalog_get_priv(aux); base = catalog->io->ctrl_io.base; dp_write(base + DP_AUX_TRANS_CTRL, 0x0); msleep(20); /* h/w recommended delay */ dp_write(base + DP_AUX_TRANS_CTRL, aux->data); end: return rc; Loading Loading @@ -402,7 +400,7 @@ static void dp_catalog_aux_setup(struct dp_catalog_aux *aux, u32 *aux_cfg) dp_write(catalog->io->phy_io.base + DP_PHY_AUX_INTERRUPT_MASK, 0x1F); } static void dp_catalog_aux_get_irq(struct dp_catalog_aux *aux) static void dp_catalog_aux_get_irq(struct dp_catalog_aux *aux, bool cmd_busy) { u32 ack; struct dp_catalog_private *catalog; Loading @@ -416,20 +414,15 @@ static void dp_catalog_aux_get_irq(struct dp_catalog_aux *aux) dp_catalog_get_priv(aux); base = catalog->io->ctrl_io.base; aux->isr1 = dp_read(base + DP_INTR_STATUS); aux->isr2 = dp_read(base + DP_INTR_STATUS2); if (cmd_busy) dp_write(base + DP_AUX_TRANS_CTRL, 0x0); aux->isr1 &= ~DP_INTR_MASK1; ack = aux->isr1 & DP_INTERRUPT_STATUS1; aux->isr = dp_read(base + DP_INTR_STATUS); aux->isr &= ~DP_INTR_MASK1; ack = aux->isr & DP_INTERRUPT_STATUS1; ack <<= 1; ack |= DP_INTR_MASK1; dp_write(base + DP_INTR_STATUS, ack); aux->isr2 &= ~DP_INTR_MASK2; ack = aux->isr2 & DP_INTERRUPT_STATUS2; ack <<= 1; ack |= DP_INTR_MASK2; dp_write(base + DP_INTR_STATUS2, ack); } /* controller related catalog functions */ Loading Loading @@ -683,6 +676,14 @@ static void dp_catalog_ctrl_enable_irq(struct dp_catalog_ctrl *ctrl, dp_catalog_get_priv(ctrl); base = catalog->io->ctrl_io.base; if (enable) { dp_write(base + DP_INTR_STATUS, DP_INTR_MASK1); dp_write(base + DP_INTR_STATUS2, DP_INTR_MASK2); } else { dp_write(base + DP_INTR_STATUS, 0x00); dp_write(base + DP_INTR_STATUS2, 0x00); } } static void dp_catalog_ctrl_hpd_config(struct dp_catalog_ctrl *ctrl, bool en) Loading Loading @@ -715,20 +716,26 @@ static void dp_catalog_ctrl_hpd_config(struct dp_catalog_ctrl *ctrl, bool en) } } static u32 dp_catalog_ctrl_get_interrupt(struct dp_catalog_ctrl *ctrl) static void dp_catalog_ctrl_get_interrupt(struct dp_catalog_ctrl *ctrl) { u32 ack = 0; struct dp_catalog_private *catalog; void __iomem *base; if (!ctrl) { pr_err("invalid input\n"); return 0; return; } dp_catalog_get_priv(ctrl); base = catalog->io->ctrl_io.base; return dp_read(base + DP_INTR_STATUS2); ctrl->isr = dp_read(base + DP_INTR_STATUS2); ctrl->isr &= ~DP_INTR_MASK2; ack = ctrl->isr & DP_INTERRUPT_STATUS2; ack <<= 1; ack |= DP_INTR_MASK2; dp_write(base + DP_INTR_STATUS2, ack); } static void dp_catalog_ctrl_phy_reset(struct dp_catalog_ctrl *ctrl) Loading drivers/gpu/drm/msm/dp/dp_catalog.h +4 −4 Original line number Diff line number Diff line Loading @@ -36,8 +36,7 @@ struct dp_catalog_aux { u32 data; u32 isr1; u32 isr2; u32 isr; u32 (*read_data)(struct dp_catalog_aux *aux); int (*write_data)(struct dp_catalog_aux *aux); Loading @@ -45,13 +44,14 @@ struct dp_catalog_aux { void (*reset)(struct dp_catalog_aux *aux); void (*enable)(struct dp_catalog_aux *aux, bool enable); void (*setup)(struct dp_catalog_aux *aux, u32 *aux_cfg); void (*get_irq)(struct dp_catalog_aux *aux); void (*get_irq)(struct dp_catalog_aux *aux, bool cmd_busy); }; struct dp_catalog_ctrl { u32 dp_tu; u32 valid_boundary; u32 valid_boundary2; u32 isr; void (*state_ctrl)(struct dp_catalog_ctrl *ctrl, u32 state); void (*config_ctrl)(struct dp_catalog_ctrl *ctrl, u32 config); Loading @@ -69,7 +69,7 @@ struct dp_catalog_ctrl { u8 lane_cnt); void (*update_vx_px)(struct dp_catalog_ctrl *ctrl, u8 v_level, u8 p_level); u32 (*get_interrupt)(struct dp_catalog_ctrl *ctrl); void (*get_interrupt)(struct dp_catalog_ctrl *ctrl); void (*update_transfer_unit)(struct dp_catalog_ctrl *ctrl); }; Loading drivers/gpu/drm/msm/dp/dp_ctrl.c +4 −5 Original line number Diff line number Diff line Loading @@ -1318,9 +1318,8 @@ static int dp_ctrl_off(struct dp_ctrl *dp_ctrl) return rc; } static void dp_ctrl_isr(struct dp_ctrl *dp_ctrl, u32 irq) static void dp_ctrl_isr(struct dp_ctrl *dp_ctrl) { u32 isr; struct dp_ctrl_private *ctrl; if (!dp_ctrl) Loading @@ -1328,12 +1327,12 @@ static void dp_ctrl_isr(struct dp_ctrl *dp_ctrl, u32 irq) ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl); isr = ctrl->catalog->get_interrupt(ctrl->catalog); ctrl->catalog->get_interrupt(ctrl->catalog); if (isr & DP_CTRL_INTR_READY_FOR_VIDEO) if (ctrl->catalog->isr & DP_CTRL_INTR_READY_FOR_VIDEO) dp_ctrl_video_ready(ctrl); if (isr & DP_CTRL_INTR_IDLE_PATTERN_SENT) if (ctrl->catalog->isr & DP_CTRL_INTR_IDLE_PATTERN_SENT) dp_ctrl_idle_patterns_sent(ctrl); } Loading drivers/gpu/drm/msm/dp/dp_ctrl.h +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ struct dp_ctrl { int (*on)(struct dp_ctrl *dp_ctrl); int (*off)(struct dp_ctrl *dp_ctrl); void (*push_idle)(struct dp_ctrl *dp_ctrl); void (*isr)(struct dp_ctrl *dp_ctrl, u32 isr); void (*isr)(struct dp_ctrl *dp_ctrl); }; struct dp_ctrl_in { Loading Loading
drivers/gpu/drm/msm/dp/dp_aux.c +12 −3 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ struct dp_aux_private { struct aux_buf rxp; u32 aux_error_num; bool cmd_busy; u8 txbuf[256]; u8 rxbuf[256]; Loading Loading @@ -82,6 +83,7 @@ static void dp_aux_buf_init(struct aux_buf *buf, u8 *data, u32 size) static void dp_aux_buf_set(struct dp_aux_private *aux) { init_completion(&aux->comp); aux->cmd_busy = false; mutex_init(&aux->mutex); dp_aux_buf_init(&aux->txp, aux->txbuf, sizeof(aux->txbuf)); Loading Loading @@ -235,7 +237,7 @@ static u32 dp_cmd_fifo_rx(struct dp_aux_private *aux, u32 len) static void dp_aux_native_handler(struct dp_aux_private *aux) { u32 isr = aux->catalog->isr1; u32 isr = aux->catalog->isr; if (isr & DP_INTR_AUX_I2C_DONE) aux->aux_error_num = DP_AUX_ERR_NONE; Loading @@ -251,7 +253,7 @@ static void dp_aux_native_handler(struct dp_aux_private *aux) static void dp_aux_i2c_handler(struct dp_aux_private *aux) { u32 isr = aux->catalog->isr1; u32 isr = aux->catalog->isr; if (isr & DP_INTR_AUX_I2C_DONE) { if (isr & (DP_INTR_I2C_NACK | DP_INTR_I2C_DEFER)) Loading Loading @@ -285,7 +287,10 @@ static void dp_aux_isr(struct dp_aux *dp_aux) aux = container_of(dp_aux, struct dp_aux_private, dp_aux); aux->catalog->get_irq(aux->catalog); aux->catalog->get_irq(aux->catalog, aux->cmd_busy); if (!aux->cmd_busy) return; if (aux->cmds->tx_mode == AUX_NATIVE) dp_aux_native_handler(aux); Loading Loading @@ -318,6 +323,7 @@ static int dp_aux_write(struct dp_aux_private *aux) } reinit_completion(&aux->comp); aux->cmd_busy = true; len = dp_aux_cmd_fifo_tx(aux); Loading @@ -333,6 +339,7 @@ static int dp_aux_write(struct dp_aux_private *aux) else ret = aux->aux_error_num; aux->cmd_busy = false; mutex_unlock(&aux->mutex); return ret; } Loading Loading @@ -367,6 +374,7 @@ static int dp_aux_read(struct dp_aux_private *aux) } reinit_completion(&aux->comp); aux->cmd_busy = true; dp_aux_cmd_fifo_tx(aux); Loading @@ -383,6 +391,7 @@ static int dp_aux_read(struct dp_aux_private *aux) ret = aux->aux_error_num; aux->cmds->buf = rp->data; aux->cmd_busy = false; mutex_unlock(&aux->mutex); Loading
drivers/gpu/drm/msm/dp/dp_catalog.c +23 −16 Original line number Diff line number Diff line Loading @@ -310,8 +310,6 @@ static int dp_catalog_aux_write_trans(struct dp_catalog_aux *aux) dp_catalog_get_priv(aux); base = catalog->io->ctrl_io.base; dp_write(base + DP_AUX_TRANS_CTRL, 0x0); msleep(20); /* h/w recommended delay */ dp_write(base + DP_AUX_TRANS_CTRL, aux->data); end: return rc; Loading Loading @@ -402,7 +400,7 @@ static void dp_catalog_aux_setup(struct dp_catalog_aux *aux, u32 *aux_cfg) dp_write(catalog->io->phy_io.base + DP_PHY_AUX_INTERRUPT_MASK, 0x1F); } static void dp_catalog_aux_get_irq(struct dp_catalog_aux *aux) static void dp_catalog_aux_get_irq(struct dp_catalog_aux *aux, bool cmd_busy) { u32 ack; struct dp_catalog_private *catalog; Loading @@ -416,20 +414,15 @@ static void dp_catalog_aux_get_irq(struct dp_catalog_aux *aux) dp_catalog_get_priv(aux); base = catalog->io->ctrl_io.base; aux->isr1 = dp_read(base + DP_INTR_STATUS); aux->isr2 = dp_read(base + DP_INTR_STATUS2); if (cmd_busy) dp_write(base + DP_AUX_TRANS_CTRL, 0x0); aux->isr1 &= ~DP_INTR_MASK1; ack = aux->isr1 & DP_INTERRUPT_STATUS1; aux->isr = dp_read(base + DP_INTR_STATUS); aux->isr &= ~DP_INTR_MASK1; ack = aux->isr & DP_INTERRUPT_STATUS1; ack <<= 1; ack |= DP_INTR_MASK1; dp_write(base + DP_INTR_STATUS, ack); aux->isr2 &= ~DP_INTR_MASK2; ack = aux->isr2 & DP_INTERRUPT_STATUS2; ack <<= 1; ack |= DP_INTR_MASK2; dp_write(base + DP_INTR_STATUS2, ack); } /* controller related catalog functions */ Loading Loading @@ -683,6 +676,14 @@ static void dp_catalog_ctrl_enable_irq(struct dp_catalog_ctrl *ctrl, dp_catalog_get_priv(ctrl); base = catalog->io->ctrl_io.base; if (enable) { dp_write(base + DP_INTR_STATUS, DP_INTR_MASK1); dp_write(base + DP_INTR_STATUS2, DP_INTR_MASK2); } else { dp_write(base + DP_INTR_STATUS, 0x00); dp_write(base + DP_INTR_STATUS2, 0x00); } } static void dp_catalog_ctrl_hpd_config(struct dp_catalog_ctrl *ctrl, bool en) Loading Loading @@ -715,20 +716,26 @@ static void dp_catalog_ctrl_hpd_config(struct dp_catalog_ctrl *ctrl, bool en) } } static u32 dp_catalog_ctrl_get_interrupt(struct dp_catalog_ctrl *ctrl) static void dp_catalog_ctrl_get_interrupt(struct dp_catalog_ctrl *ctrl) { u32 ack = 0; struct dp_catalog_private *catalog; void __iomem *base; if (!ctrl) { pr_err("invalid input\n"); return 0; return; } dp_catalog_get_priv(ctrl); base = catalog->io->ctrl_io.base; return dp_read(base + DP_INTR_STATUS2); ctrl->isr = dp_read(base + DP_INTR_STATUS2); ctrl->isr &= ~DP_INTR_MASK2; ack = ctrl->isr & DP_INTERRUPT_STATUS2; ack <<= 1; ack |= DP_INTR_MASK2; dp_write(base + DP_INTR_STATUS2, ack); } static void dp_catalog_ctrl_phy_reset(struct dp_catalog_ctrl *ctrl) Loading
drivers/gpu/drm/msm/dp/dp_catalog.h +4 −4 Original line number Diff line number Diff line Loading @@ -36,8 +36,7 @@ struct dp_catalog_aux { u32 data; u32 isr1; u32 isr2; u32 isr; u32 (*read_data)(struct dp_catalog_aux *aux); int (*write_data)(struct dp_catalog_aux *aux); Loading @@ -45,13 +44,14 @@ struct dp_catalog_aux { void (*reset)(struct dp_catalog_aux *aux); void (*enable)(struct dp_catalog_aux *aux, bool enable); void (*setup)(struct dp_catalog_aux *aux, u32 *aux_cfg); void (*get_irq)(struct dp_catalog_aux *aux); void (*get_irq)(struct dp_catalog_aux *aux, bool cmd_busy); }; struct dp_catalog_ctrl { u32 dp_tu; u32 valid_boundary; u32 valid_boundary2; u32 isr; void (*state_ctrl)(struct dp_catalog_ctrl *ctrl, u32 state); void (*config_ctrl)(struct dp_catalog_ctrl *ctrl, u32 config); Loading @@ -69,7 +69,7 @@ struct dp_catalog_ctrl { u8 lane_cnt); void (*update_vx_px)(struct dp_catalog_ctrl *ctrl, u8 v_level, u8 p_level); u32 (*get_interrupt)(struct dp_catalog_ctrl *ctrl); void (*get_interrupt)(struct dp_catalog_ctrl *ctrl); void (*update_transfer_unit)(struct dp_catalog_ctrl *ctrl); }; Loading
drivers/gpu/drm/msm/dp/dp_ctrl.c +4 −5 Original line number Diff line number Diff line Loading @@ -1318,9 +1318,8 @@ static int dp_ctrl_off(struct dp_ctrl *dp_ctrl) return rc; } static void dp_ctrl_isr(struct dp_ctrl *dp_ctrl, u32 irq) static void dp_ctrl_isr(struct dp_ctrl *dp_ctrl) { u32 isr; struct dp_ctrl_private *ctrl; if (!dp_ctrl) Loading @@ -1328,12 +1327,12 @@ static void dp_ctrl_isr(struct dp_ctrl *dp_ctrl, u32 irq) ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl); isr = ctrl->catalog->get_interrupt(ctrl->catalog); ctrl->catalog->get_interrupt(ctrl->catalog); if (isr & DP_CTRL_INTR_READY_FOR_VIDEO) if (ctrl->catalog->isr & DP_CTRL_INTR_READY_FOR_VIDEO) dp_ctrl_video_ready(ctrl); if (isr & DP_CTRL_INTR_IDLE_PATTERN_SENT) if (ctrl->catalog->isr & DP_CTRL_INTR_IDLE_PATTERN_SENT) dp_ctrl_idle_patterns_sent(ctrl); } Loading
drivers/gpu/drm/msm/dp/dp_ctrl.h +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ struct dp_ctrl { int (*on)(struct dp_ctrl *dp_ctrl); int (*off)(struct dp_ctrl *dp_ctrl); void (*push_idle)(struct dp_ctrl *dp_ctrl); void (*isr)(struct dp_ctrl *dp_ctrl, u32 isr); void (*isr)(struct dp_ctrl *dp_ctrl); }; struct dp_ctrl_in { Loading