From patchwork Wed Apr 12 19:45:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13209457 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A862C77B6E for ; Wed, 12 Apr 2023 19:46:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D92110E942; Wed, 12 Apr 2023 19:46:15 +0000 (UTC) Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0F29A10E92D for ; Wed, 12 Apr 2023 19:46:12 +0000 (UTC) Received: by mail-lf1-x132.google.com with SMTP id z26so16018262lfj.11 for ; Wed, 12 Apr 2023 12:46:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681328771; x=1683920771; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=DEAnat5PSJjsxQAWB7/SpZ+xwfK/Fj2JlbHtk3HNvoA=; b=YXwiyLzg4ji60X8cpHNlrFIzDmyZJKGB81F6A+ebWz+GR6NY5Iw6oTV86QwTK8VLlE 6JFyxipHfmjVM1joCgbYab5wEgc/NJyR1AJYa6JO8xP9LPl+ocaSmy4rQnc+SdPbnh/C 8tyxBZkFJ+js6MrlXgfSsQzD7u7/idqTlgloJP5dzbipQLlNRkjMLXU3cGd0T8Nc2N/B YuGgoV4RzSig1n7Rt3siwcaHYmf2mezeVij+xLS+fEPcYfcwznC2fX6aChJB27I6KJFt DZQWDCkyPETH8zshyG34lInJ17jBpHrxZBLHCp5PYc6fWwVwkrwwPWOGXMK9lPsqAJ/x 8WRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681328771; x=1683920771; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DEAnat5PSJjsxQAWB7/SpZ+xwfK/Fj2JlbHtk3HNvoA=; b=dSvxtf4wfLAVtyKExm/yEzPZ9phlCZOQxtz9WcKbImgndb2YsaYf6XwP8Y52GtOZMs ouv51FCxe7VZ0uQlLz7cHP1fPOYbnL7EfqTLNmwmd86Jvn/QLSbmRWFwAPPjaEcCq05w JaSN4NgClmKWfHIXdWICKn8PyUaTiJrDPWcFwzaI8qBMxoGDmUdpua3LrByMQbGBDMTT xU52ytTkcOZNx9vAmi0yZ30/o6YC+x1Ao7fdDYDUwZNpRXX8xJKaCPWb5B+6chvay1BN hxxK9GNJ/2+muCg+EtczoUK4Ke2wb2IjMFUu7hKzJ/Gwk6yIlMK+rO/qS9bs225D3wvW eiRw== X-Gm-Message-State: AAQBX9fPmi+OIW09xjJt7i9KgGfsvRkarQfW7Fn82z1CPQTHAFAM1RSH FjsL2nSQfwJpQ6fM4aviebxFVA== X-Google-Smtp-Source: AKy350ZQO4wDtrSkqQilMkiMX1DJXlr0CW0RCxaddDxjo+a6jr9yxnIMURGU7xelCIuFm0ODAe3xcA== X-Received: by 2002:ac2:544c:0:b0:4ec:9f36:9b5c with SMTP id d12-20020ac2544c000000b004ec9f369b5cmr2723lfn.68.1681328771108; Wed, 12 Apr 2023 12:46:11 -0700 (PDT) Received: from [192.168.1.101] (abxj23.neoplus.adsl.tpnet.pl. [83.9.3.23]) by smtp.gmail.com with ESMTPSA id x2-20020ac25dc2000000b004ec8de8ab3fsm1205865lfq.132.2023.04.12.12.46.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 12:46:10 -0700 (PDT) From: Konrad Dybcio Date: Wed, 12 Apr 2023 21:45:58 +0200 Subject: [PATCH 1/5] dt-bindings: display: panel: nt36523: Allow 'port' instead of 'ports' MIME-Version: 1.0 Message-Id: <20230412-topic-lenovopanel-v1-1-00b25df46824@linaro.org> References: <20230412-topic-lenovopanel-v1-0-00b25df46824@linaro.org> In-Reply-To: <20230412-topic-lenovopanel-v1-0-00b25df46824@linaro.org> To: Jianhua Lu , Neil Armstrong , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1681328765; l=1187; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=FMgShhUTMaYzSy2Me7Gv1xSXp92sIQsWFZ0aqhhoJn8=; b=9TbzELnlWNU1kmoa3o/rXyhwMOM4rjVKSxHPyH/watUFxTLNRkHx8vvXq4FZZfrwU4sEibR9V1Uw 0SXo1Q/nB7+4KemAltiOcAA+ADHzcKumbeSaLNwxSdI89adYyaP2 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Konrad Dybcio , Marijn Suijten , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Using 'port' instead of 'ports' for single-DSI usecases allows for saving a couple of DTS LoC, including a level of indentation. Allow that. Signed-off-by: Konrad Dybcio --- .../bindings/display/panel/novatek,nt36523.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/display/panel/novatek,nt36523.yaml b/Documentation/devicetree/bindings/display/panel/novatek,nt36523.yaml index 0039561ef04c..38f4f986aef1 100644 --- a/Documentation/devicetree/bindings/display/panel/novatek,nt36523.yaml +++ b/Documentation/devicetree/bindings/display/panel/novatek,nt36523.yaml @@ -33,15 +33,26 @@ properties: description: regulator that supplies the I/O voltage reg: true - ports: true backlight: true +oneOf: + - allOf: + - properties: + ports: true + - required: + - ports + + - allOf: + - properties: + port: true + - required: + - port + required: - compatible - reg - vddio-supply - reset-gpios - - ports unevaluatedProperties: false From patchwork Wed Apr 12 19:45:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13209460 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2FA8C7619A for ; Wed, 12 Apr 2023 19:46:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E74E510E93A; Wed, 12 Apr 2023 19:46:22 +0000 (UTC) Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8CCF610E93A for ; Wed, 12 Apr 2023 19:46:15 +0000 (UTC) Received: by mail-lf1-x136.google.com with SMTP id t14so16009883lft.7 for ; Wed, 12 Apr 2023 12:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681328772; x=1683920772; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=N4kTVSMXSwyC6bo9qzkKhgpiPoowje+aIZSZ/vV/bAc=; b=zWzoQ6dX2JAKA2j4dLDWKS1dbYRopx+EAMlpKfSqpLxDhwF20KnINJTVf581xvVqOY Yp1g7chdDoNPmEIELY1Ey/B9bQiivsYSeE4+4QDfvJlbPzRmjNx9DUBBjWLOukurTkN5 RHDM1qOFEb6/FgaZU49kGm+gU70plR4+GDSq1TSSCrrmmCC22lgmw1JqkLPMHsa9Vkt3 eqcw/z2ATZ3fa9oqLE3EeeSL8Fz9D+oJ+gPw+cF2EFOjwwPU1GT38bg1Z9+yS2sn6v/d 1iU/5CRTlyyCp0SpaI9VQMXeaXaq/SM8noBTw3JsYWRv3UY2nEomYEn6hD5LKzpcLXPu p9JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681328772; x=1683920772; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N4kTVSMXSwyC6bo9qzkKhgpiPoowje+aIZSZ/vV/bAc=; b=lyCkxr4vzhhaMph7Pw6Z01BcAWInZJpXc8Z0sMwoxHJNxawXZtL2hOW7JnrcNlJsCj jhBMyMZWXT+hxJqK920nuMoQzRWnHaHfiMksCy2SCNlfBMn7yFpiGWrBas0ZUOjPyUYi MuZGCbmpBR2B4XY/a8sQHWeLpc5avtGP/mpk3pjhr/pRI1Tw7SnEEKgBmGyffsebmft9 xfFdy8RSECDeEYmCktyIwtQUt6Tt5RMTrnWaxGTQZxRBbJ46oTa3n7rEknB9OcsT2Mmt LT5zEpjJDoh3BHlWjPHb5jlLJs8jSrlf1FYbE9j+hBPsSL1V4GA6FUWKjKUgGsxug+jH 6BzQ== X-Gm-Message-State: AAQBX9e5Kn6c1u8Tsu3Fx3cWSwKj13SoSaTTELXi+wq1LW/JGvrZ61Ia ZLYmtW4mVm0YkzUdB/e1TrtqLw== X-Google-Smtp-Source: AKy350a95ArQuowl/wgW6TW1gFmnTZp8BouUqK6Ak3W824KKp1HQBcg1kwwWGKQBMJhbR/Nj5V6cuA== X-Received: by 2002:a05:6512:75:b0:4d5:c96f:f7c7 with SMTP id i21-20020a056512007500b004d5c96ff7c7mr16214lfo.23.1681328772621; Wed, 12 Apr 2023 12:46:12 -0700 (PDT) Received: from [192.168.1.101] (abxj23.neoplus.adsl.tpnet.pl. [83.9.3.23]) by smtp.gmail.com with ESMTPSA id x2-20020ac25dc2000000b004ec8de8ab3fsm1205865lfq.132.2023.04.12.12.46.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 12:46:12 -0700 (PDT) From: Konrad Dybcio Date: Wed, 12 Apr 2023 21:45:59 +0200 Subject: [PATCH 2/5] dt-bindings: display: panel: nt36523: Add Lenovo J606F panel MIME-Version: 1.0 Message-Id: <20230412-topic-lenovopanel-v1-2-00b25df46824@linaro.org> References: <20230412-topic-lenovopanel-v1-0-00b25df46824@linaro.org> In-Reply-To: <20230412-topic-lenovopanel-v1-0-00b25df46824@linaro.org> To: Jianhua Lu , Neil Armstrong , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1681328765; l=1417; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=+xuQ62lO6qldIvMcfFbmsAJ1YwYhA8kqM8Kbhmig26M=; b=VAQKU+1GcrDese/v3mivE+sj/edg3KZBLnVeAboGxoCDRzkc+tnluTjVHCMq/TYmUmu8FRog0BrC yagNztnNCDXbf+S0nW0yjovosEYVTjZOapZnZ8EJ9FmB5agUnrEU X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Konrad Dybcio , Marijn Suijten , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Some Lenovo J606F tablets come with a 2K (2000x1200) 60Hz 11" 5:3 video mode display. Document it and allow rotation while at it (Lenovo mounted it upside down!). Signed-off-by: Konrad Dybcio Reviewed-by: Linus Walleij --- .../bindings/display/panel/novatek,nt36523.yaml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/display/panel/novatek,nt36523.yaml b/Documentation/devicetree/bindings/display/panel/novatek,nt36523.yaml index 38f4f986aef1..fda74d5bd89e 100644 --- a/Documentation/devicetree/bindings/display/panel/novatek,nt36523.yaml +++ b/Documentation/devicetree/bindings/display/panel/novatek,nt36523.yaml @@ -19,11 +19,16 @@ allOf: properties: compatible: - items: - - enum: - - xiaomi,elish-boe-nt36523 - - xiaomi,elish-csot-nt36523 - - const: novatek,nt36523 + oneOf: + - items: + - enum: + - xiaomi,elish-boe-nt36523 + - xiaomi,elish-csot-nt36523 + - const: novatek,nt36523 + - items: + - enum: + - lenovo,j606f-boe-nt36523w + - const: novatek,nt36523w reset-gpios: maxItems: 1 @@ -33,6 +38,7 @@ properties: description: regulator that supplies the I/O voltage reg: true + rotation: true backlight: true oneOf: From patchwork Wed Apr 12 19:46:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13209458 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 342C3C77B72 for ; Wed, 12 Apr 2023 19:46:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 31A7410E946; Wed, 12 Apr 2023 19:46:17 +0000 (UTC) Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4D26610E946 for ; Wed, 12 Apr 2023 19:46:16 +0000 (UTC) Received: by mail-lf1-x12c.google.com with SMTP id r27so16193413lfe.0 for ; Wed, 12 Apr 2023 12:46:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681328774; x=1683920774; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=V2syyztnoLcpIUNviLs7GJ0HFV5Q0EtJR2piodIqSJw=; b=RfudjppL9G0xxKBlGgs2DSoQTslqgi59iqMfEWCBk8iN+Dg6zk7BOuKfvO0F1utOJM ZYzqDjUu7wxeXrBJ2+2dejIwb/1G9bHt0x0cRvyn8zXrpGSOYp4/otzdpnATTQiLqXwY 4AE6lalKMQtRAoYa1aN8R8cdwu5lKCvOSCGKLsBblI6t41lp4tzvWtGMeimGAGrwDhfC Qzx7qc1ngIAoaHMIaSOf6vA0fzpMz+gAOqb5me3vCZMOskQYOBRMisf1FHAWiQodVTbu o9IHYRb4uw94Rse0aEMerz2ulP3wrSf3/iMuRdtHyv1iMjouAjAcNm/ZSVuCFdWFF9Xn 4EuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681328774; x=1683920774; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V2syyztnoLcpIUNviLs7GJ0HFV5Q0EtJR2piodIqSJw=; b=AD5Mqw66sB3XnWuHBsHMCierEzMyWc9vwXa2MtMH1xa2+wMnjT+Td3GV9WdnOqYH1Q M7NsecYRXVrHcpFl4xmiNxTSWihTNg6I1s4fA9F6XksxLb9LWYlJBg8jRZybv65kJRmi KVA5DremJejsiRzaoIFIWGmfwbWNX/0+Kq79da/BfY+qcXTG50lBws2MGlal8kyntZND oxmYM5fwoGUDT6sGqKgbHvuxF+/XlyYRxZ6gghsgTl7K3tdC3hpjODiu0uR6nd6YU0vD sycvr4+AqP5Hi10ekzG0UwCrfS0thyiJzDSQNV0qQQtlR94KwStQ3CWFxw4YIM6lU68m YqUQ== X-Gm-Message-State: AAQBX9fXIDKoI5WNmXkj0+mDSgM1iFEnXOwRDDjDcJOUnc+NP5qJl1Os g3/K+hAURDKZVUfg2C8ccg7Zzg== X-Google-Smtp-Source: AKy350bIn1HpqV+HLVwmlEhLY+jtsM/Pb73dRYtaanipb2FLYFUFk/ryHNgkBySXye0vjf1vyofOXw== X-Received: by 2002:ac2:569a:0:b0:4ea:f4f4:dccd with SMTP id 26-20020ac2569a000000b004eaf4f4dccdmr10465lfr.68.1681328774663; Wed, 12 Apr 2023 12:46:14 -0700 (PDT) Received: from [192.168.1.101] (abxj23.neoplus.adsl.tpnet.pl. [83.9.3.23]) by smtp.gmail.com with ESMTPSA id x2-20020ac25dc2000000b004ec8de8ab3fsm1205865lfq.132.2023.04.12.12.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 12:46:14 -0700 (PDT) From: Konrad Dybcio Date: Wed, 12 Apr 2023 21:46:00 +0200 Subject: [PATCH 3/5] drm/panel: nt36523: Add DCS backlight support MIME-Version: 1.0 Message-Id: <20230412-topic-lenovopanel-v1-3-00b25df46824@linaro.org> References: <20230412-topic-lenovopanel-v1-0-00b25df46824@linaro.org> In-Reply-To: <20230412-topic-lenovopanel-v1-0-00b25df46824@linaro.org> To: Jianhua Lu , Neil Armstrong , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1681328765; l=3407; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=9qqhcFpj6mF/L7AASWe+iOrvvqzkHzB2/YH6M7xRsIE=; b=aaw8d1wQUM5xrKtH4IBrznSRGGUZaSyx3AjopF5+cWdlTv3kuJUW1nQTTUmCN592VUP7cB4PIeZx xt2oLM0aAVhODQeuFYxIxrlaZfJNRPx6hs7y2M9Swnwxv/7IYP1u X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Konrad Dybcio , Marijn Suijten , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This chip supports controlling the backlight via DCS commands, on at least some panels. Add support for doing so. Note this may only concern the NT36523*W* variant. Nobody knows, really, there's no docs. Signed-off-by: Konrad Dybcio Reviewed-by: Jianhua Lu Reviewed-by: Linus Walleij --- drivers/gpu/drm/panel/panel-novatek-nt36523.c | 67 +++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36523.c b/drivers/gpu/drm/panel/panel-novatek-nt36523.c index d30dbbfb67b1..3c81ec014eef 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt36523.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt36523.c @@ -5,6 +5,7 @@ * Copyright (c) 2022, 2023 Jianhua Lu */ +#include #include #include #include @@ -53,6 +54,7 @@ struct panel_desc { int (*init_sequence)(struct panel_info *pinfo); bool is_dual_dsi; + bool has_dcs_backlight; }; static inline struct panel_info *to_panel_info(struct drm_panel *panel) @@ -679,6 +681,58 @@ static const struct drm_panel_funcs nt36523_panel_funcs = { .get_modes = nt36523_get_modes, }; +static int nt36523_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); + if (ret < 0) + return ret; + + dsi->mode_flags |= MIPI_DSI_MODE_LPM; + + return 0; +} + +static int nt36523_bl_get_brightness(struct backlight_device *bl) +{ + struct mipi_dsi_device *dsi = bl_get_data(bl); + u16 brightness; + int ret; + + dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; + + ret = mipi_dsi_dcs_get_display_brightness_large(dsi, &brightness); + if (ret < 0) + return ret; + + dsi->mode_flags |= MIPI_DSI_MODE_LPM; + + return brightness; +} + +static const struct backlight_ops nt36523_bl_ops = { + .update_status = nt36523_bl_update_status, + .get_brightness = nt36523_bl_get_brightness, +}; + +static struct backlight_device *nt36523_create_backlight(struct mipi_dsi_device *dsi) +{ + struct device *dev = &dsi->dev; + const struct backlight_properties props = { + .type = BACKLIGHT_RAW, + .brightness = 512, + .max_brightness = 4095, + }; + + return devm_backlight_device_register(dev, dev_name(dev), dev, dsi, + &nt36523_bl_ops, &props); +} + static int nt36523_probe(struct mipi_dsi_device *dsi) { struct device *dev = &dsi->dev; @@ -730,9 +784,16 @@ static int nt36523_probe(struct mipi_dsi_device *dsi) mipi_dsi_set_drvdata(dsi, pinfo); drm_panel_init(&pinfo->panel, dev, &nt36523_panel_funcs, DRM_MODE_CONNECTOR_DSI); - ret = drm_panel_of_backlight(&pinfo->panel); - if (ret) - return dev_err_probe(dev, ret, "failed to get backlight\n"); + if (pinfo->desc->has_dcs_backlight) { + pinfo->panel.backlight = nt36523_create_backlight(dsi); + if (IS_ERR(pinfo->panel.backlight)) + return dev_err_probe(dev, PTR_ERR(pinfo->panel.backlight), + "Failed to create backlight\n"); + } else { + ret = drm_panel_of_backlight(&pinfo->panel); + if (ret) + return dev_err_probe(dev, ret, "Failed to get backlight\n"); + } drm_panel_add(&pinfo->panel); From patchwork Wed Apr 12 19:46:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13209459 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D6182C7619A for ; Wed, 12 Apr 2023 19:46:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D9D7210E947; Wed, 12 Apr 2023 19:46:17 +0000 (UTC) Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 96FAF10E946 for ; Wed, 12 Apr 2023 19:46:16 +0000 (UTC) Received: by mail-lf1-x12f.google.com with SMTP id d7so27222855lfj.3 for ; Wed, 12 Apr 2023 12:46:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681328776; x=1683920776; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=iRmV3ZbptyRzjNEUKN3cUqrgquOQ4fNh4NEQv3SzN+Q=; b=GoQkyT6N0Y6moHhgYdP68L9f+lKcTaod6XOvgbDDI0g9iwqIOBW7GWFmkp8nK1DKe7 0yW1GGSi9g74x8J7+QkDzghmWIQNzPNNnqJCAVmlZekK2PrLOd3bhq6vDcohjLffhwGC 5MgK8c2K7qkkO9gNjfjWWgby7xpo+LYJcGSSsZc3HO+1Bf69tfGyyGSLctMNZA/NFDSS gDIQFf6oUj4KKricwOXub2SkE2qyN0AfsbI9FvBwh5+lHEZmTu39f5KvPZISoV6D5h3z W2t/gicK62AJEXrPwL3xeAKvyUUrtGdCjidq8rGQYUwdZYB8/Q72f05e9FCLsnPceUQS /TrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681328776; x=1683920776; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iRmV3ZbptyRzjNEUKN3cUqrgquOQ4fNh4NEQv3SzN+Q=; b=cJosJSnxsK+tSnzsH/OSxYlpnxyfyQ2fWfjYVcVzCNRJA6lYjiDqlwoOpz5gBF6TLu 3iYGZOsS/7eTjAEjbtLbCtixTRw8gwk39z2MzJ6lPNIH6/w9IvxP/zbrxQ31849ZSqVn Fet6e5T9zuZlu7o9IVYara99Z5tVfQB/o/tDGjA9hArYtiNtM6EFnrobRv2DZyEx9aWs c9TuCp+uVDsAl/25vpZFo5Xh9ONH+drddbjVzmwWfeNUr+mDs2XhO7TslqMrBsCz6nUK iKJZ9widW3f0cJFQwxXQ6HsVNDSHxsVGu3tgwI7LFR2XZRklzWlwTP1zLg3iLt9T+w0L fnLA== X-Gm-Message-State: AAQBX9f4Ous42rSksARHFxMtSVKD+2mmRyKEV8G/sgYuCWV60M+n75Qh vMB9jlNEVfT8ftSK26h1Y97ERQ== X-Google-Smtp-Source: AKy350bXHnApee1Viu5dW0j8U/HQ+c7GXyIeVe07SzcYGPzf3DqEBWYbZ7SR3qPrtRgvxAgZjFqHIg== X-Received: by 2002:ac2:48ba:0:b0:4b5:649a:9105 with SMTP id u26-20020ac248ba000000b004b5649a9105mr7037lfg.65.1681328776198; Wed, 12 Apr 2023 12:46:16 -0700 (PDT) Received: from [192.168.1.101] (abxj23.neoplus.adsl.tpnet.pl. [83.9.3.23]) by smtp.gmail.com with ESMTPSA id x2-20020ac25dc2000000b004ec8de8ab3fsm1205865lfq.132.2023.04.12.12.46.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 12:46:15 -0700 (PDT) From: Konrad Dybcio Date: Wed, 12 Apr 2023 21:46:01 +0200 Subject: [PATCH 4/5] drm/panel: nt36523: Get orientation from OF MIME-Version: 1.0 Message-Id: <20230412-topic-lenovopanel-v1-4-00b25df46824@linaro.org> References: <20230412-topic-lenovopanel-v1-0-00b25df46824@linaro.org> In-Reply-To: <20230412-topic-lenovopanel-v1-0-00b25df46824@linaro.org> To: Jianhua Lu , Neil Armstrong , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1681328765; l=1963; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=03x2QxCFOJ92tJUVDwn0/WKNOzd6yyjZ3Pdc9Flrqao=; b=bOzS7MQebAJyIKNBJY3A7fnCKU5niA9Qy5YrlRr2x0jODxMc3uyB2h2x7P0KnBW0UcoLPDYXQUe4 hhp5Aq77CF6aPHBYweuvlRFzFViGdpbDDMSpEjgLTDAOS8Bxu4bA X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Konrad Dybcio , Marijn Suijten , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Some bright vendors mount their display panels upside down. Add the required pieces to allow for accounting for that. Signed-off-by: Konrad Dybcio Reviewed-by: Jianhua Lu Reviewed-by: Linus Walleij --- drivers/gpu/drm/panel/panel-novatek-nt36523.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36523.c b/drivers/gpu/drm/panel/panel-novatek-nt36523.c index 3c81ec014eef..db4b4af13ec1 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt36523.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt36523.c @@ -31,6 +31,7 @@ struct panel_info { struct drm_panel panel; struct mipi_dsi_device *dsi[2]; const struct panel_desc *desc; + enum drm_panel_orientation orientation; struct gpio_desc *reset_gpio; struct backlight_device *backlight; @@ -674,11 +675,19 @@ static int nt36523_get_modes(struct drm_panel *panel, return pinfo->desc->num_modes; } +static enum drm_panel_orientation nt36523_get_orientation(struct drm_panel *panel) +{ + struct panel_info *pinfo = to_panel_info(panel); + + return pinfo->orientation; +} + static const struct drm_panel_funcs nt36523_panel_funcs = { .disable = nt36523_disable, .prepare = nt36523_prepare, .unprepare = nt36523_unprepare, .get_modes = nt36523_get_modes, + .get_orientation = nt36523_get_orientation, }; static int nt36523_bl_update_status(struct backlight_device *bl) @@ -784,6 +793,12 @@ static int nt36523_probe(struct mipi_dsi_device *dsi) mipi_dsi_set_drvdata(dsi, pinfo); drm_panel_init(&pinfo->panel, dev, &nt36523_panel_funcs, DRM_MODE_CONNECTOR_DSI); + ret = of_drm_get_panel_orientation(dev->of_node, &pinfo->orientation); + if (ret < 0) { + dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret); + return ret; + } + if (pinfo->desc->has_dcs_backlight) { pinfo->panel.backlight = nt36523_create_backlight(dsi); if (IS_ERR(pinfo->panel.backlight)) From patchwork Wed Apr 12 19:46:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13209461 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DF85DC77B72 for ; Wed, 12 Apr 2023 19:46:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C721210E948; Wed, 12 Apr 2023 19:46:22 +0000 (UTC) Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8266F10E93A for ; Wed, 12 Apr 2023 19:46:19 +0000 (UTC) Received: by mail-lf1-x136.google.com with SMTP id z8so17957397lfb.12 for ; Wed, 12 Apr 2023 12:46:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681328778; x=1683920778; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Iutcvf8dWMSkz4y9PMQuquo9+n+lyx20D7RRy3/1qoA=; b=YAH90DVzJ8z3eJgogrBqAXlrLkclRQqUqgfxJik82c+Fd5077xCxhhn+RrshhMOfpz dsAsMOl8JqWEieGraPJ0IdZ1/a5SgMrawCKXMm/egmXo2Rb8kl+/teTjt94ze0QwzLV2 EgXBWaCl3Qr9phmczh6iPP31sKJB5mNsb4Mebt/tdPmLGM7dWo1J0iJatt4tdfaD0TPa qkzhpeScwwudUVsFHGEHTAub18dPSB9bd96g6/RKrDJ7m7j10vJLshDBBQ/SaYldrfPf 1sLU0xVZD+qbDe3xD4kDFYvGM7EiQ01GAhijN3JTLb7AFzQw9fhfck/xnnTjCupAOfRn O9qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681328778; x=1683920778; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Iutcvf8dWMSkz4y9PMQuquo9+n+lyx20D7RRy3/1qoA=; b=Wme7UvFjn2QdtA8/b7u9NGF5VbT/9fHz0/uvvZ5h9J7FBfHvukx4tj3WLYfUB6J6Qk cU2hDLfJyARdFmvrfOd/mb0aADSCqC1qINwkLgFt+H4UKMwQ/ml1IiPg88sZoh9X7Svx FT3ioPyc2w7r2e3IAJBNo2MsveVzB8RLMow0A6ygYOZPcXXG0oCFoHeXbuiGRJ9hJ/v4 HqP1QpDjk4UHf3y12CnBkEokOJO7XjJrkvBQi/G9O4IIZsyQdkXJ7RA9wwG1+fOqZjIS 6OqyTYDjZV6rQ6V4E8seHSXDfjjZngDB9xMwE2Nj6/QyYRdEMD8LkcddTGFyEl+6P+3r dH8A== X-Gm-Message-State: AAQBX9eiqCNti5m3cWWWXKniOXBGukzSIOLWa+s1O3MltQpteqInwGRK +B7C5ihoocgyFJ0c0EAK5jx23w== X-Google-Smtp-Source: AKy350b+qo6W77u+TSJAZqP1trreHp37akMmOsCBganlch72FKjIrOvuu+ZX3u4mKh4k6LQTQX1pMA== X-Received: by 2002:ac2:511d:0:b0:4d8:8ad1:a05f with SMTP id q29-20020ac2511d000000b004d88ad1a05fmr7664lfb.48.1681328777744; Wed, 12 Apr 2023 12:46:17 -0700 (PDT) Received: from [192.168.1.101] (abxj23.neoplus.adsl.tpnet.pl. [83.9.3.23]) by smtp.gmail.com with ESMTPSA id x2-20020ac25dc2000000b004ec8de8ab3fsm1205865lfq.132.2023.04.12.12.46.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 12:46:17 -0700 (PDT) From: Konrad Dybcio Date: Wed, 12 Apr 2023 21:46:02 +0200 Subject: [PATCH 5/5] drm/panel: nt36523: Add Lenovo J606F panel MIME-Version: 1.0 Message-Id: <20230412-topic-lenovopanel-v1-5-00b25df46824@linaro.org> References: <20230412-topic-lenovopanel-v1-0-00b25df46824@linaro.org> In-Reply-To: <20230412-topic-lenovopanel-v1-0-00b25df46824@linaro.org> To: Jianhua Lu , Neil Armstrong , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1681328765; l=22561; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=a8GsYeAXGtH6jMRGuaf0r3p1JnRRRNynGhK9xGe2JqI=; b=gvTudzkjiLXww3NmaDzC8ttSjTWWDTKlB0b4Au/w5rdKziWvznivnuWRdMSPZnPMlHHlT03UA2IX H6c2YLFWCnHRvFZ1Nu1B6EpLPrRaG3HiGfujIkdKp1pGXCZN3UFm X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Konrad Dybcio , Marijn Suijten , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Some Lenovo J606F tablets come with a 2K (2000x1200) 60Hz 11" 5:3 video mode display. Add support for these panels. Signed-off-by: Konrad Dybcio Reviewed-by: Jianhua Lu Reviewed-by: Linus Walleij --- drivers/gpu/drm/panel/panel-novatek-nt36523.c | 491 ++++++++++++++++++++++++++ 1 file changed, 491 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36523.c b/drivers/gpu/drm/panel/panel-novatek-nt36523.c index db4b4af13ec1..4bf9f8db26ba 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt36523.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt36523.c @@ -13,6 +13,8 @@ #include #include +#include