From: Frank Wang Date: Wed, 15 Mar 2017 03:05:36 +0000 (+0800) Subject: phy: rockchip-inno-usb2: amend sm work to support legacy SoC X-Git-Tag: firefly_0821_release~325 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6f32ea684e1eb2e5f2654dca39704240673429cd;p=firefly-linux-kernel-4.4.55.git phy: rockchip-inno-usb2: amend sm work to support legacy SoC 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 --- diff --git a/drivers/phy/phy-rockchip-inno-usb2.c b/drivers/phy/phy-rockchip-inno-usb2.c index 8a6120c0e086..1471ea222d9c 100644 --- a/drivers/phy/phy-rockchip-inno-usb2.c +++ b/drivers/phy/phy-rockchip-inno-usb2.c @@ -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);