OSDN Git Service

drm/panel: sitronix-st7789v: Check display ID
authorMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 14 Jul 2023 01:37:56 +0000 (03:37 +0200)
committerNeil Armstrong <neil.armstrong@linaro.org>
Tue, 1 Aug 2023 08:29:59 +0000 (10:29 +0200)
commit290cdd7959a734a0ef20ec096af7810177c4b9f8
treed53d954b7f844118e086a64b4d44e160f145f736
parent71f739082160b5e4def3a7083dc25583cc195d04
drm/panel: sitronix-st7789v: Check display ID

A very basic debugging rule when a device is connected for the first
time is to access a read-only register which contains known data in
order to ensure the communication protocol is properly working. This
driver lacked any read helper which is often a critical piece for
speeding-up bring-ups.

Add a read helper and use it to verify the communication with the panel
is working as soon as possible in order to inform the user early if this
is not the case.

As this panel may work with no MISO line, the check is discarded in this
case. Upon error, we do not fail probing but just warn the user, in case
the DT description would be lacking the Rx bus width (which is likely on
old descriptions) in order to avoid breaking existing devices.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Tested-by: Sebastian Reichel <sre@kernel.org> # no MISO line
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230714013756.1546769-20-sre@kernel.org
drivers/gpu/drm/panel/panel-sitronix-st7789v.c