From 749f3345994918b55028535e378ccc608cdca696 Mon Sep 17 00:00:00 2001 From: xubilv Date: Thu, 13 Jul 2017 19:21:38 +0800 Subject: [PATCH] drm/panel: simple: move panel_simple_dsi_send_cmds from enable to prepare Change-Id: I9fdd1192523bc5bd99ca2fdc37fdf2f4b06cbb8a Signed-off-by: xubilv --- drivers/gpu/drm/panel/panel-simple.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 301e2bf41384..50406eb9f99c 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -229,7 +229,7 @@ static int panel_simple_dsi_send_cmds(struct panel_simple *panel, return -EINVAL; } - if (err) + if (err < 0) dev_err(panel->dev, "failed to write dcs cmd: %d\n", err); @@ -428,6 +428,12 @@ static int panel_simple_prepare(struct drm_panel *panel) if (p->reset_gpio) gpiod_direction_output(p->reset_gpio, 0); + if (p->on_cmds) { + err = panel_simple_dsi_send_cmds(p, p->on_cmds); + if (err) + dev_err(p->dev, "failed to send on cmds\n"); + } + p->prepared = true; return 0; @@ -436,17 +442,10 @@ static int panel_simple_prepare(struct drm_panel *panel) static int panel_simple_enable(struct drm_panel *panel) { struct panel_simple *p = to_panel_simple(panel); - int err; if (p->enabled) return 0; - if (p->on_cmds) { - err = panel_simple_dsi_send_cmds(p, p->on_cmds); - if (err) - dev_err(p->dev, "failed to send on cmds\n"); - } - if (p->desc && p->desc->delay.enable) msleep(p->desc->delay.enable); -- 2.34.1