Skip to content

Commit 749f334

Browse files
xubilvrkhuangtao
authored andcommitted
drm/panel: simple: move panel_simple_dsi_send_cmds from enable to prepare
Change-Id: I9fdd1192523bc5bd99ca2fdc37fdf2f4b06cbb8a Signed-off-by: xubilv <xbl@rock-chips.com>
1 parent 39d1c0c commit 749f334

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

drivers/gpu/drm/panel/panel-simple.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ static int panel_simple_dsi_send_cmds(struct panel_simple *panel,
229229
return -EINVAL;
230230
}
231231

232-
if (err)
232+
if (err < 0)
233233
dev_err(panel->dev, "failed to write dcs cmd: %d\n",
234234
err);
235235

@@ -428,6 +428,12 @@ static int panel_simple_prepare(struct drm_panel *panel)
428428
if (p->reset_gpio)
429429
gpiod_direction_output(p->reset_gpio, 0);
430430

431+
if (p->on_cmds) {
432+
err = panel_simple_dsi_send_cmds(p, p->on_cmds);
433+
if (err)
434+
dev_err(p->dev, "failed to send on cmds\n");
435+
}
436+
431437
p->prepared = true;
432438

433439
return 0;
@@ -436,17 +442,10 @@ static int panel_simple_prepare(struct drm_panel *panel)
436442
static int panel_simple_enable(struct drm_panel *panel)
437443
{
438444
struct panel_simple *p = to_panel_simple(panel);
439-
int err;
440445

441446
if (p->enabled)
442447
return 0;
443448

444-
if (p->on_cmds) {
445-
err = panel_simple_dsi_send_cmds(p, p->on_cmds);
446-
if (err)
447-
dev_err(p->dev, "failed to send on cmds\n");
448-
}
449-
450449
if (p->desc && p->desc->delay.enable)
451450
msleep(p->desc->delay.enable);
452451

0 commit comments

Comments
 (0)