Re: [PATCH v6 2/2] drm/panel: Add panel driver for ChipWealth CH13726A based panels

From: Dmitry Baryshkov

Date: Wed Apr 22 2026 - 14:50:50 EST


On Wed, Apr 22, 2026 at 02:43:25AM -0500, Aaron Kling via B4 Relay wrote:
> From: Teguh Sobirin <teguh@xxxxxxxx>
>
> This is used by the AYN Thor for the bottom panel.
>
> Signed-off-by: Teguh Sobirin <teguh@xxxxxxxx>
> Co-developed-by: Aaron Kling <webgeek1234@xxxxxxxxx>
> Signed-off-by: Aaron Kling <webgeek1234@xxxxxxxxx>
> ---
> drivers/gpu/drm/panel/Kconfig | 11 +
> drivers/gpu/drm/panel/Makefile | 1 +
> drivers/gpu/drm/panel/panel-chipwealth-ch13726a.c | 333 ++++++++++++++++++++++
> 3 files changed, 345 insertions(+)
>
> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> index d6863b28ddc559..e2c00f08f4507d 100644
> --- a/drivers/gpu/drm/panel/Kconfig
> +++ b/drivers/gpu/drm/panel/Kconfig
> @@ -105,6 +105,17 @@ config DRM_PANEL_BOE_TV101WUM_LL2
> Say Y here if you want to support for BOE TV101WUM-LL2
> WUXGA PANEL DSI Video Mode panel
>
> +config DRM_PANEL_CHIPWEALTH_CH13726A
> + tristate "CHIPWEALTH CH13726A-based DSI panel"
> + depends on OF
> + depends on DRM_MIPI_DSI
> + depends on BACKLIGHT_CLASS_DEVICE
> + select DRM_DISPLAY_DP_HELPER
> + select DRM_DISPLAY_HELPER
> + help
> + Say Y here if you want to enable support for ChipWealth
> + CH13726A-based display panels.
> +
> config DRM_PANEL_EBBG_FT8719
> tristate "EBBG FT8719 panel driver"
> depends on OF
> diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
> index a4291dc3905bed..343d283d1620fb 100644
> --- a/drivers/gpu/drm/panel/Makefile
> +++ b/drivers/gpu/drm/panel/Makefile
> @@ -9,6 +9,7 @@ obj-$(CONFIG_DRM_PANEL_BOE_TD4320) += panel-boe-td4320.o
> obj-$(CONFIG_DRM_PANEL_BOE_TH101MB31UIG002_28A) += panel-boe-th101mb31ig002-28a.o
> obj-$(CONFIG_DRM_PANEL_BOE_TV101WUM_LL2) += panel-boe-tv101wum-ll2.o
> obj-$(CONFIG_DRM_PANEL_BOE_TV101WUM_NL6) += panel-boe-tv101wum-nl6.o
> +obj-$(CONFIG_DRM_PANEL_CHIPWEALTH_CH13726A) += panel-chipwealth-ch13726a.o
> obj-$(CONFIG_DRM_PANEL_DSI_CM) += panel-dsi-cm.o
> obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
> obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
> diff --git a/drivers/gpu/drm/panel/panel-chipwealth-ch13726a.c b/drivers/gpu/drm/panel/panel-chipwealth-ch13726a.c
> new file mode 100644
> index 00000000000000..175f40e752126f
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-chipwealth-ch13726a.c
> @@ -0,0 +1,333 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * ChipWealth CH13726A MIPI-DSI panel driver
> + * Copyright (c) 2024, Teguh Sobirin <teguh@xxxxxxxx>.
> + */
> +
> +#include <linux/backlight.h>
> +#include <linux/delay.h>
> +#include <linux/gpio/consumer.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/regulator/consumer.h>
> +
> +#include <drm/drm_mipi_dsi.h>
> +#include <drm/drm_modes.h>
> +#include <drm/drm_panel.h>
> +
> +#include <video/mipi_display.h>
> +
> +static const struct regulator_bulk_data ch13726a_supplies[] = {
> + { .supply = "vdd1v2", },
> + { .supply = "vddio", },
> + { .supply = "vdd", },
> + { .supply = "avdd", },
> +};
> +
> +struct ch13726a_panel {
> + struct drm_panel panel;
> + struct mipi_dsi_device *dsi;
> + struct regulator_bulk_data *supplies;
> + struct gpio_desc *reset_gpio;
> + struct ch13726a_desc *desc;
> + enum drm_panel_orientation orientation;
> +};
> +
> +struct ch13726a_desc {
> + unsigned int width_mm;
> + unsigned int height_mm;
> + unsigned int bpc;
> +
> + const struct drm_display_mode *modes;
> + unsigned int num_modes;
> +};
> +
> +static inline struct ch13726a_panel *to_ch13726a_panel(struct drm_panel *panel)
> +{
> + return container_of(panel, struct ch13726a_panel, panel);
> +}
> +
> +static void ch13726a_reset(struct ch13726a_panel *ctx)
> +{
> + gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> + usleep_range(10000, 11000);
> + gpiod_set_value_cansleep(ctx->reset_gpio, 0);
> + usleep_range(10000, 11000);
> + gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> + usleep_range(10000, 11000);

This looks like the active-low reset. Should it be rather described as
GPIO_ACTIVE_LOW in the DT?

> +}
> +

Other than that:


Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>


--
With best wishes
Dmitry