Skip to content

Conversation

minlexx
Copy link
Member

@minlexx minlexx commented May 29, 2025

Start with lavender. Later add jasmine, tulip, maybe something else?

Fixes #70

@minlexx minlexx changed the title WIP: [6.15] Switch ALL nt36672a based panels to common driver WIP: [6.15] Switch ALL Novatek nt36672a based panels to common driver May 29, 2025
@minlexx minlexx force-pushed the alexeymin/6.15-novatek-tianma-panels branch 4 times, most recently from b5b6c39 to ee6b473 Compare May 30, 2025 13:08
Copy link

@barni2000 barni2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this driver naming the iovcc supply as vddio

@minlexx minlexx changed the title WIP: [6.15] Switch ALL Novatek nt36672a based panels to common driver [6.15] Switch ALL Novatek nt36672a based panels to common driver May 31, 2025
@minlexx minlexx force-pushed the alexeymin/6.15-novatek-tianma-panels branch from a04cdbe to 4298a2f Compare June 5, 2025 11:34
@minlexx minlexx force-pushed the qcom-sdm660-6.15.y branch from efa5eae to 2116061 Compare June 20, 2025 08:08
@minlexx minlexx force-pushed the alexeymin/6.15-novatek-tianma-panels branch from a6c8128 to 0685fd8 Compare June 20, 2025 08:10
@minlexx minlexx force-pushed the qcom-sdm660-6.15.y branch from 3e83c63 to 9a0feed Compare June 24, 2025 18:00
@minlexx minlexx force-pushed the alexeymin/6.15-novatek-tianma-panels branch from 0685fd8 to 711a648 Compare June 24, 2025 18:02
@minlexx minlexx force-pushed the qcom-sdm660-6.15.y branch from e1fff71 to 70f47ab Compare June 25, 2025 07:35
@minlexx minlexx force-pushed the alexeymin/6.15-novatek-tianma-panels branch 2 times, most recently from 17d37f6 to 0f5e5ed Compare June 26, 2025 12:25
@minlexx minlexx force-pushed the alexeymin/6.15-novatek-tianma-panels branch 2 times, most recently from a51aa75 to 1d36509 Compare August 12, 2025 21:41
@minlexx
Copy link
Member Author

minlexx commented Aug 12, 2025

Rebased on target branch after few MRs merged into it

@minlexx minlexx requested a review from barni2000 August 12, 2025 21:42
@minlexx minlexx force-pushed the alexeymin/6.15-novatek-tianma-panels branch from a553081 to 4e2c44e Compare August 12, 2025 22:34
Use the new refcounted allocation API devm_drm_panel_alloc() to allocate
the panel in place of devm_kzalloc().

Remove call to drm_panel_init() because it's part of devm_drm_panel_alloc().

Signed-off-by: Alexey Minnekhanov <[email protected]>
The driver was made with extensibility in mind, but it is not enough.
In preparation for extending the driver with support for more panels,
stop using arrays of nt36672a_panel_cmd, which incorrectly assumed
that all panels have init sequences consisting of 2 bytes. This is
not true for all panels using nt36672a controller. Instead, use
dedicated init and shutdown functions for each panel. This allows
for more flexibility, solving at least 2 problems:

 * different DSI commands length for different panels
 * different delays for msleep() calls for different panels

Make it so that each panel can initialize the way it prefers.

Combine init sequences in .on_cmds_1 and .on_cmds_2 into a new init
finction, and code from .off_cmds to new off_cmds function. Struct
nt36672a_panel_cmd and function nt36672a_send_cmds() are no longer
needed, so remove them.

While doing this, also switch to modern multi-api for sending
commands, which greatly simplifies error handling using accumulated
error counter.

This refactoring change should have no functional effect on existing
devices.

Signed-off-by: Alexey Minnekhanov <[email protected]>
Since this driver should represent not only devices manufactured by
Tianma Micro-electronics, but also from other companies, it makes more
sense to name it according to what driver file name already is: novatek.

