Loading Documentation/devicetree/bindings/usb/qpnp-pdphy.txt +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ Optional properties: - qcom,default-sink-caps: List of 32-bit values representing the nominal sink capabilities in voltage (millivolts) and current (milliamps) pairs. - qcom,no-usb3-dp-concurrency: If present, usb3 and dp concurrency is not supported. Example: qcom,qpnp-pdphy@1700 { Loading arch/arm64/boot/dts/qcom/pm660.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -365,6 +365,7 @@ qcom,default-sink-caps = <5000 3000>, /* 5V @ 3A */ <9000 3000>; /* 9V @ 3A */ qcom,no-usb3-dp-concurrency; }; pm660_adc_tm: vadc@3400 { Loading drivers/usb/pd/policy_engine.c +26 −0 Original line number Diff line number Diff line Loading @@ -388,6 +388,7 @@ struct usbpd { struct workqueue_struct *wq; struct work_struct sm_work; struct work_struct start_periph_work; struct work_struct restart_host_work; struct hrtimer timer; bool sm_queued; Loading Loading @@ -415,6 +416,7 @@ struct usbpd { bool peer_usb_comm; bool peer_pr_swap; bool peer_dr_swap; bool no_usb3dp_concurrency; u32 sink_caps[7]; int num_sink_caps; Loading Loading @@ -583,6 +585,26 @@ static void start_usb_peripheral_work(struct work_struct *w) dual_role_instance_changed(pd->dual_role); } static void restart_usb_host_work(struct work_struct *w) { struct usbpd *pd = container_of(w, struct usbpd, restart_host_work); int ret; if (!pd->no_usb3dp_concurrency) return; stop_usb_host(pd); /* blocks until USB host is completely stopped */ ret = extcon_blocking_sync(pd->extcon, EXTCON_USB_HOST, 0); if (ret) { usbpd_err(&pd->dev, "err(%d) stopping host", ret); return; } start_usb_host(pd, false); } /** * This API allows client driver to request for releasing SS lanes. It should * not be called from atomic context. Loading Loading @@ -1889,6 +1911,7 @@ static void handle_vdm_rx(struct usbpd *pd, struct rx_msg *rx_msg) /* Set to USB and DP cocurrency mode */ extcon_blocking_sync(pd->extcon, EXTCON_DISP_DP, 2); queue_work(pd->wq, &pd->restart_host_work); } /* if it's a supported SVID, pass the message to the handler */ Loading Loading @@ -4526,6 +4549,7 @@ struct usbpd *usbpd_create(struct device *parent) } INIT_WORK(&pd->sm_work, usbpd_sm); INIT_WORK(&pd->start_periph_work, start_usb_peripheral_work); INIT_WORK(&pd->restart_host_work, restart_usb_host_work); hrtimer_init(&pd->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); pd->timer.function = pd_timeout; mutex_init(&pd->swap_lock); Loading Loading @@ -4619,6 +4643,8 @@ struct usbpd *usbpd_create(struct device *parent) pd->num_sink_caps = ARRAY_SIZE(default_snk_caps); } if (device_property_read_bool(parent, "qcom,no-usb3-dp-concurrency")) pd->no_usb3dp_concurrency = true; /* * Register the Android dual-role class (/sys/class/dual_role_usb/). * The first instance should be named "otg_default" as that's what Loading Loading
Documentation/devicetree/bindings/usb/qpnp-pdphy.txt +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ Optional properties: - qcom,default-sink-caps: List of 32-bit values representing the nominal sink capabilities in voltage (millivolts) and current (milliamps) pairs. - qcom,no-usb3-dp-concurrency: If present, usb3 and dp concurrency is not supported. Example: qcom,qpnp-pdphy@1700 { Loading
arch/arm64/boot/dts/qcom/pm660.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -365,6 +365,7 @@ qcom,default-sink-caps = <5000 3000>, /* 5V @ 3A */ <9000 3000>; /* 9V @ 3A */ qcom,no-usb3-dp-concurrency; }; pm660_adc_tm: vadc@3400 { Loading
drivers/usb/pd/policy_engine.c +26 −0 Original line number Diff line number Diff line Loading @@ -388,6 +388,7 @@ struct usbpd { struct workqueue_struct *wq; struct work_struct sm_work; struct work_struct start_periph_work; struct work_struct restart_host_work; struct hrtimer timer; bool sm_queued; Loading Loading @@ -415,6 +416,7 @@ struct usbpd { bool peer_usb_comm; bool peer_pr_swap; bool peer_dr_swap; bool no_usb3dp_concurrency; u32 sink_caps[7]; int num_sink_caps; Loading Loading @@ -583,6 +585,26 @@ static void start_usb_peripheral_work(struct work_struct *w) dual_role_instance_changed(pd->dual_role); } static void restart_usb_host_work(struct work_struct *w) { struct usbpd *pd = container_of(w, struct usbpd, restart_host_work); int ret; if (!pd->no_usb3dp_concurrency) return; stop_usb_host(pd); /* blocks until USB host is completely stopped */ ret = extcon_blocking_sync(pd->extcon, EXTCON_USB_HOST, 0); if (ret) { usbpd_err(&pd->dev, "err(%d) stopping host", ret); return; } start_usb_host(pd, false); } /** * This API allows client driver to request for releasing SS lanes. It should * not be called from atomic context. Loading Loading @@ -1889,6 +1911,7 @@ static void handle_vdm_rx(struct usbpd *pd, struct rx_msg *rx_msg) /* Set to USB and DP cocurrency mode */ extcon_blocking_sync(pd->extcon, EXTCON_DISP_DP, 2); queue_work(pd->wq, &pd->restart_host_work); } /* if it's a supported SVID, pass the message to the handler */ Loading Loading @@ -4526,6 +4549,7 @@ struct usbpd *usbpd_create(struct device *parent) } INIT_WORK(&pd->sm_work, usbpd_sm); INIT_WORK(&pd->start_periph_work, start_usb_peripheral_work); INIT_WORK(&pd->restart_host_work, restart_usb_host_work); hrtimer_init(&pd->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); pd->timer.function = pd_timeout; mutex_init(&pd->swap_lock); Loading Loading @@ -4619,6 +4643,8 @@ struct usbpd *usbpd_create(struct device *parent) pd->num_sink_caps = ARRAY_SIZE(default_snk_caps); } if (device_property_read_bool(parent, "qcom,no-usb3-dp-concurrency")) pd->no_usb3dp_concurrency = true; /* * Register the Android dual-role class (/sys/class/dual_role_usb/). * The first instance should be named "otg_default" as that's what Loading