Skip to content

Commit 3ca48b9

Browse files
mmindvinodkoul
authored andcommitted
phy: rockchip: inno-usb2: add phy definition for rk3036
The usb2phy on rk3036 is very similar to rk3128 but not 100% identical. While most registers and bits are the same, a small fraction did get moved around. So we can re-use the phy-tuning function, but need a new set a bits. The biggest change might be that the phy on rk3036 does not support the charger detection, that rk3128 (and newer phys) have. Signed-off-by: Heiko Stuebner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent d78b565 commit 3ca48b9

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

drivers/phy/rockchip/phy-rockchip-inno-usb2.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,37 @@ static int rk3588_usb2phy_tuning(struct rockchip_usb2phy *rphy)
15831583
return ret;
15841584
}
15851585

1586+
static const struct rockchip_usb2phy_cfg rk3036_phy_cfgs[] = {
1587+
{
1588+
.reg = 0x17c,
1589+
.num_ports = 2,
1590+
.phy_tuning = rk3128_usb2phy_tuning,
1591+
.clkout_ctl = { 0x017c, 11, 11, 1, 0 },
1592+
.port_cfgs = {
1593+
[USB2PHY_PORT_OTG] = {
1594+
.phy_sus = { 0x017c, 8, 0, 0, 0x1d1 },
1595+
.bvalid_det_en = { 0x017c, 14, 14, 0, 1 },
1596+
.bvalid_det_st = { 0x017c, 15, 15, 0, 1 },
1597+
.bvalid_det_clr = { 0x017c, 15, 15, 0, 1 },
1598+
.ls_det_en = { 0x017c, 12, 12, 0, 1 },
1599+
.ls_det_st = { 0x017c, 13, 13, 0, 1 },
1600+
.ls_det_clr = { 0x017c, 13, 13, 0, 1 },
1601+
.utmi_bvalid = { 0x014c, 8, 8, 0, 1 },
1602+
.utmi_id = { 0x014c, 11, 11, 0, 1 },
1603+
.utmi_ls = { 0x014c, 10, 9, 0, 1 },
1604+
1605+
},
1606+
[USB2PHY_PORT_HOST] = {
1607+
.phy_sus = { 0x0194, 8, 0, 0, 0x1d1 },
1608+
.ls_det_en = { 0x0194, 14, 14, 0, 1 },
1609+
.ls_det_st = { 0x0194, 15, 15, 0, 1 },
1610+
.ls_det_clr = { 0x0194, 15, 15, 0, 1 }
1611+
}
1612+
},
1613+
},
1614+
{ /* sentinel */ }
1615+
};
1616+
15861617
static const struct rockchip_usb2phy_cfg rk3128_phy_cfgs[] = {
15871618
{
15881619
.reg = 0x17c,
@@ -2204,6 +2235,7 @@ static const struct rockchip_usb2phy_cfg rv1108_phy_cfgs[] = {
22042235

22052236
static const struct of_device_id rockchip_usb2phy_dt_match[] = {
22062237
{ .compatible = "rockchip,px30-usb2phy", .data = &rk3328_phy_cfgs },
2238+
{ .compatible = "rockchip,rk3036-usb2phy", .data = &rk3036_phy_cfgs },
22072239
{ .compatible = "rockchip,rk3128-usb2phy", .data = &rk3128_phy_cfgs },
22082240
{ .compatible = "rockchip,rk3228-usb2phy", .data = &rk3228_phy_cfgs },
22092241
{ .compatible = "rockchip,rk3308-usb2phy", .data = &rk3308_phy_cfgs },

0 commit comments

Comments
 (0)