usb: dwc3: qcom: Start USB in 'host mode' on the SDM845
authorLee Jones <lee.jones@linaro.org>
Mon, 17 Jun 2019 12:51:04 +0000 (13:51 +0100)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 18 Jun 2019 08:58:29 +0000 (11:58 +0300)
commita6e456209d088df31eacfa877d40194c755ca153
tree6b941b3f07bb02e208d2fcd7d5331c9902a54607
parent2bc02355f8ba2c1f108ec8b16a673b467a17228c
usb: dwc3: qcom: Start USB in 'host mode' on the SDM845

When booting with Device Tree, the current default boot configuration
table option, the request to boot via 'host mode' comes from the
'dr_mode' property.  A property of the same name can be used inside
ACPI tables too.  However it is missing from the SDM845's ACPI tables
so we have to supply this information using Platform Device Properties
instead.

This does not change the behaviour of any currently supported devices.
The property is only set on ACPI enabled platforms, thus for H/W
booting DT, unless a 'dr_mode' property is present, the default is
still OTG (On-The-Go) as per [0].  Any new ACPI devices added will
also be able to over-ride this implementation by providing a 'dr_mode'
property in their ACPI tables.  In cases where 'dr_mode' is omitted
from the tables AND 'host mode' should not be the default (very
unlikely), then we will have to add some way of choosing between them
at run time - most likely by ACPI HID.

[0] Documentation/devicetree/bindings/usb/generic.txt

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/dwc3-qcom.c