Skip to contentSkip to conversation

drm/panel: Add NewVision NV3051D Panels

PATCH In review Chris Morgan 2 participants 5 messages Nov 11, 2022 – Nov 14, 2022

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

v5 cover drm/panel: Add NewVision NV3051D Panels

From: Chris Morgan <[email protected]>

Add the NewVision NV3051D panel as found on the Anbernic RG353P and RG353V. The underlying LCD panel itself is unknown (the NV3051D is the controller), so the device name is used for the panel with a fallback to the driver IC.

Changes from V4:
- Removed "prepared" as its tracked by the framework.
- Use mipi_dsi_dcs_write_seq instead of custom implementation.
- Changed devm_gpiod_get_optional to assert GPIO as high at probe so it is held in reset on suggestion from maintainer.
- Removed requirement for vdd-supply in documentation.
- Added description in documentation for reset gpio to note it should be active low.

Changes from V3:
- Changed driver remove function from int to void to match change made to mipi_dsi_driver struct.

Changes from V2:
- Ensured dt_binding_check and dtbs_check successfully passed.
- Corrected some minor formatting issues in documentation.
- Added another mode per userspace request for 100hz. I was unable to find a supported 50hz mode that would also work, so for now only 60hz, 100hz, and 120hz are supported.

Changes from V1:
- Changed compatible string to the driver IC.
- Updated documentation to use new compatible string with board name.
- Refactored somewhat to make it easier to support other LCD panels with this kernel module.
- Added support for 60hz mode. Adjusted pixel clock to ensure proper 60hz and 120hz (previously was running at 124hz).
- Added vendor prefix for NewVision. Anbernic vendor prefix added in
https://lore.kernel.org/linux-devicetree/[email protected]

Chris Morgan (3):
dt-bindings: vendor-prefixes: add NewVision vendor prefix
dt-bindings: display: panel: Add NewVision NV3051D bindings drm/panel: Add NewVision NV3051D MIPI-DSI LCD panel

 .../display/panel/newvision,nv3051d.yaml      |  63 +++
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 drivers/gpu/drm/panel/Kconfig                 |   9 +
 drivers/gpu/drm/panel/Makefile                |   1 +
 .../gpu/drm/panel/panel-newvision-nv3051d.c   | 504 ++++++++++++++++++
 5 files changed, 579 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml
 create mode 100644 drivers/gpu/drm/panel/panel-newvision-nv3051d.c
Signature · 1 line
2.25.1
#1 lore raw

PATCH v5 1/3 dt-bindings: vendor-prefixes: add NewVision vendor prefix

From: Chris Morgan <[email protected]>

NewVision (also sometimes written as New Vision) is a company based in Shenzen that manufactures ICs for controlling LCD panels.

https://www.newvisiondisplay.com/

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 6e323a380294..c6aa7b3d1455 100644
@@ -883,6 +883,8 @@ patternProperties:
     description: Shenzhen Netxeon Technology CO., LTD
   "^neweast,.*":
     description: Guangdong Neweast Optoelectronics CO., LTD
+  "^newvision,.*":
+    description: New Vision Display (Shenzhen) Co., Ltd.
   "^nexbox,.*":
     description: Nexbox
   "^nextthing,.*":
Signature · 1 line
2.25.1
#2 lore raw

PATCH v5 2/3 dt-bindings: display: panel: Add NewVision NV3051D bindings

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

Add documentation for the NewVision NV3051D panel bindings. Note that for the two expected consumers of this panel binding the underlying LCD model is unknown. Name "anbernic,rg353p-panel" is used because the hardware itself is known as "anbernic,rg353p".

