From 42ee2ffcdeb8968f89acc82c6f742926b9781192 Mon Sep 17 00:00:00 2001 From: William Wu Date: Wed, 8 Aug 2018 15:42:43 +0800 Subject: [PATCH] phy: rockchip: rockchip-inno-usb2: and otg cfg for rk3368 This patch adds rk3368 otg-port phy configurations. But actually, we don't use the otg phy configurations for the time being, because we use dwc_otg_310 driver for rk3368 otg controller, and this driver doesn't use generic phy. This patch is useful if we switch to dwc2 driver for rk3368 otg in the feature. Change-Id: Ibed3fde4ef64ad25e933ac4560f956b7c9f5c476 Signed-off-by: William Wu Signed-off-by: Frank Wang --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 66bd3856eb7c..d0d7f1af2d29 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -2448,6 +2448,27 @@ static const struct rockchip_usb2phy_cfg rk3368_phy_cfgs[] = { .num_ports = 2, .clkout_ctl = { 0x0724, 15, 15, 1, 0 }, .port_cfgs = { + [USB2PHY_PORT_OTG] = { + .phy_sus = { 0x0700, 8, 0, 0, 0x1d1 }, + .bvalid_det_en = { 0x0680, 3, 3, 0, 1 }, + .bvalid_det_st = { 0x0690, 3, 3, 0, 1 }, + .bvalid_det_clr = { 0x06a0, 3, 3, 0, 1 }, + .iddig_output = { 0x0700, 10, 10, 0, 1 }, + .iddig_en = { 0x0700, 9, 9, 0, 1 }, + .idfall_det_en = { 0x0680, 6, 6, 0, 1 }, + .idfall_det_st = { 0x0690, 6, 6, 0, 1 }, + .idfall_det_clr = { 0x06a0, 6, 6, 0, 1 }, + .idrise_det_en = { 0x0680, 5, 5, 0, 1 }, + .idrise_det_st = { 0x0690, 5, 5, 0, 1 }, + .idrise_det_clr = { 0x06a0, 5, 5, 0, 1 }, + .ls_det_en = { 0x0680, 2, 2, 0, 1 }, + .ls_det_st = { 0x0690, 2, 2, 0, 1 }, + .ls_det_clr = { 0x06a0, 2, 2, 0, 1 }, + .utmi_bvalid = { 0x04bc, 23, 23, 0, 1 }, + .utmi_iddig = { 0x04bc, 26, 26, 0, 1 }, + .utmi_ls = { 0x04bc, 25, 24, 0, 1 }, + .vbus_det_en = { 0x079c, 15, 15, 1, 0 }, + }, [USB2PHY_PORT_HOST] = { .phy_sus = { 0x0728, 8, 0, 0, 0x1d1 }, .ls_det_en = { 0x0680, 4, 4, 0, 1 }, @@ -2455,6 +2476,18 @@ static const struct rockchip_usb2phy_cfg rk3368_phy_cfgs[] = { .ls_det_clr = { 0x06a0, 4, 4, 0, 1 } } }, + .chg_det = { + .opmode = { 0x0700, 3, 0, 5, 1 }, + .cp_det = { 0x04b8, 30, 30, 0, 1 }, + .dcp_det = { 0x04b8, 29, 29, 0, 1 }, + .dp_det = { 0x04b8, 31, 31, 0, 1 }, + .idm_sink_en = { 0x0718, 8, 8, 0, 1 }, + .idp_sink_en = { 0x0718, 7, 7, 0, 1 }, + .idp_src_en = { 0x0718, 9, 9, 0, 1 }, + .rdm_pdwn_en = { 0x0718, 10, 10, 0, 1 }, + .vdm_src_en = { 0x0718, 12, 12, 0, 1 }, + .vdp_src_en = { 0x0718, 11, 11, 0, 1 }, + }, }, { /* sentinel */ } };