Skip to contentSkip to conversation

dt-bindings: backlight: add VIEWE I2C backlight binding

PATCH Superseded Hefei 2 participants 12 messages Nov 25 1 message not in the archive

Subsystems (9)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Hefei

author
#1 lore raw

PATCH v2 1/6 dt-bindings: display: add VIEWE JD9365TX panel binding

---
 .../display/panel/viewe,jd9365tx.yaml         | 70 +++++++++++++++++++
 1 file changed, 70 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/panel/viewe,jd9365tx.yaml
Documentation/devicetree/bindings/display/panel/viewe,jd9365tx.yaml new file +70 -0
new file mode 100644
index 0000000..1043f93
@@ -0,0 +1,70 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/viewe,jd9365tx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: VIEWE 7.0" 720x1280 Jadard JD9365TX MIPI-DSI in-cell panel
+
+maintainers:
+  - Hefei <[email protected]>
+
+description: |
+  The VIEWE 7KF82 module is a 720x1280 RGB888 video-mode MIPI-DSI panel
+  based on Jadard JD9365TX. It uses two DSI data lanes and exposes in-cell
+  touch over I2C on the same FPC.
+
+allOf:
+  - $ref: panel-common.yaml#
+
+properties:
+  compatible:
+    const: viewe,7kf82
+
+  reg:
+    maxItems: 1
+
+  vdd-supply:
+    description: Panel VDD supply, usually 3.3V
+
+  iovcc-supply:
+    description: Panel IO voltage supply, usually 3.3V
+
+  reset-gpios:
+    description: Optional panel reset GPIO (omit if board uses POR only).
+    maxItems: 1
+
+  backlight: true
+  rotation: true
+  port: true
+
+required:
+  - compatible
+  - reg
+  - vdd-supply
+  - iovcc-supply
+  - port
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    dsi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        panel@0 {
+            compatible = "viewe,7kf82";
+            reg = <0>;
+            vdd-supply = <&reg_vdd>;
+            iovcc-supply = <&reg_iovcc>;
+            backlight = <&viewe_bl>;
+
+            port {
+                endpoint {
+                    remote-endpoint = <&dsi_out>;
+                };
+            };
+        };
+    };
+...
Signature · 1 line
2.55.0.windows.5
#2 lore raw

Re: [PATCH v2 1/6] dt-bindings: display: add VIEWE JD9365TX panel binding

Thank you for your contribution! Sashiko AI review found 4 potential issues to consider: - [Medium] dt-bindings: display: panel: undocumented viewe vendor prefix - [Medium] dt-bindings: display…

Thank you for your contribution! Sashiko AI review found 4 potential issues to consider:
- [Medium] dt-bindings: display: panel: undocumented viewe vendor prefix
- [Medium] dt-bindings: display: panel: schema filename and $id mismatch compatible
- [Low] dt-bindings: display: panel: redundant subject, empty body, and bad trailer
- [Low] dt-bindings: display: panel: redundant panel-common.yaml properties
--

commit 23e321059ffa404a62a9dbc2300a4993242b19a7
Author: Hefei <[email protected]>

Quoted 4 lines

dt-bindings: display: add VIEWE JD9365TX panel binding

[Severity: Low]
The dt-bindings: prefix already indicates a binding, so "binding" in the subject line is redundant. The commit message also has no description body, and checkpatch.pl rejects Co-authored-by: (kernel commits use

Co-developed-by paired with Signed-off-by: for human co-authors, or
Assisted-by for tools).

Documentation/devicetree/bindings/display/panel/viewe,jd9365tx.yaml line 4

Quoted 10 lines
Documentation/devicetree/bindings/display/panel/viewe,jd9365tx.yaml new file +4 -0
new file mode 100644
index 0000000000000..1043f93623c00
@@ -0,0 +1,70 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/viewe,jd9365tx.yaml#

[Severity: Medium]
Should the schema filename and $id match the compatible string documented below (viewe,7kf82.yaml)? viewe,jd9365tx.yaml does not match any compatible string in this schema and pairs the viewe panel vendor prefix with the Jadard JD9365TX controller part number.

Quoted 8 lines
Documentation/devicetree/bindings/display/panel/viewe,jd9365tx.yaml new file +8 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: VIEWE 7.0" 720x1280 Jadard JD9365TX MIPI-DSI in-cell panel
+
+maintainers:
+  - Hefei <[email protected]>
+
+description: |

Documentation/devicetree/bindings/display/panel/viewe,jd9365tx.yaml line 22

Quoted 10 lines
Documentation/devicetree/bindings/display/panel/viewe,jd9365tx.yaml new file +10 -0
+  The VIEWE 7KF82 module is a 720x1280 RGB888 video-mode MIPI-DSI panel
+  based on Jadard JD9365TX. It uses two DSI data lanes and exposes in-cell
+  touch over I2C on the same FPC.
+
+allOf:
+  - $ref: panel-common.yaml#
+
+properties:
+  compatible:
+    const: viewe,7kf82

[Severity: Medium]
Is the viewe vendor prefix documented in Documentation/devicetree/bindings/vendor-prefixes.yaml? Without a matching entry there, make dt_binding_check and checkpatch.pl flag viewe,7kf82 as an undocumented vendor prefix.

Quoted 7 lines
Documentation/devicetree/bindings/display/panel/viewe,jd9365tx.yaml new file +7 -0
+
+  reg:
+    maxItems: 1
+
+  vdd-supply:
+    description: Panel VDD supply, usually 3.3V
+

Documentation/devicetree/bindings/display/panel/viewe,jd9365tx.yaml line 39

Quoted 10 lines
Documentation/devicetree/bindings/display/panel/viewe,jd9365tx.yaml new file +10 -0
+  iovcc-supply:
+    description: Panel IO voltage supply, usually 3.3V
+
+  reset-gpios:
+    description: Optional panel reset GPIO (omit if board uses POR only).
+    maxItems: 1
+
+  backlight: true
+  rotation: true
+  port: true

[Severity: Low]
Since this schema references panel-common.yaml# and uses
unevaluatedProperties: false, reset-gpios (with maxItems: 1), backlight, rotation, and port are already defined there. Can reset-gpios use
reset-gpios: true (since omitting it from required: already expresses that it is optional) or can these common properties be omitted when
unevaluatedProperties: false is set?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
author
#3 lore raw

PATCH v2 2/6 dt-bindings: input: add Jadard JD9365TX touchscreen binding

