From patchwork Wed Oct 16 07:37:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wang X-Patchwork-Id: 13837841 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 520D2D206AB for ; Wed, 16 Oct 2024 07:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=tE76eFeF0w5KNSCI8LEUq1pGIui/CIG/PhuBZfyVnmM=; b=hthZSoFivWdGeCuSiArDncZX0i o6Du4I7BEzIrJXwNlgQ2IiZRHYN355VdhCK1vEbSa8CBV0OvXS0WVUxR5KuPRtTaTHdqgaKvecAME vdtSjB4mpowktrIr7vI1WOFv66ce7L/Z3k28MWQGcpY4fl6VBgdwWv2DKgWF/152wj5+R9oHc6MyR MeVhUn9PQmz/98cP5EjV38HqZZgw8oHhFfP1lo4s/cxVpgSFwsyOF5P4+DXaJd/IGPrKVo6YxYlJ6 kMhHhOJsiTKtm5Po10MfqegFZQQzn0b4sk0odX3rWkR8TVYkAiVFoGfYsRkisDyDcZHrLXSnNQd8H jQjBaw3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0ycR-0000000Ar4q-0hw1; Wed, 16 Oct 2024 07:38:55 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0yax-0000000Aqey-1zYE; Wed, 16 Oct 2024 07:37:24 +0000 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-2e2e31aacbbso516415a91.2; Wed, 16 Oct 2024 00:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729064242; x=1729669042; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=tE76eFeF0w5KNSCI8LEUq1pGIui/CIG/PhuBZfyVnmM=; b=m7/5jAklhzubwzlNtBXwUC5Qlr6F6hduivO4gc9wXwA+kmsn+5MhMR/0O/GSRCkxGN F03P+dATJUOQiUHHsonj5MC6rADs0Li6AVz6DbO30e6DSvdLmlJsj9hpQB2dJVwJ03YX e7MAxtJR0FzlP/K8xJd8WaV53/JUAYP2VJ2UjOJ0uIO99itJPi7U/6BkKTekgaPHl/f0 CDqwwFbjedWJUKRImARUiM2tVl9O57NGPETcq88zWNPUAwQwDJg0lH996X5PctAIdXny OhvjT1MKLG6bSup7DVzE8qHS6rSN3n65VIdcL1w95c226XgJ381UR+KQwKS6pP32k8UV ds+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729064242; x=1729669042; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tE76eFeF0w5KNSCI8LEUq1pGIui/CIG/PhuBZfyVnmM=; b=LObBd8+TBJPLC67wmoGgYGLVF+vamqU4pig41GTwxpkoxy8gKqedbp7Xo1nX5eyItH Um6smQHO49/bXLQv/VSpfsudPQMbmPp8C6ujE8V7Dl7YqgZxs4Ighzwu56Tlg/k1uPh9 gpkO1tANIeynr28//R7+8HzUjWFmELna1EG5ufd3Xggg0lP1qwByk1R4ERPojoBFdu1V /PYBTkmfSNh3Swt+1n3rD/YDvVvnx1R6RL51FBF9csHTop0YTe5vT/CTf8Nm8QhwSQrz hb5d+0TgvqwPW2NqdemKkXFFXS+p62Ti1l2qIkfSyL2SsyXdhHAJSDdGk+QeOWMSfN0y 0WSg== X-Forwarded-Encrypted: i=1; AJvYcCU1Jjjvi8DUPaJnLbFMmHQOHvijmyCchDvUzNvggc+24Upk/LentFjDQLHKfbhFBHsO/dLuRXL5wOmKSpaTHYqQ@lists.infradead.org, AJvYcCUHUldGIvuOHiVWvFHtBXr24Ij/SlWp1mROrISRaT++acvwV2MXtcmP73bdzfGfztKzHYKcNnyV7mY8e48iW0M=@lists.infradead.org X-Gm-Message-State: AOJu0YyyxMrpDbxYj5GbqGgNK0nhKK6Bvajno+OaG/Ox8ym1b+ymN4FT TOjxtKsC/W7YLX1Abr/EjgO7oV0yYs4IxFWl6z8DIWv3O8sh4PLpP3xPRQ== X-Google-Smtp-Source: AGHT+IEhzIpQMDtfFdV12qVQsmmk7szjHI+s/s4R35Hmx1nztSoglJmv993u13LVpMZmItO0dLlVng== X-Received: by 2002:a17:90b:1d01:b0:2e3:1af7:6ead with SMTP id 98e67ed59e1d1-2e31af76f40mr7378844a91.5.1729064241915; Wed, 16 Oct 2024 00:37:21 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e3b7e6339fsm765471a91.1.2024.10.16.00.37.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 00:37:21 -0700 (PDT) From: Frank Wang To: vkoul@kernel.org, kishon@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, william.wu@rock-chips.com, tim.chen@rock-chips.com, Frank Wang Subject: [PATCH v6 1/4] phy: rockchip: inno-usb2: convert clock management to bulk Date: Wed, 16 Oct 2024 15:37:10 +0800 Message-Id: <20241016073713.14133-1-frawang.cn@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241016_003723_544382_E0C6FD7D X-CRM114-Status: GOOD ( 20.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Frank Wang Since some Rockchip SoCs (e.g RK3576) have more than one clock, this converts the clock management from single to bulk method to make the driver more flexible. Signed-off-by: Frank Wang Reviewed-by: Heiko Stuebner --- Changelog: v6: - add Reviewed tag. v5: - use dev_err_probe() in clock enable error path in probe. v4: - a new patch split from the [PATCH v3 2/2], suggestions from Heiko. v1-v3: - none drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 45 +++++++++++++++---- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 6e5214862b8a3..f71266c27091e 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -229,9 +229,10 @@ struct rockchip_usb2phy_port { * @dev: pointer to device. * @grf: General Register Files regmap. * @usbgrf: USB General Register Files regmap. - * @clk: clock struct of phy input clk. + * @clks: array of phy input clocks. * @clk480m: clock struct of phy output clk. * @clk480m_hw: clock struct of phy output clk management. + * @num_clks: number of phy input clocks. * @phy_reset: phy reset control. * @chg_state: states involved in USB charger detection. * @chg_type: USB charger types. @@ -246,9 +247,10 @@ struct rockchip_usb2phy { struct device *dev; struct regmap *grf; struct regmap *usbgrf; - struct clk *clk; + struct clk_bulk_data *clks; struct clk *clk480m; struct clk_hw clk480m_hw; + int num_clks; struct reset_control *phy_reset; enum usb_chg_state chg_state; enum power_supply_type chg_type; @@ -310,6 +312,13 @@ static int rockchip_usb2phy_reset(struct rockchip_usb2phy *rphy) return 0; } +static void rockchip_usb2phy_clk_bulk_disable(void *data) +{ + struct rockchip_usb2phy *rphy = data; + + clk_bulk_disable_unprepare(rphy->num_clks, rphy->clks); +} + static int rockchip_usb2phy_clk480m_prepare(struct clk_hw *hw) { struct rockchip_usb2phy *rphy = @@ -376,7 +385,9 @@ rockchip_usb2phy_clk480m_register(struct rockchip_usb2phy *rphy) { struct device_node *node = rphy->dev->of_node; struct clk_init_data init; + struct clk *refclk = NULL; const char *clk_name; + int i; int ret = 0; init.flags = 0; @@ -386,8 +397,15 @@ rockchip_usb2phy_clk480m_register(struct rockchip_usb2phy *rphy) /* optional override of the clockname */ of_property_read_string(node, "clock-output-names", &init.name); - if (rphy->clk) { - clk_name = __clk_get_name(rphy->clk); + for (i = 0; i < rphy->num_clks; i++) { + if (!strncmp(rphy->clks[i].id, "phyclk", 6)) { + refclk = rphy->clks[i].clk; + break; + } + } + + if (!IS_ERR(refclk)) { + clk_name = __clk_get_name(refclk); init.parent_names = &clk_name; init.num_parents = 1; } else { @@ -1399,15 +1417,26 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) if (IS_ERR(rphy->phy_reset)) return PTR_ERR(rphy->phy_reset); - rphy->clk = devm_clk_get_optional_enabled(dev, "phyclk"); - if (IS_ERR(rphy->clk)) - return dev_err_probe(&pdev->dev, PTR_ERR(rphy->clk), - "failed to get phyclk\n"); + ret = devm_clk_bulk_get_all(dev, &rphy->clks); + if (ret == -EPROBE_DEFER) + return dev_err_probe(&pdev->dev, -EPROBE_DEFER, + "failed to get phy clock\n"); + + /* Clocks are optional */ + rphy->num_clks = ret < 0 ? 0 : ret; ret = rockchip_usb2phy_clk480m_register(rphy); if (ret) return dev_err_probe(dev, ret, "failed to register 480m output clock\n"); + ret = clk_bulk_prepare_enable(rphy->num_clks, rphy->clks); + if (ret) + return dev_err_probe(dev, ret, "failed to enable phy clock\n"); + + ret = devm_add_action_or_reset(dev, rockchip_usb2phy_clk_bulk_disable, rphy); + if (ret) + return ret; + if (rphy->phy_cfg->phy_tuning) { ret = rphy->phy_cfg->phy_tuning(rphy); if (ret) From patchwork Wed Oct 16 07:37:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wang X-Patchwork-Id: 13837842 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 28AD5D206AB for ; Wed, 16 Oct 2024 07:40:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HdXBvIE3AExRgp3hXtIJcaBGzKqp9wpTyWZscjBbOt0=; b=WKVwUyuexFOjnew9Xs2KD+jJOe 7n1lTz9SZSUslq4l/laLoyDGOMvfPS2fade0HrwCb+LM42MhNYBBHsDeoV7A8K1VuGjX7Ufb2NbHJ xQI3lfPuFzT/A6FzCXtMEzGTRJgJppzxJaANBgMEDomp99EJQksar7udXm6iM41cDbEfF0rJOy0RD QjCfNXEIbljUwapL1EWc0so7QBCR0z3KK7aAlWChQRh7fYjauKV01o+xQ9hFNHUurw7e1IMNBLxSA tddGtTgvOE4FZO0EijdPRjnZzYXnKgaWgomiEIwP6g7yWvi6ER4iS5bFHkDwPahNJu2w21er74s4J ABdmqYUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0ydp-0000000ArKP-3b3y; Wed, 16 Oct 2024 07:40:21 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0yb2-0000000Aqg0-0Cpy; Wed, 16 Oct 2024 07:37:29 +0000 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2e2b4110341so1071938a91.1; Wed, 16 Oct 2024 00:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729064246; x=1729669046; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HdXBvIE3AExRgp3hXtIJcaBGzKqp9wpTyWZscjBbOt0=; b=Ot2PW80r/ZHrNeLJcXWUr2ZDJco3s/Wien4qOo8l7kHANmtCbjBd68/+4EK1A8Jnay B1d8EGfUA+a400YtOROMC+lRrwfRReMEZFu2CZvdBcuHYHb/uz+M2d14dadpTD1xy+R9 0H4g1Rk0/sCSWIx4HUihtjKe26iXxxwQsgk/LjgqdPI3aYDwzxojcJXOwUrwai6OQuel I4WGQmm+FyMZg7ubOccjR1g32JzgwGG8FplECIpOGWUY1EQRrHnTvnmgwrZ8ivBW6fZ+ eqThN4ewV4UyjnqzfiiLLrEwk9P/W+hh+ZdXLNYrzgUSpJAfoTEwvQRNlvcYiozWqYPM HcrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729064246; x=1729669046; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HdXBvIE3AExRgp3hXtIJcaBGzKqp9wpTyWZscjBbOt0=; b=MjBo9sF7H8MuEXRzghfe0KQ5iOHbF0PGb5bSgRdi50DJhPqfzVhQ0A3x1JG+wC5COb Ei9eq+ivkGpwnn5CeEi5DkQLdSi8iTNNjDTnh6P0H+7uwunMcBA/mX8y4InjBrOFAQrr 5NHi5xzVX0YcK10VNt7/1UFZZKHhAKN4Valz+Mpl5hC0Kt2zNo0V+14OJwlAVpXKur76 p9zX4S18mY4KmYgSf2x3M4/gDyOMuY8SIfy8ubD3ZiMNI8fR1V/itycmjB8eAE111X27 7m8UmxOZ+Jgcx0WNqKcvfJDyv8ISi/2+buAM/1nYt/zH8zQvt8Vm7vGGUqYosG+lbVXl dkRQ== X-Forwarded-Encrypted: i=1; AJvYcCUL+VAjM6aGH7lO5kOzfUG35w4bVMXlYf0GxbrqMhvAXEC0w2J2hfiEszh9I8SYUqwWdMCUn5DJ0BTAyIl4R4U=@lists.infradead.org, AJvYcCW539rAGXaCump4nUcTv+vTIGLCoZsJygLHYOzZY+JRt3XNP6Dwj5dfNNTrWl15GROXirXhpnOGiR7SqLQ3oeIH@lists.infradead.org X-Gm-Message-State: AOJu0YzxSN0CFJqGQXm/OA1Ydti/osUbYiRlSuiqN8KjhctnX5waDmPA jyGrJvwrgALCCn0+VOXJOmt6SRXS9wa3OmYX+ImZVEOuvnr6ueBH X-Google-Smtp-Source: AGHT+IHTFYf2RmMoLVt3mWD27psiArXEXPum3fHQrqEBzIUzKiTNe15MOy/O+7lWes5lJSM0AcAojg== X-Received: by 2002:a17:90a:680e:b0:2e2:e139:447d with SMTP id 98e67ed59e1d1-2e3b786ebacmr895197a91.0.1729064246313; Wed, 16 Oct 2024 00:37:26 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e3b7e6339fsm765471a91.1.2024.10.16.00.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 00:37:26 -0700 (PDT) From: Frank Wang To: vkoul@kernel.org, kishon@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, william.wu@rock-chips.com, tim.chen@rock-chips.com, Frank Wang Subject: [PATCH v6 2/4] dt-bindings: soc: rockchip: add rk3576 usb2phy syscon Date: Wed, 16 Oct 2024 15:37:11 +0800 Message-Id: <20241016073713.14133-2-frawang.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241016073713.14133-1-frawang.cn@gmail.com> References: <20241016073713.14133-1-frawang.cn@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241016_003728_160205_668BAAA3 X-CRM114-Status: UNSURE ( 9.53 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Frank Wang The usb2phy is accessible via a syscon registers on RK3576, similar to RK3588. Signed-off-by: Frank Wang Acked-by: Rob Herring (Arm) --- Changelog: v6: - This is a new patch adds rk3576-usb2phy-grf syscon. v1-v5: - none Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml index 50d727f4b76c6..62a28cb2bc7bb 100644 --- a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml +++ b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml @@ -80,6 +80,7 @@ properties: - rockchip,rk3568-pmugrf - rockchip,rk3576-ioc-grf - rockchip,rk3576-pmu0-grf + - rockchip,rk3576-usb2phy-grf - rockchip,rk3588-usb2phy-grf - rockchip,rv1108-grf - rockchip,rv1108-pmugrf @@ -233,6 +234,7 @@ allOf: - rockchip,rk3308-usb2phy-grf - rockchip,rk3328-usb2phy-grf - rockchip,rk3399-grf + - rockchip,rk3576-usb2phy-grf - rockchip,rk3588-usb2phy-grf - rockchip,rv1108-grf From patchwork Wed Oct 16 07:37:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wang X-Patchwork-Id: 13837843 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 BDA66D206A5 for ; Wed, 16 Oct 2024 07:42:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gWSEFSMMBQYiRpWJwnlSGcr6/Rh83dU+uSxZqVGEbSU=; b=bxwKogmX4qOKGO/LKkNDwIz5BY 6ukU44s0XtR5WOF77MEncmw4E8jSAcIF6TqmZ1mxGRdIwF2zXVPjYtKAQzYuadOiuQ0lWVx+p8CEd UuBHr+v+Ncx61Jgl9Mmxi/JFqWCuvzp26+WfISRq7hOVbdV4W7b7gTYsmJPwwSV2jxmvZY2b+Z1Ua 7oQpuHSMu8oO/tsMhq/Pz0utSnCrPo9TJllhV3zz37IneYIGF/ec/t7bPxL4YLRugX5DpPCP4vkij 1iVDTZHjAcRJirI7FK5TlsYDnMcUTwtVtvsUKj3SQVvfzgTjfLbRaWqsiYpEU2CkV8h+fmFI+tNOz V0vxkTDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0yfG-0000000Arht-3Itk; Wed, 16 Oct 2024 07:41:50 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0yb6-0000000Aqhb-1zt8; Wed, 16 Oct 2024 07:37:34 +0000 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2e2af4dca5cso1208719a91.3; Wed, 16 Oct 2024 00:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729064251; x=1729669051; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gWSEFSMMBQYiRpWJwnlSGcr6/Rh83dU+uSxZqVGEbSU=; b=dMpMZ6OMG5582PE5BJc5d9ROXuxwlk0jtqu/ueaX0Rzh7YOzoGRHuNEKfWZLSFig+W QW5berBHSc0RISfmzggPv7wT3pLd6eUoTHTNixOJEyerW4KHgbdNoSDbDb6Fk1sMRDfc wfQ7tVy+mMIYWEGDtbFghtCghKoGx9AeZXtfhoD8k+hYRPzl5+RtXDYWAJpurqRiEM73 lSVxJnmycjB4LnkktbVhPPRuoRh8jBX6PbaMiJMo4IxDiA1d971+0ojpL49RMeq5LGdp vFjJzxwaw7A9IKXaWQGUmaCeLQpszfaR/QYfnWGRlQGA29ICOVLtG6x8eIrXUQOYC1zk 1TYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729064251; x=1729669051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gWSEFSMMBQYiRpWJwnlSGcr6/Rh83dU+uSxZqVGEbSU=; b=OrkwfjoNdiKxx0zEfQMZ3406m7wTM5g6pxV8KD3wqEmjtnWDml35TxPfFnDbGv9OvJ s4eKKsWs4he1cH+v/oTRw62ED/nexvOMm6hf2/tIKslu9/4utDCPHQJnATJa0y6rJZUs quW4xgDfCyI9QeOCRufBxFmIXdsR0WfNH8Kg1hwdjJYExuCr2rt7F6Ld8JWFKd2DtiIq 1x+6NAYnSOEk5ffmkYc1l7xfrfMTfxY4FfGW/R2iOZpJxNiQHiOsQpwQxR77Zw6OpkKe V3yhFOcC45UXHwJBgGHFYXyNEhzqaCRcYvkCDV9ag0iptW68Gia7Vq3DAX4bBXEclcda ivdQ== X-Forwarded-Encrypted: i=1; AJvYcCU70bzxhyQUAZZb1sHVWTUHYq/uSeHHkr9lHlqYk/GfZgEsnqMymb5xOFKuR6z2RjeI2I3ZTDwMyIH5UPflVl4t@lists.infradead.org, AJvYcCVSySbEC8LwpNTm7wkTBpl3yStlNBjwVbzHud7oPG4A5kTqmFFAulB0xBiPtlvLJ0kwWN5QZInJ1o75RiEkJSc=@lists.infradead.org X-Gm-Message-State: AOJu0YzLz3TWdF6BDK16HqndPejoZp4TymqSij9Ql5tmaPAoBQUQsQCP wGc4gErKjYp3Ohb8PoA/6HfXTzuGOufiiLS9xMkw8YxRNaYwsAhQ X-Google-Smtp-Source: AGHT+IG+duC4aYKYaW4Rt7FIJuOoR2u1R7C7pf1VvmTfz6iWzqjOEFF3pQSPiFSy/hZ/ZE2cJCCmoQ== X-Received: by 2002:a17:90a:d98a:b0:2e2:abab:c458 with SMTP id 98e67ed59e1d1-2e2f0dd1cb0mr8956565a91.8.1729064250913; Wed, 16 Oct 2024 00:37:30 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e3b7e6339fsm765471a91.1.2024.10.16.00.37.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 00:37:30 -0700 (PDT) From: Frank Wang To: vkoul@kernel.org, kishon@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, william.wu@rock-chips.com, tim.chen@rock-chips.com, Frank Wang , Krzysztof Kozlowski Subject: [PATCH v6 3/4] dt-bindings: phy: rockchip,inno-usb2phy: add rk3576 Date: Wed, 16 Oct 2024 15:37:12 +0800 Message-Id: <20241016073713.14133-3-frawang.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241016073713.14133-1-frawang.cn@gmail.com> References: <20241016073713.14133-1-frawang.cn@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241016_003732_552079_C6074A11 X-CRM114-Status: GOOD ( 11.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Frank Wang Add compatible for the USB2 phy in the Rockchip RK3576 SoC. This change also refactor the clocks list as there are new clocks adding used for the USB MMU in RK3576 SoC. Signed-off-by: Frank Wang Reviewed-by: Krzysztof Kozlowski --- Changelog: v6: - add Reviewed tag. v5: - move the clock-names item list to top-level property. - only defined minItems/maxItems in each if: then block. v4: - refactor the clocks list used if:then: v3: - narrowed rk3576 clocks by compatible property. v2: - Categorize clock names by oneOf keyword. v1: - https://patchwork.kernel.org/project/linux-phy/patch/20240923025326.10467-1-frank.wang@rock-chips.com/ .../bindings/phy/rockchip,inno-usb2phy.yaml | 45 ++++++++++++++++++- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml b/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml index 5254413137c64..6a7ef556414ce 100644 --- a/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml +++ b/Documentation/devicetree/bindings/phy/rockchip,inno-usb2phy.yaml @@ -20,6 +20,7 @@ properties: - rockchip,rk3366-usb2phy - rockchip,rk3399-usb2phy - rockchip,rk3568-usb2phy + - rockchip,rk3576-usb2phy - rockchip,rk3588-usb2phy - rockchip,rv1108-usb2phy @@ -34,10 +35,15 @@ properties: const: 0 clocks: - maxItems: 1 + minItems: 1 + maxItems: 3 clock-names: - const: phyclk + minItems: 1 + items: + - const: phyclk + - const: aclk + - const: aclk_slv assigned-clocks: description: @@ -172,6 +178,41 @@ allOf: - interrupts - interrupt-names + - if: + properties: + compatible: + contains: + enum: + - rockchip,px30-usb2phy + - rockchip,rk3128-usb2phy + - rockchip,rk3228-usb2phy + - rockchip,rk3308-usb2phy + - rockchip,rk3328-usb2phy + - rockchip,rk3366-usb2phy + - rockchip,rk3399-usb2phy + - rockchip,rk3568-usb2phy + - rockchip,rk3588-usb2phy + - rockchip,rv1108-usb2phy + then: + properties: + clocks: + maxItems: 1 + clock-names: + maxItems: 1 + + - if: + properties: + compatible: + contains: + enum: + - rockchip,rk3576-usb2phy + then: + properties: + clocks: + minItems: 3 + clock-names: + minItems: 3 + additionalProperties: false examples: From patchwork Wed Oct 16 07:37:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wang X-Patchwork-Id: 13837848 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 41740D206A5 for ; Wed, 16 Oct 2024 07:43:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9C+E1L253WMVxfeelIFI5Qx/2DDRuIfxkrOoa5l+CjA=; b=g/CbNwthM0miSTRd412wqE8uE6 r03IcHHzggqcaa9ga2oiTl/rxYbfXEJYtgBlRNHru4koHlaFPkU/C+X4vRHsyTqFLXNEkUDYdLbMA qpblOvkZobS43ejioq6FF8Ysf2ruXKcfXsgjy8b2UpZSkhfLIR1O6EFihgELJ8DCpudoEkCdZTgv1 HSYknyZNFzJ8URtVkHyQ7SrFifPLloS3vL8XWFioegJXY9NZQM++ZHeaFJOJaVgY/kZFLKC0v3CoU 9imy7mXU4qnsnX4bgGD+ttjUBL5QKZn/u6GBXKRKSl35OUmy5Y4XAqMEYIFLQYn24ezCSxwpZqX5I 75uYpuWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0yge-0000000Arrc-0hGW; Wed, 16 Oct 2024 07:43:16 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0ybA-0000000AqjI-3oOd; Wed, 16 Oct 2024 07:37:38 +0000 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-2e2da8529e1so1062541a91.1; Wed, 16 Oct 2024 00:37:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729064255; x=1729669055; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9C+E1L253WMVxfeelIFI5Qx/2DDRuIfxkrOoa5l+CjA=; b=JpUL6QTMEgzZxfHBjDQeWCn8CzzKarJ+OknA+3LiPDY2c22ez+UZ0gzkaiWah3vdKz GZkLQv+0B/d7uDSLeYQtP/LzKRdxFqcKPEXSftqWy8iAnCCAQ33Z0guNVjws91ris/LW BdgvtcUMCQUGwNHV8AFWAKxEpVgxM8x+z4VBO1tTZ8GRRW2BGRXwGcCMUb9jPJAUmUDz V58rPt0yaa6SZcp33syK12uPUTV4HDxMf8XsEucUO2RSRdu10VXYPRVcRoRU/MzgqWeR kma2Gnb+onUH5aHruSUIEo2w/JjmUikoibff9pCaM1cavqB0AozoH+l1G7Ut2C4ZDVgN b16g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729064255; x=1729669055; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9C+E1L253WMVxfeelIFI5Qx/2DDRuIfxkrOoa5l+CjA=; b=NmcSM6r6H2ayjP+0d3L3j9W4y/YGCj9JzM813lnPaGrJKxvc7113SacG+Ec30jbGQY coxHp/fc9PKeikgEZhViCyAJZE6FbedN6hePxhceEPzepySf2YAbbqJRpb0JBU6WNTWZ ZOpfsnrCKGstDKL1J0rbatKux7cRc4rWtWW1Qrm1WsELN+8Cq6q4it0iK9p4fKbd8jX/ 8egh2e1sUFT5s+FQfD4pRxM4cBeVmi6lx6rlW6TxFfVRGzfYD8EKVoVwW1OzXch4ziix 0UpGvPmcI3bggW42dZ3V0fzG3kz+DmYL+NUUmoXF4qnXt2hvpzZy220eAgrec3gydSqq Do9A== X-Forwarded-Encrypted: i=1; AJvYcCUJFihmXvPkSBpRZWj9mFOq4cjLcu5CbOVYNtOOM8NIuLg3wcrU6kPgNzfxOzzUbg6TgmghWZ9PQ5UHwTAnk6Y=@lists.infradead.org, AJvYcCUsXoQd2GECHYsJt294j/9+qr4jYzuJWNgSh4xUk4izG1J//7Zjw8VXWo4hbvV8JJvfdZcud1e1XvyfOUO5yOMy@lists.infradead.org X-Gm-Message-State: AOJu0YzZP/g1cj7wKxoOVxad6Lb8GAA2I7BvtkHpqEMIu1qavqz5Earf QRBbvHVO2g2fyXkNWx62KLsIFKPYZ//oABV2sFOHuprhnNy83/Ll X-Google-Smtp-Source: AGHT+IHXcrmycBW/mhxkk7pwUeMRxrs83n43VhXPHi3ArbQCgQM01RLXKXNpfnb6PobTpa0PowneLg== X-Received: by 2002:a17:90b:a16:b0:2e2:d1c0:758a with SMTP id 98e67ed59e1d1-2e2f0db90f3mr8554413a91.8.1729064255233; Wed, 16 Oct 2024 00:37:35 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e3b7e6339fsm765471a91.1.2024.10.16.00.37.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 00:37:34 -0700 (PDT) From: Frank Wang To: vkoul@kernel.org, kishon@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, william.wu@rock-chips.com, tim.chen@rock-chips.com, Frank Wang Subject: [PATCH v6 4/4] phy: rockchip: inno-usb2: Add usb2 phys support for rk3576 Date: Wed, 16 Oct 2024 15:37:13 +0800 Message-Id: <20241016073713.14133-4-frawang.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241016073713.14133-1-frawang.cn@gmail.com> References: <20241016073713.14133-1-frawang.cn@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241016_003736_995500_75A6CDC2 X-CRM114-Status: GOOD ( 15.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: William Wu The RK3576 SoC has two independent USB2.0 PHYs, and each PHY has one port. This adds device specific data for it. Signed-off-by: William Wu Signed-off-by: Frank Wang Reviewed-by: Heiko Stuebner --- Changelog: v6: - add Reviewed tag. v5: - no changes. v4: - split the bulk clock management as a new patch, and this just leave adding rk3576-specific data. v3: - amend the commit log adds clocks converting. - retrieve the clock by "clks.id" in *_clk480m_register() function. v2: - no changes. v1: - https://patchwork.kernel.org/project/linux-phy/patch/20240923025326.10467-2-frank.wang@rock-chips.com/ drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index f71266c27091e..96f3d868a526f 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1510,6 +1510,30 @@ static int rk3128_usb2phy_tuning(struct rockchip_usb2phy *rphy) BIT(2) << BIT_WRITEABLE_SHIFT | 0); } +static int rk3576_usb2phy_tuning(struct rockchip_usb2phy *rphy) +{ + int ret; + u32 reg = rphy->phy_cfg->reg; + + /* Deassert SIDDQ to power on analog block */ + ret = regmap_write(rphy->grf, reg + 0x0010, GENMASK(29, 29) | 0x0000); + if (ret) + return ret; + + /* Do reset after exit IDDQ mode */ + ret = rockchip_usb2phy_reset(rphy); + if (ret) + return ret; + + /* HS DC Voltage Level Adjustment 4'b1001 : +5.89% */ + ret |= regmap_write(rphy->grf, reg + 0x000c, GENMASK(27, 24) | 0x0900); + + /* HS Transmitter Pre-Emphasis Current Control 2'b10 : 2x */ + ret |= regmap_write(rphy->grf, reg + 0x0010, GENMASK(20, 19) | 0x0010); + + return ret; +} + static int rk3588_usb2phy_tuning(struct rockchip_usb2phy *rphy) { int ret; @@ -1938,6 +1962,84 @@ static const struct rockchip_usb2phy_cfg rk3568_phy_cfgs[] = { { /* sentinel */ } }; +static const struct rockchip_usb2phy_cfg rk3576_phy_cfgs[] = { + { + .reg = 0x0, + .num_ports = 1, + .phy_tuning = rk3576_usb2phy_tuning, + .clkout_ctl = { 0x0008, 0, 0, 1, 0 }, + .port_cfgs = { + [USB2PHY_PORT_OTG] = { + .phy_sus = { 0x0000, 8, 0, 0, 0x1d1 }, + .bvalid_det_en = { 0x00c0, 1, 1, 0, 1 }, + .bvalid_det_st = { 0x00c4, 1, 1, 0, 1 }, + .bvalid_det_clr = { 0x00c8, 1, 1, 0, 1 }, + .ls_det_en = { 0x00c0, 0, 0, 0, 1 }, + .ls_det_st = { 0x00c4, 0, 0, 0, 1 }, + .ls_det_clr = { 0x00c8, 0, 0, 0, 1 }, + .disfall_en = { 0x00c0, 6, 6, 0, 1 }, + .disfall_st = { 0x00c4, 6, 6, 0, 1 }, + .disfall_clr = { 0x00c8, 6, 6, 0, 1 }, + .disrise_en = { 0x00c0, 5, 5, 0, 1 }, + .disrise_st = { 0x00c4, 5, 5, 0, 1 }, + .disrise_clr = { 0x00c8, 5, 5, 0, 1 }, + .utmi_avalid = { 0x0080, 1, 1, 0, 1 }, + .utmi_bvalid = { 0x0080, 0, 0, 0, 1 }, + .utmi_ls = { 0x0080, 5, 4, 0, 1 }, + } + }, + .chg_det = { + .cp_det = { 0x0080, 8, 8, 0, 1 }, + .dcp_det = { 0x0080, 8, 8, 0, 1 }, + .dp_det = { 0x0080, 9, 9, 1, 0 }, + .idm_sink_en = { 0x0010, 5, 5, 1, 0 }, + .idp_sink_en = { 0x0010, 5, 5, 0, 1 }, + .idp_src_en = { 0x0010, 14, 14, 0, 1 }, + .rdm_pdwn_en = { 0x0010, 14, 14, 0, 1 }, + .vdm_src_en = { 0x0010, 7, 6, 0, 3 }, + .vdp_src_en = { 0x0010, 7, 6, 0, 3 }, + }, + }, + { + .reg = 0x2000, + .num_ports = 1, + .phy_tuning = rk3576_usb2phy_tuning, + .clkout_ctl = { 0x2008, 0, 0, 1, 0 }, + .port_cfgs = { + [USB2PHY_PORT_OTG] = { + .phy_sus = { 0x2000, 8, 0, 0, 0x1d1 }, + .bvalid_det_en = { 0x20c0, 1, 1, 0, 1 }, + .bvalid_det_st = { 0x20c4, 1, 1, 0, 1 }, + .bvalid_det_clr = { 0x20c8, 1, 1, 0, 1 }, + .ls_det_en = { 0x20c0, 0, 0, 0, 1 }, + .ls_det_st = { 0x20c4, 0, 0, 0, 1 }, + .ls_det_clr = { 0x20c8, 0, 0, 0, 1 }, + .disfall_en = { 0x20c0, 6, 6, 0, 1 }, + .disfall_st = { 0x20c4, 6, 6, 0, 1 }, + .disfall_clr = { 0x20c8, 6, 6, 0, 1 }, + .disrise_en = { 0x20c0, 5, 5, 0, 1 }, + .disrise_st = { 0x20c4, 5, 5, 0, 1 }, + .disrise_clr = { 0x20c8, 5, 5, 0, 1 }, + .utmi_avalid = { 0x2080, 1, 1, 0, 1 }, + .utmi_bvalid = { 0x2080, 0, 0, 0, 1 }, + .utmi_ls = { 0x2080, 5, 4, 0, 1 }, + } + }, + .chg_det = { + .cp_det = { 0x2080, 8, 8, 0, 1 }, + .dcp_det = { 0x2080, 8, 8, 0, 1 }, + .dp_det = { 0x2080, 9, 9, 1, 0 }, + .idm_sink_en = { 0x2010, 5, 5, 1, 0 }, + .idp_sink_en = { 0x2010, 5, 5, 0, 1 }, + .idp_src_en = { 0x2010, 14, 14, 0, 1 }, + .rdm_pdwn_en = { 0x2010, 14, 14, 0, 1 }, + .vdm_src_en = { 0x2010, 7, 6, 0, 3 }, + .vdp_src_en = { 0x2010, 7, 6, 0, 3 }, + }, + }, + { /* sentinel */ } +}; + static const struct rockchip_usb2phy_cfg rk3588_phy_cfgs[] = { { .reg = 0x0000, @@ -2109,6 +2211,7 @@ static const struct of_device_id rockchip_usb2phy_dt_match[] = { { .compatible = "rockchip,rk3366-usb2phy", .data = &rk3366_phy_cfgs }, { .compatible = "rockchip,rk3399-usb2phy", .data = &rk3399_phy_cfgs }, { .compatible = "rockchip,rk3568-usb2phy", .data = &rk3568_phy_cfgs }, + { .compatible = "rockchip,rk3576-usb2phy", .data = &rk3576_phy_cfgs }, { .compatible = "rockchip,rk3588-usb2phy", .data = &rk3588_phy_cfgs }, { .compatible = "rockchip,rv1108-usb2phy", .data = &rv1108_phy_cfgs }, {}