Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1655877
| From | Frank Wang <frank.wang@rock-chips.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 3/4] phy: rockchip-inno-usb2: add one phy comprises with two host-ports support |
| Date | 2017-06-02 05:30 +0200 |
| Message-ID | <tNLrI-3yD-25@gated-at.bofh.it> (permalink) |
| References | <tNLrH-3yD-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: William Wu <william.wu@rock-chips.com>
At the current rockchip-inno-usb2 phy driver framework, it can
only support usb2-phy which comprises with one otg-port and one
host-port.
However, some Rockchip SoCs' (e.g RK3228, RK3229) usb2-phy comprises
with two host-ports, so we use index of otg id for one host-port
configuration, and make it work the same as otg-port host mode.
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
---
drivers/phy/phy-rockchip-inno-usb2.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/phy/phy-rockchip-inno-usb2.c b/drivers/phy/phy-rockchip-inno-usb2.c
index d6e459d..d026b4cf 100644
--- a/drivers/phy/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/phy-rockchip-inno-usb2.c
@@ -406,7 +406,8 @@ static int rockchip_usb2phy_init(struct phy *phy)
mutex_lock(&rport->mutex);
if (rport->port_id == USB2PHY_PORT_OTG) {
- if (rport->mode != USB_DR_MODE_HOST) {
+ if (rport->mode != USB_DR_MODE_HOST &&
+ rport->mode != USB_DR_MODE_UNKNOWN) {
/* clear bvalid status and enable bvalid detect irq */
ret = property_enable(rphy,
&rport->port_cfg->bvalid_det_clr,
@@ -496,7 +497,8 @@ static int rockchip_usb2phy_exit(struct phy *phy)
struct rockchip_usb2phy_port *rport = phy_get_drvdata(phy);
if (rport->port_id == USB2PHY_PORT_OTG &&
- rport->mode != USB_DR_MODE_HOST) {
+ rport->mode != USB_DR_MODE_HOST &&
+ rport->mode != USB_DR_MODE_UNKNOWN) {
cancel_delayed_work_sync(&rport->otg_sm_work);
cancel_delayed_work_sync(&rport->chg_work);
} else if (rport->port_id == USB2PHY_PORT_HOST)
@@ -973,7 +975,8 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy,
mutex_init(&rport->mutex);
rport->mode = of_usb_get_dr_mode_by_phy(child_np, -1);
- if (rport->mode == USB_DR_MODE_HOST) {
+ if (rport->mode == USB_DR_MODE_HOST ||
+ rport->mode == USB_DR_MODE_UNKNOWN) {
ret = 0;
goto out;
}
--
2.0.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 0/4] fix some issues for Rockchip usb2-phy and add rk3228 SoCs' support Frank Wang <frank.wang@rock-chips.com> - 2017-06-02 05:30 +0200 [PATCH v2 1/4] phy: rockchip-inno-usb2: add a delay after phy resume Frank Wang <frank.wang@rock-chips.com> - 2017-06-02 05:30 +0200 [PATCH v2 2/4] phy: rockchip-inno-usb2: increase otg sm work first schedule time Frank Wang <frank.wang@rock-chips.com> - 2017-06-02 05:30 +0200 [PATCH v2 3/4] phy: rockchip-inno-usb2: add one phy comprises with two host-ports support Frank Wang <frank.wang@rock-chips.com> - 2017-06-02 05:30 +0200 Re: [PATCH v2 0/4] fix some issues for Rockchip usb2-phy and add rk3228 SoCs' support Kishon Vijay Abraham I <kishon@ti.com> - 2017-06-02 12:20 +0200
csiph-web