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: 82656 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp567578vqo; Wed, 12 Apr 2023 12:53:32 -0700 (PDT) X-Google-Smtp-Source: AKy350YAsHj67etS6xSGGDngHJd0fxnHxSRb+GOSAiL+7Ux2j5c0ztZMJ/TmV1ehkiIRwN9iwc4A X-Received: by 2002:a50:ed8d:0:b0:4fb:b0ce:3f63 with SMTP id h13-20020a50ed8d000000b004fbb0ce3f63mr3049812edr.28.1681329212112; Wed, 12 Apr 2023 12:53:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681329212; cv=none; d=google.com; s=arc-20160816; b=brXHsgH8q4hxcKRhJUrhm3xTgxVRRAWgmsL/W91+DmsJvdyAvP3N6tm3XW/uLkrcg7 TLkNb7cwGELXzKmpxmX/PZkknUGrBfAK1cp07pV/nZzt08a5Mbad7aizOvojBI+Iekhd Nm3SxOgsU6SZ36X5Xcof1WwgQU6KgUyENXJGyWtJC4E0Jpn86oJf8ZFqS2NQM9Nzv5sQ g8X+oeHn64wWUpdszJZ1UeRpSJOLqT5tJrE7NfdDVnv9fM9FJbiGvI3HdpFHpzXmoCjX TINrik4cdQU8IRWhkXfLrtiYylvOcI++ym7tSOy6EuNjZaFcPAKIXqvq9B63wY57EsPG NYjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=DEAnat5PSJjsxQAWB7/SpZ+xwfK/Fj2JlbHtk3HNvoA=; b=HNk3U3B47ouqNzON4odnazDcr+XI+WhOV545Y1nWIYNxvi2cp4LY9FIHtwaBT2IqU8 gwUAW1boDneuNp7aNQGcQVT6t2eiiKvVKTcHy84a7WiH86x0R7VOFR79v98ztxlqLCtC nFNm30uITrv5GetPCaZySKrNHXsl/yTIZYSr5Rq4nbxy2iFNHUNEfFdfefxCkyJeGAiC vjgts3MUbwUk6BfSySQp1TmFXpku7VykAhfCSgqS2j54Y+wXsuNS4zAr3GPusUZANSPe hrcFLFg8LIhVy5uGrMI84PalQ32E84K+U4fvOGMhU20W750RUUVzaYW/HUSD3nfFKvrb YJ6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YXwiyLzg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n4-20020a170906724400b009220173aa75si3341054ejk.456.2023.04.12.12.53.07; Wed, 12 Apr 2023 12:53:32 -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; dkim=pass header.i=@linaro.org header.s=google header.b=YXwiyLzg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229767AbjDLTqQ (ORCPT + 99 others); Wed, 12 Apr 2023 15:46:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbjDLTqN (ORCPT ); Wed, 12 Apr 2023 15:46:13 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAA3D1718 for ; Wed, 12 Apr 2023 12:46:12 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id q26so3936888lfe.9 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=IHhA9KSw6MGK9NWPz5OQFVGEKFBWU+EJ5uqTwPJAORtKOnYRSxwul4m0xRLMTVPiqh 6KDCdsiJe0f70YfjXnXktJygzeVHL7CdGwGpk6aOjqME3hCzAd6PzzXmAzFgFwydOcDI vpq11eLa1fSwOC2G1NRTaSy26e1oq5n8AqI6DjSKCmjGBFUJfPRNKZjsKOvYYoxPawCC EbXKRGkI/IsAETEEYKpS4NGrfxD4K63f7CPNCUDK9wV6/19SmFvQzx076N+tvnWjCk2G vhgoT9arSDoNgCkEAMrumiCs0J/tL1AoSvHQt9LSK+P9EibKxi99uvkaeuAU1YS/BB/k 6gCA== X-Gm-Message-State: AAQBX9cYTt0TS6n8B4Cm8ukum5tc1Bzybys4fOh9ypvjBLCuXSOf+lnw Q7zVeoRfcjakKtx+RdEHC3hwpg== 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 Cc: Marijn Suijten , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763001459881478019?= X-GMAIL-MSGID: =?utf-8?q?1763001459881478019?= 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: 82652 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp565489vqo; Wed, 12 Apr 2023 12:48:13 -0700 (PDT) X-Google-Smtp-Source: AKy350bKuwKSVXBbDLtXDlBmk82rellUwaUOQ62wXL5xsqJlQm5ZesGWA3XM4w8qpyarEpn6Ohxn X-Received: by 2002:a05:6a20:b047:b0:db:6026:4393 with SMTP id dx7-20020a056a20b04700b000db60264393mr19388827pzb.59.1681328893444; Wed, 12 Apr 2023 12:48:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681328893; cv=none; d=google.com; s=arc-20160816; b=LiVElOC13ut8vT1KGBckPG4uMr+lQ+Qtw3MPGt5fUf21sVwvtXmseSGQbIt5LFs/v8 cPfKeDUQDXLoQdBpAidz8biiyEXTBHGMjiw4FdJegmFSAfgSJqzuiKbGXVbkrP+IM5hF Vqr6ZJOWZcfSyO9PFCKaENwbFhTmeGjH98IiPNYR0BQBAHxC/mrXUeraS27mj/Ou7o/6 XfdSrtW2zcdQmQ4e//mfJ4uVvlHGN8yWGk7Ru//3CZ208HUu4m58HH6Ol5b8HNZIuYw+ HX8dbz+7NGJTit4Jap26ilZ91OKUQFvoPDsd/TJTEodDbnm3oKH8jwAq6lSvfcd9o7s2 KTvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=N4kTVSMXSwyC6bo9qzkKhgpiPoowje+aIZSZ/vV/bAc=; b=VSoEtHe/q0tVBSOYfpkrwTMqfo9+h/aP2rujGai/0qiAk7jjxWgYkXzgUDG+RlCLDE E2Me5DlYuzibaayTJwlimdBN/QzaWsQyddyAq4osNo1tHB0ReQZ9L5xp96lj82YvF5oR McACIsziDbrzZ4F2mEtwNSok3rh/gKli9ABh5lnRUxa0fgdXtLlwJht5q8Gz44/BS0ov R3EoG/K+o54C3FhKa7hgSqQ58u/jrFKqr0mAqphH8JjfKvGOxJZ0asj//bDXrSGpuMfe TDdI0zJ+3CLt5fgkdisYWNGVg8ax0LwnL3oew1n7/wzAmUEWOP2V45nQwfCrkrbS1+yv JGOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zWzoQ6dX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r137-20020a632b8f000000b0050bcbcaf7edsi3021844pgr.820.2023.04.12.12.48.00; Wed, 12 Apr 2023 12:48:13 -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; dkim=pass header.i=@linaro.org header.s=google header.b=zWzoQ6dX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229807AbjDLTqT (ORCPT + 99 others); Wed, 12 Apr 2023 15:46:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbjDLTqP (ORCPT ); Wed, 12 Apr 2023 15:46:15 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 399D81718 for ; Wed, 12 Apr 2023 12:46:14 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id r27so16193298lfe.0 for ; Wed, 12 Apr 2023 12:46:14 -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=jwZonH73UA6Cs4YanY0Qce28VPUnl9WUvSOsYIESHs1xsRw7udherkc2X/pBioNln7 QJ9E4uCdBH3e1jRyeHrIXj7Oye+kMBB+yS6yJHToNui4LfB0qFyypcAA7PGsi3GHyFEz 6KMW0X2zxmVqOYdNJl1B70HjL+EdDO3gQzmxvob3w+LCWm7vDwDMn4aveXl1dlr+1CWa kSL3XdUcO8s5XEONwmZz59dNRtbTSSQgPFwNoiTZACM9Ew80rmxb0JsdtH9MGYfRgK1h dUGt+yPTugLjLBYJ8bQmqiWRHP4QhRvDwbNIHjmIAl77YJX7XbQdxk/bqqXY2ZpdotIg jmAQ== X-Gm-Message-State: AAQBX9fChk6XKyOVeuZ0syp5d46/U6+irgpvS1ZVmgcdLPzCRh2PxcF/ wLYaQiVeN3gNFWD2NcTDZRyhIg== 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 Cc: Marijn Suijten , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763001125611814751?= X-GMAIL-MSGID: =?utf-8?q?1763001125611814751?= 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: 82655 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp567230vqo; Wed, 12 Apr 2023 12:52:37 -0700 (PDT) X-Google-Smtp-Source: AKy350bYDrmHFfyvG5WTFZr9gm2n56ivtfosop6cASfK9SPtbfC3x0vzs//eCl0mAtwUBu13SU5K X-Received: by 2002:a17:90b:4a0d:b0:246:5968:43f0 with SMTP id kk13-20020a17090b4a0d00b00246596843f0mr10558990pjb.10.1681329156754; Wed, 12 Apr 2023 12:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681329156; cv=none; d=google.com; s=arc-20160816; b=kqp6DibhJumIp6hpz/O2X4xhp7LZByBhmSVy4h2+0nAvD7qSJeF36OTT1KGrw8GLlu NSHg9Wpr+brlyfbHv03VXnAI9bK5I5N1qvdtcsBinl3ub7surLnMQxiT+t5Bq0wonm6d h6UoZDmIKiTnqlgLFmDsI3/ftwO/A5uCRSGKZ2a/QofP7NlnKR+7Wug8/inI2nz0RW70 z7tmGBkBKiRJTdRk9aHiZ+g6MaqLFDQjXrc8W+HWlTP/jqmya6dqTeG9hVBv6/weJWiD G4Zx/yYxLvOGd5ShAl9But8ggPyzwOPfaqfJ9Cog26inyThiIcdxA4QVXh+THdzH0EAy G9KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=V2syyztnoLcpIUNviLs7GJ0HFV5Q0EtJR2piodIqSJw=; b=N1Z1/CM0lJqcZkadUydkX18KIC9OIywdxsUYEULuZ1HO3fd3PxWT+QOB9vx9zkQ3VY a4SCMKo8N3ncnqNFiRGUKCVzZZclJMdhpAgv9cODyewEdv6fHAWkhiEwN34PIFrO0Inw FHkZHDKfH2ZznHuSYIuq4WM2hB8RY6vxthQlW2ihUnXsaSLUmEVYVo7kqreSh+v/MFq/ pUiN0W+vbtVYuBzRiIWLu7ZX93A0Vi1iUqwFSMr8dnXwaMMYTFKJpNPSPZnXc8mHsq3e zS0QpZp9xXU2DJe8vC6m9Ythr6MuKsK4QkHH5ytpwOwRbu4Ndy+VjJKq7ocDFX719UyH Z5VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RfudjppL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a5-20020a17090a854500b00246798d7efcsi2656561pjw.89.2023.04.12.12.52.07; Wed, 12 Apr 2023 12:52:36 -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; dkim=pass header.i=@linaro.org header.s=google header.b=RfudjppL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229997AbjDLTq1 (ORCPT + 99 others); Wed, 12 Apr 2023 15:46:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229719AbjDLTqR (ORCPT ); Wed, 12 Apr 2023 15:46:17 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 785D065BA for ; Wed, 12 Apr 2023 12:46:16 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id m4so15954538lfj.13 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=PzIkUbffaQaIzuwa5ld+yqHL6pc4cE1nQ6CAWeMR1D36K652QxfYxjeUSYhMKGkUQo Yugd0dMdKvvN6+pLpcGSp3sb7wMGTAF1qVQ57iutiexQ2MTjMrDJfCwZJEQEnr/4ftSu EGXfsm49MsXOnzyelRnNQ8fo958WJeq9qAi4CRQp7MJguqVSJq9KNtNmoFbzL9WI4noe FciZU4pMBr5KrNnlh9DQGVwmzghGzjg4KpH0t2+RX3atInfREVWQehnl4fP88CI6c1yD hQRpKeHLz9jb5ZsOrfVKUWlIbfv8lJqdGBpFfldWEZzcnFNlRcLIrF26J3HjA6/xxl6e cg5g== X-Gm-Message-State: AAQBX9cDIZsnXpZ6tVng/7qa54j1lo9Tgi20WG2igCPAObovT0sc4RZG Bdh699Rf69+vIgymwkI6zDUK7A== 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 Cc: Marijn Suijten , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763001402008377054?= X-GMAIL-MSGID: =?utf-8?q?1763001402008377054?= 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: 82662 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp570273vqo; Wed, 12 Apr 2023 13:00:12 -0700 (PDT) X-Google-Smtp-Source: AKy350Z2AN00aIdEPzAxMRksjmjrtWX2HQWJ/Jzy66yjYohduoDazWKrGLm+aH5YjgqvCz386x+A X-Received: by 2002:a17:90a:d155:b0:23d:3913:bc26 with SMTP id t21-20020a17090ad15500b0023d3913bc26mr484520pjw.2.1681329612046; Wed, 12 Apr 2023 13:00:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681329612; cv=none; d=google.com; s=arc-20160816; b=lTaLG5IpdLXo/XBxmZRn2q+Z0ou4YvqWJUK26adhS5/zAejld+K5uqXpJvOxIjiz4d T2ALFobGCEfkROR2QGt933AJ651hZhqL3gcIjzAW56dqpQtoifOj4tbzJ5dVtXteoVxH +eSmsGInRRWk7FhAsewtTXW7iOmNvq4BK8aBhlE9ipTFM4pegy9+ZrUnWmy8Voq3s/DK mKj7ytcSUW55BalWN+5TGvA6aS4JcdXJyASQUgBFMDaKIf1WZIOtTIHnXt33Luahk5Hu xJB2BhWco1NETdx8l+0sCibYMS3vbmTRpj8SUq22RGZftjaeGkJTJ0dG2zm1bea89F6O MLJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=iRmV3ZbptyRzjNEUKN3cUqrgquOQ4fNh4NEQv3SzN+Q=; b=nWZqin1V/yhJ+YA4gp6dx1UPmfymATxyi8GvmV6uQmspIxsGvAvgqO7kcNmGcaerxi FvWOxUlKAnbgjLDtwW/kQ2khoh3DoYSjoQ796OVEGirQy+niV/wXThsHWMiNQhpPtWAT zachUvrSHt20bKn3/Ub0po4iuZzzh4sX4Rx7rgRL9A9WQ2VucaUd2gelENZqX/aioreq ZA5Op9fIoGeaY1pk17OrFbJmeJO6NKtjB5ul0Qbycf2J2i9evzGazvrctgvVg/kDtmjF DXMYbCrpYLPim/paUiTEa2xwIh+Kap2Ra8DKn/Qdvq6bEOM3i5SuP1YulBEmjKn/VRfq yaQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GoQkyT6N; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t5-20020a17090a950500b0024664356ef7si2615253pjo.152.2023.04.12.12.59.58; Wed, 12 Apr 2023 13:00:11 -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; dkim=pass header.i=@linaro.org header.s=google header.b=GoQkyT6N; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbjDLTqa (ORCPT + 99 others); Wed, 12 Apr 2023 15:46:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbjDLTqY (ORCPT ); Wed, 12 Apr 2023 15:46:24 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D962A6E8F for ; Wed, 12 Apr 2023 12:46:17 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id t20so16111906lfd.5 for ; Wed, 12 Apr 2023 12:46:17 -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=Z+HfBb3+LDYoySrtrnC1sJ8FH3JntGLUJuButkRZ6/8XM9fpv/7WCU1q3EmKAgwrmt HnnLcbVvKYnpKKZMej/dwFYUZGC8JLq5O1SYOHB3PHUXgGZgGoyzmB9q/5oJj38JlHbp w2jJkAme1tHrzvg/eIvQKJdY57iVFA0IqM1H4fUYZcyvpKgrG/ka0z4s6drPNonOQlI+ VzkGImMn7edcjG6RJmoDsUmAThPXFCcPPIq6rgGn/VHTTmXZkWVJ5TavbWRo/t3qxuub xL19TKFa20ou6HP4FWBkCpCL2u8V0xE1kvw6d1ulchEeh4D088mtPpKP+FAJBHxc10Rs k3nw== X-Gm-Message-State: AAQBX9e03l0X3383s6hwOFjfP8XE57BEl8GfaGn5U/+t7vUB6G1MnJWn 3JZRDUBcxU88yLmjq59Mv1o7FQ== 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 Cc: Marijn Suijten , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763001879415843612?= X-GMAIL-MSGID: =?utf-8?q?1763001879415843612?= 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: 82653 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp565625vqo; Wed, 12 Apr 2023 12:48:32 -0700 (PDT) X-Google-Smtp-Source: AKy350bLGmPZkRxhUmhaA8/BHbZK7rbIPBMp1WUDsTN390SkzaHTvMGpa9XLV+7B2DopP0nJKBOl X-Received: by 2002:a17:902:ce8c:b0:1a6:3d07:af32 with SMTP id f12-20020a170902ce8c00b001a63d07af32mr13678plg.38.1681328912042; Wed, 12 Apr 2023 12:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681328912; cv=none; d=google.com; s=arc-20160816; b=hZL/FzA76D/ldoeBkFHT8YqcwnfFmYHS85MrjIg+goe4EDSf/UuFF2f2pSd5E6/6YR /qSZImD9llurHKLAouSqSKb6aU6khsTee6iskmXAbi99Nfjyrm6rEpFcEVXjKwt+75Rz KXjTmwuXdEB0ikPdLaMfEevp3EsU8g/fcJi+7h0jlPbnHg/avaemZYBBQ0mpsbNTc4vp nCKWRAisrGnDk7rsEBpTmfTHlOYzCTLCju+sx+sMIOmtxiDBUoStuUddiPetqFpNB+CW KhHYEBoaRNPlEPhptJv6SgjotjjX5sbV7IgeHN8rvnarthtVUzOvYiKSge3pv3Q8c+6V mZSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Iutcvf8dWMSkz4y9PMQuquo9+n+lyx20D7RRy3/1qoA=; b=x+aFGNtkqWEigAgZ15lXYlOHCeXC+7UtAXOV7IwFZZT3lS8SZzkECCjEopgIWS2GsB OhE7qHAf6DRmrmr+8SJDzHcPtQI1qktv7kwIPYOojmX5TTqszgQMJ3Q94N0O8yfOG/3Y aB90k5zk5OAOGTBoA9EP2RQklf2xKYBzdoxfVxDRyNeHKTez3pI1E/WfgmgmP+BAe/Rq OqelXbIkJFYJMRkb0fRVkN/wMe75tRs1+zBU+Mtu0YRKFMZ9aMr7JwuSCUrG8m02o4e4 thn+droytDh2bqUFsBeVdEsiXiiS6mWVKIpljpty1zAEKPnI/n9c0/O8wdZsNpt7QOSV deww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YAH90DVz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o15-20020a170902d4cf00b0019cd505cdc5si18242873plg.440.2023.04.12.12.48.18; Wed, 12 Apr 2023 12:48:32 -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; dkim=pass header.i=@linaro.org header.s=google header.b=YAH90DVz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229974AbjDLTqe (ORCPT + 99 others); Wed, 12 Apr 2023 15:46:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229983AbjDLTq0 (ORCPT ); Wed, 12 Apr 2023 15:46:26 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB62776A9 for ; Wed, 12 Apr 2023 12:46:19 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id t20so16111983lfd.5 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=I3SSR7aMa3qUBm1CKhvAXb+7z115pgB/Dmm1bOsP34Y7ToMswDroaGumRwIQam4lgj WZUE5N3yklRBRCI2Bir7jlOYMHu/NfIeLIKsERUfTujddFudpnEhTX4eKz+QPcawudei f7Ma4kUK6ISryz04nZKPJVam+KAGoLd1CdoiKRXXr1xe12hiavcPfWG4dVIJeclbOKm2 MupImJEv2TT9YAPGYdeDqkKLE3TjhcgqTb02X2EcKnIswvAoVS1HB4f9i3s8uc+ZHRCG KjBiyKKheb98HM/V+cv0uQBJBM5mCxSMQiDIzEVZICV9xdRcM60pfB0rkd2xUs/xTHNA h6Vw== X-Gm-Message-State: AAQBX9ct9w1mETxVh3w9lP7C/tEzWaIE2+kFtFoMi7FL0RLa8IqLzqyr yd6+d0xtY+szSh6de7PhHTinew== 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 Cc: Marijn Suijten , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763001145334690321?= X-GMAIL-MSGID: =?utf-8?q?1763001145334690321?= 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