From nobody Wed Sep 17 22:19:00 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86AE8C4332F for ; Wed, 14 Dec 2022 11:01:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237864AbiLNLBJ (ORCPT ); Wed, 14 Dec 2022 06:01:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238110AbiLNLA4 (ORCPT ); Wed, 14 Dec 2022 06:00:56 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65B2C248C6; Wed, 14 Dec 2022 03:00:52 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id h11so18848270wrw.13; Wed, 14 Dec 2022 03:00:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8bWuYbccLYmlsDCbZTaH3xdKqDQ0uR+OEo7p2PSCMbQ=; b=oN3w0I2bk93R5ECyRPURXl4IDTqrrZMgcPk+c9G6phIU2yuf9H4Uv/TCM/KbzRuW9o xuna75vjt6w+OEv60Qkn4450hcUgUqOXyrstiqv9MsHDEj6dCufFwVlzB/OFU3iV2cuM UbyEK+OvdUgHLXdc4n4+fsG2V0c6Y/wF6Cd+arWWlgD92wFwEIgO7i+tmjzKjiCdnhzX dc+4LpjyqVgvEm4AJpUZ5Pd4y9fe5g3Z/PRQMNRlYxEqcXcBPZbrU0LFRGGOX5RHXEIt hhTGthv2uEh8er357yWVZpTzE07jySVlocgm+EEFcKoTw9sVuTwsX22MVbVDpSIQc42z q8QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8bWuYbccLYmlsDCbZTaH3xdKqDQ0uR+OEo7p2PSCMbQ=; b=KX4AFKrFEW0PQZAXxSKwCTRUbkhc2deIza2g7sNdqsyidy++J0B/l9Z/ZwucVxmdh8 zUITjbM5kztJ0aqsXlRfpKYexDY/MIjjgH38i10f1pfN+Zy1H9DmnsyoeHL7+hy9FpYY 2pRC+YJbms03gRUC04Dpz58VJKXSb/KV9hyRq37xYu6zX9LDzSq5+uTBO8VcYRpfSP65 oplFekTT8jbotT9W6uCpFZw9IWD1l3CiJuRAbW4M0/4IfIhX2bFnYAkL2fKNmRKks/QZ XHZsDQ/gbzrbJB4N9EczJqCJihINqNm5i2blZxolaBmb8qxDSRFOLZGQbOQqeJ9ezQz4 7iVA== X-Gm-Message-State: ANoB5pnydmzOAFeUwcrNOdJd9s/AFyIzzCp9PVeC66EvKsJtIQYu+Um3 UW1YVbnCCd86desCNifLcqQ= X-Google-Smtp-Source: AA0mqf4fDa95aULXawsKqT1SKBgAy/p3IaxzRBOJtO1UUceZ7KPiYNq/Kj7zzXOYoCmB6O9yxJcXvg== X-Received: by 2002:a05:6000:1a4f:b0:242:30c8:c368 with SMTP id t15-20020a0560001a4f00b0024230c8c368mr16073608wry.14.1671015650721; Wed, 14 Dec 2022 03:00:50 -0800 (PST) Received: from localhost.localdomain (2a02-8428-46a0-7c01-bc7c-15f1-6c3b-ad74.rev.sfr.net. [2a02:8428:46a0:7c01:bc7c:15f1:6c3b:ad74]) by smtp.gmail.com with ESMTPSA id h1-20020adfaa81000000b002366c3eefccsm2462096wrc.109.2022.12.14.03.00.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 03:00:50 -0800 (PST) From: Christophe Branchereau To: thierry.reding@gmail.com, sam@ravnborg.org, airlied@gmail.com, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christophe Branchereau Subject: [PATCH v2 1/2] drm/panel: add the orisetech ota5601a Date: Wed, 14 Dec 2022 12:00:36 +0100 Message-Id: <20221214110037.149387-2-cbranchereau@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221214110037.149387-1-cbranchereau@gmail.com> References: <20221214110037.149387-1-cbranchereau@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add the orisetech ota5601a ic driver For now it only supports the focaltech gpt3 3" 640x480 ips panel found in the ylm rg300x handheld. Signed-off-by: Christophe Branchereau --- drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + .../gpu/drm/panel/panel-orisetech-ota5601a.c | 351 ++++++++++++++++++ 3 files changed, 361 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-orisetech-ota5601a.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index a582ddd583c2..2f492e402cd1 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -381,6 +381,15 @@ config DRM_PANEL_OLIMEX_LCD_OLINUXINO Say Y here if you want to enable support for Olimex Ltd. LCD-OLinuXino panel. =20 +config DRM_PANEL_ORISETECH_OTA5601A + tristate "Orise Technology ota5601a RGB/SPI panel" + depends on OF && SPI + depends on BACKLIGHT_CLASS_DEVICE + select REGMAP_SPI + help + Say Y here if you want to enable support for the panels built + around the Orise Technology OTA9601A display controller. + config DRM_PANEL_ORISETECH_OTM8009A tristate "Orise Technology otm8009a 480x800 dsi 2dl panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 34e717382dbb..91d1870312af 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -35,6 +35,7 @@ obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36672A) +=3D panel-novat= ek-nt36672a.o obj-$(CONFIG_DRM_PANEL_NOVATEK_NT39016) +=3D panel-novatek-nt39016.o obj-$(CONFIG_DRM_PANEL_MANTIX_MLAF057WE51) +=3D panel-mantix-mlaf057we51.o obj-$(CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO) +=3D panel-olimex-lcd-olinuxi= no.o +obj-$(CONFIG_DRM_PANEL_ORISETECH_OTA5601A) +=3D panel-orisetech-ota5601a.o obj-$(CONFIG_DRM_PANEL_ORISETECH_OTM8009A) +=3D panel-orisetech-otm8009a.o obj-$(CONFIG_DRM_PANEL_OSD_OSD101T2587_53TS) +=3D panel-osd-osd101t2587-53= ts.o obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) +=3D panel-panasonic-vvx10f= 034n00.o diff --git a/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c b/drivers/gpu= /drm/panel/panel-orisetech-ota5601a.c new file mode 100644 index 000000000000..018fea7c6354 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c @@ -0,0 +1,351 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Orisetech OTA5601A TFT LCD panel driver + * + * Copyright (C) 2021, Christophe Branchereau + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +struct ota5601a_panel_info { + const struct drm_display_mode *display_modes; + unsigned int num_modes; + u16 width_mm, height_mm; + u32 bus_format, bus_flags; +}; + +struct ota5601a { + struct drm_panel drm_panel; + struct regmap *map; + struct regulator *supply; + const struct ota5601a_panel_info *panel_info; + + struct gpio_desc *reset_gpio; +}; + +static inline struct ota5601a *to_ota5601a(struct drm_panel *panel) +{ + return container_of(panel, struct ota5601a, drm_panel); +} + +static const struct reg_sequence ota5601a_panel_regs[] =3D { + { 0xfd, 0x00 }, + { 0x02, 0x00 }, + + { 0x18, 0x00 }, + { 0x34, 0x20 }, + + { 0x0c, 0x01 }, + { 0x0d, 0x48 }, + { 0x0e, 0x48 }, + { 0x0f, 0x48 }, + { 0x07, 0x40 }, + { 0x08, 0x33 }, + { 0x09, 0x3a }, + + { 0x16, 0x01 }, + { 0x19, 0x8d }, + { 0x1a, 0x28 }, + { 0x1c, 0x00 }, + + { 0xfd, 0xc5 }, + { 0x82, 0x0c }, + { 0xa2, 0xb4 }, + + { 0xfd, 0xc4 }, + { 0x82, 0x45 }, + + { 0xfd, 0xc1 }, + { 0x91, 0x02 }, + + { 0xfd, 0xc0 }, + { 0xa1, 0x01 }, + { 0xa2, 0x1f }, + { 0xa3, 0x0b }, + { 0xa4, 0x38 }, + { 0xa5, 0x00 }, + { 0xa6, 0x0a }, + { 0xa7, 0x38 }, + { 0xa8, 0x00 }, + { 0xa9, 0x0a }, + { 0xaa, 0x37 }, + + { 0xfd, 0xce }, + { 0x81, 0x18 }, + { 0x82, 0x43 }, + { 0x83, 0x43 }, + { 0x91, 0x06 }, + { 0x93, 0x38 }, + { 0x94, 0x02 }, + { 0x95, 0x06 }, + { 0x97, 0x38 }, + { 0x98, 0x02 }, + { 0x99, 0x06 }, + { 0x9b, 0x38 }, + { 0x9c, 0x02 }, + + { 0xfd, 0x00 }, +}; + +static const struct regmap_config ota5601a_regmap_config =3D { + .reg_bits =3D 8, + .val_bits =3D 8, +}; + +static int ota5601a_prepare(struct drm_panel *drm_panel) +{ + struct ota5601a *panel =3D to_ota5601a(drm_panel); + int err; + + err =3D regulator_enable(panel->supply); + if (err) { + dev_err(drm_panel->dev, "Failed to enable power supply: %d\n", err); + return err; + } + + /* Reset to be held low for 10us min according to the doc, 10ms before se= nding commands */ + gpiod_set_value_cansleep(panel->reset_gpio, 1); + usleep_range(10, 30); + gpiod_set_value_cansleep(panel->reset_gpio, 0); + usleep_range(10000, 20000); + + /* Init all registers. */ + err =3D regmap_multi_reg_write(panel->map, ota5601a_panel_regs, + ARRAY_SIZE(ota5601a_panel_regs)); + if (err) { + dev_err(drm_panel->dev, "Failed to init registers: %d\n", err); + goto err_disable_regulator; + } + + msleep(120); + + return 0; + +err_disable_regulator: + regulator_disable(panel->supply); + return err; +} + +static int ota5601a_unprepare(struct drm_panel *drm_panel) +{ + struct ota5601a *panel =3D to_ota5601a(drm_panel); + + gpiod_set_value_cansleep(panel->reset_gpio, 1); + + regulator_disable(panel->supply); + + return 0; +} + +static int ota5601a_enable(struct drm_panel *drm_panel) +{ + struct ota5601a *panel =3D to_ota5601a(drm_panel); + int err; + + err =3D regmap_write(panel->map, 0x01, 0x01); + + if (err) { + dev_err(drm_panel->dev, "Unable to enable panel: %d\n", err); + return err; + } + + if (drm_panel->backlight) { + /* Wait for the picture to be ready before enabling backlight */ + msleep(120); + } + + return 0; +} + +static int ota5601a_disable(struct drm_panel *drm_panel) +{ + struct ota5601a *panel =3D to_ota5601a(drm_panel); + int err; + + err =3D regmap_write(panel->map, 0x01, 0x00); + + if (err) { + dev_err(drm_panel->dev, "Unable to disable panel: %d\n", err); + return err; + } + + return 0; +} + +static int ota5601a_get_modes(struct drm_panel *drm_panel, + struct drm_connector *connector) +{ + struct ota5601a *panel =3D to_ota5601a(drm_panel); + const struct ota5601a_panel_info *panel_info =3D panel->panel_info; + struct drm_display_mode *mode; + unsigned int i; + + for (i =3D 0; i < panel_info->num_modes; i++) { + mode =3D drm_mode_duplicate(connector->dev, + &panel_info->display_modes[i]); + if (!mode) + return -ENOMEM; + + drm_mode_set_name(mode); + + mode->type =3D DRM_MODE_TYPE_DRIVER; + if (panel_info->num_modes =3D=3D 1) + mode->type |=3D DRM_MODE_TYPE_PREFERRED; + + drm_mode_probed_add(connector, mode); + } + + connector->display_info.bpc =3D 8; + connector->display_info.width_mm =3D panel_info->width_mm; + connector->display_info.height_mm =3D panel_info->height_mm; + + drm_display_info_set_bus_formats(&connector->display_info, + &panel_info->bus_format, 1); + connector->display_info.bus_flags =3D panel_info->bus_flags; + + return panel_info->num_modes; +} + +static const struct drm_panel_funcs ota5601a_funcs =3D { + .prepare =3D ota5601a_prepare, + .unprepare =3D ota5601a_unprepare, + .enable =3D ota5601a_enable, + .disable =3D ota5601a_disable, + .get_modes =3D ota5601a_get_modes, +}; + +static int ota5601a_probe(struct spi_device *spi) +{ + struct device *dev =3D &spi->dev; + struct ota5601a *panel; + int err; + + panel =3D devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL); + if (!panel) + return -ENOMEM; + + spi_set_drvdata(spi, panel); + + panel->panel_info =3D of_device_get_match_data(dev); + if (!panel->panel_info) + return -EINVAL; + + panel->supply =3D devm_regulator_get(dev, "power"); + if (IS_ERR(panel->supply)) { + dev_err(dev, "Failed to get power supply\n"); + return PTR_ERR(panel->supply); + } + + panel->reset_gpio =3D devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(panel->reset_gpio)) { + dev_err(dev, "Failed to get reset GPIO\n"); + return PTR_ERR(panel->reset_gpio); + } + + spi->bits_per_word =3D 8; + spi->mode =3D SPI_MODE_3 | SPI_3WIRE; + err =3D spi_setup(spi); + if (err) { + dev_err(dev, "Failed to setup SPI\n"); + return err; + } + + panel->map =3D devm_regmap_init_spi(spi, &ota5601a_regmap_config); + if (IS_ERR(panel->map)) { + dev_err(dev, "Failed to init regmap\n"); + return PTR_ERR(panel->map); + } + + drm_panel_init(&panel->drm_panel, dev, &ota5601a_funcs, + DRM_MODE_CONNECTOR_DPI); + + err =3D drm_panel_of_backlight(&panel->drm_panel); + if (err) { + if (err !=3D -EPROBE_DEFER) + dev_err(dev, "Failed to get backlight handle\n"); + return err; + } + + drm_panel_add(&panel->drm_panel); + + return 0; +} + +static void ota5601a_remove(struct spi_device *spi) +{ + struct ota5601a *panel =3D spi_get_drvdata(spi); + + drm_panel_remove(&panel->drm_panel); + + ota5601a_disable(&panel->drm_panel); + ota5601a_unprepare(&panel->drm_panel); +} + +static const struct drm_display_mode gpt3_display_modes[] =3D { + { /* 60 Hz */ + .clock =3D 27000, + .hdisplay =3D 640, + .hsync_start =3D 640 + 220, + .hsync_end =3D 640 + 220 + 20, + .htotal =3D 640 + 220 + 20 + 20, + .vdisplay =3D 480, + .vsync_start =3D 480 + 7, + .vsync_end =3D 480 + 7 + 6, + .vtotal =3D 480 + 7 + 6 + 7, + .flags =3D DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC, + }, + + { /* 50 Hz */ + .clock =3D 24000, + .hdisplay =3D 640, + .hsync_start =3D 640 + 280, + .hsync_end =3D 640 + 280 + 20, + .htotal =3D 640 + 280 + 20 + 20, + .vdisplay =3D 480, + .vsync_start =3D 480 + 7, + .vsync_end =3D 480 + 7 + 6, + .vtotal =3D 480 + 7 + 6 + 7, + .flags =3D DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC, + }, +}; + +static const struct ota5601a_panel_info gpt3_info =3D { + .display_modes =3D gpt3_display_modes, + .num_modes =3D ARRAY_SIZE(gpt3_display_modes), + .width_mm =3D 71, + .height_mm =3D 51, + .bus_format =3D MEDIA_BUS_FMT_RGB888_1X24, + .bus_flags =3D DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE, +}; + +static const struct of_device_id ota5601a_of_match[] =3D { + { .compatible =3D "focaltech,gpt3", .data =3D &gpt3_info }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, ota5601a_of_match); + +static struct spi_driver ota5601a_driver =3D { + .driver =3D { + .name =3D "ota5601a", + .of_match_table =3D ota5601a_of_match, + }, + .probe =3D ota5601a_probe, + .remove =3D ota5601a_remove, +}; + +module_spi_driver(ota5601a_driver); + +MODULE_AUTHOR("Christophe Branchereau "); +MODULE_LICENSE("GPL v2"); --=20 2.35.1 From nobody Wed Sep 17 22:19:00 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18884C4332F for ; Wed, 14 Dec 2022 11:01:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238175AbiLNLBQ (ORCPT ); Wed, 14 Dec 2022 06:01:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238092AbiLNLA6 (ORCPT ); Wed, 14 Dec 2022 06:00:58 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 251041ADA8; Wed, 14 Dec 2022 03:00:55 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id h10so18873420wrx.3; Wed, 14 Dec 2022 03:00:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UxEwCtwZkbo/SE2lM+SFwhtddp9U5nr3fRj5lE/pCQU=; b=qkIo8apE6wPveAxrTPls0JzOt/rL9PFCLyGUfd7u8N6CEsd+GnAynINEmMpFhDmCh3 +qxl0KMr94ttaHM1+9vGi5TvBw2aP46Uzj0HYeqizB9gYpJYEsAp9w5+oSra3Jc50rjc XbFE5pvpA8woVsD4Wr2SdQBtZ2fKMCDSHY5Oua9rscOltiKOhVRNMd9mHJK09mAb4w8F JwCtAELfxo8zMslMPj8L3exc09pWQmAksKe5s8Cc7IqRDwJ+jy1Ph0RKJnZbiW0/hbQa 93JYj0PWqkVPjrYG0fYTISnEPJ8cTvGIWY2SHUxMrSTv8DhUTbEt+wjIUX0e2RmXbxzP jjgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UxEwCtwZkbo/SE2lM+SFwhtddp9U5nr3fRj5lE/pCQU=; b=7evsxIGgzW2tuzpPRvocF7cAmHTfDPDswWLO3N3o4/JdydU6+lZP2MaZGgiMXER9q9 KHBt69tHbm9r3IAij9drCL1CU16OsAvlrDTaP9W/INugl0WNCNd/zmKJYnw2U74wmMCp uDFbwXZVb//gbm6n1iIjjtqGrxywz0ANBj7M/ktCG06yKw52Y39EgriGVfw5A/HqGI1x VWbDFiOmSJW/4wNAgpua7ZpV/w5PIv9LBtT0peVPsyeM+Tz8qMeKOMHLVqHV4n4JMibz L9uuzMO6v0OGVkfaYaV788HiupuUtLb2Dxj+imFMdVtLMQj1gmvR1f6M9b5lsN+b7Gpd GMEw== X-Gm-Message-State: ANoB5pmXkxCCoIhcqG/ERjl8TSaqPmhJIvTteiK3r4ZHaXaoibzg/s3L e0Cm+brqMW7mSp/D1b5EXNI= X-Google-Smtp-Source: AA0mqf59FBVRgtaf6cj5kFR/HiVbmK7de5Q+pWQcjUEGezL/ocj+OLcGbULF+zUHMy1A/kYu6VKu7g== X-Received: by 2002:a05:6000:910:b0:236:61bb:c79b with SMTP id bz16-20020a056000091000b0023661bbc79bmr16981257wrb.3.1671015653583; Wed, 14 Dec 2022 03:00:53 -0800 (PST) Received: from localhost.localdomain (2a02-8428-46a0-7c01-bc7c-15f1-6c3b-ad74.rev.sfr.net. [2a02:8428:46a0:7c01:bc7c:15f1:6c3b:ad74]) by smtp.gmail.com with ESMTPSA id h1-20020adfaa81000000b002366c3eefccsm2462096wrc.109.2022.12.14.03.00.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 03:00:52 -0800 (PST) From: Christophe Branchereau To: thierry.reding@gmail.com, sam@ravnborg.org, airlied@gmail.com, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christophe Branchereau Subject: [PATCH v2 2/2] dt-bindings: display/panel: Add the Focaltech gpt3 Date: Wed, 14 Dec 2022 12:00:37 +0100 Message-Id: <20221214110037.149387-3-cbranchereau@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221214110037.149387-1-cbranchereau@gmail.com> References: <20221214110037.149387-1-cbranchereau@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add bindings for the Forcaltech gpt3, which is a 640x480 3.0" 4:3 IPS LCD Panel found in the YLM/Anbernic RG300X handheld. Signed-off-by: Christophe Branchereau Reviewed-by: Krzysztof Kozlowski --- .../display/panel/focaltech,gpt3.yaml | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/focalte= ch,gpt3.yaml diff --git a/Documentation/devicetree/bindings/display/panel/focaltech,gpt3= .yaml b/Documentation/devicetree/bindings/display/panel/focaltech,gpt3.yaml new file mode 100644 index 000000000000..d54e96b2a9e1 --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/focaltech,gpt3.yaml @@ -0,0 +1,56 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/focaltech,gpt3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Focaltech GPT3 3.0" (640x480 pixels) IPS LCD panel + +maintainers: + - Christophe Branchereau + +allOf: + - $ref: panel-common.yaml# + - $ref: /schemas/spi/spi-peripheral-props.yaml# + +properties: + compatible: + const: focaltech,gpt3 + + reg: + maxItems: 1 + +required: + - compatible + - reg + - power-supply + - reset-gpios + +unevaluatedProperties: false + +examples: + - | + #include + + spi { + #address-cells =3D <1>; + #size-cells =3D <0>; + + panel@0 { + compatible =3D "focaltech,gpt3"; + reg =3D <0>; + + spi-max-frequency =3D <3125000>; + + reset-gpios =3D <&gpe 2 GPIO_ACTIVE_LOW>; + + backlight =3D <&backlight>; + power-supply =3D <&vcc>; + + port { + panel_input: endpoint { + remote-endpoint =3D <&panel_output>; + }; + }; + }; + }; --=20 2.35.1