dt-bindings: display: add VIEWE 7KF82 JD9365TX panel
Subsystems (9)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v4 1/6 dt-bindings: display: add VIEWE 7KF82 JD9365TX panel
Add the device tree binding for the VIEWE 7KF82 720x1280 Jadard JD9365TX MIPI-DSI panel, and register the viewe vendor prefix.
--- .../bindings/display/panel/viewe,7kf82.yaml | 67 +++++++++++++++++++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + 2 files changed, 69 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/viewe,7kf82.yaml
Documentation/devicetree/bindings/display/panel/viewe,7kf82.yaml new file +67 -0
@@ -0,0 +1,67 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/viewe,7kf82.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: true + backlight: true + rotation: true + port: true + +required: + - compatible + - reg + - vdd-supply + - iovcc-supply + - port + +additionalProperties: false + +examples: + - | + dsi { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "viewe,7kf82"; + reg = <0>; + vdd-supply = <®_vdd>; + iovcc-supply = <®_iovcc>; + backlight = <&viewe_bl>; + + port { + endpoint { + remote-endpoint = <&dsi_out>; + }; + }; + }; + }; +...
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -1739,6 +1739,8 @@ patternProperties: description: Vicor Corporation "^videostrong,.*": description: Videostrong Technology Co., Ltd. + "^viewe,.*": + description: VIEWE Technology Co., Ltd. "^virtio,.*": description: Virtual I/O Device Specification, developed by the OASIS consortium "^virtual,.*":
Signature · 1 line
2.55.0.windows.5
PATCH v4 2/6 dt-bindings: input: add Jadard JD9365TX touchscreen
In reply to a message not in the archiveDocument the in-cell I2C touch companion used on JD9365TX modules. Many FPCs omit the interrupt line; boards may still wire one.
--- .../input/touchscreen/jadard,jd9365tx.yaml | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/jadard,jd9365tx.yaml
Documentation/devicetree/bindings/input/touchscreen/jadard,jd9365tx.yaml new file +63 -0
@@ -0,0 +1,63 @@ +# 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. Many module FPCs + expose only the I2C bus; some boards also wire an interrupt GPIO. The + touch controller is commonly powered from the same rails as the panel. + +allOf: + - $ref: touchscreen.yaml# + +properties: + compatible: + const: jadard,jd9365tx + + reg: + maxItems: 1 + + interrupts: + 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 + +unevaluatedProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + touchscreen@68 { + compatible = "jadard,jd9365tx"; + reg = <0x68>; + vdd-supply = <®_vdd>; + iovcc-supply = <®_iovcc>; + touchscreen-size-x = <720>; + touchscreen-size-y = <1280>; + poll-interval = <16>; + }; + }; +...
Signature · 1 line
2.55.0.windows.5
PATCH v4 3/6 dt-bindings: backlight: add VIEWE 7KF82 I2C backlight
In reply to a message not in the archiveDocument the I2C backlight MCU on the VIEWE 7KF82 module (address 0x45, register 0x86, brightness 0..255).
--- .../leds/backlight/viewe,7kf82-backlight.yaml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/backlight/viewe,7kf82-backlight.yaml
Documentation/devicetree/bindings/leds/backlight/viewe,7kf82-backlight.yaml new file +46 -0
@@ -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,7kf82-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
PATCH v4 4/6 drm/panel: add VIEWE JD9365TX 7 inch DSI panel
In reply to a message not in the archiveAdd a DRM panel driver for the VIEWE 7KF82 720x1280 Jadard JD9365TX 2-lane MIPI-DSI module. The TX command set differs from JD9365DA (page select 0xDE, unlock 0xDF, lane config 0xCC).
--- drivers/gpu/drm/panel/Kconfig | 11 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-viewe-jd9365tx.c | 340 +++++++++++++++++++ 3 files changed, 352 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-viewe-jd9365tx.c
drivers/gpu/drm/panel/Kconfig +11 -0
@@ -1141,6 +1141,17 @@ config DRM_PANEL_TRULY_NT35597_WQXGA Say Y here if you want to enable support for Truly NT35597 WQXGA Dual DSI Video Mode panel +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_VISIONOX_G2647FB105 tristate "Visionox G2647FB105" depends on OF
drivers/gpu/drm/panel/Makefile +1 -0
@@ -113,6 +113,7 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o +obj-$(CONFIG_DRM_PANEL_VIEWE_JD9365TX) += panel-viewe-jd9365tx.o obj-$(CONFIG_DRM_PANEL_VISIONOX_G2647FB105) += panel-visionox-g2647fb105.o obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o obj-$(CONFIG_DRM_PANEL_VISIONOX_RM692E5) += panel-visionox-rm692e5.o
drivers/gpu/drm/panel/panel-viewe-jd9365tx.c new file +340 -0
340 lines not on this page · raw message
Signature · 1 line
2.55.0.windows.5
[email protected]
AI reviewRe: [PATCH v4 4/6] drm/panel: add VIEWE JD9365TX 7 inch DSI panel
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [High] drm/panel: jd9365tx_probe() calls removed of_drm_get_panel_orientation() - [Low] drm/panel…
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider:
- [High] drm/panel: jd9365tx_probe() calls removed of_drm_get_panel_orientation()
- [Low] drm/panel: jd9365tx_send_cmds() duplicates mipi_dsi_dcs_write_seq_multi()
--
commit ca140a7fa3afff2f94a32e601392829d717fcccf
Author: Hefei <[email protected]>
drm/panel: add VIEWE JD9365TX 7 inch DSI panel
This commit adds a DRM panel driver for the VIEWE 7KF82 720x1280 Jadard JD9365TX 2-lane MIPI-DSI panel module.
Quoted 6 lines
drivers/gpu/drm/panel/panel-viewe-jd9365tx.c new file +0
-0@@ -0,0 +1,340 @@
[ ... ]
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 138
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() with the dsi_ctx that jd9365tx_prepare() already sets up? That avoids calling the deprecated mipi_dsi_dcs_write_buffer() helper, removes the custom jd9365tx_send_cmds() loop, and drops the fixed 64-byte data[] padding per entry in struct jd9365tx_cmd.
[ ... ]
Quoted 5 lines
drivers/gpu/drm/panel/panel-viewe-jd9365tx.c new file +5
-0+static int jd9365tx_probe (struct mipi_dsi_device *dsi) +{ +struct device *dev = &dsi->dev; +struct jd9365tx_panel *ctx; +int ret;
[ ... ]
drivers/gpu/drm/panel/panel-viewe-jd9365tx.c line 295
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 <0 ) +return dev_err_probe (dev, ret,"failed to get orientation\n" );
[Severity: High]
Does this fail to build when CONFIG_DRM_PANEL_VIEWE_JD9365TX is enabled? Commit b5a8b1f2a973 ("drm/panel: Use drm_of_get_panel_orientation()") removed of_drm_get_panel_orientation() in favor of drm_of_get_panel_orientation() declared in <drm/drm_of.h>, which also needs to be included here.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
PATCH v4 5/6 Input: add Jadard JD9365TX in-cell touchscreen driver
In reply to a message not in the archiveAdd a polling I2C driver for the JD9365TX in-cell touch controller. Typical module FPCs expose I2C only, so the driver polls coordinate SRAM after opening the controller backdoor.
--- drivers/input/touchscreen/Kconfig | 12 + drivers/input/touchscreen/Makefile | 1 + drivers/input/touchscreen/jadard_jd9365tx.c | 356 ++++++++++++++++++++ 3 files changed, 369 insertions(+) create mode 100644 drivers/input/touchscreen/jadard_jd9365tx.c
drivers/input/touchscreen/Kconfig +12 -0
@@ -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
@@ -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 +356 -0
356 lines not on this page · raw message
Signature · 1 line
2.55.0.windows.5
[email protected]
AI reviewRe: [PATCH v4 5/6] Input: add Jadard JD9365TX in-cell touchscreen driver
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [High] Input: jadard_jd9365tx: wrong supply array type in jadard_tp_probe() - [Low] Input: jadard_jd9365tx…
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider:
- [High] Input: jadard_jd9365tx: wrong supply array type in jadard_tp_probe()
- [Low] Input: jadard_jd9365tx: u32 overflow in jd_resolve_coord_addr() bounds check
--
commit 57a37b18fbb37602183e66793eebea170b919dc2
Author: Hefei <[email protected]>
Input: add Jadard JD9365TX in-cell touchscreen driver
This commit adds a polling I2C touchscreen driver for the Jadard JD9365TX in-cell touch controller.
Quoted 6 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +0
-0@@ -0,0 +1,356 @@
[ ... ]
Quoted 12 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +12
-0+struct jadard_tp { +struct i2c_client *client; +struct input_dev *input; +struct touchscreen_properties prop; +struct gpio_desc *reset; +struct regulator *vdd; +struct regulator *iovcc; +u32 coord_addr; +u16 touch_data_size; +u16 max_points; +unsigned int poll_interval_ms; +};
[ ... ]
Quoted 9 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +9
-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));
drivers/input/touchscreen/jadard_jd9365tx.c line 164
Quoted 10 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +10
-0+if (ret) +return ret; + + addr =get_unaligned_le32 (&buf[JD_ESRAM_COORD_IDX *8 ]); + len =get_unaligned_le32 (&buf[JD_ESRAM_COORD_IDX *8 +4 ]); + +if (addr <JD_ERAM_BASE || + addr + len >JD_ERAM_BASE +0x1000 || + len <JD_REPORT_MIN_SIZE || len >JD_TOUCH_DATA_SIZE ) +return -EINVAL ;
[Severity: Low]
Can the 32-bit addition addr + len wrap around here? If the controller returns a corrupted section descriptor with addr near U32_MAX and len in [JD_REPORT_MIN_SIZE, JD_TOUCH_DATA_SIZE], addr + len wraps to a small value below JD_ERAM_BASE + 0x1000 and jd_resolve_coord_addr() accepts an invalid coordinate address instead of falling back to JD_DEFAULT_COORD_ADDR. Checking len first and testing
addr > JD_ERAM_BASE + 0x1000 - len avoids the overflow.
[ ... ]
Quoted 13 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +13
-0+static int jadard_tp_probe (struct i2c_client *client) +{ +struct device *dev = &client->dev; +struct jadard_tp *ts; +struct input_dev *input; +struct regulator_bulk_data supplies[2 ]; +u32 val; +int error; + + ts =devm_kzalloc (dev,sizeof (*ts),GFP_KERNEL ); +if (!ts) +return -ENOMEM ; +
drivers/input/touchscreen/jadard_jd9365tx.c line 275
Quoted 10 lines
drivers/input/touchscreen/jadard_jd9365tx.c new file +10
-0+ ts->client = client; + ts->max_points =JD_MAX_POINTS ; + ts->poll_interval_ms =JD_DEFAULT_POLL_MS ; + ts->touch_data_size =JD_TOUCH_DATA_SIZE ; + ts->coord_addr =JD_DEFAULT_COORD_ADDR ; + + supplies[0 ].supply ="vdd" ; + supplies[1 ].supply ="iovcc" ; + error =devm_regulator_bulk_get_enable (dev,ARRAY_SIZE (supplies), + supplies);
[Severity: High]
Does passing struct regulator_bulk_data * to devm_regulator_bulk_get_enable() fail to build with -Werror=incompatible-pointer-types? devm_regulator_bulk_get_enable() takes a const char * const * array of supply names, so if built without that error it also reads uninitialized stack memory (supplies[0].consumer) as the second supply name pointer. Using static const char * const supplies[] = { "vdd", "iovcc" } fixes this, and the unused vdd and iovcc fields in struct jadard_tp can be dropped as well.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
PATCH v4 6/6 backlight: add VIEWE 7KF82 I2C backlight driver
In reply to a message not in the archiveDrive the VIEWE 7KF82 backlight MCU over I2C (register 0x86). The MCU has no public discrete part number on the FPC silk.
--- drivers/video/backlight/Kconfig | 7 +++ drivers/video/backlight/Makefile | 1 + drivers/video/backlight/viewe_bl_i2c.c | 82 ++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 drivers/video/backlight/viewe_bl_i2c.c
drivers/video/backlight/Kconfig +7 -0
@@ -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
@@ -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 +82 -0
82 lines not on this page · raw message
Signature · 1 line
2.55.0.windows.5