Skip to contentSkip to conversation

Add support for Mayqueen Pixpaper e-ink panel

PATCH Superseded LiangCheng Wang 1 participant 4 messages Jul 21, 2025

Subsystems (5)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

LiangCheng Wang

author maintainer
#0 lore raw

v3 cover Add support for Mayqueen Pixpaper e-ink panel

This patch series adds support for the Mayqueen Pixpaper e-ink display panel, controlled via SPI.

The series includes:
- A new vendor-prefix entry for "mayqueen"
- Device tree binding documentation for the Pixpaper panel
- A DRM tiny driver implementation for the Pixpaper panel
- A MAINTAINERS entry for the Pixpaper DRM driver and binding

The panel supports 122x250 resolution with XRGB8888 format and uses SPI, along with GPIO lines for reset, busy, and data/command control.

The driver has been tested on:
- Raspberry Pi 2 Model B
with Linux kernel 6.16.

---
Changes in v3:
- MAINTAINERS
- Added pixpaper-regs.h

- Kconfig
- Rename config symbol to DRM_PIXPAPER (drop TINYDRM_ prefix).
- Reordered Kconfig select lines alphabetically.

- Code structure & style
- Fix include order: move <linux/> headers above <drm/> headers.
- Removed forward declarations; placed static functions next to usage
- Switched logging to drm_err()/drm_warn()/drm_dbg() (legacy DRM_ERROR/WARN removed)
- Remove dev_info() statements.
- Switched encoder type to DRM_MODE_ENCODER_NONE
- Moved pixpaper_panel_hw_init() from atomic_enable() to probe() to avoid redundant hardware init.
- Use helper to_pixpaper_panel() instead of container_of() on crtc.

- Robustness
- Added timeout + warning in pixpaper_wait_busy() to ensure robustness if BUSY line gets stuck.
- Introduced struct pixpaper_error_ctx to propagate SPI/GPIO errors

- Clean‑ups
- Removed drm_plane_enable_fb_damage_clips() (full‑frame updates)
- Removed noisy info prints; kept drm_dbg() only where helpful
- Consolidated all magic register values/commands into new pixpaper-regs.h with datasheet‑aligned naming

- Memory helpers
- Driver now uses GEM SHMEM helpers; GEM DMA helpers dropped (panel has no bus‑mastering DMA)

- Functionality fixes
- Rewrote pack_pixels_to_byte() to correctly handle 4-color (B/W/R/Y) layout based on expected panel color encoding

- DRM callback safety
- Add missing drm_dev_enter()/drm_dev_exit() in callbacks.

- Tags added
- Reviewed-by: Rob Herring <[email protected]> (from v1)
- Acked-by: Rob Herring <[email protected]> (from v1)
- Acked-by: Krzysztof Kozlowski <[email protected]> (from v2)

- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Reordered patches so that DT bindings come before the driver (suggested by Rob Herring)
- Fixed sparse warning: removed duplicate .reset initializer in pixpaper_plane_funcs
- Fixed checkpatch issues reported by Media CI:
- Removed unnecessary blank line before closing brace
- Moved opening parentheses up to function call lines (e.g., DRM_WARN(...))
- Fixed alignment of conditionals
- Fixed dev_warn( and drm_universal_plane_init( formatting
- Thanks to Rob Herring for ack on vendor-prefix patch
- Link to v1: https://lore.kernel.org/r/[email protected]

Thanks to all reviewers for feedback across earlier versions.

Best regards,
LiangCheng Wang
<[email protected]>

---
LiangCheng Wang (2):
dt-bindings: display: Add Mayqueen Pixpaper e-ink panel
drm: tiny: Add support for Mayqueen Pixpaper e-ink panel

Wig Cheng (1):
dt-bindings: vendor-prefixes: Add Mayqueen name

 .../bindings/display/mayqueen,pixpaper.yaml        |  63 ++
 .../devicetree/bindings/vendor-prefixes.yaml       |   2 +
 MAINTAINERS                                        |   7 +
 drivers/gpu/drm/tiny/Kconfig                       |  15 +
 drivers/gpu/drm/tiny/Makefile                      |   1 +
 drivers/gpu/drm/tiny/pixpaper-regs.h               | 428 +++++++++++
 drivers/gpu/drm/tiny/pixpaper.c                    | 790 +++++++++++++++++++++
 7 files changed, 1306 insertions(+)

---
base-commit: 6832a9317eee280117cd695fa885b2b7a7a38daf
change-id: 20250708-drm-6021df0715d7

Best regards,

Signature · 1 line
LiangCheng Wang <[email protected]>
author maintainer
#1 lore raw

PATCH v3 1/3 dt-bindings: vendor-prefixes: Add Mayqueen name

From: Wig Cheng <[email protected]>

Mayqueen is a Taiwan-based company primarily focused on the development of arm64 development boards and e-paper displays.

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 5d2a7a8d3ac6c666c8b557c2ef385918e5e97bf9..9207c25a3490a3aa5cc9d513290e7890799f92cf 100644
@@ -916,6 +916,8 @@ patternProperties:
     description: Maxim Integrated Products
   "^maxlinear,.*":
     description: MaxLinear Inc.
+  "^mayqueen,.*":
+    description: Mayqueen Technologies Ltd.
   "^mbvl,.*":
     description: Mobiveil Inc.
   "^mcube,.*":
Signature · 1 line
2.34.1
author maintainer
#2 lore raw

PATCH v3 2/3 dt-bindings: display: Add Mayqueen Pixpaper e-ink panel

In reply to LiangCheng Wang

The binding is for the Mayqueen Pixpaper e-ink display panel, controlled via an SPI interface.

---
 .../bindings/display/mayqueen,pixpaper.yaml        | 63 ++++++++++++++++++++++
 1 file changed, 63 insertions(+)
Documentation/devicetree/bindings/display/mayqueen,pixpaper.yaml new file +63 -0
new file mode 100644
index 0000000000000000000000000000000000000000..cd27f8ba5ae1d94660818525b5fa71db98c8acb7
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/mayqueen,pixpaper.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mayqueen Pixpaper e-ink display panel
+
+maintainers:
+  - LiangCheng Wang <[email protected]>
+
+description:
+  The Pixpaper is an e-ink display panel controlled via an SPI interface.
+  The panel has a resolution of 122x250 pixels and requires GPIO pins for
+  reset, busy, and data/command control.
+
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+properties:
+  compatible:
+    const: mayqueen,pixpaper
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency:
+    maximum: 1000000
+    default: 1000000
+
+  reset-gpios:
+    maxItems: 1
+
+  busy-gpios:
+    maxItems: 1
+
+  dc-gpios:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - reset-gpios
+  - busy-gpios
+  - dc-gpios
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        display@0 {
+            compatible = "mayqueen,pixpaper";
+            reg = <0>;
+            spi-max-frequency = <1000000>;
+            reset-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
+            busy-gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>;
+            dc-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
+        };
+    };
Signature · 1 line
2.34.1
author maintainer
#3 lore raw

PATCH v3 3/3 drm: tiny: Add support for Mayqueen Pixpaper e-ink panel

In reply to LiangCheng Wang

Introduce a DRM driver for the Mayqueen Pixpaper e-ink display panel, which is controlled via SPI. The driver supports a 122x250 resolution display with XRGB8888 format.

Also, add a MAINTAINERS entry for the Pixpaper driver.

---
 MAINTAINERS                          |   7 +
 drivers/gpu/drm/tiny/Kconfig         |  15 +
 drivers/gpu/drm/tiny/Makefile        |   1 +
 drivers/gpu/drm/tiny/pixpaper-regs.h | 428 +++++++++++++++++++
 drivers/gpu/drm/tiny/pixpaper.c      | 790 +++++++++++++++++++++++++++++++++++
 5 files changed, 1241 insertions(+)
MAINTAINERS +7 -0
index 60bba48f5479a025f9da3eaf9dbacb67a194df07..b05b7a0b7a6c4f7b02300da89ac65744f60ee8da 100644
@@ -7758,6 +7758,13 @@ T:	git https://gitlab.freedesktop.org/drm/misc/kernel.git
 F:	Documentation/devicetree/bindings/display/repaper.txt
 F:	drivers/gpu/drm/tiny/repaper.c
 
+DRM DRIVER FOR PIXPAPER E-INK PANEL
+M:	LiangCheng Wang <[email protected]>
+S:	Maintained
+F:	Documentation/devicetree/bindings/display/mayqueen,pixpaper.yaml
+F:	drivers/gpu/drm/tiny/pixpaper-regs.h
+F:	drivers/gpu/drm/tiny/pixpaper.c
+
 DRM DRIVER FOR QEMU'S CIRRUS DEVICE
 M:	Dave Airlie <[email protected]>
 M:	Gerd Hoffmann <[email protected]>
drivers/gpu/drm/tiny/Kconfig +15 -0
index 06e54694a7f2fe1649e1886f039926b24f698e0d..94a5bf61a115929640022128e20c723ab7c0e735 100644
@@ -82,6 +82,21 @@ config DRM_PANEL_MIPI_DBI
 	  https://github.com/notro/panel-mipi-dbi/wiki.
 	  To compile this driver as a module, choose M here.
 
+config DRM_PIXPAPER
+        tristate "DRM support for PIXPAPER display panels"
+        depends on DRM && SPI
+        select DRM_CLIENT_SELECTION
+        select DRM_GEM_DMA_HELPER
+        select DRM_KMS_HELPER
+        help
+	  DRM driver for the Mayqueen Pixpaper e-ink display panel.
+
+	  This driver supports small e-paper displays connected over SPI,
+	  with a resolution of 122x250 and XRGB8888 framebuffer format.
+	  It is intended for low-power embedded applications.
+
+	  If M is selected, the module will be built as pixpaper.ko.
+
 config TINYDRM_HX8357D
 	tristate "DRM support for HX8357D display panels"
 	depends on DRM && SPI
drivers/gpu/drm/tiny/Makefile +1 -0
index 4a9ff61ec25420e2c0a648c04eaab7ca25dd5407..48d30bf6152f979404ac1004174587823a30109e 100644
@@ -6,6 +6,7 @@ obj-$(CONFIG_DRM_BOCHS)			+= bochs.o
 obj-$(CONFIG_DRM_CIRRUS_QEMU)		+= cirrus-qemu.o
 obj-$(CONFIG_DRM_GM12U320)		+= gm12u320.o
 obj-$(CONFIG_DRM_PANEL_MIPI_DBI)	+= panel-mipi-dbi.o
+obj-$(CONFIG_DRM_PIXPAPER)              += pixpaper.o
 obj-$(CONFIG_TINYDRM_HX8357D)		+= hx8357d.o
 obj-$(CONFIG_TINYDRM_ILI9163)		+= ili9163.o
 obj-$(CONFIG_TINYDRM_ILI9225)		+= ili9225.o
drivers/gpu/drm/tiny/pixpaper-regs.h new file +428 -0

428 lines not on this page · raw message

drivers/gpu/drm/tiny/pixpaper.c new file +790 -0

790 lines not on this page · raw message

Signature · 1 line
2.34.1