[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <b323d8c7ea4eb6bc325f6a6465cb2547cc6be757.1604988979.git.frank@allwinnertech.com>
Date: Tue, 10 Nov 2020 14:40:32 +0800
From: Frank Lee <frank@...winnertech.com>
To: tiny.windzz@...il.com
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Yangtao Li <frank@...winnertech.com>,
Kishon Vijay Abraham I <kishon@...com>,
Vinod Koul <vkoul@...nel.org>,
Maxime Ripard <mripard@...nel.org>,
Chen-Yu Tsai <wens@...e.org>,
Randy Dunlap <rdunlap@...radead.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
Colin Ian King <colin.king@...onical.com>
Subject: [RESEND PATCH 13/19] phy: sun4i-usb: add support for A100 USB PHY
From: Yangtao Li <frank@...winnertech.com>
Add support for a100's usb phy, which with 2 PHYs.
Signed-off-by: Yangtao Li <frank@...winnertech.com>
---
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,
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,
+ .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 },
{ },
};
--
2.28.0
Powered by blists - more mailing lists