In reply to a message not in the archive
---
 .../input/touchscreen/jadard,jd9365tx.yaml    | 64 +++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/jadard,jd9365tx.yaml
Documentation/devicetree/bindings/input/touchscreen/jadard,jd9365tx.yaml new file +64 -0
new file mode 100644
index 0000000..aaf2a7e
@@ -0,0 +1,64 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/jadard,jd9365tx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Jadard JD9365TX in-cell touchscreen
+
+maintainers:
+  - Hefei <[email protected]>
+
+description: |
+  In-cell touch integrated with Jadard JD9365TX DSI panels. The module FPC
+  often exposes only I2C (no interrupt GPIO); the driver polls coordinate
+  reports. The touch controller is commonly powered from the same rails as
+  the panel; those supplies should still be described here when dedicated
+  regulators exist.
+
+allOf:
+  - $ref: touchscreen.yaml#
+
+properties:
+  compatible:
+    const: jadard,jd9365tx
+
+  reg:
+    maxItems: 1
+
+  poll-interval: true
+
+  vdd-supply:
+    description: Analog / touch power supply
+
+  iovcc-supply:
+    description: Digital I/O power supply
+
+  reset-gpios:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - vdd-supply
+  - iovcc-supply
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        touchscreen@68 {
+            compatible = "jadard,jd9365tx";
+            reg = <0x68>;
+            vdd-supply = <&reg_vdd>;
+            iovcc-supply = <&reg_iovcc>;
+            touchscreen-size-x = <720>;
+            touchscreen-size-y = <1280>;
+            poll-interval = <16>;
+        };
+    };
+...
Signature · 1 line
2.55.0.windows.5
#4 lore raw

Re: [PATCH v2 2/6] dt-bindings: input: add Jadard JD9365TX touchscreen binding

Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Low] dt-bindings: input: redundant binding in subject and invalid commit message - [Low] dt-bindings…

Thank you for your contribution! Sashiko AI review found 2 potential issues to consider:
- [Low] dt-bindings: input: redundant binding in subject and invalid commit message
- [Low] dt-bindings: input: jadard,jd9365tx missing interrupts and supply mismatch
--

commit 5025f445b383095ff3ce67c95d18c172670d9482
Author: Hefei <[email protected]>

Quoted 4 lines

dt-bindings: input: add Jadard JD9365TX touchscreen binding

[Severity: Low]
Under DT binding conventions, the "dt-bindings:" prefix already indicates that the patch adds a binding, so the trailing word "binding" in the subject is redundant (for example, "dt-bindings: input: touchscreen: add Jadard JD9365TX").

The commit also lacks a changelog body describing the hardware and why the binding is being added, and uses a non-standard Co-authored-by: trailer for an AI tool, both of which trigger checkpatch.pl warnings. Per Documentation/process/coding-assistants.rst, AI coding assistants cannot certify the Developer Certificate of Origin as co-authors and should be disclosed in the changelog or with an Assisted-by: trailer instead.

Quoted 6 lines
Documentation/devicetree/bindings/input/touchscreen/jadard,jd9365tx.yaml new file +0 -0
new file mode 100644
index 0000000000000..aaf2a7e00ff04
@@ -0,0 +1,64 @@

[ ... ]

Quoted 25 lines
Documentation/devicetree/bindings/input/touchscreen/jadard,jd9365tx.yaml new file +25 -0
+description: |
+  In-cell touch integrated with Jadard JD9365TX DSI panels. The module FPC
+  often exposes only I2C (no interrupt GPIO); the driver polls coordinate
+  reports. The touch controller is commonly powered from the same rails as
+  the panel; those supplies should still be described here when dedicated
+  regulators exist.
+
+allOf:
+  - $ref: touchscreen.yaml#
+
+properties:
+  compatible:
+    const: jadard,jd9365tx
+
+  reg:
+    maxItems: 1
+
+  poll-interval: true
+
+  vdd-supply:
+    description: Analog / touch power supply
+
+  iovcc-supply:
+    description: Digital I/O power supply
+

Documentation/devicetree/bindings/input/touchscreen/jadard,jd9365tx.yaml line 46

Quoted 10 lines
Documentation/devicetree/bindings/input/touchscreen/jadard,jd9365tx.yaml new file +10 -0
+  reset-gpios:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - vdd-supply
+  - iovcc-supply
+
+unevaluatedProperties: false

[Severity: Low]
Should this schema allow an optional interrupts property and reconcile the power supply requirements with the description?

The description notes that module FPCs "often" omit the interrupt GPIO and that the driver polls, but DT bindings describe hardware capabilities rather than a specific Linux driver implementation or single module FPC. With unevaluatedProperties: false and no interrupts property, any board that wires the JD9365TX interrupt line will fail dt_binding_check.

In addition, the description states that the supplies should be described "when dedicated regulators exist", whereas the required list demands vdd-supply and iovcc-supply unconditionally.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
author
#5 lore raw

PATCH v2 3/6 dt-bindings: backlight: add VIEWE I2C backlight binding

In reply to a message not in the archive
---
 .../leds/backlight/viewe,i2c-backlight.yaml   | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/backlight/viewe,i2c-backlight.yaml
Documentation/devicetree/bindings/leds/backlight/viewe,i2c-backlight.yaml new file +46 -0
new file mode 100644
index 0000000..9be4bc9
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/backlight/viewe,i2c-backlight.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: VIEWE 7KF82 I2C panel backlight
+
+maintainers:
+  - Hefei <[email protected]>
+
+description: |
+  I2C backlight MCU used on the VIEWE 7KF82 DSI module. Protocol is device
+  address 0x45, register 0x86, brightness 0..255. A discrete MCU part number
+  is not exposed on the FPC silk; the binding is therefore keyed to the
+  module.
+
+allOf:
+  - $ref: common.yaml#
+
+properties:
+  compatible:
+    const: viewe,7kf82-backlight
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        backlight@45 {
+            compatible = "viewe,7kf82-backlight";
+            reg = <0x45>;
+            default-brightness = <200>;
+        };
+    };
+...
Signature · 1 line
2.55.0.windows.5
#6 lore raw
Thank you for your contribution! Sashiko AI review found 4 potential issues to consider: - [Low] dt-bindings: backlight: undocumented vendor prefix viewe - [Low] dt-bindings: backlight: schema…

