History

usb: roles: Provide the switch drivers handle to the switch in the API

The USB role callback functions had a parameter pointing to the parent device (struct device) of the switch. The assumption was that the switch parent is always the controller. Firstly, that may not be true in every case, and secondly, it prevents us from supporting devices that supply multiple muxes. Changing the first parameter of usb_role_switch_set_t and usb_role_switch_get_t from struct device to struct usb_role_switch.

Heikki Krogerus committed 6 years ago

Commit bce30521 parent 69af04410 files · +77 −59Browse files

Showing the changes to include/linux (1 of 10 files). Show all

Unified · Split

include/linux/usb/role.h+3−2
@@ -13,8 +13,9 @@ enum usb_role { · 12 unmodified lines
13 USB_ROLE_DEVICE,13 USB_ROLE_DEVICE,
14};14};
15 15
16typedef int (*usb_role_switch_set_t)(struct device *dev, enum usb_role role);16typedef int (*usb_role_switch_set_t)(struct usb_role_switch *sw,
17typedef enum usb_role (*usb_role_switch_get_t)(struct device *dev);17 enum usb_role role);
18typedef enum usb_role (*usb_role_switch_get_t)(struct usb_role_switch *sw);
18 19
19/**20/**
20 * struct usb_role_switch_desc - USB Role Switch Descriptor21 * struct usb_role_switch_desc - USB Role Switch Descriptor