bool support_usb_id;
bool support_pmu_id;
bool support_pmu_rid;
+ bool support_hp_trans;
enum tegra_usb_id_detection id_det_type;
struct extcon_dev *id_extcon_dev;
struct extcon_dev *vbus_extcon_dev;
tegra_otg_start_gadget(tegra, 1);
else if (to == OTG_STATE_A_HOST)
tegra_otg_start_host(tegra, 1);
- } else if (from == OTG_STATE_A_HOST && to == OTG_STATE_A_SUSPEND) {
- tegra_otg_start_host(tegra, 0);
- } else if (from == OTG_STATE_B_PERIPHERAL && otg->gadget && to == OTG_STATE_A_SUSPEND) {
- tegra_otg_start_gadget(tegra, 0);
+ } else if (from == OTG_STATE_A_HOST) {
+ if (to == OTG_STATE_A_SUSPEND)
+ tegra_otg_start_host(tegra, 0);
+ else if (to == OTG_STATE_B_PERIPHERAL && otg->gadget
+ && tegra->support_hp_trans) {
+ tegra_otg_start_host(tegra, 0);
+ tegra_otg_start_gadget(tegra, 1);
+ }
+ } else if (from == OTG_STATE_B_PERIPHERAL && otg->gadget) {
+ if (to == OTG_STATE_A_SUSPEND)
+ tegra_otg_start_gadget(tegra, 0);
+ else if (to == OTG_STATE_A_HOST
+ && tegra->support_hp_trans) {
+ tegra_otg_start_gadget(tegra, 0);
+ tegra_otg_start_host(tegra, 1);
+ }
}
}
if (!(status & USB_ID_STATUS) && (status & USB_ID_INT_EN))
to = OTG_STATE_A_HOST;
- else if (status & USB_VBUS_STATUS && from != OTG_STATE_A_HOST)
+ else if (status & USB_VBUS_STATUS &&
+ (from != OTG_STATE_A_HOST || tegra->support_hp_trans))
to = OTG_STATE_B_PERIPHERAL;
else
to = OTG_STATE_A_SUSPEND;
tegra->support_pmu_rid =
of_property_read_bool(pdev->dev.of_node,
"nvidia,enable-aca-rid-detection");
+ tegra->support_hp_trans =
+ of_property_read_bool(pdev->dev.of_node,
+ "nvidia,enable-host-peripheral-transitions");
} else {
pdata = dev_get_platdata(&pdev->dev);
}