From 33c82b95cf8a7c05367cc0a9133587b0c4c1c741 Mon Sep 17 00:00:00 2001 From: Frank Wang Date: Tue, 1 Jun 2021 11:33:15 +0800 Subject: [PATCH] phy: rockchip: naneng-usb2: rework phy_set_mode to accept phy mode and submode This fixes "submode" parameter for PHY set_mode() callback function. Signed-off-by: Frank Wang Change-Id: Ia42b77e22914b995c8cea5910ae3a364269d9cfb --- drivers/phy/rockchip/phy-rockchip-naneng-usb2.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-naneng-usb2.c b/drivers/phy/rockchip/phy-rockchip-naneng-usb2.c index 7580e5cc85b7..f66054602c0d 100644 --- a/drivers/phy/rockchip/phy-rockchip-naneng-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-naneng-usb2.c @@ -659,7 +659,8 @@ static int rockchip_set_vbus_power(struct rockchip_usb2phy_port *rport, return ret; } -static int rockchip_usb2phy_set_mode(struct phy *phy, enum phy_mode mode) +static int rockchip_usb2phy_set_mode(struct phy *phy, + enum phy_mode mode, int submode) { struct rockchip_usb2phy_port *rport = phy_get_drvdata(phy); struct rockchip_usb2phy *rphy = dev_get_drvdata(phy->dev.parent); @@ -1077,7 +1078,7 @@ static ssize_t otg_mode_store(struct device *device, extcon_set_state(rphy->edev, EXTCON_USB_HOST, true); extcon_sync(rphy->edev, EXTCON_USB); extcon_sync(rphy->edev, EXTCON_USB_HOST); - rockchip_usb2phy_set_mode(rport->phy, PHY_MODE_USB_HOST); + rockchip_usb2phy_set_mode(rport->phy, PHY_MODE_USB_HOST, 0); property_enable(rphy->grf, &rport->port_cfg->idpullup, false); property_enable(rphy->grf, &rport->port_cfg->iddig_output, @@ -1086,7 +1087,7 @@ static ssize_t otg_mode_store(struct device *device, true); break; case USB_DR_MODE_PERIPHERAL: - rockchip_usb2phy_set_mode(rport->phy, PHY_MODE_USB_DEVICE); + rockchip_usb2phy_set_mode(rport->phy, PHY_MODE_USB_DEVICE, 0); property_enable(rphy->grf, &rport->port_cfg->idpullup, true); property_enable(rphy->grf, &rport->port_cfg->iddig_output, @@ -1095,7 +1096,7 @@ static ssize_t otg_mode_store(struct device *device, true); break; case USB_DR_MODE_OTG: - rockchip_usb2phy_set_mode(rport->phy, PHY_MODE_USB_OTG); + rockchip_usb2phy_set_mode(rport->phy, PHY_MODE_USB_OTG, 0); property_enable(rphy->grf, &rport->port_cfg->iddig_output, false); property_enable(rphy->grf, &rport->port_cfg->iddig_en, @@ -1266,7 +1267,7 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy, extcon_set_state(rphy->edev, EXTCON_USB, false); extcon_set_state(rphy->edev, EXTCON_USB_HOST, true); } - rockchip_usb2phy_set_mode(rport->phy, PHY_MODE_USB_HOST); + rockchip_usb2phy_set_mode(rport->phy, PHY_MODE_USB_HOST, 0); /* * Here set iddig to 0 by disable idpullup, the otg_suspendm * will be set to 1 to enable the disconnect detection module,