Thank you for your contribution! Sashiko AI review found 4 potential issues to consider:
- [Low] dt-bindings: backlight: undocumented vendor prefix viewe
- [Low] dt-bindings: backlight: schema filename and $id mismatch compatible
- [Low] dt-bindings: backlight: redundant word binding in commit subject
- [Low] dt-bindings: backlight: empty commit body and invalid Co-authored-by
--

commit 30cc2981090ca10d47ee3c9cabb7273eb616720b
Author: Hefei <[email protected]>

Quoted 1 line

dt-bindings: backlight: add VIEWE I2C backlight binding

[Severity: Low]
The "dt-bindings:" prefix already indicates that this patch adds a binding, so the trailing word "binding" in the subject can be dropped.

Quoted 3 lines

[Severity: Low]
The commit message has no changelog body describing the hardware or why the binding is being added. In addition, "Co-authored-by:" is not a valid kernel trailer (checkpatch reports BAD_SIGN_OFF), and per Documentation/process/coding-assistants.rst AI tools cannot certify the DCO and should not be credited via sign-off or co-author trailers.

Documentation/devicetree/bindings/leds/backlight/viewe,i2c-backlight.yaml line 5

Quoted 11 lines
Documentation/devicetree/bindings/leds/backlight/viewe,i2c-backlight.yaml new file +5 -0
new file mode 100644
index 0000000000000..9be4bc93087ae
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/backlight/viewe,i2c-backlight.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#

[Severity: Low]
Should this file and its $id be named viewe,7kf82-backlight.yaml to match the single compatible string it documents, as required by Documentation/devicetree/bindings/writing-bindings.rst?

[ ... ]

Documentation/devicetree/bindings/leds/backlight/viewe,i2c-backlight.yaml line 23

Quoted 3 lines
Documentation/devicetree/bindings/leds/backlight/viewe,i2c-backlight.yaml new file +3 -0
+properties:
+  compatible:
+    const: viewe,7kf82-backlight

[Severity: Low]
Is "viewe" documented in Documentation/devicetree/bindings/vendor-prefixes.yaml? Without a vendor prefix entry, make dt_binding_check and checkpatch fail validation on this compatible string.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
author
#7 lore raw

PATCH v2 4/6 drm/panel: add VIEWE JD9365TX 7 inch DSI panel

In reply to a message not in the archive
---
 drivers/gpu/drm/panel/Kconfig                |  11 +
 drivers/gpu/drm/panel/Makefile               |   1 +
 drivers/gpu/drm/panel/panel-viewe-jd9365tx.c | 353 +++++++++++++++++++
 3 files changed, 365 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-viewe-jd9365tx.c
drivers/gpu/drm/panel/Kconfig +11 -0
index 3100640..ad1eee3 100644
@@ -324,6 +324,17 @@ config DRM_PANEL_INNOLUX_P079ZCA
 	  24 bit RGB per pixel. It provides a MIPI DSI interface to
 	  the host and has a built-in LED backlight.
 
+config DRM_PANEL_VIEWE_JD9365TX
+	tristate "VIEWE 7\" JD9365TX DSI panel"
+	depends on OF
+	depends on DRM_MIPI_DSI
+	depends on BACKLIGHT_CLASS_DEVICE
+	help
+	  Say Y here to enable the VIEWE 7" 720x1280 Jadard JD9365TX
+	  MIPI-DSI panel.
+
+	  If unsure, say N.
+
 config DRM_PANEL_JADARD_JD9365DA_H3
 	tristate "Jadard JD9365DA-H3 WXGA DSI panel"
 	depends on OF
drivers/gpu/drm/panel/Makefile +1 -0
index 75f6bf2..2933489 100644
@@ -33,6 +33,7 @@ obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9881C) += panel-ilitek-ili9881c.o
 obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9882T) += panel-ilitek-ili9882t.o
 obj-$(CONFIG_DRM_PANEL_INNOLUX_EJ030NA) += panel-innolux-ej030na.o
 obj-$(CONFIG_DRM_PANEL_INNOLUX_P079ZCA) += panel-innolux-p079zca.o
+obj-$(CONFIG_DRM_PANEL_VIEWE_JD9365TX) += panel-viewe-jd9365tx.o
 obj-$(CONFIG_DRM_PANEL_JADARD_JD9365DA_H3) += panel-jadard-jd9365da-h3.o
 obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o
 obj-$(CONFIG_DRM_PANEL_JDI_LPM102A188A) += panel-jdi-lpm102a188a.o
drivers/gpu/drm/panel/panel-viewe-jd9365tx.c new file +353 -0

353 lines not on this page · raw message

Signature · 1 line
2.55.0.windows.5
#8 lore raw

Re: [PATCH v2 4/6] drm/panel: add VIEWE JD9365TX 7 inch DSI panel

Thank you for your contribution! Sashiko AI review found 5 potential issues to consider: - [High] drm/panel: jd9365tx_probe() calls static drm_panel_init() with devm_kzalloc() - [High] drm/panel…

Thank you for your contribution! Sashiko AI review found 5 potential issues to consider:
- [High] drm/panel: jd9365tx_probe() calls static drm_panel_init() with devm_kzalloc()
- [High] drm/panel: jd9365tx_probe() calls removed of_drm_get_panel_orientation()
- [Low] drm/panel: jd9365tx_get_modes() misuses drm_connector_set_panel_orientation()
- [Low] drm/panel: jd9365tx_send_cmds() duplicates mipi_dsi_dcs_write_seq_multi()
- [Low] drm/panel: undocumented jadard,jd9365tx-7kf82 compatible and unsorted Kconfig
--

commit 3ecc9eb3ae7d4c1cce585568afbec867631fedbb
Author: Hefei <[email protected]>

drm/panel: add VIEWE JD9365TX 7 inch DSI panel

This commit adds a DRM panel driver for the VIEWE 7" 720x1280 Jadard JD9365TX (7KF82) 2-lane MIPI-DSI panel.

Quoted 40 lines
drivers/gpu/drm/panel/Kconfig +11 -0
index 26ffa2378f55c..9a3038bf60987 100644
@@ -427,6 +427,17 @@ config DRM_PANEL_INNOLUX_P079ZCA
 	  24 bit RGB per pixel. It provides a MIPI DSI interface to
 	  the host and has a built-in LED backlight.
 
