From mboxrd@z Thu Jan 1 00:00:00 1970 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 CC14AD0E3F9 for ; Thu, 24 Oct 2024 19:47:05 +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:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VcgwJVWlzPEuuHH5Ob49x3tyit0LaUMJN0j41yxlCMA=; b=Q1KhFtE+Q+FmB3 6ceTvyI25BloOfzWapbaKCoRniKuq1byheWvskiHdrJPFbk50rPk0euskQh+EIb5TE4N2DMe9EuUV xrDDnAONpytSBO24KcF9N+3bELBnreD8aJCS2DxWjtAbiR1N3YfMIbA4K81I6Y7vEllyPEMk8mDgK ZBKWIU9xxqBticLbP3ARDLIIJQS7yA2C0cH+22FQnWy+Yr0QeUtleEDqfc76DQMRsf9I6L9wnsD9n IgnZDi52t5VLkPnk6nDXaq5nKGIIMBMEcVVZpCTgjabZ5dSusreW3oTOfUVi+atSAwxjePQ6Y3Vlv NCNcNW8lkpFun+B8kKRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t43nV-00000001dfs-0USk; Thu, 24 Oct 2024 19:47:05 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t43Q1-00000001ak3-3Okv; Thu, 24 Oct 2024 19:22:51 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 05BC0339; Thu, 24 Oct 2024 12:23:16 -0700 (PDT) Received: from minigeek.lan (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D6E593F528; Thu, 24 Oct 2024 12:22:42 -0700 (PDT) Date: Thu, 24 Oct 2024 20:22:33 +0100 From: Andre Przywara To: Cody Eksal Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-usb@vger.kernel.org, Vinod Koul , Kishon Vijay Abraham I , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Yangtao Li , Florian Fainelli , Krzysztof Kozlowski , Parthiban , Linus Walleij , Thierry Reding , Maxime Ripard , Greg Kroah-Hartman , Yangtao Li , Viresh Kumar , Nishanth Menon , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "Rafael J. Wysocki" Subject: Re: [PATCH 06/13] phy: sun4i-usb: add support for A100 USB PHY Message-ID: <20241024202216.6cded8c4@minigeek.lan> In-Reply-To: <20241024170540.2721307-7-masterr3c0rd@epochal.quest> References: <20241024170540.2721307-1-masterr3c0rd@epochal.quest> <20241024170540.2721307-7-masterr3c0rd@epochal.quest> Organization: Arm Ltd. X-Mailer: Claws Mail 4.2.0 (GTK 3.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241024_122249_989969_FFC1BB7F X-CRM114-Status: GOOD ( 20.51 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On Thu, 24 Oct 2024 14:05:24 -0300 Cody Eksal wrote: Hi, > From: Yangtao Li > > Add support for a100's usb phy, which with 2 PHYs. > > Signed-off-by: Yangtao Li > [masterr3c0rd@epochal.quest: modified to use quirk flags] > Signed-off-by: Cody Eksal > --- > drivers/phy/allwinner/phy-sun4i-usb.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c > index b0f19e950601..a3942b2ee90b 100644 > --- a/drivers/phy/allwinner/phy-sun4i-usb.c > +++ b/drivers/phy/allwinner/phy-sun4i-usb.c > @@ -1006,6 +1006,16 @@ static const struct sun4i_usb_phy_cfg sun50i_a64_cfg = { > .phy0_dual_route = true, > }; > > +static const struct sun4i_usb_phy_cfg sun50i_a100_cfg = { > + .num_phys = 2, > + .disc_thresh = 3, This member is never used when .siddq_in_base is true (and yes, this is wrong for the H616 too), ... > + .phyctl_offset = REG_PHYCTL_A33, > + .dedicated_clocks = true, > + .hci_phy_ctl_clear = PHY_CTL_SIDDQ, > + .phy0_dual_route = true, > + .siddq_in_base = true, ... which makes this whole description identical to the D1 version. So at the very least we wouldn't this new a100_cfg, but instead just point to the existing d1_cfg. > +}; > + > static const struct sun4i_usb_phy_cfg sun50i_h6_cfg = { > .num_phys = 4, > .phyctl_offset = REG_PHYCTL_A33, > @@ -1040,6 +1050,7 @@ static const struct of_device_id sun4i_usb_phy_of_match[] = { > { .compatible = "allwinner,sun20i-d1-usb-phy", .data = &sun20i_d1_cfg }, > { .compatible = "allwinner,sun50i-a64-usb-phy", > .data = &sun50i_a64_cfg}, > + { .compatible = "allwinner,sun50i-a100-usb-phy", .data = &sun50i_a100_cfg }, And this also brings up the question whether we need a new compatible string. As it stands now, we could also use: compatible = "allwinner,sun50i-a100-usb-phy", "allwinner,sun20i-d1-usb-phy"; and wouldn't need any driver changes at all. Which would have the neat side effect to make USB work already with v5.18 kernels. The only downside is the somewhat weird ordering of the compatible strings, with the much newer chip as the fallback. What do other people think here? Cheers, Andre > { .compatible = "allwinner,sun50i-h6-usb-phy", .data = &sun50i_h6_cfg }, > { .compatible = "allwinner,sun50i-h616-usb-phy", .data = &sun50i_h616_cfg }, > { .compatible = "allwinner,suniv-f1c100s-usb-phy", -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy