From patchwork Mon Nov 7 05:35:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 13033806 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 4CB97C4332F for ; Mon, 7 Nov 2022 05:37:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eSoVoaq73jy3oFzadGcBx6Wgp+Lxm7MN83Ny1lvY47k=; b=cHFZ/Vq5z9p56D hIyXoPpBfHjbv2q95xLTXca2x7OHSIynorwmHThvciOR8pXiZDn84hrEbaYVitC4PkhWBeyg625Oa PFcmrokwSTJmYxfj4b3UduNcNSw3Ri+aCIyTy5yBhIqJB0ByltR4lz4Q5kb3NDuScLxgnxi3T+852 dE50LFSlFDelRt6C7A1rZc9+0WEjBPEB8WR0B2o2efzm3Rw0ViMLvPLyb44uPO65Sm/LVTEpqh1cP cA5itinzs4rHgoD936cnNj6Lqk4Rm5X/5ajGTVjwc6BkvohZEvZz6BW65XSmv/4MbQgxkVabpUUyv XEbzhPyYwidkOHYX9KiA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1orunu-00Bnf1-HJ; Mon, 07 Nov 2022 05:36:14 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1orunc-00BnD9-Rj for linux-arm-kernel@lists.infradead.org; Mon, 07 Nov 2022 05:35:58 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 3B67E5C00E9; Mon, 7 Nov 2022 00:35:56 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 07 Nov 2022 00:35:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1667799356; x=1667885756; bh=U/ ywLtSrQavtT5ylYj1CEGcLt1CRHte7fNbDPyPxvAk=; b=kj9zvcWvXLzQX0KtSa JWQLIBtGCuKms9tsRopHUP9j6Y3ew0TqAZBnFMiTkpHWWx9IFviqpHTzo8US8wpW ivz/UIH76R1Fgq9280ALOQkIVyt+PKEHlFlhsy29+3RdBHnE9DiYl/JCZTa47SrG 3aAbedVTdqRs+xIjFCBHthcTZOmNARDe+5gCxD5IW0VipW4MYwLfHdpTeyD0mlo7 Ek/6HnW+KD7//lnfXzWx0dVq3+nnfidqoPABI0qyWJ6EIvW16jvHZcFVoiMqg2O6 1wzTv+dXAWHuBGHUHl+AQHrkx0vGaz4/rDNsTLLnQsW+NNnAlzD4ut0aRvJVZIaJ EEZw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1667799356; x=1667885756; bh=U/ywLtSrQavtT 5ylYj1CEGcLt1CRHte7fNbDPyPxvAk=; b=MI/oacq5X9xPoxAcrHyX7aHAfbAgX ZdKRERY8+WbwjFpWaXAS0ZJ5z5SNR726lYEI7S7aK+ITJj1laohrLgKoiJTpUf1w XeJIYwvsoh7kloBrW134DLCv1tO0pNaRaSqedTFhMS9+5mwzXMn12SEupVQulu4j P54gHXBdNUAb7S6e7Q+UBEygmgnB4Gc6UwQfTiIxrGmEkUvvSVcH73UPs6/JhsaR 9Hl5OfMtSsY7Bqn8NH9BaDpTx8hXV6lpePG6gQ9cOn9u7MkMxBTigfjTyKfCzOOc deQYIMiMxsdabLELYwTTHjDvEcDI+RcNxPI72dIMq8z7ZDeHbsCfyAEew== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrvdejgdekhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Nov 2022 00:35:55 -0500 (EST) From: Samuel Holland To: Chen-Yu Tsai , Jernej Skrabec , Maxime Ripard Cc: Samuel Holland , Daniel Vetter , David Airlie , Jagan Teki , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Krzysztof Kozlowski Subject: [PATCH v2 1/4] dt-bindings: display: sun6i-dsi: Fix clock conditional Date: Sun, 6 Nov 2022 23:35:49 -0600 Message-Id: <20221107053552.2330-2-samuel@sholland.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221107053552.2330-1-samuel@sholland.org> References: <20221107053552.2330-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221106_213556_995359_BECD9579 X-CRM114-Status: GOOD ( 10.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The A64 case should have limited maxItems, instead of duplicating the minItems value from the main binding. While here, simplify the binding by making this an "else" case of the two-clock conditional block. Fixes: fe5040f2843a ("dt-bindings: sun6i-dsi: Document A64 MIPI-DSI controller") Acked-by: Krzysztof Kozlowski Signed-off-by: Samuel Holland --- (no changes since v1) .../bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml index 7910831fa4b8..bf9bfe8f88ae 100644 --- a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml +++ b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml @@ -78,16 +78,10 @@ allOf: required: - clock-names - - if: - properties: - compatible: - contains: - const: allwinner,sun50i-a64-mipi-dsi - - then: + else: properties: clocks: - minItems: 1 + maxItems: 1 unevaluatedProperties: false From patchwork Mon Nov 7 05:35:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 13033807 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 7D5C7C433FE for ; Mon, 7 Nov 2022 05:37:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=h74zdSCIx7Vb2Ot7hU5aMtXKY+/7wPZFlbIocgX4EJM=; b=hhOUokTpU52V8W 5t4l1O1FBdJZBmosTWqJC14X4TIWW5oAdyOI5fz2s82F09s2G2ecSl7jlxwKhcxWQIts7kj3mF0oz LIwLIvgRUDhSnaOhXPX6jMynbYlsuJcBK9vQn0glhQHJA31aUSvMTZJH9WIRnQW9SgA/vIXd/KH1z FOo//ACmLTYDP26U+B53ynk2pvBOqcGcddtwbqNhCw2cZGouBSBDJkYgyvJt5DPNz/XwCs657X3Wo ktvImJjo2zz4IY2OFmEMR5EhObWzgcpPFnl8JaiRCuFmBDNMwIKPz0azzDKOCtDMfFJdui1eZD+Bn 7PKtVfVYDAJGkq9tyzCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oruo3-00Bnib-Kc; Mon, 07 Nov 2022 05:36:23 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1orune-00BnFp-2L for linux-arm-kernel@lists.infradead.org; Mon, 07 Nov 2022 05:35:59 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 76AA75C00E2; Mon, 7 Nov 2022 00:35:57 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 07 Nov 2022 00:35:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1667799357; x=1667885757; bh=XO S3JN6XNHJjuLSX9mYtAFmUbNNKkKhsMQg7RXfIvl8=; b=lcQTpLQ2lKPVay2JKO AA+dZXwjhdR1FAIPE4vfd4d9H5SkVJ5RG1sZjZ4hbIB/qbggMBT66yUs3g3h4aGD uCIyTa5TQp15XO87DcuG1aQyZj9mtgZPAZPb5WjHE2Adkxx7oTLzri3i/bv1fPDm 4w51JMvyDBhCTzwoaSz0S1K6S9AQoWBnpmVKXD16c3/Vss7/Mwri0en+wnyb45Zp +Ox4xC+lOK3j0l3HtEjYrcBg2jcjFLFi1Fr4DgohYtZAsJxztVIg467KgcJa3k3s xtK0eAvhhY9XKaTOWqtFFvgrO5a4DUHGkdADBQ9qRvhM38PRpXz99xkablY3jX5O 7Byw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1667799357; x=1667885757; bh=XOS3JN6XNHJju LSX9mYtAFmUbNNKkKhsMQg7RXfIvl8=; b=dTaH4BYcqDFA+iJYWY4osHn0IA528 daRlsgfbclwP1n5+wDMzhNKMKkhieWDoEkn+RXUFDeBloKfuBLIltQ7iXfQOxTCx ukx17uWmWfLSERGJBAo2SFnWdNp6LIIS8BuLBAztOESAafBxd/Zv9yDTvmPFxK/n 5SfVTqXPdofDOZjtJ1Q4EKmrcpCZuF+DPoa7KtoQW9p+aWWj7LLcRuEcb0qdplIT E14dXws7Wn+A5ZGEbL5qBlm8TRT3TWBpA5Pa8yCADwWwTXhym6JsiOIE/ZyZxwUo PLpzGGKDv1iwVMlaQur+hanuyHV1A6h8tf/EHfXM6XbziPgzNdMGVjFug== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrvdejgdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Nov 2022 00:35:56 -0500 (EST) From: Samuel Holland To: Chen-Yu Tsai , Jernej Skrabec , Maxime Ripard Cc: Samuel Holland , Daniel Vetter , David Airlie , Jagan Teki , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Krzysztof Kozlowski Subject: [PATCH v2 2/4] dt-bindings: display: sun6i-dsi: Add the A100 variant Date: Sun, 6 Nov 2022 23:35:50 -0600 Message-Id: <20221107053552.2330-3-samuel@sholland.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221107053552.2330-1-samuel@sholland.org> References: <20221107053552.2330-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221106_213558_223430_F3583861 X-CRM114-Status: GOOD ( 12.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The "40nm" MIPI DSI controller found in the A100 and D1 SoCs has the same register layout as previous SoC integrations. However, its module clock now comes from the TCON, which means it no longer runs at a fixed rate, so this needs to be distinguished in the driver. The controller also now uses pins on Port D instead of dedicated pins, so it drops the separate power domain. Acked-by: Krzysztof Kozlowski Signed-off-by: Samuel Holland --- Removal of the vcc-dsi-supply is maybe a bit questionable. Since there is no "VCC-DSI" pin anymore, it's not obvious which pin actually does power the DSI controller/PHY. Possibly power comes from VCC-PD or VCC-IO or VCC-LVDS. So far, all boards have all of these as always-on supplies, so it is hard to test. (no changes since v1) .../display/allwinner,sun6i-a31-mipi-dsi.yaml | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml index bf9bfe8f88ae..c731fbdc2fe0 100644 --- a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml +++ b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml @@ -12,9 +12,14 @@ maintainers: properties: compatible: - enum: - - allwinner,sun6i-a31-mipi-dsi - - allwinner,sun50i-a64-mipi-dsi + oneOf: + - enum: + - allwinner,sun6i-a31-mipi-dsi + - allwinner,sun50i-a64-mipi-dsi + - allwinner,sun50i-a100-mipi-dsi + - items: + - const: allwinner,sun20i-d1-mipi-dsi + - const: allwinner,sun50i-a100-mipi-dsi reg: maxItems: 1 @@ -59,7 +64,6 @@ required: - phys - phy-names - resets - - vcc-dsi-supply - port allOf: @@ -68,7 +72,9 @@ allOf: properties: compatible: contains: - const: allwinner,sun6i-a31-mipi-dsi + enum: + - allwinner,sun6i-a31-mipi-dsi + - allwinner,sun50i-a100-mipi-dsi then: properties: @@ -83,6 +89,18 @@ allOf: clocks: maxItems: 1 + - if: + properties: + compatible: + contains: + enum: + - allwinner,sun6i-a31-mipi-dsi + - allwinner,sun50i-a64-mipi-dsi + + then: + required: + - vcc-dsi-supply + unevaluatedProperties: false examples: From patchwork Mon Nov 7 05:35:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 13033808 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 B30B7C4332F for ; Mon, 7 Nov 2022 05:37:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MXl7n1AuYRPU73UG7AkuewmQjIcXw2M88gyD/SwBTcE=; b=xVpQ+Hs6cldJcD lhGmm6iPeh8uofnEHnRjovGlF9kHAekkx1lW1ny7l2Wm2g5pq+bWDcHipSMX0IJhP9QcEbdvDH6uL +Qda+Yka0xDr2jjfCoY7vYRP3/i4g88fF7vz5yweDHBc/xZM2eN19Pe5UdGo32j1r3rIaK4lEqlKk G7oKUafXzp5hvxPkfzc5kQawXwYivhIoZ/mr0Q/Oj30q8c4U/7y2cIhL4boQXRdJISKIUfaMKxX9D 4Exq4cziLzS/5L5kX+y7X2+Nqd/jANioZBXnw93Owuf2nzXViL+h+GyidJFd0kssOwFgNK/NP7075 Fqf0orG85364rcU0y3OQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oruoF-00BoEs-5P; Mon, 07 Nov 2022 05:36:35 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1orunf-00BnGU-A4 for linux-arm-kernel@lists.infradead.org; Mon, 07 Nov 2022 05:36:01 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 9DEF65C010C; Mon, 7 Nov 2022 00:35:58 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 07 Nov 2022 00:35:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1667799358; x=1667885758; bh=hJ m3+9Icpv8Ke2FDwmS9fKVqHyT127p94CmAYBoMAhs=; b=FgmMl/K89bVXhV0r/k Kl4jwiLC2N49AAwAKPzJ2B7OYJbfb50Waf6uzgAdDVa0X5hUTfE9PogSj9MsjC8i 8W2n07zunObPqEI6Po1QwlMnUxcGiGzrSIE1dZSOSYlB/aVrI+WzmvE+ekzyroA0 qWWc/Pi5Jd1bwhINzLq9lJ6KZgQriGZMPWZLjvQzZ0fqp8MT14VlIwejU/uek1AX 2aP5cbRb3WDH/j6CTMTCSF/QjbfOjB+oFWYo+lPiARYaKMqvhPIBnQc5FTNPrY8C YntODwk1RsbW62xNf1wDGbEDFIjtbS1dPMX8+zukK/duDE87nNkDjgUbTL+btEDc tPSw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1667799358; x=1667885758; bh=hJm3+9Icpv8Ke 2FDwmS9fKVqHyT127p94CmAYBoMAhs=; b=nF+Nf6wnls2jvRTOZjaUWlED1V+aR Jy8tNu79Csij6O2mO1o3j2DL0oPJSo23W6rXcJA/DF7Cy/YI6rUl0uurLqEF/4E6 Bj3rvQQ+gfwmhGs2OotE8l42IBi9lTzCOzwGZDqzcic1OaMFI+gxKNdCaUBJNoie RUX9waLG9+AYSKd6ao4LObBV6qAj7Ivg9guaPEbi12OCNoFsZbwwDBI3R3a9wwmM zF5G6yz8hzrtYkeZRg+vo4bQA185MA2kn3HxMsBZzeFvSe5DqHHOzBPJyoskoJ6g WqZDqD+nbhM0iybCkuFBTAQsvW0t9tvSBANfUE1iih53xfnbFMNM9MgSg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrvdejgdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Nov 2022 00:35:57 -0500 (EST) From: Samuel Holland To: Chen-Yu Tsai , Jernej Skrabec , Maxime Ripard Cc: Samuel Holland , Daniel Vetter , David Airlie , Jagan Teki , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: [PATCH v2 3/4] drm/sun4i: dsi: Add a variant structure Date: Sun, 6 Nov 2022 23:35:51 -0600 Message-Id: <20221107053552.2330-4-samuel@sholland.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221107053552.2330-1-samuel@sholland.org> References: <20221107053552.2330-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221106_213559_474192_53CEF602 X-CRM114-Status: GOOD ( 21.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace the ad-hoc calls to of_device_is_compatible() with a structure describing the differences between variants. This is in preparation for adding more variants to the driver. Reviewed-by: Jernej Skrabec Signed-off-by: Samuel Holland --- Changes in v2: - Add the variant check to the probe error path drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 53 +++++++++++++++++--------- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 7 ++++ 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 34234a144e87..f22c96cc8408 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -1101,12 +1101,16 @@ static const struct component_ops sun6i_dsi_ops = { static int sun6i_dsi_probe(struct platform_device *pdev) { + const struct sun6i_dsi_variant *variant; struct device *dev = &pdev->dev; - const char *bus_clk_name = NULL; struct sun6i_dsi *dsi; void __iomem *base; int ret; + variant = device_get_match_data(dev); + if (!variant) + return -EINVAL; + dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL); if (!dsi) return -ENOMEM; @@ -1114,10 +1118,7 @@ static int sun6i_dsi_probe(struct platform_device *pdev) dsi->dev = dev; dsi->host.ops = &sun6i_dsi_host_ops; dsi->host.dev = dev; - - if (of_device_is_compatible(dev->of_node, - "allwinner,sun6i-a31-mipi-dsi")) - bus_clk_name = "bus"; + dsi->variant = variant; base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(base)) { @@ -1142,7 +1143,7 @@ static int sun6i_dsi_probe(struct platform_device *pdev) return PTR_ERR(dsi->regs); } - dsi->bus_clk = devm_clk_get(dev, bus_clk_name); + dsi->bus_clk = devm_clk_get(dev, variant->has_mod_clk ? "bus" : NULL); if (IS_ERR(dsi->bus_clk)) return dev_err_probe(dev, PTR_ERR(dsi->bus_clk), "Couldn't get the DSI bus clock\n"); @@ -1151,21 +1152,21 @@ static int sun6i_dsi_probe(struct platform_device *pdev) if (ret) return ret; - if (of_device_is_compatible(dev->of_node, - "allwinner,sun6i-a31-mipi-dsi")) { + if (variant->has_mod_clk) { dsi->mod_clk = devm_clk_get(dev, "mod"); if (IS_ERR(dsi->mod_clk)) { dev_err(dev, "Couldn't get the DSI mod clock\n"); ret = PTR_ERR(dsi->mod_clk); goto err_attach_clk; } - } - /* - * In order to operate properly, that clock seems to be always - * set to 297MHz. - */ - clk_set_rate_exclusive(dsi->mod_clk, 297000000); + /* + * In order to operate properly, the module clock on the + * A31 variant always seems to be set to 297MHz. + */ + if (variant->set_mod_clk) + clk_set_rate_exclusive(dsi->mod_clk, 297000000); + } dsi->dphy = devm_phy_get(dev, "dphy"); if (IS_ERR(dsi->dphy)) { @@ -1191,7 +1192,8 @@ static int sun6i_dsi_probe(struct platform_device *pdev) err_remove_dsi_host: mipi_dsi_host_unregister(&dsi->host); err_unprotect_clk: - clk_rate_exclusive_put(dsi->mod_clk); + if (dsi->variant->has_mod_clk && dsi->variant->set_mod_clk) + clk_rate_exclusive_put(dsi->mod_clk); err_attach_clk: regmap_mmio_detach_clk(dsi->regs); @@ -1205,16 +1207,31 @@ static int sun6i_dsi_remove(struct platform_device *pdev) component_del(&pdev->dev, &sun6i_dsi_ops); mipi_dsi_host_unregister(&dsi->host); - clk_rate_exclusive_put(dsi->mod_clk); + if (dsi->variant->has_mod_clk && dsi->variant->set_mod_clk) + clk_rate_exclusive_put(dsi->mod_clk); regmap_mmio_detach_clk(dsi->regs); return 0; } +static const struct sun6i_dsi_variant sun6i_a31_mipi_dsi_variant = { + .has_mod_clk = true, + .set_mod_clk = true, +}; + +static const struct sun6i_dsi_variant sun50i_a64_mipi_dsi_variant = { +}; + static const struct of_device_id sun6i_dsi_of_table[] = { - { .compatible = "allwinner,sun6i-a31-mipi-dsi" }, - { .compatible = "allwinner,sun50i-a64-mipi-dsi" }, + { + .compatible = "allwinner,sun6i-a31-mipi-dsi", + .data = &sun6i_a31_mipi_dsi_variant, + }, + { + .compatible = "allwinner,sun50i-a64-mipi-dsi", + .data = &sun50i_a64_mipi_dsi_variant, + }, { } }; MODULE_DEVICE_TABLE(of, sun6i_dsi_of_table); diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h index c863900ae3b4..f1ddefe0f554 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h @@ -15,6 +15,11 @@ #define SUN6I_DSI_TCON_DIV 4 +struct sun6i_dsi_variant { + bool has_mod_clk; + bool set_mod_clk; +}; + struct sun6i_dsi { struct drm_connector connector; struct drm_encoder encoder; @@ -31,6 +36,8 @@ struct sun6i_dsi { struct mipi_dsi_device *device; struct drm_device *drm; struct drm_panel *panel; + + const struct sun6i_dsi_variant *variant; }; static inline struct sun6i_dsi *host_to_sun6i_dsi(struct mipi_dsi_host *host) From patchwork Mon Nov 7 05:35:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 13033809 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 6C78DC433FE for ; Mon, 7 Nov 2022 05:38:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=s+ccciEe2IUSwMsnQ9M2+G9eobr7YYufkxlaiou6MJg=; b=uVR/W2HcQaHK7n c95KPhOZfDLk9nj9Ji0Bf55xQW2i8ibk5yxYmrOMYB4jOe6HwTkKSnBdB2YX/2c6P0XwOXZJz8d94 jFAJYnjVdx39LXktsnP0egQsS+t2z9zi+hQB5d26c8xGNfjxCSlsGMz5EPiwNAp+yOoeklzT1A4Ih 0tJOUKEQqhs/NdGKmZ1YvxJXgt6iMQ4YSaTT752FJPuIVi/XJiJcSjtl9tZ9Oh//2SPW0Qt/O6lQ9 LMEr2Uqe+EolvJ6kw6+EUg42yVz/f831krR5KfuOPP0VrbFTEgqPThMOwqQIagRrwLYQc7ac9ZjBq OCza4SGBAYgaOmOVWLUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oruoX-00BoXf-QX; Mon, 07 Nov 2022 05:36:55 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1orung-00BnH9-Gr for linux-arm-kernel@lists.infradead.org; Mon, 07 Nov 2022 05:36:02 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C40E25C010F; Mon, 7 Nov 2022 00:35:59 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 07 Nov 2022 00:35:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1667799359; x=1667885759; bh=CT F3MeYBdYDb9QkjYMGL6Erp3oYYPDieKsIYfX3UM/o=; b=oztyJd2DwVU66oSlO4 hU2Ylwpd5r1sGPpUVIZgDeVlN1YDysjnKxtHaa5Eog5QGNexxDJUxh7iPO4WBL++ XqHRfDNfAzaXQxVPKm3KUjKI6+6/KZrzopx/A6efEm/VPPqotGYXxk7fOkpnz21o DJffO8LVzKGG26HyVWUGDtulT85+blUv8sbvW5i4AxZ4H8eA6u3Y3pJbDeEZh4FL 2MorhqWRAWmzYckreZAHD1I9x2P0aw/OWMM5GrXXcZC8iD4eNNDUFshOHDzJ1qoz 6JIdDlbRFkVRc6Z+sMAU85kJ2/wBNQYH+5vLeWqhRgVnUo9xbuOWCnPq0oGGvv8d +8UQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1667799359; x=1667885759; bh=CTF3MeYBdYDb9 QkjYMGL6Erp3oYYPDieKsIYfX3UM/o=; b=hxhSlOjhW0zlCMgveB+jr7nbj6mHp ziNeGtdMV4fuZHTiLUT2y7+ZOy4/61VkkNcvW3yR8+JV1nihEsL083adPxSosn/j 4MjY6vOxJ4vFEiUfnENhtsW0WDEa9M1PQUZ4iuF+JODFtDb6BxHCVrM1AHEEHiRh cZpNuxlL8pllUnjBAnu+1ioeKJJOkfKcxPjxXtLcXMmlXYsIG5iBENAK3AePEJ7b HeZo6N7bRMfqxii0x+3KL2x2xG97kT/dUa5Fhgdx42bFJZGzSvVHvugyv0vnk6oC XGwg1Eo0w7VuMRrnc+ltGbazO46gLhWDz0ZvmpgxayWgTD9Yn3VlNag4Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrvdejgdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpeefnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Nov 2022 00:35:58 -0500 (EST) From: Samuel Holland To: Chen-Yu Tsai , Jernej Skrabec , Maxime Ripard Cc: Samuel Holland , Daniel Vetter , David Airlie , Jagan Teki , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: [PATCH v2 4/4] drm/sun4i: dsi: Add the A100 variant Date: Sun, 6 Nov 2022 23:35:52 -0600 Message-Id: <20221107053552.2330-5-samuel@sholland.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221107053552.2330-1-samuel@sholland.org> References: <20221107053552.2330-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221106_213600_684845_6CF52BA5 X-CRM114-Status: GOOD ( 11.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The A100 variant of the MIPI DSI controller now gets its module clock from the TCON via the TCON TOP, so the clock rate cannot be set to a fixed value. Otherwise, it appears to be the same as the A31 variant. Reviewed-by: Jernej Skrabec Signed-off-by: Samuel Holland --- (no changes since v1) drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index f22c96cc8408..760ff05eabf4 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -1223,6 +1223,10 @@ static const struct sun6i_dsi_variant sun6i_a31_mipi_dsi_variant = { static const struct sun6i_dsi_variant sun50i_a64_mipi_dsi_variant = { }; +static const struct sun6i_dsi_variant sun50i_a100_mipi_dsi_variant = { + .has_mod_clk = true, +}; + static const struct of_device_id sun6i_dsi_of_table[] = { { .compatible = "allwinner,sun6i-a31-mipi-dsi", @@ -1232,6 +1236,10 @@ static const struct of_device_id sun6i_dsi_of_table[] = { .compatible = "allwinner,sun50i-a64-mipi-dsi", .data = &sun50i_a64_mipi_dsi_variant, }, + { + .compatible = "allwinner,sun50i-a100-mipi-dsi", + .data = &sun50i_a100_mipi_dsi_variant, + }, { } }; MODULE_DEVICE_TABLE(of, sun6i_dsi_of_table);