From: Arpit Saini <arpit.saini@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
Jessica Zhang <jesszhan0024@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
ayushi.makhija@oss.qualcomm.com, rajeevny@qti.qualcomm.com
Subject: Re: [PATCH v3 2/2] drm/panel: add Ilitek ILI7807S panel driver
Date: Mon, 29 Jun 2026 15:21:08 +0530 [thread overview]
Message-ID: <8236a2a1-040a-4ef3-ae14-41c1127a749b@oss.qualcomm.com> (raw)
In-Reply-To: <5pvhrsikc3spr5jworztun7pjpgnkfihxvqd3dthhn7yeoud56@vcajuuwqplvo>
Hi Dmitry,
On 6/27/2026 2:11 AM, Dmitry Baryshkov wrote:
> On Wed, Jun 24, 2026 at 02:23:52PM +0530, Arpit Saini wrote:
>> Add a DRM panel driver for the DLC DLC0697 1080x1920@60Hz MIPI DSI
>> panel based on the Ilitek ILI7807S display controller.
>>
>> The panel operates in video burst mode with four data lanes using
>> RGB888 pixel format.
>>
>> Signed-off-by: Arpit Saini <arpit.saini@oss.qualcomm.com>
>> ---
>> drivers/gpu/drm/panel/Kconfig | 12 ++
>> drivers/gpu/drm/panel/Makefile | 1 +
>> drivers/gpu/drm/panel/panel-ilitek-ili7807s.c | 293 ++++++++++++++++++++++++++
>> 3 files changed, 306 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
>> index 7450b27622a2..1cbaac1bf545 100644
>> --- a/drivers/gpu/drm/panel/Kconfig
>> +++ b/drivers/gpu/drm/panel/Kconfig
>> @@ -264,6 +264,18 @@ config DRM_PANEL_HYDIS_HV101HD1
>>
>> If M is selected the module will be called panel-hydis-hv101hd1
>>
>> +config DRM_PANEL_ILITEK_ILI7807S
>> + tristate "Ilitek ILI7807S-based panels"
>> + depends on OF
>> + depends on DRM_MIPI_DSI
>> + depends on BACKLIGHT_CLASS_DEVICE
>> + help
>> + Say Y if you want to enable support for panels based on the
>> + Ilitek ILI7807S display controller, such as the DLC DLC0697
>> + 1080x1920 MIPI DSI panel.
>> +
>> + If M is selected the module will be called panel-ilitek-ili7807s.
>> +
>> config DRM_PANEL_ILITEK_IL9322
>> tristate "Ilitek ILI9322 320x240 QVGA panels"
>> depends on OF && SPI
>> diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
>> index c2c5cf817116..c3002b351cb8 100644
>> --- a/drivers/gpu/drm/panel/Makefile
>> +++ b/drivers/gpu/drm/panel/Makefile
>> @@ -26,6 +26,7 @@ obj-$(CONFIG_DRM_PANEL_HIMAX_HX83112B) += panel-himax-hx83112b.o
>> obj-$(CONFIG_DRM_PANEL_HIMAX_HX83121A) += panel-himax-hx83121a.o
>> obj-$(CONFIG_DRM_PANEL_HIMAX_HX8394) += panel-himax-hx8394.o
>> obj-$(CONFIG_DRM_PANEL_HYDIS_HV101HD1) += panel-hydis-hv101hd1.o
>> +obj-$(CONFIG_DRM_PANEL_ILITEK_ILI7807S) += panel-ilitek-ili7807s.o
>> obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o
>> obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9341) += panel-ilitek-ili9341.o
>> obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9805) += panel-ilitek-ili9805.o
>> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili7807s.c b/drivers/gpu/drm/panel/panel-ilitek-ili7807s.c
>> new file mode 100644
>> index 000000000000..8ddfab2693ec
>> --- /dev/null
>> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili7807s.c
>> @@ -0,0 +1,293 @@
>> +// SPDX-License-Identifier: GPL-2.0-only
>> +/*
>> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
>> + */
>> +
>> +#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 <drm/drm_probe_helper.h>
>> +
>> +struct panel_desc {
>> + const struct drm_display_mode *mode;
>> + unsigned int lanes;
>> + enum mipi_dsi_pixel_format format;
>> + unsigned long mode_flags;
>> + void (*init)(struct mipi_dsi_multi_context *dsi_ctx);
>> +};
>> +
>> +struct ili7807s {
>> + struct drm_panel panel;
>> + struct mipi_dsi_device *dsi;
>> + const struct panel_desc *desc;
>> +
>> + struct regulator_bulk_data *supplies;
>> + struct gpio_desc *reset_gpio;
>> +};
>> +
>> +static const struct regulator_bulk_data ili7807s_supplies[] = {
>> + { .supply = "vddi" },
>> + { .supply = "avdd" },
>> + { .supply = "avee" },
>> +};
>> +
>> +static inline struct ili7807s *to_ili7807s(struct drm_panel *panel)
>> +{
>> + return container_of(panel, struct ili7807s, panel);
>> +}
>> +
>> +static void ili7807s_reset(struct ili7807s *ctx)
>> +{
>> + gpiod_set_value_cansleep(ctx->reset_gpio, 0);
>> + usleep_range(10000, 11000);
>> + gpiod_set_value_cansleep(ctx->reset_gpio, 1);
>> + usleep_range(10000, 11000);
>> + gpiod_set_value_cansleep(ctx->reset_gpio, 0);
>> + usleep_range(10000, 11000);
> This looks like the reset being active-low. Please define it as is in
> the DT and use normal (hold = 1, drop = 0) semantics in the driver.\
Ack.
>
>> +}
>> +
>> +static void dlc0697_init_sequence(struct mipi_dsi_multi_context *dsi_ctx)
>> +{
>> + mipi_dsi_dcs_soft_reset_multi(dsi_ctx);
>> + mipi_dsi_msleep(dsi_ctx, 120);
>> +
>> + mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x78, 0x07, 0x00);
>> + mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x35, 0x00);
> mipi_dsi_dcs_set_tear_on_multi()
>
>> + mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x5e, 0x09, 0x99);
> MIPI_DCS_SET_CABC_MIN_BRIGHTNESS
>
>> + mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x53, 0x24);
> MIPI_DCS_WRITE_CONTROL_DISPLAY
>
>> + mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x55, 0x01);
> MIPI_DCS_WRITE_POWER_SAVE
Ack.
>
>> + mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x51, 0x3f, 0xff);
> mipi_dsi_dcs_set_display_brightness_large_multi(). Also please use
> 0x1fff instead of the full brightness.
>
>> +
>> + mipi_dsi_dcs_exit_sleep_mode_multi(dsi_ctx);
>> + mipi_dsi_msleep(dsi_ctx, 120);
>> +
>> + mipi_dsi_dcs_set_display_on_multi(dsi_ctx);
>> + mipi_dsi_msleep(dsi_ctx, 20);
>> +}
>> +
>> +static int ili7807s_on(struct ili7807s *ctx)
>> +{
>> + struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
>> +
>> + ctx->dsi->mode_flags |= MIPI_DSI_MODE_LPM;
> Drop, set it in probe()
Ack.
>
>> +
>> + ctx->desc->init(&dsi_ctx);
>> +
>> + ctx->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
> Drop
>
>> +
>> + return dsi_ctx.accum_err;
>> +}
>> +
>> +static int ili7807s_off(struct ili7807s *ctx)
>> +{
>> + struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
>> +
>> + ctx->dsi->mode_flags |= MIPI_DSI_MODE_LPM;
> Drop
>
>> +
>> + mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
>> + mipi_dsi_msleep(&dsi_ctx, 20);
>> +
>> + mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
>> + mipi_dsi_msleep(&dsi_ctx, 120);
>> +
>> + ctx->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
> Drop
>
>> +
>> + return dsi_ctx.accum_err;
>> +}
>> +
>> +static int ili7807s_prepare(struct drm_panel *panel)
>> +{
>> + struct ili7807s *ctx = to_ili7807s(panel);
>> + int ret;
>> +
>> + ret = regulator_bulk_enable(ARRAY_SIZE(ili7807s_supplies), ctx->supplies);
>> + if (ret < 0) {
>> + dev_err(ctx->panel.dev, "failed to enable regulators: %d\n", ret);
>> + return ret;
>> + }
>> +
>> + msleep(20);
>> +
>> + ili7807s_reset(ctx);
>> +
>> + ret = ili7807s_on(ctx);
>> + if (ret < 0) {
>> + dev_err(ctx->panel.dev, "failed to initialise panel: %d\n", ret);
>> + goto err;
>> + }
>> +
>> + return 0;
>> +
>> +err:
>> + gpiod_set_value_cansleep(ctx->reset_gpio, 1);
>> +
>> + regulator_bulk_disable(ARRAY_SIZE(ili7807s_supplies), ctx->supplies);
>> + return ret;
>> +}
>> +
>> +static int ili7807s_unprepare(struct drm_panel *panel)
>> +{
>> + struct ili7807s *ctx = to_ili7807s(panel);
>> + int ret;
>> +
>> + ret = ili7807s_off(ctx);
>> + if (ret < 0)
>> + dev_err(ctx->panel.dev, "failed to disable panel: %d\n", ret);
>> +
>> + gpiod_set_value_cansleep(ctx->reset_gpio, 1);
>> +
>> + regulator_bulk_disable(ARRAY_SIZE(ili7807s_supplies), ctx->supplies);
>> +
>> + return 0;
>> +}
>> +
>> +static int ili7807s_get_modes(struct drm_panel *panel,
>> + struct drm_connector *connector)
>> +{
>> + struct ili7807s *ctx = to_ili7807s(panel);
>> +
>> + return drm_connector_helper_get_modes_fixed(connector, ctx->desc->mode);
>> +}
>> +
>> +static const struct drm_panel_funcs ili7807s_panel_funcs = {
>> + .prepare = ili7807s_prepare,
>> + .unprepare = ili7807s_unprepare,
>> + .get_modes = ili7807s_get_modes,
>> +};
>> +
>> +static int ili7807s_bl_update_status(struct backlight_device *bl)
>> +{
>> + struct mipi_dsi_device *dsi = bl_get_data(bl);
>> + u16 brightness = backlight_get_brightness(bl);
>> + int ret;
>> +
>> + dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
>> +
>> + ret = mipi_dsi_dcs_set_display_brightness_large(dsi, brightness);
>> +
>> + dsi->mode_flags |= MIPI_DSI_MODE_LPM;
>> +
>> + return ret;
>> +}
>> +
>> +static const struct backlight_ops ili7807s_bl_ops = {
>> + .update_status = ili7807s_bl_update_status,
>> +};
>> +
>> +static struct backlight_device *ili7807s_create_backlight(struct mipi_dsi_device *dsi)
>> +{
>> + struct device *dev = &dsi->dev;
>> + const struct backlight_properties props = {
>> + .type = BACKLIGHT_RAW,
>> + .brightness = 0x3fff,
>> + .max_brightness = 0x3fff,
>> + };
>> +
>> + return devm_backlight_device_register(dev, dev_name(dev), dev, dsi,
>> + &ili7807s_bl_ops, &props);
>> +}
>> +
>> +static const struct drm_display_mode dlc0697_mode = {
>> + .clock = 131911,
> = (1080 + 18 + 2 + 16) * (1920 + 26 + 4 + 20) * 60 / 1000
Ack.
>> +
>> + .hdisplay = 1080,
>> + .hsync_start = 1080 + 18,
>> + .hsync_end = 1080 + 18 + 2,
>> + .htotal = 1080 + 18 + 2 + 16,
>> +
>> + .vdisplay = 1920,
>> + .vsync_start = 1920 + 26,
>> + .vsync_end = 1920 + 26 + 4,
>> + .vtotal = 1920 + 26 + 4 + 20,
>> +
>> + .width_mm = 0,
>> + .height_mm = 0,
> Do you really don't know the dimensions of the panel you are
> contributing?
Ack, will update in v4.
Thanks
Arpit
>> + .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
>> +};
>> +
prev parent reply other threads:[~2026-06-29 9:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 8:53 [PATCH v3 0/2] drm/panel: add support for Ilitek ILI7807S DSI panels Arpit Saini
2026-06-24 8:53 ` [PATCH v3 1/2] dt-bindings: display: panel: add Ilitek ILI7807S panel controller Arpit Saini
2026-06-24 8:53 ` [PATCH v3 2/2] drm/panel: add Ilitek ILI7807S panel driver Arpit Saini
2026-06-26 20:41 ` Dmitry Baryshkov
2026-06-29 9:51 ` Arpit Saini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8236a2a1-040a-4ef3-ae14-41c1127a749b@oss.qualcomm.com \
--to=arpit.saini@oss.qualcomm.com \
--cc=airlied@gmail.com \
--cc=ayushi.makhija@oss.qualcomm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jesszhan0024@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rajeevny@qti.qualcomm.com \
--cc=robh@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®