Skip to content

Commit 452c46c

Browse files
committed
drm/msm/dsi: split dsi_ctrl_config() function
It makes no sense to pass NULL parameters to dsi_ctrl_config() in the disable case. Split dsi_ctrl_config() into enable and disable parts and drop unused params. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org> Patchwork: https://patchwork.freedesktop.org/patch/542559/ Link: https://lore.kernel.org/r/20230614224402.296825-2-dmitry.baryshkov@linaro.org
1 parent e2fd7dd commit 452c46c

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

drivers/gpu/drm/msm/dsi/dsi_host.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -705,19 +705,19 @@ static inline enum dsi_cmd_dst_format dsi_get_cmd_fmt(
705705
}
706706
}
707707

708-
static void dsi_ctrl_config(struct msm_dsi_host *msm_host, bool enable,
708+
static void dsi_ctrl_disable(struct msm_dsi_host *msm_host)
709+
{
710+
dsi_write(msm_host, REG_DSI_CTRL, 0);
711+
}
712+
713+
static void dsi_ctrl_enable(struct msm_dsi_host *msm_host,
709714
struct msm_dsi_phy_shared_timings *phy_shared_timings, struct msm_dsi_phy *phy)
710715
{
711716
u32 flags = msm_host->mode_flags;
712717
enum mipi_dsi_pixel_format mipi_fmt = msm_host->format;
713718
const struct msm_dsi_cfg_handler *cfg_hnd = msm_host->cfg_hnd;
714719
u32 data = 0, lane_ctrl = 0;
715720

716-
if (!enable) {
717-
dsi_write(msm_host, REG_DSI_CTRL, 0);
718-
return;
719-
}
720-
721721
if (flags & MIPI_DSI_MODE_VIDEO) {
722722
if (flags & MIPI_DSI_MODE_VIDEO_HSE)
723723
data |= DSI_VID_CFG0_PULSE_MODE_HSA_HE;
@@ -802,7 +802,7 @@ static void dsi_ctrl_config(struct msm_dsi_host *msm_host, bool enable,
802802
if (!(flags & MIPI_DSI_CLOCK_NON_CONTINUOUS)) {
803803
lane_ctrl = dsi_read(msm_host, REG_DSI_LANE_CTRL);
804804

805-
if (msm_dsi_phy_set_continuous_clock(phy, enable))
805+
if (msm_dsi_phy_set_continuous_clock(phy, true))
806806
lane_ctrl &= ~DSI_LANE_CTRL_HS_REQ_SEL_PHY;
807807

808808
dsi_write(msm_host, REG_DSI_LANE_CTRL,
@@ -2358,7 +2358,7 @@ int msm_dsi_host_power_on(struct mipi_dsi_host *host,
23582358

23592359
dsi_timing_setup(msm_host, is_bonded_dsi);
23602360
dsi_sw_reset(msm_host);
2361-
dsi_ctrl_config(msm_host, true, phy_shared_timings, phy);
2361+
dsi_ctrl_enable(msm_host, phy_shared_timings, phy);
23622362

23632363
if (msm_host->disp_en_gpio)
23642364
gpiod_set_value(msm_host->disp_en_gpio, 1);
@@ -2390,7 +2390,7 @@ int msm_dsi_host_power_off(struct mipi_dsi_host *host)
23902390
goto unlock_ret;
23912391
}
23922392

2393-
dsi_ctrl_config(msm_host, false, NULL, NULL);
2393+
dsi_ctrl_disable(msm_host);
23942394

23952395
if (msm_host->disp_en_gpio)
23962396
gpiod_set_value(msm_host->disp_en_gpio, 0);

0 commit comments

Comments
 (0)