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 X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52DE8C64E7D for ; Sat, 28 Nov 2020 21:56:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D918208B3 for ; Sat, 28 Nov 2020 21:56:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391521AbgK1VzG (ORCPT ); Sat, 28 Nov 2020 16:55:06 -0500 Received: from foss.arm.com ([217.140.110.172]:37318 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387575AbgK1TkK (ORCPT ); Sat, 28 Nov 2020 14:40:10 -0500 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 2A75D30E; Sat, 28 Nov 2020 11:39:24 -0800 (PST) Received: from [192.168.2.22] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 916ED3F23F; Sat, 28 Nov 2020 11:39:22 -0800 (PST) Subject: Re: [RESEND PATCH 13/19] phy: sun4i-usb: add support for A100 USB PHY To: Frank Lee , tiny.windzz@gmail.com Cc: Randy Dunlap , linux-kernel@vger.kernel.org, Maxime Ripard , Kishon Vijay Abraham I , Vinod Koul , Krzysztof Kozlowski , Colin Ian King , Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org, Jernej Skrabec References: From: =?UTF-8?Q?Andr=c3=a9_Przywara?= Organization: ARM Ltd. Message-ID: Date: Sat, 28 Nov 2020 19:39:02 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/11/2020 06:40, Frank Lee wrote: Hi, > From: Yangtao Li > > Add support for a100's usb phy, which with 2 PHYs. > > Signed-off-by: Yangtao Li > --- > drivers/phy/allwinner/phy-sun4i-usb.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c > index a6900495baa5..1a0e403131e7 100644 > --- a/drivers/phy/allwinner/phy-sun4i-usb.c > +++ b/drivers/phy/allwinner/phy-sun4i-usb.c > @@ -107,6 +107,7 @@ enum sun4i_usb_phy_type { > sun8i_r40_phy, > sun8i_v3s_phy, > sun50i_a64_phy, > + sun50i_a100_phy, But with that patch fixing the H6 support you don't need a new name, do you? Because below you just add the sun50i_a100_phy name next to every place with a sun50i_h6_phy check. > sun50i_h6_phy, > }; > > @@ -289,7 +290,13 @@ static int sun4i_usb_phy_init(struct phy *_phy) > } > > if (data->cfg->type == sun8i_a83t_phy || > + data->cfg->type == sun50i_a100_phy || > data->cfg->type == sun50i_h6_phy) { > + if (phy->pmu && data->cfg->enable_pmu_unk1) { > + val = readl(phy->pmu + REG_PMU_UNK1); > + writel(val & ~BIT(3), phy->pmu + REG_PMU_UNK1); > + } > + > if (phy->index == 0) { > val = readl(data->base + data->cfg->phyctl_offset); > val |= PHY_CTL_VBUSVLDEXT; > @@ -339,6 +346,7 @@ static int sun4i_usb_phy_exit(struct phy *_phy) > > if (phy->index == 0) { > if (data->cfg->type == sun8i_a83t_phy || > + data->cfg->type == sun50i_a100_phy || > data->cfg->type == sun50i_h6_phy) { > void __iomem *phyctl = data->base + > data->cfg->phyctl_offset; > @@ -960,6 +968,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, > + .type = sun50i_a100_phy, So you could just use the sun50i_h6_phy type here. Cheers, Andre > + .disc_thresh = 3, > + .phyctl_offset = REG_PHYCTL_A33, > + .dedicated_clocks = true, > + .enable_pmu_unk1 = true, > + .phy0_dual_route = true, > +}; > + > static const struct sun4i_usb_phy_cfg sun50i_h6_cfg = { > .num_phys = 4, > .type = sun50i_h6_phy, > @@ -983,6 +1001,7 @@ static const struct of_device_id sun4i_usb_phy_of_match[] = { > { .compatible = "allwinner,sun8i-v3s-usb-phy", .data = &sun8i_v3s_cfg }, > { .compatible = "allwinner,sun50i-a64-usb-phy", > .data = &sun50i_a64_cfg}, > + { .compatible = "allwinner,sun50i-a100-usb-phy", .data = &sun50i_a100_cfg }, > { .compatible = "allwinner,sun50i-h6-usb-phy", .data = &sun50i_h6_cfg }, > { }, > }; >