Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp113729rwb; Fri, 12 Aug 2022 15:37:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Hw1Pf9knz2QDCV7X63Lg4fpK0+qc7ZtxTNhdx8U5RTw0lbBmtJu+eZMz5DKpOkS4awtH1 X-Received: by 2002:a17:907:3e21:b0:730:92bb:7fcd with SMTP id hp33-20020a1709073e2100b0073092bb7fcdmr3921683ejc.170.1660343875180; Fri, 12 Aug 2022 15:37:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660343875; cv=none; d=google.com; s=arc-20160816; b=B3i8hjzE+347bLZ05n2zAGpzHSZ+adEN4+1Vv3trPqBCSvmAuR2kV68sZNUZ3KHXb5 EXlO33K1jRQGFKa3YfwWLrReV+UioAsdiTMgSTScEOrTYJo3Prb5ayzkYNjkbPJrBdvS ftrwbOjQESq8ycf3KVNhxApQZRZAODx6/6HpvAIl9bL7uoZJv+MYnKV/3Vh98O5FWBux Wsa7sZKEHnbJl0mVBcrvDFyEylA9jxm0wGocrPDHsiDTTFyMfQDhjARdcJkMdLgZ/Sm+ c/q+tTKBStt5yLdvi+7YfvkZd3kcQ36GI/HESdjc6TxJcjoL8x+rcK0WASz3jKMjULZ+ 83Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:feedback-id:dkim-signature:dkim-signature; bh=kgS42RQgG/tiE5VGji6aib4Oy9gURPck9Fi+x//w8eU=; b=ylII5xeOC5XKAuDnATNdnjQs/F7tcYxjrWL9KeIBm9hhIUo0afGxV45xlC4Xchdf28 CUJjneckHDJVcGF4McWHIStz97QAqFuVGkyRtHwqOEtDVQdEt5nmKwO4xWTfBhoT0GNI oWQ5Il5iVsuWDlejFo9KNZZwjk/619NUNJbJq8CkKBzK5Chmbnhxt3lybv4teulb9Iwa 6699R2SSKWMNONtmkmP9Tcl+vOXGLjVSi3QHsc6uVqO6zqP4SaxwyXZ2Y4hpKDB1YOpr mgbF0aEqQtiCn7XdDb04u23/kzCd0jpzEHX8CtjG3MF/aoHawthjivT7aQYkV9d6wG8i l4kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=yCsbGqpO; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Wj97d76G; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w5-20020a05640234c500b0043e39c683f9si3188191edc.556.2022.08.12.15.37.27; Fri, 12 Aug 2022 15:37:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=yCsbGqpO; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Wj97d76G; 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 S235899AbiHLWcA (ORCPT + 99 others); Fri, 12 Aug 2022 18:32:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230118AbiHLWb7 (ORCPT ); Fri, 12 Aug 2022 18:31:59 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 152A79FD8; Fri, 12 Aug 2022 15:31:58 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 01C0F32008FB; Fri, 12 Aug 2022 18:31:55 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 12 Aug 2022 18:31:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:content-type: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=1660343515; x= 1660429915; bh=kgS42RQgG/tiE5VGji6aib4Oy9gURPck9Fi+x//w8eU=; b=y CsbGqpOkVSo0Xin2aC9GExcdGKs8UxUhKlgip+5w4IqZuVN8gWqzAP1JIB8gF2FJ oPg70bJH7vDXn+vjd012wOrsmGWOARsAvVBDtyX3V2cNFEt/7zApF9TtGAMsftTA L3rfxRfby+8Tk+M48jlZSbYMXmB90lMASMwpLl7CSIUswO4QYJhkCIvRvockDRc6 S2ybO3xop0kRYDvwJryn4QSrOXflD8/50GVWnxaCU1BD9UefYa8DiZtOgQ1r3NOS c1W4K8RDz9T1HlvB1aumy8MweCVVPitq6FVjJaFU5MayKGqrdmAYNLZIUTbccSOd vH5BN0Slo1ch9O5cY4TLw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type: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=1660343515; x= 1660429915; bh=kgS42RQgG/tiE5VGji6aib4Oy9gURPck9Fi+x//w8eU=; b=W j97d76GyyLi27VuagXD865UAWLlMXkhvJGZbd5+L6MdlFK6IZ3/3isSic4Y560kM h1KtXR3Q34AYqr6zhdudMoKZ0fi9zfOoSP4ExZqEYnVKtB9ti0W2AOkQl9YuA1Ct hNswG0cIbLt34mOBlrzF6SPuXDqHnOCUEnXsn0idHA3qGw947xNA2ewscuUsSSxL 0e67OLm8DdF6O1iID7Bsn5Mj1hk3vJoDrrHgUsWWJu+RziRejF0XGEWChO2gcFwA EQL9umR8VzQWGGtz/3Oq/E+mfHH/9XHHTNGX6eMm3j3otdJmSHVVOSHvn9l8kjAS Fl+h1wBWkzZkdK3g9bKNA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdegjedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvvehfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpefurghm uhgvlhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenuc ggtffrrghtthgvrhhnpefftdevkedvgeekueeutefgteffieelvedukeeuhfehledvhfei tdehudfhudehhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 12 Aug 2022 18:31:54 -0400 (EDT) Subject: Re: [PATCH 6/8] phy: allwinner: phy-sun6i-mipi-dphy: Set enable bit last To: Paul Kocialkowski Cc: Kishon Vijay Abraham I , Vinod Koul , Chen-Yu Tsai , Jernej Skrabec , Maxime Ripard , Jagan Teki , Krzysztof Kozlowski , Maxime Ripard , 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 References: <20220812075603.59375-1-samuel@sholland.org> <20220812075603.59375-7-samuel@sholland.org> From: Samuel Holland Message-ID: Date: Fri, 12 Aug 2022 17:31:54 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi Paul, On 8/12/22 7:03 AM, Paul Kocialkowski wrote: > On Fri 12 Aug 22, 02:56, Samuel Holland wrote: >> 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. > > Did you get a chance to actually test this with either DSI/CSI-2 hardware? I have tested DSI output with the Clockwork DevTerm (D1 SoC) and Pine64 PinePhone (A64 SoC). I do not have any MIPI CSI hardware to test with. > I vaguely remember that the order mattered. Do you have an idea of what the > Allwinner BSP does too? The Allwinner BSP makes the same change as this commit in its "lowlevel_v2x" copy of the code, which is used for R40 and T7 (original DPHY) and A100 and D1 (updated DPHY). It does not make the change in "lowlevel_sun50iw1" (A64 SoC, original DPHY), but I tested A64 with this change, and it works fine. > Otherwise I could give it a try, at least with my MIPI CSI-2 setup > that uses the driver. This commit only changes sun6i_dphy_tx_power_on(). The code for RX is unchanged -- in fact, it already sets SUN6I_DPHY_GCTL_REG last. Regards, Samuel >> Signed-off-by: Samuel Holland >> --- >> >> 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 625c6e1e9990..9698d68d0db7 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; >> } >> >> -- >> 2.35.1 >> >