+config DRM_PANEL_VIEWE_JD9365TX
+	tristate "VIEWE 7\" JD9365TX DSI panel"
+	depends on OF
+	depends on DRM_MIPI_DSI
+	depends on BACKLIGHT_CLASS_DEVICE
+	help
+	  Say Y here to enable the VIEWE 7" 720x1280 Jadard JD9365TX
+	  MIPI-DSI panel.
+
+	  If unsure, say N.
+
 config DRM_PANEL_JADARD_JD9365DA_H3
 	tristate "Jadard JD9365DA-H3 WXGA DSI panel"
 	depends on OF
drivers/gpu/drm/panel/Makefile +1 -0
index 365f2e73f6b45..84ed0891a40d1 100644
@@ -42,6 +42,7 @@ obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9881C) += panel-ilitek-ili9881c.o
 obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9882T) += panel-ilitek-ili9882t.o
 obj-$(CONFIG_DRM_PANEL_INNOLUX_EJ030NA) += panel-innolux-ej030na.o
 obj-$(CONFIG_DRM_PANEL_INNOLUX_P079ZCA) += panel-innolux-p079zca.o
+obj-$(CONFIG_DRM_PANEL_VIEWE_JD9365TX) += panel-viewe-jd9365tx.o
 obj-$(CONFIG_DRM_PANEL_JADARD_JD9365DA_H3) += panel-jadard-jd9365da-h3.o
 obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o
 obj-$(CONFIG_DRM_PANEL_JDI_LPM102A188A) += panel-jdi-lpm102a188a.o
drivers/gpu/drm/panel/panel-viewe-jd9365tx.c new file +0 -0
new file mode 100644
index 0000000000000..b511dd6bfed96
@@ -0,0 +1,353 @@

[ ... ]

Quoted 17 lines
drivers/gpu/drm/panel/panel-viewe-jd9365tx.c new file +17 -0
+struct jd9365tx_cmd {
+	u8 len;
+	u8 data[64];
+	u16 delay_ms;
+};
+
+#define JD_CMD(...) {					\
+	.len = sizeof((u8[]){ __VA_ARGS__ }),		\
+	.data = { __VA_ARGS__ },			\
+	.delay_ms = 0,					\
+}
+
+#define JD_CMD_DELAY(ms, ...) {				\
+	.len = sizeof((u8[]){ __VA_ARGS__ }),		\
+	.data = { __VA_ARGS__ },			\
+	.delay_ms = (ms),				\
+}

[ ... ]

Quoted 14 lines
drivers/gpu/drm/panel/panel-viewe-jd9365tx.c new file +14 -0
+static int jd9365tx_send_cmds(struct mipi_dsi_device *dsi,
+			      const struct jd9365tx_cmd *cmds,
+			      unsigned int count)
+{
+	unsigned int i;
+	int ret;
+
+	for (i = 0; i < count; i++) {
+		const struct jd9365tx_cmd *cmd = &cmds[i];
+
+		if (cmd->len) {
+			ret = mipi_dsi_dcs_write_buffer(dsi, cmd->data, cmd->len);
+			if (ret < 0) {
+				dev_err(&dsi->dev,

drivers/gpu/drm/panel/panel-viewe-jd9365tx.c line 137

Quoted 10 lines
drivers/gpu/drm/panel/panel-viewe-jd9365tx.c new file +10 -0
+					"DCS write 0x%02x failed: %d\n",
+					cmd->data[0], ret);
+				return ret;
+			}
+		}
+		if (cmd->delay_ms)
+			msleep(cmd->delay_ms);
+	}
+	return 0;
+}

[Severity: Low]
Can the init sequence use mipi_dsi_dcs_write_seq_multi() and mipi_dsi_msleep() instead of a custom struct jd9365tx_cmd table and jd9365tx_send_cmds() loop? jd9365tx_prepare() already sets up a struct mipi_dsi_multi_context, and using the standard _multi() helpers avoids duplicating mipi_dsi_dcs_write_buffer_multi() and allocating a fixed 64-byte buffer per command entry.

[ ... ]

Quoted 25 lines
drivers/gpu/drm/panel/panel-viewe-jd9365tx.c new file +25 -0
+static int jd9365tx_get_modes(struct drm_panel *panel,
+			      struct drm_connector *connector)
+{
+	struct jd9365tx_panel *ctx = to_jd9365tx(panel);
+	struct drm_display_mode *mode;
+
+	mode = drm_mode_duplicate(connector->dev, &jd9365tx_7kf82_mode);
+	if (!mode)
+		return -ENOMEM;
+
+	drm_mode_set_name(mode);
+	mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
+	drm_mode_probed_add(connector, mode);
+
+	connector->display_info.width_mm = mode->width_mm;
+	connector->display_info.height_mm = mode->height_mm;
+	drm_connector_set_panel_orientation(connector, ctx->orientation);
+	return 1;
+}
+
+static enum drm_panel_orientation
+jd9365tx_get_orientation(struct drm_panel *panel)
+{
+	struct jd9365tx_panel *ctx = to_jd9365tx(panel);
+

drivers/gpu/drm/panel/panel-viewe-jd9365tx.c line 272

Quoted 10 lines
drivers/gpu/drm/panel/panel-viewe-jd9365tx.c new file +10 -0
+	return ctx->orientation;
+}
+
+static const struct drm_panel_funcs jd9365tx_funcs = {
+	.prepare = jd9365tx_prepare,
+	.disable = jd9365tx_disable,
+	.unprepare = jd9365tx_unprepare,
+	.get_modes = jd9365tx_get_modes,
+	.get_orientation = jd9365tx_get_orientation,
+};

[Severity: Low]
Should jd9365tx_get_modes() delegate to drm_connector_helper_get_modes_fixed(connector, &jd9365tx_7kf82_mode) and drop the drm_connector_set_panel_orientation() call?

jd9365tx_funcs already provides .get_orientation, so panel-bridge helpers configure the panel orientation property before drm_dev_register(). Calling drm_connector_set_panel_orientation() inside .get_modes runs after drm_dev_register(), which can trigger a WARN_ON in drm_object_attach_property() if orientation has not already been attached.

Quoted 10 lines
drivers/gpu/drm/panel/panel-viewe-jd9365tx.c new file +10 -0
+
+static int jd9365tx_probe(struct mipi_dsi_device *dsi)
+{
+	struct device *dev = &dsi->dev;
+	struct jd9365tx_panel *ctx;
+	int ret;
+
+	ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
+	if (!ctx)
+		return -ENOMEM;

[ ... ]

drivers/gpu/drm/panel/panel-viewe-jd9365tx.c line 306

Quoted 3 lines
drivers/gpu/drm/panel/panel-viewe-jd9365tx.c new file +3 -0
+	ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation);
+	if (ret)
+		return ret;

[Severity: High]
Does calling of_drm_get_panel_orientation() break the build?

Commit b5a8b1f2a973 ("drm/panel: Use drm_of_get_panel_orientation()") removed of_drm_get_panel_orientation() in favor of drm_of_get_panel_orientation() from <drm/drm_of.h>, which is also not included here.

drivers/gpu/drm/panel/panel-viewe-jd9365tx.c line 308

Quoted 2 lines
drivers/gpu/drm/panel/panel-viewe-jd9365tx.c new file +2 -0
+
+	drm_panel_init(&ctx->panel, dev, &jd9365tx_funcs, DRM_MODE_CONNECTOR_DSI);

[Severity: High]
Does calling drm_panel_init() after devm_kzalloc() break the build and leave ctx->panel.bridge uninitialized?

Commit fe417df954a9 ("drm/panel: Make drm_panel_init() static") made drm_panel_init() private to drivers/gpu/drm/drm_panel.c. Panel drivers must allocate and initialize their container struct with devm_drm_panel_alloc(), which also initializes the embedded struct drm_bridge required by drm_panel_add().

[ ... ]

drivers/gpu/drm/panel/panel-viewe-jd9365tx.c line 339

Quoted 6 lines
drivers/gpu/drm/panel/panel-viewe-jd9365tx.c new file +6 -0
+static const struct of_device_id jd9365tx_of_match[] = {
+	{ .compatible = "viewe,7kf82" },
+	{ .compatible = "jadard,jd9365tx-7kf82" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, jd9365tx_of_match);

[Severity: Low]
Is "jadard,jd9365tx-7kf82" documented in the DT binding schema? Documentation/devicetree/bindings/display/panel/viewe,jd9365tx.yaml in commit "dt-bindings: display: add VIEWE JD9365TX panel binding" only lists "viewe,7kf82".

Also, DRM_PANEL_VIEWE_JD9365TX and panel-viewe-jd9365tx.o are inserted between INNOLUX and JADARD in drivers/gpu/drm/panel/Kconfig and drivers/gpu/drm/panel/Makefile rather than in alphabetical order, and the commit message has an empty body.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
author
#9 lore raw

PATCH v2 5/6 Input: add Jadard JD9365TX in-cell touchscreen driver

In reply to a message not in the archive
---
 drivers/input/touchscreen/Kconfig           |  12 +
 drivers/input/touchscreen/Makefile          |   1 +
 drivers/input/touchscreen/jadard_jd9365tx.c | 373 ++++++++++++++++++++
 3 files changed, 386 insertions(+)
 create mode 100644 drivers/input/touchscreen/jadard_jd9365tx.c
drivers/input/touchscreen/Kconfig +12 -0
index e2ee722..da425c8 100644
@@ -540,6 +540,18 @@ config TOUCHSCREEN_IPROC
 	  To compile this driver as a module, choose M here: the
 	  module will be called bcm_iproc_tsc.
 
+config TOUCHSCREEN_JADARD_JD9365TX
+	tristate "Jadard JD9365TX in-cell touchscreen"
+	depends on I2C
+	help
+	  Say Y here if you have a Jadard JD9365TX in-cell touchscreen.
+	  The driver polls over I2C when no interrupt line is wired.
+
+	  If unsure, say N.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called jadard_jd9365tx.
+
 config TOUCHSCREEN_S6SY761
 	tristate "Samsung S6SY761 Touchscreen driver"
 	depends on I2C
drivers/input/touchscreen/Makefile +1 -0
index 58094f2..5846f4d 100644
@@ -59,6 +59,7 @@ obj-$(CONFIG_TOUCHSCREEN_IMAGIS)	+= imagis.o
 obj-$(CONFIG_TOUCHSCREEN_IMX6UL_TSC)	+= imx6ul_tsc.o
 obj-$(CONFIG_TOUCHSCREEN_INEXIO)	+= inexio.o
 obj-$(CONFIG_TOUCHSCREEN_IPROC)		+= bcm_iproc_tsc.o
+obj-$(CONFIG_TOUCHSCREEN_JADARD_JD9365TX) += jadard_jd9365tx.o
 obj-$(CONFIG_TOUCHSCREEN_LPC32XX)	+= lpc32xx_ts.o
 obj-$(CONFIG_TOUCHSCREEN_MAX11801)	+= max11801_ts.o
 obj-$(CONFIG_TOUCHSCREEN_MXS_LRADC)     += mxs-lradc-ts.o
drivers/input/touchscreen/jadard_jd9365tx.c new file +373 -0

373 lines not on this page · raw message

Signature · 1 line
2.55.0.windows.5
#10 lore raw

Re: [PATCH v2 5/6] Input: add Jadard JD9365TX in-cell touchscreen driver

Thank you for your contribution! Sashiko AI review found 8 potential issues to consider: - [High] Input: jadard_jd9365tx: deferred jd_hw_init() in jd_poll() breaks lifecycle - [High] Input…

Thank you for your contribution! Sashiko AI review found 8 potential issues to consider:
- [High] Input: jadard_jd9365tx: deferred jd_hw_init() in jd_poll() breaks lifecycle
- [High] Input: jadard_jd9365tx: broken MT slot gating in jd_report_touches()
- [Medium] Input: jadard_jd9365tx: uninitialized stack read in jd_report_touches()
- [Medium] Input: jadard_jd9365tx: missing reset-gpios handling in jadard_tp_probe()
- [Low] Input: jadard_jd9365tx: signed shift overflow in jd_resolve_coord_addr()
- [Low] Input: jadard_jd9365tx: duplicate OF-only size parsing in jadard_tp_probe()
- [Low] Input: jadard_jd9365tx: Input and I2C subsystem convention violations
- [Low] Input: jadard_jd9365tx: missing commit description and invalid trailer
--

commit 14bb2db3ff6aa2fe722f173dd49badfb3b138498
Author: Hefei <[email protected]>

Quoted 4 lines

Input: add Jadard JD9365TX in-cell touchscreen driver

[Severity: Low]
This commit adds a new touchscreen driver without a changelog body describing the hardware, communication protocol, or polling design, and it carries a non-standard Co-authored-by trailer for an AI tool without a corresponding human DCO sign-off.

Quoted 5 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +0 -0
new file mode 100644
index 0000000000000..2030157c3a5b8

[ ... ]

Quoted 10 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +10 -0
+static int jd_resolve_coord_addr(struct jadard_tp *ts)
+{
+	u32 esram_num_addr = JD_ERAM_BASE + 4 + JD_MAX_DSRAM_NUM * 8;
+	u32 esram_sec_addr = esram_num_addr + 4;
+	u8 buf[JD_ESRAM_SECTION_NUM * 8];
+	u32 addr, len;
+	int ret;
+
+	ret = jd_read_reg(ts->client, esram_sec_addr, buf, sizeof(buf));
+	if (ret)

drivers/input/touchscreen/jadard_jd9365tx.c line 164

Quoted 10 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +10 -0
+		return ret;
+
+	addr = buf[JD_ESRAM_COORD_IDX * 8 + 0] |
+	       (buf[JD_ESRAM_COORD_IDX * 8 + 1] << 8) |
+	       (buf[JD_ESRAM_COORD_IDX * 8 + 2] << 16) |
+	       (buf[JD_ESRAM_COORD_IDX * 8 + 3] << 24);
+	len = buf[JD_ESRAM_COORD_IDX * 8 + 4] |
+	      (buf[JD_ESRAM_COORD_IDX * 8 + 5] << 8) |
+	      (buf[JD_ESRAM_COORD_IDX * 8 + 6] << 16) |
+	      (buf[JD_ESRAM_COORD_IDX * 8 + 7] << 24);

[Severity: Low]
Can the << 24 shifts on buf[...] overflow a 32-bit signed int?

Each u8 element is promoted to signed int before shifting, so bit 7 being set triggers signed integer overflow under CONFIG_UBSAN. Using get_unaligned_le32() avoids both manual byte assembly and the signed shift.

drivers/input/touchscreen/jadard_jd9365tx.c line 173

Quoted 9 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +9 -0
+
+	if (addr < JD_ERAM_BASE || addr >= JD_ERAM_BASE + 0x1000 ||
+	    len == 0 || len > JD_TOUCH_DATA_SIZE)
+		return -EINVAL;
+
+	ts->coord_addr = addr;
+	ts->touch_data_size = (u16)len;
+	return 0;
+}

[Severity: Medium]
Can setting ts->touch_data_size to a value smaller than 53 cause jd_report_touches() to read uninitialized stack memory from buf?

jd_poll() allocates u8 buf[JD_TOUCH_DATA_SIZE] on the stack without initializing it and reads only ts->touch_data_size bytes from I2C. However, jd_report_touches() unconditionally loops over all 10 slots (ts->max_points) and reads 5 bytes per slot starting at JD_TOUCH_COORD_INFO_ADDR (offsets 3 through 52). If the ESRAM section table reports len < 53, jd_report_touches() parses uninitialized stack bytes and reports them to userspace as touch coordinates and touch major values.

[ ... ]

Quoted 11 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +11 -0
+static void jd_report_touches(struct jadard_tp *ts, const u8 *buf)
+{
+	u8 finger_num = buf[JD_FINGER_NUM_ADDR];
+	unsigned int i;
+	bool any = false;
+
+	if (finger_num > ts->max_points)
+		finger_num = ts->max_points;
+
+	for (i = 0; i < ts->max_points; i++) {
+		const u8 *c = buf + JD_TOUCH_COORD_INFO_ADDR +

drivers/input/touchscreen/jadard_jd9365tx.c line 220

Quoted 10 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +10 -0
+			      i * JD_FINGER_DATA_SIZE;
+		u16 x = (c[0] << 8) | c[1];
+		u16 y = (c[2] << 8) | c[3];
+		u8 w = c[4];
+		bool down = false;
+
+		if (i < finger_num &&
+		    x <= ts->abs_x_max && y <= ts->abs_y_max &&
+		    x != 0xFFFF && y != 0xFFFF)
+			down = true;

[Severity: High]
Does gating down on i < finger_num drop active touches in higher-numbered MT slots when an earlier slot is released?

Each index i maps directly to MT slot i, while finger_num is the total count of active contacts. If two fingers are down in slots 0 and 1 and finger 0 lifts, finger_num becomes 1 while slot 1 (i == 1) still holds the remaining finger's coordinates; i < finger_num (1 < 1) then evaluates to false and releases slot 1 as well.

Also, when buf[JD_FINGER_NUM_ADDR] > ts->max_points (such as 0xFF when the report buffer is not ready), clamping finger_num to ts->max_points processes the frame as up to 10 touches instead of discarding the invalid frame.

[ ... ]

drivers/input/touchscreen/jadard_jd9365tx.c line 248

Quoted 12 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +12 -0
+static void jd_poll(struct input_dev *input)
+{
+	struct jadard_tp *ts = input_get_drvdata(input);
+	u8 buf[JD_TOUCH_DATA_SIZE];
+	int ret;
+
+	if (!ts->ready) {
+		ret = jd_hw_init(ts);
+		if (ret)
+			return;
+		ts->ready = true;
+	}

[Severity: High]
Does deferring jd_hw_init() from jadard_tp_probe() to jd_poll() break device probing, polling, and power-cycle recovery?

Because jadard_tp_probe() never communicates with the controller, probe succeeds and leaves vdd and iovcc enabled even when the device is absent or has an unsupported chip ID (-ENODEV). When the input device is opened, jd_hw_init() -> jd_section_ready() can stall input_open_device() (under input->mutex) and system_freezable_wq for up to 50 iterations of msleep(2) plus I2C reads, and any failure causes jd_poll() to retry jd_hw_init() on every 8-16 ms poll tick indefinitely. Furthermore, once ts->ready is set, it is never cleared across a DSI panel reset or system suspend/resume, so the controller is never returned to the 0xF2 backdoor mode required for subsequent 0xF3 register reads.

[ ... ]

Quoted 26 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +26 -0
+static int jadard_tp_probe(struct i2c_client *client)
+{
+	struct device *dev = &client->dev;
+	struct jadard_tp *ts;
+	struct input_dev *input;
+	u32 val;
+	int ret;
+
+	ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL);
+	if (!ts)
+		return -ENOMEM;
+
+	ts->client = client;
+	ts->max_points = JD_MAX_POINTS;
+	ts->abs_x_max = 719;
+	ts->abs_y_max = 1279;
+	ts->poll_interval_ms = JD_DEFAULT_POLL_MS;
+	ts->touch_data_size = JD_TOUCH_DATA_SIZE;
+
+	ts->vdd = devm_regulator_get(dev, "vdd");
+	if (IS_ERR(ts->vdd))
+		return PTR_ERR(ts->vdd);
+
+	ts->iovcc = devm_regulator_get(dev, "iovcc");
+	if (IS_ERR(ts->iovcc))
+		return PTR_ERR(ts->iovcc);

drivers/input/touchscreen/jadard_jd9365tx.c line 298

Quoted 10 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +10 -0
+
+	ret = regulator_enable(ts->vdd);
+	if (ret)
+		return ret;
+
+	ret = regulator_enable(ts->iovcc);
+	if (ret) {
+		regulator_disable(ts->vdd);
+		return ret;
+	}

[Severity: Medium]
Should jadard_tp_probe() request and deassert the optional reset-gpios after enabling the regulators?

The jadard,jd9365tx Devicetree binding defines reset-gpios, so boards wiring that reset line can leave the controller held in reset and unresponsive on I2C if probe never acquires and deasserts it.

Quoted 4 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +4 -0
+
+	ret = devm_add_action_or_reset(dev, jadard_tp_disable_regulators, ts);
+	if (ret)
+		return ret;

drivers/input/touchscreen/jadard_jd9365tx.c line 312

Quoted 10 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +10 -0
+
+	if (!device_property_read_u32(dev, "poll-interval", &val) &&
+	    val >= 8 && val <= 100)
+		ts->poll_interval_ms = val;
+
+	if (!of_property_read_u32(dev->of_node, "touchscreen-size-x", &val) && val)
+		ts->abs_x_max = val - 1;
+
+	if (!of_property_read_u32(dev->of_node, "touchscreen-size-y", &val) && val)
+		ts->abs_y_max = val - 1;

[Severity: Low]
Why parse touchscreen-size-x and touchscreen-size-y manually with of_property_read_u32() when touchscreen_parse_properties() is called below?

touchscreen_parse_properties() already reads these properties via the generic device property API and stores the pre-swap axis maxima in ts->prop.max_x and ts->prop.max_y. On non-OF property providers where dev->of_node is NULL, ts->abs_x_max and ts->abs_y_max stay at 719 and 1279, causing jd_report_touches() to drop valid coordinates above 719x1279.

Quoted 36 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +36 -0
+
+	input = devm_input_allocate_device(dev);
+	if (!input)
+		return -ENOMEM;
+
+	input->name = "Jadard JD9365TX Touchscreen";
+	input->id.bustype = BUS_I2C;
+	input->dev.parent = dev;
+
+	__set_bit(EV_ABS, input->evbit);
+	__set_bit(EV_KEY, input->evbit);
+	__set_bit(BTN_TOUCH, input->keybit);
+
+	input_set_abs_params(input, ABS_MT_POSITION_X, 0, ts->abs_x_max, 0, 0);
+	input_set_abs_params(input, ABS_MT_POSITION_Y, 0, ts->abs_y_max, 0, 0);
+	input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
+
+	touchscreen_parse_properties(input, true, &ts->prop);
+
+	ret = input_mt_init_slots(input, ts->max_points, INPUT_MT_DIRECT);
+	if (ret)
+		return ret;
+
+	input_set_drvdata(input, ts);
+	ts->input = input;
+	i2c_set_clientdata(client, ts);
+
+	ret = input_setup_polling(input, jd_poll);
+	if (ret)
+		return ret;
+
+	input_set_poll_interval(input, ts->poll_interval_ms);
+
+	return input_register_device(input);
+}
+

drivers/input/touchscreen/jadard_jd9365tx.c line 358

Quoted 10 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +10 -0
+static const struct of_device_id jadard_tp_of_match[] = {
+	{ .compatible = "jadard,jd9365tx" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, jadard_tp_of_match);
+
+static const struct i2c_device_id jadard_tp_id[] = {
+	{ "jd9365tx", 0 },
+	{ }
+};

[Severity: Low]
This isn't a bug, but several places in the driver depart from Input and I2C subsystem conventions:

- devm_input_allocate_device() already sets input->dev.parent = dev, so the manual assignment in jadard_tp_probe() is redundant.
- The __set_bit() calls for EV_ABS, EV_KEY, and BTN_TOUCH in jadard_tp_probe() are redundant because input_set_abs_params() sets EV_ABS and input_mt_init_slots(..., INPUT_MT_DIRECT) sets EV_KEY and BTN_TOUCH.
- Calling input_report_key(ts->input, BTN_TOUCH, any) in jd_report_touches() is redundant because input_mt_sync_frame() already reports BTN_TOUCH via pointer emulation.
- jadard_tp_id[] should use a named initializer ({ .name = "jd9365tx" }) rather than { "jd9365tx", 0 }.
- vdd and iovcc can be managed with devm_regulator_bulk_get_enable() instead of open-coding devm_regulator_get(), regulator_enable(), and jadard_tp_disable_regulators().
- In Input drivers, error-only variables are conventionally named error (or err), and functions with multiple failure points check the result of the final call (error = input_register_device(input); if (error) return error; return 0;).

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
author
#11 lore raw

PATCH v2 6/6 backlight: add VIEWE I2C backlight driver

In reply to a message not in the archive
---
 drivers/video/backlight/Kconfig        |  7 +++
 drivers/video/backlight/Makefile       |  1 +
 drivers/video/backlight/viewe_bl_i2c.c | 79 ++++++++++++++++++++++++++
 3 files changed, 87 insertions(+)
 create mode 100644 drivers/video/backlight/viewe_bl_i2c.c
drivers/video/backlight/Kconfig +7 -0
index 7b836f9..8ea7332 100644
@@ -501,6 +501,13 @@ config BACKLIGHT_LED
 	  If you have a LCD backlight adjustable by LED class driver, say Y
 	  to enable this driver.
 
+config BACKLIGHT_VIEWE_I2C
+	tristate "VIEWE I2C backlight"
+	depends on I2C
+	help
+	  Backlight driver for VIEWE DSI panels. Brightness is written to
+	  the panel MCU at I2C address 0x45, register 0x86.
+
 endif # BACKLIGHT_CLASS_DEVICE
 
 endmenu
drivers/video/backlight/Makefile +1 -0
index bcb568a..b82d959 100644
@@ -61,3 +61,4 @@ obj-$(CONFIG_BACKLIGHT_WM831X)		+= wm831x_bl.o
 obj-$(CONFIG_BACKLIGHT_ARCXCNN) 	+= arcxcnn_bl.o
 obj-$(CONFIG_BACKLIGHT_RAVE_SP)		+= rave-sp-backlight.o
 obj-$(CONFIG_BACKLIGHT_LED)		+= led_bl.o
+obj-$(CONFIG_BACKLIGHT_VIEWE_I2C)	+= viewe_bl_i2c.o
drivers/video/backlight/viewe_bl_i2c.c new file +79 -0

79 lines not on this page · raw message

Signature · 1 line
2.55.0.windows.5
#12 lore raw

Re: [PATCH v2 6/6] backlight: add VIEWE I2C backlight driver

Thank you for your contribution! Sashiko AI review found 6 potential issues to consider: - [Medium] backlight: viewe_bl_i2c: missing DT brightness parsing in viewe_bl_probe() - [Medium] backlight…

Thank you for your contribution! Sashiko AI review found 6 potential issues to consider:
- [Medium] backlight: viewe_bl_i2c: missing DT brightness parsing in viewe_bl_probe()
- [Medium] backlight: viewe_bl_i2c: missing backlight_update_status() in viewe_bl_probe()
- [Low] backlight: viewe_bl_i2c: positional initializer in struct i2c_device_id table
- [Low] backlight: viewe_bl_i2c: open-coded register write in viewe_bl_update_status()
- [Low] backlight: viewe_bl_i2c: dead clientdata and missing suspend/unbind blanking
- [Low] backlight: viewe_bl_i2c: empty commit message body and non-standard trailer
--

commit c7c0be93ab188af721db0878f1959009280ef433
Author: Hefei <[email protected]>

Quoted 4 lines

backlight: add VIEWE I2C backlight driver

[Severity: Low]
Could a commit message body be added to describe the hardware and rationale for the driver? Also, Co-authored-by: is not a standard kernel trailer and is placed after Signed-off-by:.

Quoted 6 lines
drivers/video/backlight/viewe_bl_i2c.c new file +0 -0
new file mode 100644
index 0000000000000..53dcf0834dcb2
@@ -0,0 +1,79 @@

[ ... ]

Quoted 5 lines
drivers/video/backlight/viewe_bl_i2c.c new file +5 -0
+static int viewe_bl_update_status(struct backlight_device *bd)
+{
+	struct i2c_client *client = bl_get_data(bd);
+	u8 buf[2] = { VIEWE_BL_REG, (u8)backlight_get_brightness(bd) };
+	struct i2c_msg msg = {

drivers/video/backlight/viewe_bl_i2c.c line 30

Quoted 10 lines
drivers/video/backlight/viewe_bl_i2c.c new file +10 -0
+		.addr = client->addr,
+		.flags = 0,
+		.len = sizeof(buf),
+		.buf = buf,
+	};
+	int ret;
+
+	ret = i2c_transfer(client->adapter, &msg, 1);
+	return ret == 1 ? 0 : (ret < 0 ? ret : -EIO);
+}

[Severity: Low]
Could viewe_bl_update_status() use i2c_smbus_write_byte_data(client, VIEWE_BL_REG, backlight_get_brightness(bd)) instead of open-coding i2c_transfer()? Manually building struct i2c_msg drops client->flags and prevents the driver from working on SMBus-only adapters.

drivers/video/backlight/viewe_bl_i2c.c line 42

Quoted 12 lines
drivers/video/backlight/viewe_bl_i2c.c new file +12 -0
+
+static const struct backlight_ops viewe_bl_ops = {
+	.update_status = viewe_bl_update_status,
+};
+
+static int viewe_bl_probe(struct i2c_client *client)
+{
+	struct backlight_properties props = {
+		.type = BACKLIGHT_RAW,
+		.brightness = VIEWE_BL_DEFAULT,
+		.max_brightness = VIEWE_BL_MAX,
+	};

[Severity: Medium]
Should viewe_bl_probe() parse default-brightness and max-brightness from client->dev instead of hardcoding VIEWE_BL_DEFAULT and VIEWE_BL_MAX?

The companion DT binding in Documentation/devicetree/bindings/leds/backlight/viewe,i2c-backlight.yaml references common.yaml# and uses default-brightness in its example, but devm_backlight_device_register() does not read firmware properties itself, so any DT-configured brightness limits or defaults are ignored.

drivers/video/backlight/viewe_bl_i2c.c line 51

Quoted 9 lines
drivers/video/backlight/viewe_bl_i2c.c new file +9 -0
+	struct backlight_device *bd;
+
+	bd = devm_backlight_device_register(&client->dev, "viewe_bl",
+					   &client->dev, client, &viewe_bl_ops,
+					   &props);
+	if (IS_ERR(bd))
+		return PTR_ERR(bd);
+
+	i2c_set_clientdata(client, bd);

[Severity: Low]
i2c_set_clientdata() stores bd, but nothing in the driver ever calls i2c_get_clientdata(), and neither BL_CORE_SUSPENDRESUME in viewe_bl_ops nor a .remove callback is set, leaving the backlight illuminated across system suspend (when used standalone) or driver unbind.

drivers/video/backlight/viewe_bl_i2c.c line 53

Quoted 2 lines
drivers/video/backlight/viewe_bl_i2c.c new file +2 -0
+	return 0;
+}

[Severity: Medium]
Should viewe_bl_probe() call backlight_update_status(bd) before returning?

devm_backlight_device_register() copies props into bd->props without invoking ops->update_status(), so register 0x86 is never programmed with the initial brightness at probe time, sysfs brightness and bl_power state start out of sync with the hardware, and probe succeeds even if no device responds at client->addr.

drivers/video/backlight/viewe_bl_i2c.c line 64

Quoted 11 lines
drivers/video/backlight/viewe_bl_i2c.c new file +11 -0
+
+static const struct of_device_id viewe_bl_of_match[] = {
+	{ .compatible = "viewe,7kf82-backlight" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, viewe_bl_of_match);
+
+static const struct i2c_device_id viewe_bl_id[] = {
+	{ "viewe_bl", 0 },
+	{ }
+};

[Severity: Low]
New struct i2c_device_id entries should use named initializers (for example, { .name = "7kf82-backlight" }, matching the DT compatible suffix).

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6