Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1605980

Re: [PATCH v2 2/2] drm/panel: add innolux,p079zca panel driver

Path csiph.com!feeder.erje.net!2.eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Brian Norris <briannorris@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/2] drm/panel: add innolux,p079zca panel driver
Date Tue, 21 Mar 2017 21:40:02 +0100
Message-ID <tnyJs-8ra-11@gated-at.bofh.it> (permalink)
References <tlbxD-4kc-3@gated-at.bofh.it> <tlbxD-4kc-1@gated-at.bofh.it> <tnxDI-7Ii-11@gated-at.bofh.it>
X-Original-To Sean Paul <seanpaul@chromium.org>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=PXKvlLUdmrwZ9gC+rCWgslwP4zM+3cpc96ssaQu9zTw=; b=Ztza8uiIkI11c4id5YFcCxdS34x5wO4Ur+zZmkP7ApXB0mNmZ2Mt/I6GW/4LPRy5Gk m8WNbdh0f1+lgNv++XInnlSErLjd4/eQCXpyU76zc8ei3LygPyGpl9jEGXeNcQz7IY0E fgzz/9PnHbe+qN3Tg+3ySZTebZ/i3PdwXdjvM=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=PXKvlLUdmrwZ9gC+rCWgslwP4zM+3cpc96ssaQu9zTw=; b=MSe0qpOHHKbNLJdsnJywFou/5rCURF5/DA31IO4Tc+PqH8jRTsboj4nkOkMXylwrYo 5bKm8fC9SDzycUZxslfdahcHP4iQQji1dRe2EHaJa8GUI9GoDmS4XZSPqXzJOzquVfQM 3jecIlMzJtn3MUXkqk+19eu19owIkxO6q7XtaiIMptMJHSE75U5sZqJd8CcGwrNAGl7Q CSUfU3UEr4eQvyAHo1u/5L5EM5e52jtuCERFeUGlT0808jgareINuqXCCuMGKdQcyMMV h5QfZ684NZo7UNsK3jh9zD6ag3lhk7AB+2CPyvqdSHpd9zIFKV8wRNK94/EGy6pJeM4A YVQQ==
X-Gm-Message-State AFeK/H230CyO8LhDQRTMVw4Wv8LiBDXVu8MM8tuWlCmmotc3Z5kzQ/oIADAKH66g7GvPAKSi
X-Received by 10.84.210.167 with SMTP id a36mr50657571pli.40.1490128713756; Tue, 21 Mar 2017 13:38:33 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 106
Organization linux.* mail to news gateway
X-Original-Cc Chris Zhong <zyw@rock-chips.com>, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Thierry Reding <thierry.reding@gmail.com>
X-Original-Date Tue, 21 Mar 2017 13:38:31 -0700
X-Original-Message-ID <20170321203829.GD74389@google.com>
X-Original-References <1489562353-10313-1-git-send-email-zyw@rock-chips.com> <1489562353-10313-2-git-send-email-zyw@rock-chips.com> <20170321192635.GA19389@art_vandelay>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1605980

Show key headers only | View raw


+ Thierry for real

On Tue, Mar 21, 2017 at 03:26:35PM -0400, Sean Paul wrote:
> On Wed, Mar 15, 2017 at 03:19:13PM +0800, Chris Zhong wrote:
> > Support Innolux P079ZCA 7.85" 768x1024 TFT LCD panel, it is a MIPI DSI
> > panel.
> > 
> > Signed-off-by: Chris Zhong <zyw@rock-chips.com>
> > ---
> > 
> > Changes in v2:
> > - add some error check
> > - always use Low power mode to send commend
> > - add comments for all the sleep
> > - use DRM_DEV_ERROR instead of dev_err
> > 
> 
> Minor suggestion below. Once that's cleared up, you can add:
> Reviewed-by: Sean Paul <seanpaul@chromium.org>
> 
> Also, please add Thierry directly to your patches so he sees them.
> 
> 
> >  drivers/gpu/drm/panel/Kconfig                 |  11 +
> >  drivers/gpu/drm/panel/Makefile                |   1 +
> >  drivers/gpu/drm/panel/panel-innolux-p079zca.c | 344 ++++++++++++++++++++++++++
> >  3 files changed, 356 insertions(+)
> >  create mode 100644 drivers/gpu/drm/panel/panel-innolux-p079zca.c
> > 
> 
> <snip>
> > +static int innolux_panel_prepare(struct drm_panel *panel)
> > +{
> > +	struct innolux_panel *innolux = to_innolux_panel(panel);
> > +	int err, ret;
> > +
> > +	if (innolux->prepared)
> > +		return 0;
> > +
> > +	gpiod_set_value_cansleep(innolux->enable_gpio, 0);
> > +
> > +	err = regulator_enable(innolux->supply);
> > +	if (err < 0)
> > +		return err;
> > +
> > +	/* T2: 15ms - 1000ms */
> > +	usleep_range(15000, 16000);
> > +
> > +	gpiod_set_value_cansleep(innolux->enable_gpio, 1);
> > +
> > +	/* T4: 15ms - 1000ms */
> > +	usleep_range(15000, 16000);
> > +
> > +	err = mipi_dsi_dcs_exit_sleep_mode(innolux->link);
> > +	if (err < 0) {
> > +		DRM_DEV_ERROR(panel->dev, "failed to exit sleep mode: %d\n",
> > +			      err);
> > +		goto poweroff;
> > +	}
> > +
> > +	/* T6: 120ms - 1000ms*/
> > +	msleep(120);
> > +
> > +	err = mipi_dsi_dcs_set_display_on(innolux->link);
> > +	if (err < 0) {
> > +		DRM_DEV_ERROR(panel->dev, "failed to set display on: %d\n",
> > +			      err);
> > +		goto poweroff;
> > +	}
> > +
> > +	/* T7: 5ms */
> > +	usleep_range(5000, 6000);
> > +
> > +	innolux->prepared = true;
> > +
> > +	return 0;
> > +
> > +poweroff:
> > +	ret = regulator_disable(innolux->supply);
> > +	if (ret)
> > +		return ret;
> 
> I don't think we should be returning this error code. If we're here, it's
> because something else triggered err, and we should return that. Change this to:
> 
> if (regulator_disable(innolux->supply))
>         DRM_DEV_ERROR(panel->dev, "failed to disable regulator after error\n");

And maybe include the error code in that message still?

	ret = regulator_disable(innolux->supply);
	if (ret)
		DRM_DEV_ERROR(panel->dev, "failed to disable regulator after error (%d)\n",
			      ret);

Brian

> > +
> > +	gpiod_set_value_cansleep(innolux->enable_gpio, 0);
> > +	return err;
> > +}
> 
> <snip>
> 
> > -- 
> > 2.6.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 2/2] drm/panel: add innolux,p079zca panel driver Chris Zhong <zyw@rock-chips.com> - 2017-03-15 08:30 +0100
  Re: [PATCH v2 2/2] drm/panel: add innolux,p079zca panel driver Brian Norris <briannorris@chromium.org> - 2017-03-17 01:50 +0100
  Re: [PATCH v2 2/2] drm/panel: add innolux,p079zca panel driver Sean Paul <seanpaul@chromium.org> - 2017-03-21 20:30 +0100
    Re: [PATCH v2 2/2] drm/panel: add innolux,p079zca panel driver Brian Norris <briannorris@chromium.org> - 2017-03-21 21:40 +0100
      Re: [PATCH v2 2/2] drm/panel: add innolux,p079zca panel driver Sean Paul <seanpaul@chromium.org> - 2017-03-21 22:20 +0100

csiph-web