devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Paul Cercueil <paul@crapouillou.net>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	Sam Ravnborg <sam@ravnborg.org>, David Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel@ffwll.ch>, Rob Herring <robh+dt@kernel.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Noralf Tronnes <noralf@tronnes.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	od@zcrc.me,
	"open list:DRM PANEL DRIVERS" <dri-devel@lists.freedesktop.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH v2 3/6] drm: Add SPI DBI host driver
Date: Wed, 9 Sep 2020 13:57:48 +0200	[thread overview]
Message-ID: <CACRpkdaN7S9PoYd2d-hxUNq9NXA52P0TugwRzyFuCTCc6Onp=Q@mail.gmail.com> (raw)
In-Reply-To: <20200822163250.63664-4-paul@crapouillou.net>

Hi Paul,

I looked a bit at this patch

On Sat, Aug 22, 2020 at 6:33 PM Paul Cercueil <paul@crapouillou.net> wrote:

> +config DRM_MIPI_DBI_SPI
> +       tristate "SPI host support for MIPI DBI"
> +       depends on DRM && OF && SPI

I think you want to depend on SPI_HOST actually.

> +       struct gpio_desc *dc;

This dc is very much undocumented, so I can only guess what
it is for, please add some kerneldoc explaining what it is.
I suppose it is in the DBI spec but I don't have it.

> +       gpiod_set_value_cansleep(dbi->dc, 0);

Since it is optional I usually prefer to do it like this:

if (dbi->dc)
   gpiod_set_value_cansleep(dbi->dc, 0);

> +  gpiod_set_value_cansleep(dbi->dc, 1);

Since you drive this low when you assert it and
high when you de-assert it, inverse this and mark the
GPIO line as GPIO_ACTIVE_LOW in the device tree
instead.

> +       dbi->dc = devm_gpiod_get_optional(dev, "dc", GPIOD_OUT_LOW);
> +       if (IS_ERR(dbi->dc)) {
> +               dev_err(dev, "Failed to get gpio 'dc'\n");
> +               return PTR_ERR(dbi->dc);
> +       }

Currently you are requesting the line asserted according to the
above logic. Is that what you want?

If you change the DT to GPIO_ACTIVE_LOW then this seems
correct.

But I am overall a bit curious about this "dc" thing. What is it
really? It seems suspiciously similar to a SPI chip select,
and then that is something that should be handled by the
SPI core and set as cs-gpios in the device tree instead.
It is certainly used exactly like a chip select as far as I can
tell.

Yours,
Linus Walleij

  reply	other threads:[~2020-09-09 15:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-22 16:32 [PATCH v2 0/6] DSI/DBI, panel drivers, & tinyDRM v2 Paul Cercueil
2020-08-22 16:32 ` [PATCH v2 1/6] dt-bindings: display: Document NewVision NV3052C DT node Paul Cercueil
2020-09-08 21:50   ` Rob Herring
2020-09-09 11:41   ` Linus Walleij
2020-08-22 16:32 ` [PATCH v2 2/6] drm: dsi: Let host and device specify supported bus Paul Cercueil
2020-08-22 16:32 ` [PATCH v2 3/6] drm: Add SPI DBI host driver Paul Cercueil
2020-09-09 11:57   ` Linus Walleij [this message]
2020-08-22 16:32 ` [PATCH v2 4/6] drm/tiny: Add TinyDRM for DSI/DBI panels Paul Cercueil
2020-08-22 16:32 ` [PATCH v2 5/6] drm/panel: Add panel driver for NewVision NV3052C based LCDs Paul Cercueil
2020-08-24 20:55   ` Linus Walleij
2020-08-22 16:32 ` [PATCH v2 6/6] drm/panel: Add Ilitek ILI9341 DBI panel driver Paul Cercueil
2020-08-30 16:36   ` 答复: " 何小龙 (Leon He)
2020-08-30 16:48     ` Paul Cercueil
2020-08-30 19:11       ` Laurent Pinchart
2020-08-30 20:28         ` Sam Ravnborg
2020-09-07 12:57           ` Paul Cercueil
2020-09-08  7:18             ` Neil Armstrong
2020-09-09 11:38   ` Linus Walleij

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='CACRpkdaN7S9PoYd2d-hxUNq9NXA52P0TugwRzyFuCTCc6Onp=Q@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@linux.ie \
    --cc=broonie@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=noralf@tronnes.org \
    --cc=od@zcrc.me \
    --cc=paul@crapouillou.net \
    --cc=robh+dt@kernel.org \
    --cc=sam@ravnborg.org \
    --cc=thierry.reding@gmail.com \
    --cc=tzimmermann@suse.de \
    /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).