Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3664959rwl; Tue, 27 Dec 2022 12:55:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXumuzKyDDd8HevrRHQUso0dPhlzYCCpSDSyyG2/4UWmChXxdXsiorenFWw8esaXmjhoeCBn X-Received: by 2002:a17:907:6e05:b0:7c1:235d:2a2b with SMTP id sd5-20020a1709076e0500b007c1235d2a2bmr24673198ejc.24.1672174545002; Tue, 27 Dec 2022 12:55:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672174544; cv=none; d=google.com; s=arc-20160816; b=gm5gw/1trT7DaMQ25snbS9kbGsM6DWZwA7RirMI71F0+RMv97SGxUK8esalZpVoyN5 +FvfhIvAi2UEqOmTRu0WhcOOBCRO3rUHjpkVyAMRcAtfpaVvk4PcLm9EL/sGUqZU4fch e7nSEkjPRwrZd6hbpy2o+ZW91u0CFMBkTgOBZdUF12arr0CQD2I06F0XQwoRB1foCQUn qloRE37FCTbsfYeiYa6mNLD0Rs946cv+78Q0SpxNEyY00d+HpxJ26yIcQH+jW5IzCLgK kqlF/zBOlJbtqd+INKskCikeVYWZyp+XR3Lzwf5TeOWjpeTCtn7Q7MP4t/mVDZuPuPkf zNcA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=kJFTtxiotZoJV5BdSdpmMCdU2y0LmlkRPWUJearOYDw=; b=t4+S19lCfxAplZFnO8ZAPFX7vLH/QNQakdFuPBkAII37+sdRDrPVSHhEw56nxtHL4e dbnPEbfMKRTn48nmPxIEiMPA1rX75awysOwBkDwi+B7OwUJgYj0PJmaJA2pEthxrvgGw m5ICgBpkJGIgRGUBIT2iFqMxZYznfb2eZRpavymsVOOloXW6yCVVT8DdGtlmmASUND1I V9vP1WNdZQW/9ZlXDjqEm9pJGvk8jR0Jq3SwiqmLsLQii2XTwHGnX2GTlS4R+ayoWsRq oN53C02KD4W+WUOj4WDnPtyyFyAk49qgOSR1wuEOzsbr3RNNchMUNZaUFlZat4QOvnIb Xqww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pQWElqlF; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f8-20020a056402354800b004614acc0706si13185108edd.250.2022.12.27.12.55.29; Tue, 27 Dec 2022 12:55:44 -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=@kernel.org header.s=k20201202 header.b=pQWElqlF; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232881AbiL0Ul1 (ORCPT + 66 others); Tue, 27 Dec 2022 15:41:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232746AbiL0Uj0 (ORCPT ); Tue, 27 Dec 2022 15:39:26 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A410FFCC1; Tue, 27 Dec 2022 12:35:18 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7C33FB811F8; Tue, 27 Dec 2022 20:35:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D67FFC433D2; Tue, 27 Dec 2022 20:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672173315; bh=17q78AWH7ZS36A1H5pgoO7SU1wwmo9sZqO+Q1V9JmNc=; h=From:To:Cc:Subject:Date:From; b=pQWElqlF3knnZFTo07jtgss8Ml7LZy45UAsMGdgrcazfa0pO8D18PDrrJwahtaYwc D71ENkHTOdai5PfiyT0FX3tRS44OYLQWH0bgYwTMBy2GrtWpocH+AmgJpkWqemoWqA gxPntyK4+0Z7l3kIwTRwMksZ+J3hSkvbkXT7tiup8RfkNqDJDRtSVYgQcDUk+TY5Y2 zKDLER/3m6abEKmy8fTPyJYb59xX/E+fctveswCOlXkBCzDaH5zjS8xXCkiWF2tW/N C9mbubEg/aj0EuYfZym6ZsvQ4MTm+YvycKxgmdj8Lcpa0TB4cZsXUKLUV8UO8YqXSz /98e8hcwA7Iyw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andre Przywara , Samuel Holland , Vinod Koul , Sasha Levin , kishon@kernel.org, wens@csie.org, jernej.skrabec@gmail.com, wsa+renesas@sang-engineering.com, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH AUTOSEL 5.10 1/7] phy: sun4i-usb: Add support for the H616 USB PHY Date: Tue, 27 Dec 2022 15:35:04 -0500 Message-Id: <20221227203512.1214527-1-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 From: Andre Przywara [ Upstream commit 0f607406525d25019dd9c498bcc0b42734fc59d5 ] The USB PHY used in the Allwinner H616 SoC inherits some traits from its various predecessors: it has four full PHYs like the H3, needs some extra bits to be set like the H6, and puts SIDDQ on a different bit like the A100. Plus it needs this weird PHY2 quirk. Name all those properties in a new config struct and assign a new compatible name to it. Signed-off-by: Andre Przywara Reviewed-by: Samuel Holland Link: https://lore.kernel.org/r/20221031111358.3387297-5-andre.przywara@arm.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/allwinner/phy-sun4i-usb.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c index 651d5e2a25ce..230987e55ece 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c @@ -974,6 +974,17 @@ static const struct sun4i_usb_phy_cfg sun50i_h6_cfg = { .missing_phys = BIT(1) | BIT(2), }; +static const struct sun4i_usb_phy_cfg sun50i_h616_cfg = { + .num_phys = 4, + .type = sun50i_h6_phy, + .disc_thresh = 3, + .phyctl_offset = REG_PHYCTL_A33, + .dedicated_clocks = true, + .phy0_dual_route = true, + .hci_phy_ctl_clear = PHY_CTL_SIDDQ, + .needs_phy2_siddq = true, +}; + static const struct of_device_id sun4i_usb_phy_of_match[] = { { .compatible = "allwinner,sun4i-a10-usb-phy", .data = &sun4i_a10_cfg }, { .compatible = "allwinner,sun5i-a13-usb-phy", .data = &sun5i_a13_cfg }, @@ -988,6 +999,7 @@ static const struct of_device_id sun4i_usb_phy_of_match[] = { { .compatible = "allwinner,sun50i-a64-usb-phy", .data = &sun50i_a64_cfg}, { .compatible = "allwinner,sun50i-h6-usb-phy", .data = &sun50i_h6_cfg }, + { .compatible = "allwinner,sun50i-h616-usb-phy", .data = &sun50i_h616_cfg }, { }, }; MODULE_DEVICE_TABLE(of, sun4i_usb_phy_of_match); -- 2.35.1