phy: rockchip-inno-usb2: amend sm work to support legacy SoC
authorFrank Wang <frank.wang@rock-chips.com>
Wed, 15 Mar 2017 03:05:36 +0000 (11:05 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 16 Mar 2017 00:33:27 +0000 (08:33 +0800)
This adds amend logic of sm work to compatibly support some legacy SoCs,
because _host_utmi_linestate_ and _host_utmi_hostdisconnect_ GRF status
bits which are required for host sm work were not introduced in these
SoCs.

Change-Id: Ib4f499f592618930ac5016a63b7a530674aa6005
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
drivers/phy/phy-rockchip-inno-usb2.c

index 8a6120c..1471ea2 100644 (file)
@@ -916,6 +916,12 @@ static void rockchip_usb2phy_sm_work(struct work_struct *work)
        unsigned int ul_mask, uhd_mask;
        int ret;
 
+       if (!rport->port_cfg->utmi_ls.offset ||
+           !rport->port_cfg->utmi_hstdet.offset) {
+               dev_dbg(&rport->phy->dev, "some property may not be specified\n");
+               return;
+       }
+
        mutex_lock(&rport->mutex);
 
        ret = regmap_read(rphy->grf, rport->port_cfg->utmi_ls.offset, &ul);