return IRQ_HANDLED;
}
-static int nwl_dsi_enable(struct nwl_dsi *dsi)
+static int nwl_dsi_mode_set(struct nwl_dsi *dsi)
{
struct device *dev = dsi->dev;
union phy_configure_opts *phy_cfg = &dsi->phy_cfg;
adjusted_mode->flags |= (DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC);
adjusted_mode->flags &= ~(DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC);
- /* Do a full modeset if crtc_state->active is changed to be true. */
+ /*
+ * Do a full modeset if crtc_state->active is changed to be true.
+ * This ensures our ->mode_set() is called to get the DSI controller
+ * and the PHY ready to send DCS commands, when only the connector's
+ * DPMS is brought out of "Off" status.
+ */
if (crtc_state->active_changed && crtc_state->active)
crtc_state->mode_changed = true;
memcpy(&dsi->mode, adjusted_mode, sizeof(dsi->mode));
drm_mode_debug_printmodeline(adjusted_mode);
-}
-
-static void
-nwl_dsi_bridge_atomic_pre_enable(struct drm_bridge *bridge,
- struct drm_bridge_state *old_bridge_state)
-{
- struct nwl_dsi *dsi = bridge_to_dsi(bridge);
- int ret;
- pm_runtime_get_sync(dsi->dev);
+ pm_runtime_get_sync(dev);
if (clk_prepare_enable(dsi->lcdif_clk) < 0)
return;
/* Step 1 from DSI reset-out instructions */
ret = reset_control_deassert(dsi->rst_pclk);
if (ret < 0) {
- DRM_DEV_ERROR(dsi->dev, "Failed to deassert PCLK: %d\n", ret);
+ DRM_DEV_ERROR(dev, "Failed to deassert PCLK: %d\n", ret);
return;
}
/* Step 2 from DSI reset-out instructions */
- nwl_dsi_enable(dsi);
+ nwl_dsi_mode_set(dsi);
/* Step 3 from DSI reset-out instructions */
ret = reset_control_deassert(dsi->rst_esc);
if (ret < 0) {
- DRM_DEV_ERROR(dsi->dev, "Failed to deassert ESC: %d\n", ret);
+ DRM_DEV_ERROR(dev, "Failed to deassert ESC: %d\n", ret);
return;
}
ret = reset_control_deassert(dsi->rst_byte);
if (ret < 0) {
- DRM_DEV_ERROR(dsi->dev, "Failed to deassert BYTE: %d\n", ret);
+ DRM_DEV_ERROR(dev, "Failed to deassert BYTE: %d\n", ret);
return;
}
}
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
.atomic_reset = drm_atomic_helper_bridge_reset,
.atomic_check = nwl_dsi_bridge_atomic_check,
- .atomic_pre_enable = nwl_dsi_bridge_atomic_pre_enable,
.atomic_enable = nwl_dsi_bridge_atomic_enable,
.atomic_disable = nwl_dsi_bridge_atomic_disable,
.mode_set = nwl_dsi_bridge_mode_set,