From: xubilv Date: Thu, 13 Jul 2017 11:21:38 +0000 (+0800) Subject: drm/panel: simple: move panel_simple_dsi_send_cmds from enable to prepare X-Git-Tag: release-20171130_firefly~4^2~146 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=749f3345994918b55028535e378ccc608cdca696;p=firefly-linux-kernel-4.4.55.git drm/panel: simple: move panel_simple_dsi_send_cmds from enable to prepare Change-Id: I9fdd1192523bc5bd99ca2fdc37fdf2f4b06cbb8a Signed-off-by: xubilv --- 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);