Skip to contentSkip to conversation

drm/tiny: Add support for Sitronix ST7539

RFC PATCH In review Christian Eggers 2 participants 2 messages Jul 3, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 drm/tiny: Add support for Sitronix ST7539

Based on the existing ST7586 driver. But the ST7539 ...
- is monochrome only
- has 8 VERTICAL pixels per byte
- doesn't support any MIPI DCS commands
- has (a few) 16 bit commands
- doesn't support setting a clipping rect when writing to the RAM
- doesn't support rotation (only mirroring of X and/or Y axis)

Questions/TODO:
- should drivers for such old displays be mainlined?
- shall I use mipi_dbi_ although the display doesn't implement MIPI DCS (and has some 16 bit commands)?
- can the conversion to 8 vertical pixels/byte (taken from solomon/ssd130x.c) be avoided / simplified / made more efficient?
- how to implement setting of the display contrast (required by my application)?
- add device tree binding

---
 MAINTAINERS                   |   6 +
 drivers/gpu/drm/tiny/Kconfig  |  11 +
 drivers/gpu/drm/tiny/Makefile |   1 +
 drivers/gpu/drm/tiny/st7539.c | 424 ++++++++++++++++++++++++++++++++++
 4 files changed, 442 insertions(+)
 create mode 100644 drivers/gpu/drm/tiny/st7539.c
MAINTAINERS +6 -0
index e7d543cf9f6c..7191206c1ae3 100644
@@ -7116,6 +7116,12 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/display/panel/samsung,s6d7aa0.yaml
 F:	drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c
 
+DRM DRIVER FOR SITRONIX ST7539 PANELS
+M:	Christian Eggers <[email protected]>
+S:	Maintained
+T:	git https://gitlab.freedesktop.org/drm/misc/kernel.git
+F:	drivers/gpu/drm/tiny/st7539.c
+
 DRM DRIVER FOR SITRONIX ST7586 PANELS
 M:	David Lechner <[email protected]>
 S:	Maintained
drivers/gpu/drm/tiny/Kconfig +11 -0
index f6889f649bc1..220d2aee9354 100644
@@ -186,6 +186,17 @@ config TINYDRM_REPAPER
 
 	  If M is selected the module will be called repaper.
 
+config TINYDRM_ST7539
+	tristate "DRM support for Sitronix ST7539 display panels"
+	depends on DRM && SPI
+	select DRM_KMS_HELPER
+	select DRM_GEM_DMA_HELPER
+	select DRM_MIPI_DBI
+	help
+	  DRM driver for Sitronix ST7539 panels.
+
+	  If M is selected the module will be called st7539.
+
 config TINYDRM_ST7586
 	tristate "DRM support for Sitronix ST7586 display panels"
 	depends on DRM && SPI
drivers/gpu/drm/tiny/Makefile +1 -0
index 76dde89a044b..0bd217779995 100644
@@ -14,5 +14,6 @@ obj-$(CONFIG_TINYDRM_ILI9341)		+= ili9341.o
 obj-$(CONFIG_TINYDRM_ILI9486)		+= ili9486.o
 obj-$(CONFIG_TINYDRM_MI0283QT)		+= mi0283qt.o
 obj-$(CONFIG_TINYDRM_REPAPER)		+= repaper.o
+obj-$(CONFIG_TINYDRM_ST7539)		+= st7539.o
 obj-$(CONFIG_TINYDRM_ST7586)		+= st7586.o
 obj-$(CONFIG_TINYDRM_ST7735R)		+= st7735r.o
drivers/gpu/drm/tiny/st7539.c new file +424 -0

424 lines not on this page · raw message

Signature · 1 line
2.43.0
#1 lore raw
Quoted 9 lines · Christian Eggers

Based on the existing ST7586 driver. But the ST7539 ...
- is monochrome only
- has 8 VERTICAL pixels per byte
- doesn't support any MIPI DCS commands
- has (a few) 16 bit commands
- doesn't support setting a clipping rect when writing to the RAM
- doesn't support rotation (only mirroring of X and/or Y axis)

Questions/TODO:

To start with, I would suggest reading [1]. This patch is really hard to read because it isn't properly formatted. If you don't change the patch, you can resend it as [RFC PATCH RESEND] using git send-email, or if you do change the patch before re-sending, e.g. because you fixed checkpatch style issues, just call it v2.

[1]: https://www.kernel.org/doc/html/latest/process/submitting-patches.html

Quoted 1 line

- should drivers for such old displays be mainlined?

If it is actually going to be used and you are willing to maintain it, then yes.

Quoted 6 lines

- shall I use mipi_dbi_ although the display doesn't implement MIPI DCS (and has some 16 bit commands)?
- can the conversion to 8 vertical pixels/byte (taken from solomon/ssd130x.c) be avoided / simplified / made more efficient?
- how to implement setting of the display contrast (required by my application)?

I see that ssd130x_update_bl() is using brightness to control contrast. Don't know if it that is the best way though.

Quoted 4 lines

- add device tree binding

---