From: Sam Ravnborg <sam@ravnborg.org>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: devicetree@vger.kernel.org, david@lechnology.com,
dave.stevenson@raspberrypi.com, dri-devel@lists.freedesktop.org,
robh+dt@kernel.org, thierry.reding@gmail.com, maxime@cerno.tech
Subject: Re: [PATCH v2 3/3] drm/panel: Add MIPI DBI compatible SPI driver
Date: Thu, 27 Jan 2022 20:59:34 +0100 [thread overview]
Message-ID: <YfL5ptT3Kw1ohC/1@ravnborg.org> (raw)
In-Reply-To: <20220125175700.37408-4-noralf@tronnes.org>
Hi Noralf,
On Tue, Jan 25, 2022 at 06:57:00PM +0100, Noralf Trønnes wrote:
> Add a driver that will work with most MIPI DBI compatible SPI panels.
> This avoids adding a driver for every new MIPI DBI compatible controller
> that is to be used by Linux. The 'compatible' Device Tree property with
> a '.bin' suffix will be used to load a firmware file that contains the
> controller configuration.
Loading a configuration from a firmware file is very
elegant - I like.
This will be very useful in a million cases with a lot of small panels!
> +
> + /*
> + * Optional MIPI commands to execute when the display pipeline is enabled.
> + * This can be used to configure the display controller.
> + *
> + * The commands are stored in a byte array with the format:
> + * command, num_parameters, [ parameter, ...], command, ...
> + *
> + * Some commands require a pause before the next command can be received.
> + * Inserting a delay in the command sequence is done by using the NOP command with one
> + * parameter: delay in miliseconds (the No Operation command is part of the MIPI Display
> + * Command Set where it has no parameters).
> + *
> + * Example:
> + * command 0x11
> + * sleep 120ms
> + * command 0xb1 parameters 0x01, 0x2c, 0x2d
> + * command 0x29
> + *
> + * Byte sequence:
> + * 0x11 0x00
> + * 0x00 0x01 0x78
> + * 0xb1 0x03 0x01 0x2c 0x2d
> + * 0x29 0x00
> + */
Using a binary file that is unreadable when it is first created is less
elegant.
I am sure you have considered a txt file - and I know parsing a txt file
in prone for more errros than parsing a binary file.
But if the text file looked like:
"
# The is a comment
cmd 0x11 0x00
# We need to sleep
sleepms 120
# Do something more
cmd 0xb1 0x03 0x01 0x2c 0x2d
cmd 0x29 0x00
"
The file is easier to comment (document) and easier to read and
modify.
The suffix could be ".panel" to tell this is something specific for
a panel.
Using lib/parser could make the code somewhat simple but I did not try
to code it myself.
The code you included below for the binary file is very simple,
but you shift the burden to the people who have to create binary files.
And people using obscure displays are not always so good at this stuff.
Sorry that I do not include code to do the above, but let me know if
this would help to convince you.
Sam - who has been absent due to house renovation and such
next prev parent reply other threads:[~2022-01-27 20:15 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-25 17:56 [PATCH v2 0/3] drm/panel: Add MIPI DBI compatible SPI driver Noralf Trønnes
2022-01-25 17:56 ` [PATCH v2 1/3] dt-bindings: display: add bindings for MIPI DBI compatible SPI panels Noralf Trønnes
2022-01-27 9:37 ` Maxime Ripard
2022-02-07 23:20 ` Rob Herring
2022-02-08 12:16 ` Noralf Trønnes
2022-02-09 9:04 ` Maxime Ripard
2022-02-09 12:29 ` Noralf Trønnes
2022-01-25 17:56 ` [PATCH v2 2/3] drm/mipi-dbi: Add driver_private member to struct mipi_dbi_dev Noralf Trønnes
2022-01-25 17:57 ` [PATCH v2 3/3] drm/panel: Add MIPI DBI compatible SPI driver Noralf Trønnes
2022-01-27 10:04 ` Maxime Ripard
2022-01-27 17:53 ` Noralf Trønnes
2022-02-02 10:09 ` Maxime Ripard
2022-02-02 13:53 ` Noralf Trønnes
2022-02-02 17:14 ` Sam Ravnborg
2022-02-03 15:06 ` Maxime Ripard
2022-01-27 17:19 ` David Lechner
2022-01-27 20:08 ` Noralf Trønnes
2022-01-27 19:59 ` Sam Ravnborg [this message]
2022-01-27 20:26 ` Noralf Trønnes
2022-01-27 17:13 ` [PATCH v2 0/3] " David Lechner
2022-01-27 20:02 ` Noralf Trønnes
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=YfL5ptT3Kw1ohC/1@ravnborg.org \
--to=sam@ravnborg.org \
--cc=dave.stevenson@raspberrypi.com \
--cc=david@lechnology.com \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=maxime@cerno.tech \
--cc=noralf@tronnes.org \
--cc=robh+dt@kernel.org \
--cc=thierry.reding@gmail.com \
/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