---
 .../display/panel/newvision,nv3051d.yaml      | 63 +++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml
Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml new file +63 -0
new file mode 100644
index 000000000000..116c1b6030a2
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/newvision,nv3051d.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NewVision NV3051D based LCD panel
+
+description: |
+  The NewVision NV3051D is a driver chip used to drive DSI panels. For now,
+  this driver only supports the 640x480 panels found in the Anbernic RG353
+  based devices.
+
+maintainers:
+  - Chris Morgan <[email protected]>
+
+allOf:
+  - $ref: panel-common.yaml#
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - anbernic,rg353p-panel
+          - anbernic,rg353v-panel
+      - const: newvision,nv3051d
+
+  reg: true
+  backlight: true
+  port: true
+  reset-gpios:
+    description: Active low reset GPIO
+  vdd-supply: true
+
+required:
+  - compatible
+  - reg
+  - backlight
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    dsi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        panel@0 {
+            compatible = "anbernic,rg353p-panel", "newvision,nv3051d";
+            reg = <0>;
+            backlight = <&backlight>;
+            reset-gpios = <&gpio4 0 GPIO_ACTIVE_LOW>;
+            vdd-supply = <&vcc3v3_lcd>;
+
+            port {
+                mipi_in_panel: endpoint {
+                    remote-endpoint = <&mipi_out_panel>;
+                };
+            };
+        };
+    };
+
+...
Signature · 1 line
2.25.1
#3 lore raw

PATCH v5 3/3 drm/panel: Add NewVision NV3051D MIPI-DSI LCD panel

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

Support NewVision NV3051D panels as found on the Anbernic RG353P and RG353V. The underlying LCD part number for the RG353x devices is unknown, so the device name and a fallback for the driver IC is used instead.

---
 drivers/gpu/drm/panel/Kconfig                 |   9 +
 drivers/gpu/drm/panel/Makefile                |   1 +
 .../gpu/drm/panel/panel-newvision-nv3051d.c   | 504 ++++++++++++++++++
 3 files changed, 514 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-newvision-nv3051d.c
drivers/gpu/drm/panel/Kconfig +9 -0
index a582ddd583c2..427c22bdbfb3 100644
@@ -296,6 +296,15 @@ config DRM_PANEL_NEC_NL8048HL11
 	  panel (found on the Zoom2/3/3630 SDP boards). To compile this driver
 	  as a module, choose M here.
 
+config DRM_PANEL_NEWVISION_NV3051D
+	tristate "NewVision NV3051D DSI panel"
+	depends on OF
+	depends on DRM_MIPI_DSI
+	depends on BACKLIGHT_CLASS_DEVICE
+	help
+	  This driver supports the NV3051D based panel found on the Anbernic
+	  RG353P and RG353V.
+
 config DRM_PANEL_NEWVISION_NV3052C
 	tristate "NewVision NV3052C RGB/SPI panel"
 	depends on OF && SPI
drivers/gpu/drm/panel/Makefile +1 -0
index 34e717382dbb..cb03b3a82738 100644
@@ -27,6 +27,7 @@ obj-$(CONFIG_DRM_PANEL_LEADTEK_LTK500HD1829) += panel-leadtek-ltk500hd1829.o
 obj-$(CONFIG_DRM_PANEL_LG_LB035Q02) += panel-lg-lb035q02.o
 obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
 obj-$(CONFIG_DRM_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o
+obj-$(CONFIG_DRM_PANEL_NEWVISION_NV3051D) += panel-newvision-nv3051d.o
 obj-$(CONFIG_DRM_PANEL_NEWVISION_NV3052C) += panel-newvision-nv3052c.o
 obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35510) += panel-novatek-nt35510.o
 obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35560) += panel-novatek-nt35560.o
drivers/gpu/drm/panel/panel-newvision-nv3051d.c new file +504 -0

504 lines not on this page · raw message

Signature · 1 line
2.25.1
#4 lore raw
In reply to Chris Morgan
Quoted 7 lines · Chris Morgan

From: Chris Morgan <[email protected]>

Add the NewVision NV3051D panel as found on the Anbernic RG353P and RG353V. The underlying LCD panel itself is unknown (the NV3051D is the controller), so the device name is used for the panel with a fallback to the driver IC.

Quoted 8 lines

Changes from V4:
- Removed "prepared" as its tracked by the framework.
- Use mipi_dsi_dcs_write_seq instead of custom implementation.
- Changed devm_gpiod_get_optional to assert GPIO as high at probe so it is held in reset on suggestion from maintainer.
- Removed requirement for vdd-supply in documentation.
- Added description in documentation for reset gpio to note it should be active low.

v5 looks good, patches applied to drm-misc-next and pushed, I had to fix a minor checkpatch complaint in the driver but it was trivial.

Yours,
Linus Walleij