This does not change neither module file name nor Kconfig symbol, only
driver identification in dmesg. This makes it possible to e.g. grep
dmesg for "novatek" and get messages from both nt36672a-based panel and
Novatek touchscreen.

Signed-off-by: Alexey Minnekhanov <[email protected]>
Add support for Tianma video mode panel based on nt36672a, used in
Xiaomi Redmi Note 7 smartphone (xiaomi-lavender). Tianma panel is
one of the 3 panel variants that you can find inside xiaomi-lavender.

Signed-off-by: Alexey Minnekhanov <[email protected]>
Add support for Tianma video mode panel based on nt36672a, used in
Xiaomi Mi A2 smartphone (xiaomi-jasmine). It shares some code with
already supported panel in this driver for xiaomi-lavender.

Signed-off-by: Alexey Minnekhanov <[email protected]>
minlexx and others added 12 commits August 15, 2025 16:22
Add support for Tianma video mode panel based on nt36672a, used in
Xiaomi Redmi Note 6 Pro smartphone (xiaomi-tulip). It shares almost
exactly the same init/off sequences with already supported panel in this
driver for Redmi Note 7 (xiaomi-lavender).

Signed-off-by: Alexey Minnekhanov <[email protected]>
Add support for TXD video mode panel based on nt36672a, used in
Asus Zenfone Max Pro M1 smartphone (asus-x00td).

Signed-off-by: iAboothahir <[email protected]>
use touch in follower mode

Signed-off-by: Alexey Minnekhanov <[email protected]>
…smine)

use touch in follower mode

Signed-off-by: Alexey Minnekhanov <[email protected]>
Sometimes Novatek touchscreen is paired together with Novatek panel,
and they both need to be powered together in sync.

Add support for nvt-ts driver to operate in panel follower mode, in
which touchscreen isn't in full control of its lifecycle.
This is managed using callbacks from panel, to get informed when the
panel is powered on and off. From there we can match the nvt-ts
device's power state to that of the panel.

Without this probing touchscreen before panel sometimes randomly fails
with I2C read errors.

 * split some code from probe function to separate initial_power_on
   function, which is called once from panel_prepared callback, or
   from probe function, depending on mode;
 * update Kconfig to depend on DRM.

Signed-off-by: Alexey Minnekhanov <[email protected]>
Add support for the Shenchao panel used in the Xiaomi Redmi Note 7
(xiaomi-lavender) smartphone. It is one of the 3 display panels found in
xiaomi-lavender.

Signed-off-by: Richard Acayan <[email protected]>
Add the compatible for the Xiaomi Redmi Note 7 with the Shenchao display
panel.

Signed-off-by: Richard Acayan <[email protected]>
The Redmi Note 7 can have 3 different display panels. Add support for
the Shenchao panel.

Signed-off-by: Richard Acayan <[email protected]>
The commit 007ac02 ("drm/msm/dsi: switch to DRM_PANEL_BRIDGE")
breaks panels which send DSI commands in their .unprepare callbacks.
Migrate to using .disable for that for some panels.

Inspired-by: https://gitlab.com/sdm845-mainline/linux/-/commit/88d6f2060e1f4fd283075079088844e0474e8d8b

Co-developed-by: Joel Selvaraj <[email protected]>
Signed-off-by: Joel Selvaraj <[email protected]>
Co-developed-by: Caleb Connolly <[email protected]>
Signed-off-by: Caleb Connolly <[email protected]>
Signed-off-by: Alexey Minnekhanov <[email protected]>
The driver now supports 5 new panels for 4 different smartphones.
Describe them.

Signed-off-by: Alexey Minnekhanov <[email protected]>
@minlexx minlexx force-pushed the alexeymin/6.15-novatek-tianma-panels branch from 4e2c44e to e383456 Compare August 15, 2025 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add real panel driver for lavender and panel-follower mode for nvt-ts
4 participants