linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Vinay Simha <simhavcs@gmail.com>
Cc: Archit Taneja <archit.taneja@gmail.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	John Stultz <john.stultz@linaro.org>,
	Rob Clark <robdclark@gmail.com>, David Airlie <airlied@linux.ie>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:DRM PANEL DRIVERS" <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH v4 2/2] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel
Date: Tue, 14 Jun 2016 13:25:27 +0200	[thread overview]
Message-ID: <20160614112527.GA30021@ulmo.ba.sec> (raw)
In-Reply-To: <CAGWqDJ4AFjqOGxS1-_EBu5WOFVWaUqM+g6nWyparEkKN1yYbVg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3383 bytes --]

On Tue, Jun 14, 2016 at 04:27:53PM +0530, Vinay Simha wrote:
[...]
> On Mon, Jun 13, 2016 at 6:05 PM, Thierry Reding
> <thierry.reding@gmail.com> wrote:
> > On Mon, Jun 13, 2016 at 03:55:28PM +0530, Vinay Simha BN wrote:
[...]
> >> +const char *regs[] = {
> >> +     "vddp",
> >> +     "dcdc_en",
> >> +     "vcc"
> >> +};
> >
> > This should be static. Also use a more sensible name, such as
> > regulator_names, please.
> it kept as regs, to keep constant names as used in
> the dsi_cfg file
> drivers/gpu/drm/msm/dsi/dsi_cfg.c

That's a completely different driver, no need to be consistent.

> >> +static int jdi_panel_init(struct jdi_panel *jdi)
> >> +{
> > [...]
> >> +     struct mipi_dsi_device *dsi = jdi->dsi;
> >> +     int ret;
> >> +
> >> +     dsi->mode_flags |= MIPI_DSI_MODE_LPM;
> >> +
> >> +     ret = mipi_dsi_dcs_soft_reset(dsi);
> >> +     if (ret < 0)
> >> +             return ret;
> >> +
> >> +     usleep_range(10000, 20000);
> >> +
> >> +     ret = mipi_dsi_dcs_set_pixel_format(dsi, 0x70);
> >> +     if (ret < 0)
> >> +             return ret;
> >
> > Please use the existing symbolic constants for this.
> i am not clear on the symbolic constants for pixel_format ?

See include/video/mipi_display.h

> >> +
> >> +     ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY,
> >> +                              (u8[]){ 0x24 }, 1);
> >> +     if (ret < 0)
> >> +             return ret;
> brightness control setting, to enable pwm/backlight
> >> +
> >> +     ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_POWER_SAVE,
> >> +                              (u8[]){ 0x00 }, 1);
> >> +     if (ret < 0)
> >> +             return ret;
> >
> this is to set cabc off/on

Can you point me to the specification of these? I'd like to investigate
whether or not we can turn these into more sensible commands. As-is, it
is completely obfuscated and I'd like to avoid that where possible.

> >> +     ret = mipi_dsi_generic_write(dsi, (u8[]){0xB0, 0x00}, 2);
> >> +     if (ret < 0)
> >> +             return ret;
> >> +     mdelay(10);
> >
> > Same here. This also needs at least a comment, though ideally you'd use
> > symbolic names for those magic numbers.
> i do not have the datasheet to give more description.
> this is for interface setting, either command mode/video mode

Okay, please add a comment on what this is supposed to do, then.

> >> +
> >> +     jdi->mode = &default_mode;
> >> +
> >> +     for (i = 0; i < num; i++)
> >> +             s[i].supply = regs[i];
> >> +
> >> +     ret = devm_regulator_bulk_get(dev, num, s);
> >> +     if (ret < 0) {
> >> +             dev_err(dev, "%s: failed to init regulator, ret=%d\n",
> >> +                     __func__, ret);
> >> +             return ret;
> >> +     }
> >> +
> >> +     jdi->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
> >> +     if (IS_ERR(jdi->reset_gpio)) {
> >> +             dev_err(dev, "cannot get reset-gpios %ld\n",
> >> +                     PTR_ERR(jdi->reset_gpio));
> >
> > This is a third variant of error reporting. Please stick to one.
> for PTR_ERR(jdi->reset_gpio) returns unsigned long, so this error reporting
> cannot be changed to ret,
> others error reporting incorporated consistently.

PTR_ERR() returns signed long, not unsigned.

You can still use the same format for the message and substitute the
%ld printk specifier to match the type.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-06-14 11:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13 10:25 [PATCH v2 1/2] drm/dsi: Implement dcs set/get display brightness Vinay Simha BN
2016-06-13 10:25 ` [PATCH v4 2/2] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel Vinay Simha BN
2016-06-13 12:35   ` Thierry Reding
2016-06-14 10:57     ` Vinay Simha
2016-06-14 11:25       ` Thierry Reding [this message]
2016-06-14 17:03         ` Vinay Simha
2016-06-15 13:11     ` Vinay Simha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160614112527.GA30021@ulmo.ba.sec \
    --to=thierry.reding@gmail.com \
    --cc=airlied@linux.ie \
    --cc=archit.taneja@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robdclark@gmail.com \
    --cc=simhavcs@gmail.com \
    --cc=sumit.semwal@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).