+static irqreturn_t rockchip_usb2phy_id_irq(int irq, void *data)
+{
+ struct rockchip_usb2phy_port *rport = data;
+ struct rockchip_usb2phy *rphy = dev_get_drvdata(rport->phy->dev.parent);
+
+ if (!property_enabled(rphy, &rport->port_cfg->idfall_det_st) &&
+ !property_enabled(rphy, &rport->port_cfg->idrise_det_st))
+ return IRQ_NONE;
+
+ mutex_lock(&rport->mutex);
+
+ /* clear id fall or rise detect irq pending status */
+ if (property_enabled(rphy, &rport->port_cfg->idfall_det_st)) {
+ property_enable(rphy, &rport->port_cfg->idfall_det_clr,
+ true);
+ extcon_set_state(rphy->edev, EXTCON_USB_HOST, true);
+ } else if (property_enabled(rphy, &rport->port_cfg->idrise_det_st)) {
+ property_enable(rphy, &rport->port_cfg->idrise_det_clr,
+ true);
+ extcon_set_state(rphy->edev, EXTCON_USB_HOST, false);
+ }
+
+ extcon_sync(rphy->edev, EXTCON_USB_HOST);
+
+ mutex_unlock(&rport->mutex);
+
+ return IRQ_HANDLED;
+}
+