From patchwork Mon Nov 14 02:21:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 19515 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1922981wru; Sun, 13 Nov 2022 18:22:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf79kNo8WWrvO8xSvccDIR0Oslx06Fv1EG2cRXwOo5V78UCq5RUTxa9+/NnA3pqTbECa6IJw X-Received: by 2002:a17:906:349b:b0:7a1:e4c2:fb0b with SMTP id g27-20020a170906349b00b007a1e4c2fb0bmr8870485ejb.464.1668392566743; Sun, 13 Nov 2022 18:22:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668392566; cv=none; d=google.com; s=arc-20160816; b=VZhtN+Wrq3sxw3qYAE5pOVKCGAFOHOFWFHKnlWQVHT6g8bt9uOttX1ARoGYnW0vWgt ytjQCcdRnd8eQTUMZmkDeEn5V7LCTWpGFCOl3TgW+FD0g9JHv3UxZLMRFJephbAFUKpo I3QAjQa0g6ZreJA4frFdnoiH6RhIsYm4maA868zcd9esWs+cVkXh0lnHhPSCJVScERk4 mDODSrIywGP+2AEehDH34VJD0bwgpfLACgoZIZDzTkPPes++LW6wrlxuv3t33+S/4f4W yH2LkEJVLbJl9Tm/oM3tf1wnpCHqb9h31grQvMLmG826/g8GyhvvHuihZmzyGHP0xEHZ GKWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=8dGrluyziuRFhWRkKBXbsD9qADCfDkyrmE8KHFwP3gA=; b=uk5DfeP3GSzA3ViHLDozf6uNXzb6ERJcYmbX7l5TjfwJFcPjgOUqS5+tzVxPI1JI20 D93OIYmcmGhm2n9JDzyUV6dI+oVjd9UmEvEpKJfWscOwKKacZEPsEDDdPRBeLgWQLBXC EsgxW3BQRzbSkJEHZ1hbHX7zZXtIqHPMItyFjkUo73G/prsr1R56UXPXtNDFlVGDt9nF 9b6Cae9bU3PbHh6pCI/yVByFihBNuws+A+7mmcPr2rzlCD0QJ1tG1ROhDjCL2gk5bzFY aujxL67fxPJcc8HlDxCAu3a4v06XgesiXWvQWrbNyqSQekdDIvqCXvw8gVYf0e4UEOue wrWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=eIjuzMBf; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=HLDoThWV; 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=sholland.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id va29-20020a17090711dd00b007adca6532e3si6331783ejb.229.2022.11.13.18.22.23; Sun, 13 Nov 2022 18:22:46 -0800 (PST) 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=@sholland.org header.s=fm2 header.b=eIjuzMBf; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=HLDoThWV; 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=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235695AbiKNCVV (ORCPT + 99 others); Sun, 13 Nov 2022 21:21:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235443AbiKNCVU (ORCPT ); Sun, 13 Nov 2022 21:21:20 -0500 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A0A8F5A2; Sun, 13 Nov 2022 18:21:19 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 02C6632007F0; Sun, 13 Nov 2022 21:21:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sun, 13 Nov 2022 21:21:19 -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=fm2; t=1668392477; x=1668478877; bh=8d GrluyziuRFhWRkKBXbsD9qADCfDkyrmE8KHFwP3gA=; b=eIjuzMBfwoTXzDRlEv 4tpkzlPpyVUMvi7Bgj4grlg88EXkPbd1wfPLuGI7iClTEoxcTbB48BRTsiSbr0cL 6TLrfNVqhqCSWwONN9EUZZfz3N3Qel0IMhMAr5UfPCBkX6rPlUNmDpnxeWXi+qam ra6O/9D6TPuM71e42E0KGKyYLfvEbr2AnxuJpBX0IqJ3ssj033josoLc/nUNfKnZ k1UGqlQj7gP6lTdLitnji2GZn+qOiXz8oguDj0IaZbssGr+8PJD5em5s6AkeW68B C9wQFPX/qW50ulUKGEr01BRrPab0lG7NVqXGdS0seku4uuuqoZnC5JEyzPof+DPW irqQ== 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=fm1; t=1668392477; x=1668478877; bh=8dGrluyziuRFh WRkKBXbsD9qADCfDkyrmE8KHFwP3gA=; b=HLDoThWVgYInc0MDAvNrF03X9Y4WW MERCuwxx8u4+QVT07jfKM+EUeqwKdv+eixnrDRkkc7WQGaJQAce7Y+7bA4Luhypz LbyO0eaJDE7wWgFyxzdQ+smeayC1PC54lO762tFod8X/rUTBYNzDTuWV1bW+ELnL fnFVLurjvNveG41wEVpFeJjb5tUCT7N4e3iF2TJsYQSSezWWoRy2qQu19V2uWaVw +c56d6Dcvxx+tfvGazQH/FqA1A/XtQTgAcW1p5yICsO9/jmQPH/27afag4HbQSDQ lUS51bpDG1otaLgZUwMnhxUv4VbbKoeTPjBfGAOSpj6OmBBxbUQDRpVNw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgedugdeghecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 13 Nov 2022 21:21:16 -0500 (EST) From: Samuel Holland To: Kishon Vijay Abraham I , Vinod Koul , Chen-Yu Tsai , Jernej Skrabec , Maxime Ripard Cc: Paul Kocialkowski , Samuel Holland , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH v2 1/8] dt-bindings: sun6i-a31-mipi-dphy: Add the interrupts property Date: Sun, 13 Nov 2022 20:21:06 -0600 Message-Id: <20221114022113.31694-2-samuel@sholland.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221114022113.31694-1-samuel@sholland.org> References: <20221114022113.31694-1-samuel@sholland.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749436403599408501?= X-GMAIL-MSGID: =?utf-8?q?1749436403599408501?= The sun6i DPHY can generate several interrupts, mostly for reporting error conditions, but also for detecting BTA and UPLS sequences. Document this capability in order to accurately describe the hardware. The DPHY has no interrupt number provided in the vendor documentation because its interrupt line is shared with the DSI controller. A trivial interrupt handler was used to verify that interrupts were in fact generated by the DPHY and not the DSI controller. Signed-off-by: Samuel Holland Acked-by: Krzysztof Kozlowski --- Changes in v2: - Add the interrupts property to the binding example - Drop the inappropriate Fixes tags .../bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml b/Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml index dfb6a8993535..4c45d7fcc853 100644 --- a/Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml +++ b/Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml @@ -24,6 +24,9 @@ properties: reg: maxItems: 1 + interrupts: + maxItems: 1 + clocks: items: - description: Bus Clock @@ -53,6 +56,7 @@ required: - "#phy-cells" - compatible - reg + - interrupts - clocks - clock-names - resets @@ -61,9 +65,12 @@ additionalProperties: false examples: - | + #include + dphy0: d-phy@1ca1000 { compatible = "allwinner,sun6i-a31-mipi-dphy"; reg = <0x01ca1000 0x1000>; + interrupts = ; clocks = <&ccu 23>, <&ccu 97>; clock-names = "bus", "mod"; resets = <&ccu 4>; From patchwork Mon Nov 14 02:21:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 19522 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1923653wru; Sun, 13 Nov 2022 18:25:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf4wWs9mg8beFOJBmN7s/elPuJmR8/g1Kj0V/1NKqu7WEsWHekgRkEpRqRZaeQs4mjnMptst X-Received: by 2002:a17:907:1ddb:b0:78d:894d:e123 with SMTP id og27-20020a1709071ddb00b0078d894de123mr8719945ejc.112.1668392718822; Sun, 13 Nov 2022 18:25:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668392718; cv=none; d=google.com; s=arc-20160816; b=Uz0J20xaOg5dctjl6EREP8e7+KEOU0WqzeelCbGBjDAbXuRATqk9COpfD01zt4xDG4 xyC5vfbz840GRfU4hBEsCoGwtGNQH6RRaVdzvQ6fooQ8LuvLurKKBtJvcgsel318GecB 2qNW+oMWBanIuyDiiTHnQsHoTvhLmYVfF/685HAbBgAvSH/pm0n01nQ3C5CbM19lrQWP WL5VePB8GNNPPbV2Lsqe6/dkTGiecJJgWW44+/sm4BAEprGI2ydtizyp37PNQRkaGqJW mfVdOjj8UgLDCNBNcYOcRhdL3azAHT754fjUpnTbsNB18kIJKrCJtpPlwmzKd6gZhS+Z B3IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=umolr3krKDreOXkBCRZ2ECU8DgIaOFUrAbwdoxr5jYk=; b=V6vKp/GLqm0QJtmpvdpONSN5lMAKvtmkZVYN2Yv4faDDsHnBcB9lIx/b59lpm18Z6v LZhh5k8DR7bkzJOeL72CxtuMPLeiUDWbm2wh+5GEmtEhvyvT64n1y/vjh+A80Ofl+i4J /rBK3+uuIJShGjNSIhI4W7MelTyDfpCqrekAi6QYyjzXvPs2Gkyj9YxTeGHwX4zEcWG7 EKLKXcde8DI6mZMRAmHPGQjDdqp8RBL9aR2qeGtuiXgwyDJUW9Fijqax4eDHDGWFtKgx bUKnEmKXj7yij3hREIqrVariVPUzrRvGImOLqflqHvHZHAWNH+ReE82JiqAPBrqiotia Satg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=hag55g1t; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=rocms4d2; 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=sholland.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o7-20020a056402038700b004637be0f76csi1754559edv.186.2022.11.13.18.24.55; Sun, 13 Nov 2022 18:25:18 -0800 (PST) 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=@sholland.org header.s=fm2 header.b=hag55g1t; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=rocms4d2; 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=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235724AbiKNCV3 (ORCPT + 99 others); Sun, 13 Nov 2022 21:21:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235700AbiKNCVX (ORCPT ); Sun, 13 Nov 2022 21:21:23 -0500 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D7C3FAD2; Sun, 13 Nov 2022 18:21:22 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id AAB7C320091D; Sun, 13 Nov 2022 21:21:20 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 13 Nov 2022 21:21:21 -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=fm2; t=1668392480; x=1668478880; bh=um olr3krKDreOXkBCRZ2ECU8DgIaOFUrAbwdoxr5jYk=; b=hag55g1tUE4L+mclEK dlPwOqw7GtDUBcPb1uLPdd3jtsG2dbVhWYh6YsCKgfwHuIOurjU4HnzokYfBjGEa v4M3ugVEmku+ppkvrJN6o0C25KSyQMHCExkPPmJGkbTUcnbSbovTMcw8VB5TptcG a1tP6uV0gyEH+M7xF+fCKgANDmnmUK4n8YoFJlU4F0VDnSsA+W8c5EnUL+JNogzr wGQql5f/5YrbgiYhPOukAEa1s/jvckQDfQ0yUbypd5oGYOn/U37oEkwwUVdmAiJq i3GktiZm+7ZwX8FUGqJTV5VkdSuGflm2uHCpc8S43PpkSo4o0qMM8bryNjr5CtZ1 uzHg== 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=fm1; t=1668392480; x=1668478880; bh=umolr3krKDreO XkBCRZ2ECU8DgIaOFUrAbwdoxr5jYk=; b=rocms4d2lCJfpHIoSs8dzXri6ofgM aafnZghvkK3AcRg2XftkOYC40gRtbDYwlO55E5PfA3+Bwb0YLNV+iafmsYMag8pP K/iAs7fskFmauoWyi8CJpfS0sBwhiMk45cd41aPGHSLeWl1coIDVe+kCwcWSaiYq ZS8IuC0nkRXuzlqDUbp3WbH6nHxmsiXnzhDwImS8PNhePOX3COCB8VxTos4QKnV/ eW0GxgfOiX9uh0L3tpRhwPsz+tFZLjb7GD40GGhdeygJtyQIFW/GYQf9ThQfWiwe 2QU/6zjKHgSOd9Og8msCHd+Wr3JvOIjlXumFtq03ZDMK1UKijKPjdLM/g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgedugdeghecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 13 Nov 2022 21:21:19 -0500 (EST) From: Samuel Holland To: Kishon Vijay Abraham I , Vinod Koul , Chen-Yu Tsai , Jernej Skrabec , Maxime Ripard Cc: Paul Kocialkowski , Samuel Holland , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH v2 2/8] ARM: dts: sun8i: a33: Add DPHY interrupt Date: Sun, 13 Nov 2022 20:21:07 -0600 Message-Id: <20221114022113.31694-3-samuel@sholland.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221114022113.31694-1-samuel@sholland.org> References: <20221114022113.31694-1-samuel@sholland.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749436563255128543?= X-GMAIL-MSGID: =?utf-8?q?1749436563255128543?= The DPHY has an interrupt line which is shared with the DSI controller. Signed-off-by: Samuel Holland --- (no changes since v1) arch/arm/boot/dts/sun8i-a33.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/sun8i-a33.dtsi b/arch/arm/boot/dts/sun8i-a33.dtsi index b3d1bdfb5118..30fdd2703b1f 100644 --- a/arch/arm/boot/dts/sun8i-a33.dtsi +++ b/arch/arm/boot/dts/sun8i-a33.dtsi @@ -278,6 +278,7 @@ dsi_in_tcon0: endpoint { dphy: d-phy@1ca1000 { compatible = "allwinner,sun6i-a31-mipi-dphy"; reg = <0x01ca1000 0x1000>; + interrupts = ; clocks = <&ccu CLK_BUS_MIPI_DSI>, <&ccu CLK_DSI_DPHY>; clock-names = "bus", "mod"; From patchwork Mon Nov 14 02:21:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 19516 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1923014wru; Sun, 13 Nov 2022 18:22:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf5bkZLkA77J/RA7rIiKAhE+FKVe+zNYZXSu857liFdlW9477WUOwlVGQurghBjpP0mxWZo7 X-Received: by 2002:a05:6402:1495:b0:461:b506:6b8a with SMTP id e21-20020a056402149500b00461b5066b8amr9596033edv.208.1668392575055; Sun, 13 Nov 2022 18:22:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668392575; cv=none; d=google.com; s=arc-20160816; b=Rblua/78cGQ/EPBehtQy4FuGtUL9WUCHUcZVPt3GBOv9CYqYJIhjbelEyvM26yG2lA Te2zfjUbj/muaxqghPn3OqLqhmpE04Mi6eWZ5s2II9ZahW+1ahvlLOFUVrhsgD0ysb8W mAm+B1E4IpFMUQ32G55Q+DX4op2EjJbFRw+3bLzKnnX5sEfCD4HWMA8fCu37ALJF4hNB GXtRXH7ZPb2YEVNwzaPc84pXsXUc+gjg4v7fxPqXZT3bcNj6Me6YrKCT6l1PB+9Itaxa 6fY6oERKc8Y+nU0sPX4whq706zdDj3HaLg50sLfTQf3h28UzFQr/A4RRd/j0+oFH/kWk 2RbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=+AyJRlUtw7YrN/zrnK1iUvTLXnPZ+9CqwIituSa4cZE=; b=HJb6B7PO8G3qq2DwXel9Ezn9WbcYB/nr6990RpmfxIwx56FJqbuA2zdNpeoW9qmIQi dlgxfgGq6s8Aog2cQMX6rdSTZPa0E1+RIy3K++jy08I8K6g7Ds2VmwUZPvo4wWmma+iK Eu7pd1LAMNsA68NBU337WWcG2PCUGlRodMiTpP28SfKsWfwyE/Stf76keQnkRR1VBChO tvipPPFceARPZmweKoKHy06nXsD8V8Js+yJTFui7I9cA8b1xdhG42avfS1jPBdoeggCt w6i0rYPQ5Iv16D0r0PFkys42/S/j/cDXt1oavNb1IIbo/hHZ3u1z7sDTEWjH4z44YGzo fU+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=k890dPAV; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=mTyFuoH1; 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=sholland.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e6-20020a056402190600b004604dd1cb37si6005586edz.212.2022.11.13.18.22.31; Sun, 13 Nov 2022 18:22:55 -0800 (PST) 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=@sholland.org header.s=fm2 header.b=k890dPAV; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=mTyFuoH1; 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=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235753AbiKNCVi (ORCPT + 99 others); Sun, 13 Nov 2022 21:21:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235714AbiKNCV0 (ORCPT ); Sun, 13 Nov 2022 21:21:26 -0500 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C559C12093; Sun, 13 Nov 2022 18:21:24 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 5B366320091E; Sun, 13 Nov 2022 21:21:23 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 13 Nov 2022 21:21:24 -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=fm2; t=1668392482; x=1668478882; bh=+A yJRlUtw7YrN/zrnK1iUvTLXnPZ+9CqwIituSa4cZE=; b=k890dPAVDkQjmQmihQ 94VBs2P1Trbfpql9DNIml3vOr3ibLmQqy62qeQV01jIapywMjoIKQ2Q+ocuQ9id/ IZqK6U8b8LbuMZC51oj8CoFqm252QDus22/DshPl/oKlwOeNMRM4FaPLnPUzoPrl xP2lXd+8ZpT1145xC6qyelCL3xFs3HNUXwSDgLo+o25W8vbFbtTSb5+i+ypJe9rp lP4J96gYTYhqZ8+I8kBZ+F/1kctkJVrud0y2KW2CBp8bWOsNqnYiMxIe3syxJoyQ K3h7bfF9Rd714qO9sKxrYV5v+/wkR8hl2PB98lfttL6410d7FOa+QrK+urWkbfWz YXuA== 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=fm1; t=1668392482; x=1668478882; bh=+AyJRlUtw7YrN /zrnK1iUvTLXnPZ+9CqwIituSa4cZE=; b=mTyFuoH1oscs64LiEtfA2+1XlyM1h t+6u5kyzCFdAt+MnQjQzXSSl429VqCOFS5iZb66ybEku4jcXlwRGfHDKOHGY3xWQ kp0yi5v/Y18N6q96SHhL2qZPkqiqq51YrVj9CgvYwZlgYCZCoXTJUlNQSnsXsGOd Oz5d1JQjAV2TFN0Qpm38XJiyjzmCJGsXPxygPQl4CHpGafnY7reRffGaMbYU84FX kJPE003BYS6rPqN63JHxUb6piW1YuKlRq4KmRzkJmxtYqHbmyGHLImgKAifvVRBN CqqNYAPc2d+PYyko6rgAtHQPSP8J3uK1WOBmGgqfzdXv3/idi4lk4qOjw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgedugdeghecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 13 Nov 2022 21:21:22 -0500 (EST) From: Samuel Holland To: Kishon Vijay Abraham I , Vinod Koul , Chen-Yu Tsai , Jernej Skrabec , Maxime Ripard Cc: Paul Kocialkowski , Samuel Holland , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH v2 3/8] arm64: dts: allwinner: a64: Add DPHY interrupt Date: Sun, 13 Nov 2022 20:21:08 -0600 Message-Id: <20221114022113.31694-4-samuel@sholland.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221114022113.31694-1-samuel@sholland.org> References: <20221114022113.31694-1-samuel@sholland.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749436412879076927?= X-GMAIL-MSGID: =?utf-8?q?1749436412879076927?= The DPHY has an interrupt line which is shared with the DSI controller. Signed-off-by: Samuel Holland --- (no changes since v1) arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi index 77b5349f6087..62f45f71ec65 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi @@ -1199,6 +1199,7 @@ dphy: d-phy@1ca1000 { compatible = "allwinner,sun50i-a64-mipi-dphy", "allwinner,sun6i-a31-mipi-dphy"; reg = <0x01ca1000 0x1000>; + interrupts = ; clocks = <&ccu CLK_BUS_MIPI_DSI>, <&ccu CLK_DSI_DPHY>; clock-names = "bus", "mod"; From patchwork Mon Nov 14 02:21:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 19517 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1923018wru; Sun, 13 Nov 2022 18:22:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Kkj809dwFBd7dTlA+fFhiL9mUi/DrcSzMRCmLaz1lrzILJo+ct5Ro7hiJwLqE2chGbZfJ X-Received: by 2002:a17:907:c08e:b0:7ae:e2fb:c028 with SMTP id st14-20020a170907c08e00b007aee2fbc028mr4960568ejc.539.1668392575686; Sun, 13 Nov 2022 18:22:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668392575; cv=none; d=google.com; s=arc-20160816; b=zuMGyiS8WpKnATzcr31C8Xk8yxylHZ33IAtWEW+6EEzcH0+G3R2iAemPBqy7FTVptu +RP2qttGwCgB60/nUU67OgbfMqMoXnr7oMXeQXqWcJ8fOR55e/n2KlnBXlSZTNTCRrC1 pyx9L3EVZBkoN4KXcWGqlYZAmaW2jwO+KGsvh+Av2KimfKd4JiJEhxU9IDhuoUiV4l3F 5rGFBR+Teb0HxwxQzeH7YuJMqqXFLnWr5yPZVuAj1U+VcWkq3XW5T7zufBn8UqnRcZQl i2vioxhivtJnpXD71KZwOFtscB3Wq4eKDnfuHctePfrcY0hkHxigEgYKHh5E/ColnL+Y HfKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=daqMpdoSZQlwwcrabmEMNr70r6TIeuLcvfWltwDoDCA=; b=D7aUpvTpO47tTiJwbuAZvx9/YlimijzAQySYqAkCI6l2INTc9s5ht+1tZoXBppcf+Q PagJJ5uUzYefFmnRIG3EOFngRD38W0PCnOuGcunPcAn4dPcSkEGbgW8lUzqhSwfjJ5rD sHYA9w/IDfCliaKpXDMlgjpwdOTfxpriEbtv2nkBknTygB4eySEH1aebxEdDPaHg+vOx +egE2NkR7DFeRCnaycJF28S8OAE/CZ3W/DeIWobPun34GuSUDkQvwOObIB0hOl+yIXHG UQfBaDI0mnhbhNlzSJp1+KpqHpOQ6uqD4DdELXeiJRPHWVG476tEMmQZ9O11I9OoroHs 8L3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=aHsKz5oL; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=CBKjR40v; 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=sholland.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dz17-20020a0564021d5100b0043d00293d23si9833561edb.391.2022.11.13.18.22.32; Sun, 13 Nov 2022 18:22:55 -0800 (PST) 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=@sholland.org header.s=fm2 header.b=aHsKz5oL; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=CBKjR40v; 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=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235772AbiKNCVl (ORCPT + 99 others); Sun, 13 Nov 2022 21:21:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235730AbiKNCVc (ORCPT ); Sun, 13 Nov 2022 21:21:32 -0500 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEE4513EB6; Sun, 13 Nov 2022 18:21:27 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 086A432007F0; Sun, 13 Nov 2022 21:21:25 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 13 Nov 2022 21:21:27 -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=fm2; t=1668392485; x=1668478885; bh=da qMpdoSZQlwwcrabmEMNr70r6TIeuLcvfWltwDoDCA=; b=aHsKz5oLBXQXNp4Ik/ LHdfX5xdZ+wXnD/gJ8FSjzMetjo6UEgpsI/ka5HFNrkJEJzILCoTyjsPhLMSzljD pLq6gL3ZQHNAnnio+mO4I0FgJ9NeG7i+oqyVsEvvbouRoAsjiA+bVVJx2p1JJI+L 0nuiULWnpWo061fxYQ4TQK+7KY0GeqpPHCdnniUKcHfVu3rcNZLjPLXPkvaqVhAa CJA6ykKNmdu/I+fNA/woPUdRUMaOQ/5+is5Q/j3p1mixfMo5+5Zr3dNzZeS/1t4g 4pIOTiYIb8jQ7grT9aiRG2jznaMStD6WKdMWmW4HP+sR+WH2gunAj1ofo0TyLRAD zvjg== 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=fm1; t=1668392485; x=1668478885; bh=daqMpdoSZQlww crabmEMNr70r6TIeuLcvfWltwDoDCA=; b=CBKjR40vwDu3SJKzMaLzmu/kI5izn ZU6eqN8OIeyMs6DHWaDYBzSGGVN58Xe51Lznxw8pILX3IaX/yKUdZAUluOOuh0IH n/dNo7HCscYi/KdFg1MNQyXX8d/QCF5wuprn9TRbeKxvKTu4R9BL8t+iQ+jpIOpw cS6qg7YnTsTs3Ec2zOrhebdwaqMPaFKJeuEKffdrdvGINy2s4a/f5K2okIoH6PKs Wl3a0ooeNX0LbpqV8YluBJR3t72+2yXX743tAbLDI6H1xEA7z5/+u+N//So2InV3 GY6ohHK6YfbIz1Ta9jJN1SRQAf6S6QZ01YbV4v0+IrpzOkbVQfgZLtBhA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgedugdeghecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 13 Nov 2022 21:21:24 -0500 (EST) From: Samuel Holland To: Kishon Vijay Abraham I , Vinod Koul , Chen-Yu Tsai , Jernej Skrabec , Maxime Ripard Cc: Paul Kocialkowski , Samuel Holland , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-sunxi@lists.linux.dev, Krzysztof Kozlowski Subject: [PATCH v2 4/8] dt-bindings: sun6i-a31-mipi-dphy: Add the A100 DPHY variant Date: Sun, 13 Nov 2022 20:21:09 -0600 Message-Id: <20221114022113.31694-5-samuel@sholland.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221114022113.31694-1-samuel@sholland.org> References: <20221114022113.31694-1-samuel@sholland.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749436413344103898?= X-GMAIL-MSGID: =?utf-8?q?1749436413344103898?= A100 features an updated DPHY, which moves PLL control inside the DPHY register space. (Previously PLL-MIPI was controlled from the CCU. This does not affect the "clocks" property because the link between PLL-MIPI and the DPHY was never represented in the devicetree.) It also requires a modified analog power-on sequence. Finally, the new DPHY adds support for operating as an LVDS PHY. D1 uses this same variant. Acked-by: Krzysztof Kozlowski Reviewed-by: Paul Kocialkowski Signed-off-by: Samuel Holland --- (no changes since v1) .../bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml b/Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml index 4c45d7fcc853..fe9702e7bdd8 100644 --- a/Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml +++ b/Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml @@ -17,9 +17,13 @@ properties: compatible: oneOf: - const: allwinner,sun6i-a31-mipi-dphy + - const: allwinner,sun50i-a100-mipi-dphy - items: - const: allwinner,sun50i-a64-mipi-dphy - const: allwinner,sun6i-a31-mipi-dphy + - items: + - const: allwinner,sun20i-d1-mipi-dphy + - const: allwinner,sun50i-a100-mipi-dphy reg: maxItems: 1 From patchwork Mon Nov 14 02:21:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 19520 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1923238wru; Sun, 13 Nov 2022 18:23:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf7hpSaZoePCMZxqsRZInVTFuhxDvN/DYkSX9Mq3rHDQPixolB+XVgi9rK9hN3d02yw92jmv X-Received: by 2002:a17:906:374a:b0:7ad:9ad7:e882 with SMTP id e10-20020a170906374a00b007ad9ad7e882mr8841213ejc.520.1668392626445; Sun, 13 Nov 2022 18:23:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668392626; cv=none; d=google.com; s=arc-20160816; b=A5E3NKp9yGmSut4s0f5bBZNST03HAADnArLg3BzFLXwIbBs2jw33zUqP7BhBYJBMck /d5KBKRhGbipqZyNloY7QnKwAgmOtBnB+ySX8YtVuGtgg2MGgUgzG/QkQfPgriPDNYIi RAvKv3yoq2y3Q4HXnRBuiH6ndgSBCMg4O3m+MLP017mX4Fws4f+Q73txbOWNWKlxTo2q uwioX2UdVRo2VVZ+tNpOzM/uktl3jeWdz5icJZqulOUNUHrMqorYxxqBYoHulDvL7ncA kUgrsTjZ6m2SyEdWFmjaqbArrc5Rwm0qVXS6CGn4ZoQ6kQf8COLzbI26gSIbiIWa6dfW 2prg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=3kS+hGr1YOBmWI2lELCrF34cgmevTqDNsJTi/d0Iu/E=; b=z2YB9WCySDThIsdAgxROJYHOgvxyvQm8c0LwbVDFaZDIP4BOGRWs53SF7nQwXcNisB uIC2X/n9k4crSg/J9bWoxWfOIxL4Zvyw2lZgbBdb95fIeoECYymGrffMdO+wF0ytgGxx 0Xtx72iwk+3RhhzA3bvYnuzkgqnlEqhhdmruCnbnkNHF89k6Z6ZFjtBPTsClUbzcc98L a0flvcbPfpLiOP8SKWwuNDlMB3VMvFnUvilr40HEDgh1oBzlj98V8IMTr6B1QGz2JGXC v6F1UOP4qGf+XBiPQhvoNS27fnwyzHkUD5nEk61e6vzs50AHkZ1dtELD6BG4ApPK60O/ n+oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=OWeZLFE8; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=m29fVrIO; 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=sholland.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bu15-20020a170906a14f00b0072b0f6f1456si5715604ejb.612.2022.11.13.18.23.22; Sun, 13 Nov 2022 18:23:46 -0800 (PST) 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=@sholland.org header.s=fm2 header.b=OWeZLFE8; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=m29fVrIO; 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=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235785AbiKNCVt (ORCPT + 99 others); Sun, 13 Nov 2022 21:21:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235692AbiKNCVg (ORCPT ); Sun, 13 Nov 2022 21:21:36 -0500 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1878613FAE; Sun, 13 Nov 2022 18:21:30 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id A953A320046E; Sun, 13 Nov 2022 21:21:28 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 13 Nov 2022 21:21:29 -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=fm2; t=1668392488; x=1668478888; bh=3k S+hGr1YOBmWI2lELCrF34cgmevTqDNsJTi/d0Iu/E=; b=OWeZLFE8iVyyVkI+0P PaX1rQBL6LwRSN+/Ve4FVilwBScRuFLc/XVksw8zKS/b2FQEDWjVRhvcwlNq57NR K0Ziv2YGRgwU0WwfqQp/n5eYUQSvu41AJBwD+a+UcQ2ViGnqRB57FVy5qcyI278k EeszYPUsVb1OL9JU6pFVPE12MtoFGsjYm+ZeoQ6WodmBxnA0tCbBXH5Yw1smx2oj j420rQulS2JOHQ5GSELSodyjhmeHAN3k3bZIA1aUriPka0Az+Zy6sxtPuwJ9weuU YEbavxh0q9k9mYt/nIt78p93z9v2txGE0zCUIM0uJiA2hRjKjGdVb/3cKOQRUnCp q8jw== 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=fm1; t=1668392488; x=1668478888; bh=3kS+hGr1YOBmW I2lELCrF34cgmevTqDNsJTi/d0Iu/E=; b=m29fVrIOdb2kwzqaEAblpCJCgDzxN WtjuuZC+vxU2nbqqtyiGYetiPEEZOmO+k+bPfKzlSeU2jIt+pK9JEXWHXStXlTyY hlRcTm5x17LaXUmaShMdcUphc9RHgxs5Au/U91xtRW6DgL8XIcyw1Duza5erSG7J 18XRhlvuV941qbg4WPcv1eGFyw155oEPCGYn19c8ry5biM5BqEFOp4oyNTaOOyQN ulnEthOOB9//ORZDvEEsT38f3nY4qjkkLF/2Fs9Z23CM6IUXALvcJ1AiLD6eZDvm wcKX33zcb8ckc/eCOj92WbV1hrg3TsmGd0J7UV3hxuaLJVzPb/R4jeFyw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgedugdeghecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 13 Nov 2022 21:21:27 -0500 (EST) From: Samuel Holland To: Kishon Vijay Abraham I , Vinod Koul , Chen-Yu Tsai , Jernej Skrabec , Maxime Ripard Cc: Paul Kocialkowski , Samuel Holland , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH v2 5/8] phy: allwinner: phy-sun6i-mipi-dphy: Make RX support optional Date: Sun, 13 Nov 2022 20:21:10 -0600 Message-Id: <20221114022113.31694-6-samuel@sholland.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221114022113.31694-1-samuel@sholland.org> References: <20221114022113.31694-1-samuel@sholland.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749436466869727546?= X-GMAIL-MSGID: =?utf-8?q?1749436466869727546?= While all variants of the DPHY likely support RX mode, the new variant in the A100 is not used in this direction by the BSP, and it has some analog register changes, so its RX power-on sequence is unknown. To be safe, limit RX support to variants where the power-on sequence is known. Signed-off-by: Samuel Holland --- Changes in v2: - Rename "supports_rx" to "rx_supported" - Add a blank line for readability drivers/phy/allwinner/phy-sun6i-mipi-dphy.c | 26 +++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c index 3900f1650851..7d7322670a83 100644 --- a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c +++ b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c @@ -114,6 +114,10 @@ enum sun6i_dphy_direction { SUN6I_DPHY_DIRECTION_RX, }; +struct sun6i_dphy_variant { + bool rx_supported; +}; + struct sun6i_dphy { struct clk *bus_clk; struct clk *mod_clk; @@ -123,6 +127,7 @@ struct sun6i_dphy { struct phy *phy; struct phy_configure_opts_mipi_dphy config; + const struct sun6i_dphy_variant *variant; enum sun6i_dphy_direction direction; }; @@ -409,6 +414,10 @@ static int sun6i_dphy_probe(struct platform_device *pdev) if (!dphy) return -ENOMEM; + dphy->variant = device_get_match_data(&pdev->dev); + if (!dphy->variant) + return -EINVAL; + regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(regs)) { dev_err(&pdev->dev, "Couldn't map the DPHY encoder registers\n"); @@ -445,8 +454,14 @@ static int sun6i_dphy_probe(struct platform_device *pdev) ret = of_property_read_string(pdev->dev.of_node, "allwinner,direction", &direction); - if (!ret && !strncmp(direction, "rx", 2)) + if (!ret && !strncmp(direction, "rx", 2)) { + if (!dphy->variant->rx_supported) { + dev_err(&pdev->dev, "RX not supported on this variant\n"); + return -EOPNOTSUPP; + } + dphy->direction = SUN6I_DPHY_DIRECTION_RX; + } phy_set_drvdata(dphy->phy, dphy); phy_provider = devm_of_phy_provider_register(&pdev->dev, of_phy_simple_xlate); @@ -454,8 +469,15 @@ static int sun6i_dphy_probe(struct platform_device *pdev) return PTR_ERR_OR_ZERO(phy_provider); } +static const struct sun6i_dphy_variant sun6i_a31_mipi_dphy_variant = { + .rx_supported = true, +}; + static const struct of_device_id sun6i_dphy_of_table[] = { - { .compatible = "allwinner,sun6i-a31-mipi-dphy" }, + { + .compatible = "allwinner,sun6i-a31-mipi-dphy", + .data = &sun6i_a31_mipi_dphy_variant, + }, { } }; MODULE_DEVICE_TABLE(of, sun6i_dphy_of_table); From patchwork Mon Nov 14 02:21:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 19518 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1923045wru; Sun, 13 Nov 2022 18:23:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf4fqgjkyJq5dpSrD6QbgcwfqSh7y1thzAF03+MKSnyuCzyAUtpxoxbxGwHYIzzaf9EJS2OI X-Received: by 2002:a17:906:fb81:b0:7ae:9187:eb70 with SMTP id lr1-20020a170906fb8100b007ae9187eb70mr8351575ejb.533.1668392580868; Sun, 13 Nov 2022 18:23:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668392580; cv=none; d=google.com; s=arc-20160816; b=yle9aoeGGyrOZYpkgYy/sWkGlZPH8nmiMdg2KMaZPBKomYqo8/GxE/pmTYmOy+EK4h e3545NSTuv7fO8W5udWXKmwQrFiizBpcWuJHk5++7BAldfu0JKySnDDLfkf1/6gQg7/Q /jWc/8LqnG6EhDk4IrsxiOkvXzgp2bNBuKOy0xg7+GMq68t1l6dlL5e5xteppCjfni08 HXPeqEYjfZOVWBEQSVHAZsAHSK2Xyx7PEIjN1YCTle4IPj6Gi21gDpj+zeM5Wwy4dB0H eE99bubz/PorsZfUFs5gZOkp4c+ryCUSWxPXS2EDi1FnPzT+MsJnmKD4rTKIp5M+f8G2 RdQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=Pe5+rxKJXBwbi3S5z0eDboZk1Gy4CrOI9srKQdU3gkc=; b=p+60zu+eXHeeAJf39PLiOfNEh24MXCIW8QPUsNr7qAacXNZEb6YjDzgOuNvFXTYSyH kybLY/QmXrnzfFZMy8i8brNpGJLXakhd38XBw2Zcao8yFn4BLxu6qAlGClWtTcc/rdeT YY36sqXIq2jSTy7bAYoelZxGdGsbucIl7+rIKMvuxKC3BkPg1qpF1j1gTzj5UaRchTTL w7vbm+9wQFuVhZTeCs5Ef3hiXU+Ww+X/rLfDgoiY47w97xuHgg9l2DIj8Q2VmLgbcwY2 /uv+GM/kRVisj/H9XIs2V1BqdelyAWH/gp71kKnmG3AN6dsU3ysxM2esGiz5bgRB9mfl kt3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=gvSnK23K; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=L3EOj7g2; 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=sholland.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw4-20020a170906478400b007801a579899si9512708ejc.448.2022.11.13.18.22.37; Sun, 13 Nov 2022 18:23:00 -0800 (PST) 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=@sholland.org header.s=fm2 header.b=gvSnK23K; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=L3EOj7g2; 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=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235707AbiKNCWF (ORCPT + 99 others); Sun, 13 Nov 2022 21:22:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235728AbiKNCVj (ORCPT ); Sun, 13 Nov 2022 21:21:39 -0500 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A704BDF3A; Sun, 13 Nov 2022 18:21:32 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 43F303200914; Sun, 13 Nov 2022 21:21:31 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 13 Nov 2022 21:21:32 -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=fm2; t=1668392490; x=1668478890; bh=Pe 5+rxKJXBwbi3S5z0eDboZk1Gy4CrOI9srKQdU3gkc=; b=gvSnK23KlZhlQgj8By bFNa5ZFb8CgAhfh6C5eUE9LhBcthyducRab3pHtEmaF6z6z3sxZAJh+lQDRQOKwf XHHLGLe7dFVj7ZRkVn8tWwVkj8jtp0Y/3Pf0z/ZOgr+fGgh7At418Nfb0YBVoHF0 3XUEqvURAhgpykh8iymFOZjOplbjjl6K31xUf1MShd2lcX2m4z0YgQxAGOkW5WHb 0q3j6hOFTsa/OwnEr1y9lsKfLdC6rDvJg5z52P8kt82AZVv5ny2E8kclNUjEBlAm A3SgUvzaWn8WlLzYR1z3nj0phh62g+iIQXQlc6THGwgROHiPtAqcub8gNLsf/JVz N+0g== 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=fm1; t=1668392490; x=1668478890; bh=Pe5+rxKJXBwbi 3S5z0eDboZk1Gy4CrOI9srKQdU3gkc=; b=L3EOj7g2AClJ7LrMgV9z2rmaQ21rd cCWp4xVKqqPcqr0R+mMehllu13Df3hTOjCheC1YjdGrndbr866v8TO1NaQZA0p1K Yp3g6XzjjS3whKM6vBpjp1DXhRhJMPvM9etPTEujCDc8mVy82Da8P5WgZIb12eEZ hvtxknCb/SMUjB5n4jNZY88Mfm5F81n2JHac3X8IG7/ZYtUCg6SrQdRIDjVazy3s 2OpsLxAKFnYrIOGduDKmE6HNcIMffpTx2/ceYjJLYq27t3KbmIMdtkH4C0qcupe3 1Sw+MWRGxXT/jqZW1ZfaFet75OE1Ukb1P2tKCyhT9mppfCzy2yFNF96Ug== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgedugdeghecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 13 Nov 2022 21:21:30 -0500 (EST) From: Samuel Holland To: Kishon Vijay Abraham I , Vinod Koul , Chen-Yu Tsai , Jernej Skrabec , Maxime Ripard Cc: Paul Kocialkowski , Samuel Holland , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH v2 6/8] phy: allwinner: phy-sun6i-mipi-dphy: Set the enable bit last Date: Sun, 13 Nov 2022 20:21:11 -0600 Message-Id: <20221114022113.31694-7-samuel@sholland.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221114022113.31694-1-samuel@sholland.org> References: <20221114022113.31694-1-samuel@sholland.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749436418647145314?= X-GMAIL-MSGID: =?utf-8?q?1749436418647145314?= The A100 variant of the DPHY requires configuring the analog registers before setting the global enable bit. Since this order also works on the other variants, always use it, to minimize the differences between them. Reviewed-by: Paul Kocialkowski Signed-off-by: Samuel Holland --- (no changes since v1) drivers/phy/allwinner/phy-sun6i-mipi-dphy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c index 7d7322670a83..a2afedc399fd 100644 --- a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c +++ b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c @@ -183,10 +183,6 @@ static int sun6i_dphy_tx_power_on(struct sun6i_dphy *dphy) SUN6I_DPHY_TX_TIME4_HS_TX_ANA0(3) | SUN6I_DPHY_TX_TIME4_HS_TX_ANA1(3)); - regmap_write(dphy->regs, SUN6I_DPHY_GCTL_REG, - SUN6I_DPHY_GCTL_LANE_NUM(dphy->config.lanes) | - SUN6I_DPHY_GCTL_EN); - regmap_write(dphy->regs, SUN6I_DPHY_ANA0_REG, SUN6I_DPHY_ANA0_REG_PWS | SUN6I_DPHY_ANA0_REG_DMPC | @@ -244,6 +240,10 @@ static int sun6i_dphy_tx_power_on(struct sun6i_dphy *dphy) SUN6I_DPHY_ANA2_EN_P2S_CPU_MASK, SUN6I_DPHY_ANA2_EN_P2S_CPU(lanes_mask)); + regmap_write(dphy->regs, SUN6I_DPHY_GCTL_REG, + SUN6I_DPHY_GCTL_LANE_NUM(dphy->config.lanes) | + SUN6I_DPHY_GCTL_EN); + return 0; } From patchwork Mon Nov 14 02:21:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 19519 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1923108wru; Sun, 13 Nov 2022 18:23:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf5TTOf7eQMj/Rwk3ZprRjHxyWz2FGakjASlbiVzDgK/OSgWCtEK87L5CtMubtEP3ieF2NwV X-Received: by 2002:a17:906:1746:b0:79f:9ff6:6576 with SMTP id d6-20020a170906174600b0079f9ff66576mr8447309eje.414.1668392598144; Sun, 13 Nov 2022 18:23:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668392598; cv=none; d=google.com; s=arc-20160816; b=cu5MWpPLB9tfXPzOGqXcbFnDUHiR9WXHOkaMwo3y2MSfZmeivX9HvKPw8r/rZNiRWs nEUrmYUzVDi5XUJsdgFuT0cHX7Mk/6vzWJiF8Z4t2BCMhTCsJZ/QhpWhRndY3gZz2eMq sBp1TiEQkSvGZtDTftP6FjCr8JOB1m9A/gwQ572wL+0M7VU13gFu6W/UZQkySq6GAwXk iJmKM2Th+n68ZVfU5xevqR9GScP3ScHppH46GFba3Kq5DPiGsqoXOAlhterL0AcE8KRc XtGZ1DB/Z+yv3O7EeCGk392R2nRh5/nerEtBPBEA9xb1P/XN6XhTbAx3hzJa3E2sdyQZ Hzfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=IjZjxserGXTvttPKvZ0ovwYSypli2lFE/yrZvqzapxw=; b=BsQ0pTFsxAD9itG+/Mlv1QRPsk+ACfvRF/6Yum7hBVB6J3od0QrXEeZtQh9xgvjFRR Bplc9SnlLAXYDvoPpgwE2fuTGK2QYAxmLTYSU4Tp8HGjbzcSEaSin2xeWufUOWzOraP7 k11dntFwPfRAMrXMQiX3l3JyL6oNyfTBkYGYDGBvncrVYEhhHFsdm9wiJKIS0KtIglES iTvDAswNw9s8DwFarfsxBpwY8/sRzb+OWvJu5ZgR9CWmQDyIX3k8+j33O5KxLsc5rWsf wcM7x3wapEaOJ+eWY+nxJuK11odS9oo4ImiB+08XzSLO7vUKgtjWtt+j/dZrqpRF6YVA K6uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=qGFkq+xh; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=ZuHNvXBM; 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=sholland.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o7-20020a056402038700b004612915d1a0si6627616edv.507.2022.11.13.18.22.54; Sun, 13 Nov 2022 18:23:18 -0800 (PST) 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=@sholland.org header.s=fm2 header.b=qGFkq+xh; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=ZuHNvXBM; 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=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235638AbiKNCWK (ORCPT + 99 others); Sun, 13 Nov 2022 21:22:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235734AbiKNCVl (ORCPT ); Sun, 13 Nov 2022 21:21:41 -0500 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 524CD11161; Sun, 13 Nov 2022 18:21:35 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id D99E7320046E; Sun, 13 Nov 2022 21:21:33 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 13 Nov 2022 21:21:34 -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=fm2; t=1668392493; x=1668478893; bh=Ij ZjxserGXTvttPKvZ0ovwYSypli2lFE/yrZvqzapxw=; b=qGFkq+xhPS5HTDytAM soFfpWfqMMgMmf2YKT4u5PoyI6aaxHQb42nUB00+hXg66W/8bdUjtlZWcIdinqw8 ZCSi0v8WWWn1dGrPEQ3AJg+BD512iVWLYh/shNB4FXC5rP7VefZKw1ITC+I1bprr R2WEIiLvqTIjgD95bWxcmWTm6ScCnfI/kKsvimbCxV7R8iUErqC193X0Pc+zL3Lw nonW7dWay5eq0FPObrg3qLOYPW9kEhgedVGO8+FtHdmZjgtVqymA6g1+cTH3sYZ3 ARVvNnR5jbh1BSURYY/jQMAT6gkSpFWDRIO5IoC1nQOr5/XUAkgi6ZTvL09W1tWc gNiA== 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=fm1; t=1668392493; x=1668478893; bh=IjZjxserGXTvt tPKvZ0ovwYSypli2lFE/yrZvqzapxw=; b=ZuHNvXBMtJaEJY+Vh2k2PASdUdLeh A9pQJxXGKiM8WQB5XyCySa1y7WX5fb+4ZAQdGAmSSpINUzt4iqvQCo7qWx87l6Vv 5UBtsvY9OhNxGoQHYfsMkUes4EImPYm3pOypPK51PwUCmqkC1ZEMczsZkjLWHsXm ZaXxoa2sGeV6qxB/N5Uttctokq+AEii9IG09fGwSPgFCsnQBUyPWB5n+9Lp6S7Qx n4ocMy2lcPD0a3j+eJqg/M++VfgDt3vN2HnrblxggVx/ZOic/fxIiyC5J7AqV70v XeSiHDVGKTZhVuJEuzCh4nQTPJwUGD8xIwf3tF3cGsBd+BlekedqTPDHw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgedugdeghecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 13 Nov 2022 21:21:32 -0500 (EST) From: Samuel Holland To: Kishon Vijay Abraham I , Vinod Koul , Chen-Yu Tsai , Jernej Skrabec , Maxime Ripard Cc: Paul Kocialkowski , Samuel Holland , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH v2 7/8] phy: allwinner: phy-sun6i-mipi-dphy: Add a variant power-on hook Date: Sun, 13 Nov 2022 20:21:12 -0600 Message-Id: <20221114022113.31694-8-samuel@sholland.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221114022113.31694-1-samuel@sholland.org> References: <20221114022113.31694-1-samuel@sholland.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749436437039813756?= X-GMAIL-MSGID: =?utf-8?q?1749436437039813756?= The A100 variant uses the same values for the timing registers, and it uses the same final power-on sequence, but it needs a different analog register configuration in the middle. Support this by moving the variant-specific parts to a hook provided by the variant. Signed-off-by: Samuel Holland --- (no changes since v1) drivers/phy/allwinner/phy-sun6i-mipi-dphy.c | 59 ++++++++++++--------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c index a2afedc399fd..ac144ee0f0a6 100644 --- a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c +++ b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c @@ -114,7 +114,10 @@ enum sun6i_dphy_direction { SUN6I_DPHY_DIRECTION_RX, }; +struct sun6i_dphy; + struct sun6i_dphy_variant { + void (*tx_power_on)(struct sun6i_dphy *dphy); bool rx_supported; }; @@ -156,33 +159,10 @@ static int sun6i_dphy_configure(struct phy *phy, union phy_configure_opts *opts) return 0; } -static int sun6i_dphy_tx_power_on(struct sun6i_dphy *dphy) +static void sun6i_a31_mipi_dphy_tx_power_on(struct sun6i_dphy *dphy) { u8 lanes_mask = GENMASK(dphy->config.lanes - 1, 0); - regmap_write(dphy->regs, SUN6I_DPHY_TX_CTL_REG, - SUN6I_DPHY_TX_CTL_HS_TX_CLK_CONT); - - regmap_write(dphy->regs, SUN6I_DPHY_TX_TIME0_REG, - SUN6I_DPHY_TX_TIME0_LP_CLK_DIV(14) | - SUN6I_DPHY_TX_TIME0_HS_PREPARE(6) | - SUN6I_DPHY_TX_TIME0_HS_TRAIL(10)); - - regmap_write(dphy->regs, SUN6I_DPHY_TX_TIME1_REG, - SUN6I_DPHY_TX_TIME1_CLK_PREPARE(7) | - SUN6I_DPHY_TX_TIME1_CLK_ZERO(50) | - SUN6I_DPHY_TX_TIME1_CLK_PRE(3) | - SUN6I_DPHY_TX_TIME1_CLK_POST(10)); - - regmap_write(dphy->regs, SUN6I_DPHY_TX_TIME2_REG, - SUN6I_DPHY_TX_TIME2_CLK_TRAIL(30)); - - regmap_write(dphy->regs, SUN6I_DPHY_TX_TIME3_REG, 0); - - regmap_write(dphy->regs, SUN6I_DPHY_TX_TIME4_REG, - SUN6I_DPHY_TX_TIME4_HS_TX_ANA0(3) | - SUN6I_DPHY_TX_TIME4_HS_TX_ANA1(3)); - regmap_write(dphy->regs, SUN6I_DPHY_ANA0_REG, SUN6I_DPHY_ANA0_REG_PWS | SUN6I_DPHY_ANA0_REG_DMPC | @@ -214,6 +194,36 @@ static int sun6i_dphy_tx_power_on(struct sun6i_dphy *dphy) SUN6I_DPHY_ANA3_EN_LDOC | SUN6I_DPHY_ANA3_EN_LDOD); udelay(1); +} + +static int sun6i_dphy_tx_power_on(struct sun6i_dphy *dphy) +{ + u8 lanes_mask = GENMASK(dphy->config.lanes - 1, 0); + + regmap_write(dphy->regs, SUN6I_DPHY_TX_CTL_REG, + SUN6I_DPHY_TX_CTL_HS_TX_CLK_CONT); + + regmap_write(dphy->regs, SUN6I_DPHY_TX_TIME0_REG, + SUN6I_DPHY_TX_TIME0_LP_CLK_DIV(14) | + SUN6I_DPHY_TX_TIME0_HS_PREPARE(6) | + SUN6I_DPHY_TX_TIME0_HS_TRAIL(10)); + + regmap_write(dphy->regs, SUN6I_DPHY_TX_TIME1_REG, + SUN6I_DPHY_TX_TIME1_CLK_PREPARE(7) | + SUN6I_DPHY_TX_TIME1_CLK_ZERO(50) | + SUN6I_DPHY_TX_TIME1_CLK_PRE(3) | + SUN6I_DPHY_TX_TIME1_CLK_POST(10)); + + regmap_write(dphy->regs, SUN6I_DPHY_TX_TIME2_REG, + SUN6I_DPHY_TX_TIME2_CLK_TRAIL(30)); + + regmap_write(dphy->regs, SUN6I_DPHY_TX_TIME3_REG, 0); + + regmap_write(dphy->regs, SUN6I_DPHY_TX_TIME4_REG, + SUN6I_DPHY_TX_TIME4_HS_TX_ANA0(3) | + SUN6I_DPHY_TX_TIME4_HS_TX_ANA1(3)); + + dphy->variant->tx_power_on(dphy); regmap_update_bits(dphy->regs, SUN6I_DPHY_ANA3_REG, SUN6I_DPHY_ANA3_EN_VTTC | @@ -470,6 +480,7 @@ static int sun6i_dphy_probe(struct platform_device *pdev) } static const struct sun6i_dphy_variant sun6i_a31_mipi_dphy_variant = { + .tx_power_on = sun6i_a31_mipi_dphy_tx_power_on, .rx_supported = true, }; From patchwork Mon Nov 14 02:21:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 19521 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1923592wru; Sun, 13 Nov 2022 18:25:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf47wUO6jW6GslMSyMWqSliipZ01U0+I3akstdKcPeyMsmpy4BtfAmedcjpUn53V1Yhe7GTp X-Received: by 2002:a17:907:c30c:b0:7ad:b152:6bd1 with SMTP id tl12-20020a170907c30c00b007adb1526bd1mr9054630ejc.30.1668392701727; Sun, 13 Nov 2022 18:25:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668392701; cv=none; d=google.com; s=arc-20160816; b=ldrNOJf11jQgPI65VMTKsLu6E2fRAh5ijScx2ao/A4xBMWjfIGEsOUgglvjk6dW9M7 k+MCKyZilI7CbYTgd+SRWr7TEk6CIV66p/h8ec51/wBjNl3w+01UKG2Mz23/DqxSa3ys D99pl7ZzqCKJAG8A0mxz2lhXiW8npL41CnfJ1mWtbus7FiQfZJ76eOowqorCV+U13eEU JVSRDeNJjufvjgq+d0yXp0KdPTp2+suOhzuQ31vTfxLdN7WYROpnByn7aZr5fvm5DclM YQFMImRyZ0mmACYFvfVsthIGL0qiQD9fu+PtpbHVTnso7zFptJgx9+DGjo0Yc+NeVgB7 +3FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=gjTxd/OJ3XJY9Y9W7MUwj9LbmBQtUOqoYWx80cWH4tA=; b=Vk45JfyRF2swigqnvjoaAycx3vIuTWPv62RRRY5m+ccWmzWSh1hJrNBxIAsBMBC3gD Pvq+famw2o3Tm9QRtrKcFwhrIttodqo8j3dbrA6X9ln/x975rdkxCbOKxTI+ifIsVpDy /e6KbMNOfHf+x2nvpPNc00z6RmZJc3ZXJjD8dhekbXaNKC+POmR4zQLhqBrlw3Kjnl2E 9AZXrC4BV5pgkThhqwHQP3X8GyQxvk25EQAbqZVZJGAe+S8rBVmE0AzwJtML5AjTuESN eqbUD/qfWWnouVJ+s3B7Jk6NUu76lhOG8PtumWyZ1/mHDyGYRORPpkAPSAAZsUbHx0vz NWng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=dv9RTRgh; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=eDe5SHgi; 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=sholland.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d17-20020a170906641100b00730a4246dd0si6203947ejm.593.2022.11.13.18.24.37; Sun, 13 Nov 2022 18:25:01 -0800 (PST) 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=@sholland.org header.s=fm2 header.b=dv9RTRgh; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=eDe5SHgi; 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=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235762AbiKNCWM (ORCPT + 99 others); Sun, 13 Nov 2022 21:22:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235730AbiKNCVs (ORCPT ); Sun, 13 Nov 2022 21:21:48 -0500 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1C4FF59C; Sun, 13 Nov 2022 18:21:37 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 7BBAD3200919; Sun, 13 Nov 2022 21:21:36 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sun, 13 Nov 2022 21:21:37 -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=fm2; t=1668392496; x=1668478896; bh=gj Txd/OJ3XJY9Y9W7MUwj9LbmBQtUOqoYWx80cWH4tA=; b=dv9RTRgh0sYupDLwTl 1jiL05KjhZ3cPsZwCHIh8u/HNuoCOyWmMo18j0BF6bLzEmGERmWbt6k0u3aomUnb YYHmwjgoAQTjmBnGOr1v840kg52Wf/J0xz36ZHthYM6mrX/HmYhfMqoSbKwDNaaH f4karJO+BiVcWoCqaHcigFUgCD/zxZ0YGVvQGxlFWSGatZmUqCahownObk9w/hpN p3svfgj8LNucGbXdeM6Zm6FwYZZY9Zub8Q5mWPXRD1jnme8mZTaI0jSWhvy+eHCT oK9ljUpR93MJvKzZDu2JT6nv2C94RH+xl06jYYDpA6nsKbS3G4JfQWUuT5x+AqGE z9Rw== 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=fm1; t=1668392496; x=1668478896; bh=gjTxd/OJ3XJY9 Y9W7MUwj9LbmBQtUOqoYWx80cWH4tA=; b=eDe5SHgitCLCmhqOB38VQdkdhxkUL td2WQK2rki7jIoZd9+vCH0fjf3CJRMs4AT13upvh67rh6YjYIY9BTG9LsNgJKHq/ FGuWLAGIvAuLP4xL6+XuinTkaGArlldg22AKwQY4mo8ZZ9ArG8QqYNTUD40D7izc Wv2mW+PVvTq/+1ZVl/9HgN/IBdEZGxsE4cqo0xmIuXJOplvfxu7a4Q0rYeWgr/Nm bD3kTDb/oI7WwZRbzbZYl7Liy7/SzPFbdlor+vwZNu964j8usJ7dWo0veVAUNgEu pn/eEWqnS2/PSlhh9jyeQHi88UJmyEZ19OBMo0Jnw2qt2dNAvlm7rHEsw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgedugdeghecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 13 Nov 2022 21:21:35 -0500 (EST) From: Samuel Holland To: Kishon Vijay Abraham I , Vinod Koul , Chen-Yu Tsai , Jernej Skrabec , Maxime Ripard Cc: Paul Kocialkowski , Samuel Holland , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH v2 8/8] phy: allwinner: phy-sun6i-mipi-dphy: Add the A100 DPHY variant Date: Sun, 13 Nov 2022 20:21:13 -0600 Message-Id: <20221114022113.31694-9-samuel@sholland.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221114022113.31694-1-samuel@sholland.org> References: <20221114022113.31694-1-samuel@sholland.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749436545591069535?= X-GMAIL-MSGID: =?utf-8?q?1749436545591069535?= A100 features an updated DPHY, which moves PLL control inside the DPHY register space (previously the PLL was controlled from the CCU). It also requires a modified analog power-on sequence. This "combo PHY" can also be used as an LVDS PHY, but that is not yet supported by the driver. Signed-off-by: Samuel Holland --- (no changes since v1) drivers/phy/allwinner/phy-sun6i-mipi-dphy.c | 143 +++++++++++++++++++- 1 file changed, 142 insertions(+), 1 deletion(-) diff --git a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c index ac144ee0f0a6..36eab95271b2 100644 --- a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c +++ b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c @@ -70,11 +70,19 @@ #define SUN6I_DPHY_ANA0_REG 0x4c #define SUN6I_DPHY_ANA0_REG_PWS BIT(31) +#define SUN6I_DPHY_ANA0_REG_PWEND BIT(30) +#define SUN6I_DPHY_ANA0_REG_PWENC BIT(29) #define SUN6I_DPHY_ANA0_REG_DMPC BIT(28) #define SUN6I_DPHY_ANA0_REG_DMPD(n) (((n) & 0xf) << 24) +#define SUN6I_DPHY_ANA0_REG_SRXDT(n) (((n) & 0xf) << 20) +#define SUN6I_DPHY_ANA0_REG_SRXCK(n) (((n) & 0xf) << 16) +#define SUN6I_DPHY_ANA0_REG_SDIV2 BIT(15) #define SUN6I_DPHY_ANA0_REG_SLV(n) (((n) & 7) << 12) #define SUN6I_DPHY_ANA0_REG_DEN(n) (((n) & 0xf) << 8) +#define SUN6I_DPHY_ANA0_REG_PLR(n) (((n) & 0xf) << 4) #define SUN6I_DPHY_ANA0_REG_SFB(n) (((n) & 3) << 2) +#define SUN6I_DPHY_ANA0_REG_RSD BIT(1) +#define SUN6I_DPHY_ANA0_REG_SELSCK BIT(0) #define SUN6I_DPHY_ANA1_REG 0x50 #define SUN6I_DPHY_ANA1_REG_VTTMODE BIT(31) @@ -97,8 +105,13 @@ #define SUN6I_DPHY_ANA3_EN_LDOR BIT(18) #define SUN6I_DPHY_ANA4_REG 0x5c +#define SUN6I_DPHY_ANA4_REG_EN_MIPI BIT(31) +#define SUN6I_DPHY_ANA4_REG_EN_COMTEST BIT(30) +#define SUN6I_DPHY_ANA4_REG_COMTEST(n) (((n) & 3) << 28) +#define SUN6I_DPHY_ANA4_REG_IB(n) (((n) & 3) << 25) #define SUN6I_DPHY_ANA4_REG_DMPLVC BIT(24) #define SUN6I_DPHY_ANA4_REG_DMPLVD(n) (((n) & 0xf) << 20) +#define SUN6I_DPHY_ANA4_REG_VTT_SET(n) (((n) & 0x7) << 17) #define SUN6I_DPHY_ANA4_REG_CKDV(n) (((n) & 0x1f) << 12) #define SUN6I_DPHY_ANA4_REG_TMSC(n) (((n) & 3) << 10) #define SUN6I_DPHY_ANA4_REG_TMSD(n) (((n) & 3) << 8) @@ -109,6 +122,56 @@ #define SUN6I_DPHY_DBG5_REG 0xf4 +#define SUN50I_DPHY_TX_SLEW_REG0 0xf8 +#define SUN50I_DPHY_TX_SLEW_REG1 0xfc +#define SUN50I_DPHY_TX_SLEW_REG2 0x100 + +#define SUN50I_DPHY_PLL_REG0 0x104 +#define SUN50I_DPHY_PLL_REG0_CP36_EN BIT(23) +#define SUN50I_DPHY_PLL_REG0_LDO_EN BIT(22) +#define SUN50I_DPHY_PLL_REG0_EN_LVS BIT(21) +#define SUN50I_DPHY_PLL_REG0_PLL_EN BIT(20) +#define SUN50I_DPHY_PLL_REG0_P(n) (((n) & 0xf) << 16) +#define SUN50I_DPHY_PLL_REG0_N(n) (((n) & 0xff) << 8) +#define SUN50I_DPHY_PLL_REG0_NDET BIT(7) +#define SUN50I_DPHY_PLL_REG0_TDIV BIT(6) +#define SUN50I_DPHY_PLL_REG0_M0(n) (((n) & 3) << 4) +#define SUN50I_DPHY_PLL_REG0_M1(n) ((n) & 0xf) + +#define SUN50I_DPHY_PLL_REG1 0x108 +#define SUN50I_DPHY_PLL_REG1_UNLOCK_MDSEL(n) (((n) & 3) << 14) +#define SUN50I_DPHY_PLL_REG1_LOCKMDSEL BIT(13) +#define SUN50I_DPHY_PLL_REG1_LOCKDET_EN BIT(12) +#define SUN50I_DPHY_PLL_REG1_VSETA(n) (((n) & 0x7) << 9) +#define SUN50I_DPHY_PLL_REG1_VSETD(n) (((n) & 0x7) << 6) +#define SUN50I_DPHY_PLL_REG1_LPF_SW BIT(5) +#define SUN50I_DPHY_PLL_REG1_ICP_SEL(n) (((n) & 3) << 3) +#define SUN50I_DPHY_PLL_REG1_ATEST_SEL(n) (((n) & 3) << 1) +#define SUN50I_DPHY_PLL_REG1_TEST_EN BIT(0) + +#define SUN50I_DPHY_PLL_REG2 0x10c +#define SUN50I_DPHY_PLL_REG2_SDM_EN BIT(31) +#define SUN50I_DPHY_PLL_REG2_FF_EN BIT(30) +#define SUN50I_DPHY_PLL_REG2_SS_EN BIT(29) +#define SUN50I_DPHY_PLL_REG2_SS_FRAC(n) (((n) & 0x1ff) << 20) +#define SUN50I_DPHY_PLL_REG2_SS_INT(n) (((n) & 0xff) << 12) +#define SUN50I_DPHY_PLL_REG2_FRAC(n) ((n) & 0xfff) + +#define SUN50I_COMBO_PHY_REG0 0x110 +#define SUN50I_COMBO_PHY_REG0_EN_TEST_COMBOLDO BIT(5) +#define SUN50I_COMBO_PHY_REG0_EN_TEST_0P8 BIT(4) +#define SUN50I_COMBO_PHY_REG0_EN_MIPI BIT(3) +#define SUN50I_COMBO_PHY_REG0_EN_LVDS BIT(2) +#define SUN50I_COMBO_PHY_REG0_EN_COMBOLDO BIT(1) +#define SUN50I_COMBO_PHY_REG0_EN_CP BIT(0) + +#define SUN50I_COMBO_PHY_REG1 0x114 +#define SUN50I_COMBO_PHY_REG2_REG_VREF1P6(n) (((n) & 0x7) << 4) +#define SUN50I_COMBO_PHY_REG2_REG_VREF0P8(n) ((n) & 0x7) + +#define SUN50I_COMBO_PHY_REG2 0x118 +#define SUN50I_COMBO_PHY_REG2_HS_STOP_DLY(n) ((n) & 0xff) + enum sun6i_dphy_direction { SUN6I_DPHY_DIRECTION_TX, SUN6I_DPHY_DIRECTION_RX, @@ -196,6 +259,76 @@ static void sun6i_a31_mipi_dphy_tx_power_on(struct sun6i_dphy *dphy) udelay(1); } +static void sun50i_a100_mipi_dphy_tx_power_on(struct sun6i_dphy *dphy) +{ + unsigned long mipi_symbol_rate = dphy->config.hs_clk_rate; + unsigned int div, n; + + regmap_write(dphy->regs, SUN6I_DPHY_ANA4_REG, + SUN6I_DPHY_ANA4_REG_IB(2) | + SUN6I_DPHY_ANA4_REG_DMPLVD(4) | + SUN6I_DPHY_ANA4_REG_VTT_SET(3) | + SUN6I_DPHY_ANA4_REG_CKDV(3) | + SUN6I_DPHY_ANA4_REG_TMSD(1) | + SUN6I_DPHY_ANA4_REG_TMSC(1) | + SUN6I_DPHY_ANA4_REG_TXPUSD(2) | + SUN6I_DPHY_ANA4_REG_TXPUSC(3) | + SUN6I_DPHY_ANA4_REG_TXDNSD(2) | + SUN6I_DPHY_ANA4_REG_TXDNSC(3)); + + regmap_update_bits(dphy->regs, SUN6I_DPHY_ANA2_REG, + SUN6I_DPHY_ANA2_EN_CK_CPU, + SUN6I_DPHY_ANA2_EN_CK_CPU); + + regmap_update_bits(dphy->regs, SUN6I_DPHY_ANA2_REG, + SUN6I_DPHY_ANA2_REG_ENIB, + SUN6I_DPHY_ANA2_REG_ENIB); + + regmap_write(dphy->regs, SUN6I_DPHY_ANA3_REG, + SUN6I_DPHY_ANA3_EN_LDOR | + SUN6I_DPHY_ANA3_EN_LDOC | + SUN6I_DPHY_ANA3_EN_LDOD); + + regmap_write(dphy->regs, SUN6I_DPHY_ANA0_REG, + SUN6I_DPHY_ANA0_REG_PLR(4) | + SUN6I_DPHY_ANA0_REG_SFB(1)); + + regmap_write(dphy->regs, SUN50I_COMBO_PHY_REG0, + SUN50I_COMBO_PHY_REG0_EN_CP); + + /* Choose a divider to limit the VCO frequency to around 2 GHz. */ + div = 16 >> order_base_2(DIV_ROUND_UP(mipi_symbol_rate, 264000000)); + n = mipi_symbol_rate * div / 24000000; + + regmap_write(dphy->regs, SUN50I_DPHY_PLL_REG0, + SUN50I_DPHY_PLL_REG0_CP36_EN | + SUN50I_DPHY_PLL_REG0_LDO_EN | + SUN50I_DPHY_PLL_REG0_EN_LVS | + SUN50I_DPHY_PLL_REG0_PLL_EN | + SUN50I_DPHY_PLL_REG0_NDET | + SUN50I_DPHY_PLL_REG0_P((div - 1) % 8) | + SUN50I_DPHY_PLL_REG0_N(n) | + SUN50I_DPHY_PLL_REG0_M0((div - 1) / 8) | + SUN50I_DPHY_PLL_REG0_M1(2)); + + /* Disable sigma-delta modulation. */ + regmap_write(dphy->regs, SUN50I_DPHY_PLL_REG2, 0); + + regmap_update_bits(dphy->regs, SUN6I_DPHY_ANA4_REG, + SUN6I_DPHY_ANA4_REG_EN_MIPI, + SUN6I_DPHY_ANA4_REG_EN_MIPI); + + regmap_update_bits(dphy->regs, SUN50I_COMBO_PHY_REG0, + SUN50I_COMBO_PHY_REG0_EN_MIPI | + SUN50I_COMBO_PHY_REG0_EN_COMBOLDO, + SUN50I_COMBO_PHY_REG0_EN_MIPI | + SUN50I_COMBO_PHY_REG0_EN_COMBOLDO); + + regmap_write(dphy->regs, SUN50I_COMBO_PHY_REG2, + SUN50I_COMBO_PHY_REG2_HS_STOP_DLY(20)); + udelay(1); +} + static int sun6i_dphy_tx_power_on(struct sun6i_dphy *dphy) { u8 lanes_mask = GENMASK(dphy->config.lanes - 1, 0); @@ -408,7 +541,7 @@ static const struct regmap_config sun6i_dphy_regmap_config = { .reg_bits = 32, .val_bits = 32, .reg_stride = 4, - .max_register = SUN6I_DPHY_DBG5_REG, + .max_register = SUN50I_COMBO_PHY_REG2, .name = "mipi-dphy", }; @@ -484,11 +617,19 @@ static const struct sun6i_dphy_variant sun6i_a31_mipi_dphy_variant = { .rx_supported = true, }; +static const struct sun6i_dphy_variant sun50i_a100_mipi_dphy_variant = { + .tx_power_on = sun50i_a100_mipi_dphy_tx_power_on, +}; + static const struct of_device_id sun6i_dphy_of_table[] = { { .compatible = "allwinner,sun6i-a31-mipi-dphy", .data = &sun6i_a31_mipi_dphy_variant, }, + { + .compatible = "allwinner,sun50i-a100-mipi-dphy", + .data = &sun50i_a100_mipi_dphy_variant, + }, { } }; MODULE_DEVICE_TABLE(of, sun6i_dphy_of_table);