Commit 35fcf02f authored by Heikki Krogerus's avatar Heikki Krogerus Committed by Greg Kroah-Hartman

usb: roles: intel_xhci: Always allow user control

Trying to determine the USB port type with this mux is very
difficult. To simplify the situation, always allow user
control, even if the port is USB Type-C port.
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 74789aed
...@@ -38,20 +38,6 @@ struct intel_xhci_usb_data { ...@@ -38,20 +38,6 @@ struct intel_xhci_usb_data {
void __iomem *base; void __iomem *base;
}; };
struct intel_xhci_acpi_match {
const char *hid;
int hrv;
};
/*
* ACPI IDs for PMICs which do not support separate data and power role
* detection (USB ACA detection for micro USB OTG), we allow userspace to
* change the role manually on these.
*/
static const struct intel_xhci_acpi_match allow_userspace_ctrl_ids[] = {
{ "INT33F4", 3 }, /* X-Powers AXP288 PMIC */
};
static int intel_xhci_usb_set_role(struct device *dev, enum usb_role role) static int intel_xhci_usb_set_role(struct device *dev, enum usb_role role)
{ {
struct intel_xhci_usb_data *data = dev_get_drvdata(dev); struct intel_xhci_usb_data *data = dev_get_drvdata(dev);
...@@ -127,9 +113,10 @@ static enum usb_role intel_xhci_usb_get_role(struct device *dev) ...@@ -127,9 +113,10 @@ static enum usb_role intel_xhci_usb_get_role(struct device *dev)
return role; return role;
} }
static struct usb_role_switch_desc sw_desc = { static const struct usb_role_switch_desc sw_desc = {
.set = intel_xhci_usb_set_role, .set = intel_xhci_usb_set_role,
.get = intel_xhci_usb_get_role, .get = intel_xhci_usb_get_role,
.allow_userspace_control = true,
}; };
static int intel_xhci_usb_probe(struct platform_device *pdev) static int intel_xhci_usb_probe(struct platform_device *pdev)
...@@ -137,7 +124,6 @@ static int intel_xhci_usb_probe(struct platform_device *pdev) ...@@ -137,7 +124,6 @@ static int intel_xhci_usb_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct intel_xhci_usb_data *data; struct intel_xhci_usb_data *data;
struct resource *res; struct resource *res;
int i;
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
if (!data) if (!data)
...@@ -150,11 +136,6 @@ static int intel_xhci_usb_probe(struct platform_device *pdev) ...@@ -150,11 +136,6 @@ static int intel_xhci_usb_probe(struct platform_device *pdev)
if (!data->base) if (!data->base)
return -ENOMEM; return -ENOMEM;
for (i = 0; i < ARRAY_SIZE(allow_userspace_ctrl_ids); i++)
if (acpi_dev_present(allow_userspace_ctrl_ids[i].hid, "1",
allow_userspace_ctrl_ids[i].hrv))
sw_desc.allow_userspace_control = true;
platform_set_drvdata(pdev, data); platform_set_drvdata(pdev, data);
data->role_sw = usb_role_switch_register(dev, &sw_desc); data->role_sw = usb_role_switch_register(dev, &sw_desc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment