Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp845732rwb; Thu, 22 Sep 2022 07:09:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5JcjnFUURFdZzaJx3LijCF2JmlP5oPqfgBql/qvaRffSdmN4HKXADLi5vJHeb2At9usaLS X-Received: by 2002:a05:6a00:ad0:b0:555:ac02:433b with SMTP id c16-20020a056a000ad000b00555ac02433bmr1393206pfl.18.1663855744053; Thu, 22 Sep 2022 07:09:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663855744; cv=none; d=google.com; s=arc-20160816; b=flRtTOKi8EK6HiEnlUCtHxzKfHLQ+lYJQ1a/10UJ3Ne5EQSSL4fI+ITwT0mjdnKR3d VbhnQHERxCj/Iym7XJrlCB9OwzjcgeyP3mKcshWV41jIV7XNudXgWBSsefhuKgw4Jtyd FJUWWepkcLEeik+uRdwvKEksROmknr28VyhY6Hho8qXdgy3Wxgwu65ycavDX3qFlLp7o eoFHpzgFwQ3FuoNGD9mczlZmaR2KLqSWsW61pq/Lnx38DA5Gzxp1BoTb4mDvTrxB+4rP 8Kp9MOhTUR4tObtiUGRmok+MXjal5fLvT8i7du78KkDMCzuB94ZZzr+bNOrNtl5EymrD sFdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9dVnyQGCYq4Dk0Dy2B+Nrg6oLg03BnbEGymqJobiP8w=; b=TWYLoyJsf5e/BX9a3xxnm5Q10mw6eLkjyXRYtgn2hfDHgVaR06Nt/y0UsZVSjRNKvd LPdDEXvHrkMngQs8bgGeTogXe0PHm8EnepakS/It8tiV9k/chYG8SAzx6U/xGCLynbSf QREJu6Ni3DA7cfSJFIoFGEONjjggwBoWc/s1UspIRwacpfcn0GZi2Ir0BP9T04pdaB29 2Z6R+Xfwq7facn9sG+jDDi0qJW8kuNORAIF3YxfwYq9d3umoNBTYujFflG5U3kHdV7U3 qBzMV3MW5P0Mp8BZBnqfI/QQyqm/GPA7QNdA7DL8jNb641pF/dMtZHADdiHBSd3gQsxv 3rqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f131-20020a636a89000000b0043a345c65f3si6024125pgc.755.2022.09.22.07.08.51; Thu, 22 Sep 2022 07:09:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231892AbiIVN7Q (ORCPT + 99 others); Thu, 22 Sep 2022 09:59:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231886AbiIVN7O (ORCPT ); Thu, 22 Sep 2022 09:59:14 -0400 Received: from m-r1.th.seeweb.it (m-r1.th.seeweb.it [IPv6:2001:4b7a:2000:18::170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5457FEF080 for ; Thu, 22 Sep 2022 06:59:12 -0700 (PDT) Received: from localhost.localdomain (95.49.29.188.neoplus.adsl.tpnet.pl [95.49.29.188]) by m-r1.th.seeweb.it (Postfix) with ESMTPA id 41BB4200F4; Thu, 22 Sep 2022 15:59:09 +0200 (CEST) From: Konrad Dybcio To: ~postmarketos/upstreaming@lists.sr.ht Cc: martin.botka@somainline.org, angelogioacchino.delregno@somainline.org, marijn.suijten@somainline.org, jamipkettunen@somainline.org, Konrad Dybcio , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2 2/2] gpu/drm/panel: Add Sony TD4353 JDI panel driver Date: Thu, 22 Sep 2022 15:59:00 +0200 Message-Id: <20220922135902.129760-2-konrad.dybcio@somainline.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922135902.129760-1-konrad.dybcio@somainline.org> References: <20220922135902.129760-1-konrad.dybcio@somainline.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for the Sony TD4353 JDI 2160x1080 display panel used in some Sony Xperia XZ2 and XZ2 Compact smartphones. Due to the specifics of smartphone manufacturing, it is impossible to retrieve a better name for this panel. This revision adds support for the default 60 Hz configuration, however there could possibly be some room for expansion, as the display panels used on Sony devices have historically been capable of >2x refresh rate overclocking. --- Changes since v1: - introduce a helper for flipping the reset pins - make the order of flipping the pins and regulators consistent (this may cause issues in general, as the panels nowadays are super duper high tech but it does not seem to have an effect on these ones) - remove akari/apollo specific compatibles and default to the bigger size (adjusted in DT) - use common mipi_dsi_dcs_write_seq drivers/gpu/drm/panel/Kconfig | 10 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-sony-td4353-jdi.c | 328 ++++++++++++++++++ 3 files changed, 339 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-sony-td4353-jdi.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index a582ddd583c2..6ef1b48169b5 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -637,6 +637,16 @@ config DRM_PANEL_SONY_ACX565AKM Say Y here if you want to enable support for the Sony ACX565AKM 800x600 3.5" panel (found on the Nokia N900). +config DRM_PANEL_SONY_TD4353_JDI + tristate "Sony TD4353 JDI panel" + depends on GPIOLIB && OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for the Sony Tama + TD4353 JDI command mode panel as found on some Sony Xperia + XZ2 and XZ2 Compact smartphones. + config DRM_PANEL_SONY_TULIP_TRULY_NT35521 tristate "Sony Tulip Truly NT35521 panel" depends on GPIOLIB && OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 8e71aa7581b8..8ef27bc86f94 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -64,6 +64,7 @@ obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701) += panel-sitronix-st7701.o obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7703) += panel-sitronix-st7703.o obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o obj-$(CONFIG_DRM_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o +obj-$(CONFIG_DRM_PANEL_SONY_TD4353_JDI) += panel-sony-td4353-jdi.o obj-$(CONFIG_DRM_PANEL_SONY_TULIP_TRULY_NT35521) += panel-sony-tulip-truly-nt35521.o obj-$(CONFIG_DRM_PANEL_TDO_TL070WSH30) += panel-tdo-tl070wsh30.o obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o diff --git a/drivers/gpu/drm/panel/panel-sony-td4353-jdi.c b/drivers/gpu/drm/panel/panel-sony-td4353-jdi.c new file mode 100644 index 000000000000..9e4f48a5126b --- /dev/null +++ b/drivers/gpu/drm/panel/panel-sony-td4353-jdi.c @@ -0,0 +1,328 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2022 Konrad Dybcio + * + * Generated with linux-mdss-dsi-panel-driver-generator with a + * substantial amount of manual adjustments. + * + * SONY Downstream kernel calls this one: + * - "JDI ID3" for Akari (XZ2) + * - "JDI ID4" for Apollo (XZ2 Compact) + */ + +#include +#include +#include +#include +#include +#include + +#include