Commit 8802f563 authored by Hans de Goede's avatar Hans de Goede Committed by Simon Glass
Browse files

usb: Add an usb_device parameter to usb_reset_root_port



Add an usb_device parameter to usb_reset_root_port so that it knows which
root-port it is resetting. This is necessary for proper device-model support
for usb_reset_root_port.

Also remove a duplicate declaration of usb_reset_root_port() from usb.h .
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Acked-by: default avatarSimon Glass <sjg@chromium.org>
parent 682c9f8d
...@@ -924,7 +924,7 @@ static int usb_hub_port_reset(struct usb_device *dev, struct usb_device *hub) ...@@ -924,7 +924,7 @@ static int usb_hub_port_reset(struct usb_device *dev, struct usb_device *hub)
return err; return err;
} }
} else { } else {
usb_reset_root_port(); usb_reset_root_port(dev);
} }
return 0; return 0;
......
...@@ -265,7 +265,7 @@ int usb_init(void) ...@@ -265,7 +265,7 @@ int usb_init(void)
return usb_started ? 0 : -1; return usb_started ? 0 : -1;
} }
int usb_reset_root_port(void) int usb_reset_root_port(struct usb_device *udev)
{ {
return -ENOSYS; return -ENOSYS;
} }
......
...@@ -180,7 +180,7 @@ void *poll_int_queue(struct usb_device *dev, struct int_queue *queue) ...@@ -180,7 +180,7 @@ void *poll_int_queue(struct usb_device *dev, struct int_queue *queue)
return NULL; /* URB still pending */ return NULL; /* URB still pending */
} }
int usb_reset_root_port(void) int usb_reset_root_port(struct usb_device *dev)
{ {
void *mbase = host->mregs; void *mbase = host->mregs;
u8 power; u8 power;
...@@ -232,7 +232,7 @@ int usb_lowlevel_init(int index, enum usb_init_type init, void **controller) ...@@ -232,7 +232,7 @@ int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
if (get_timer(0) >= timeout) if (get_timer(0) >= timeout)
return -ENODEV; return -ENODEV;
usb_reset_root_port(); usb_reset_root_port(NULL);
host->is_active = 1; host->is_active = 1;
hcd.hcd_priv = host; hcd.hcd_priv = host;
......
...@@ -175,9 +175,9 @@ int usb_lowlevel_init(int index, enum usb_init_type init, void **controller); ...@@ -175,9 +175,9 @@ int usb_lowlevel_init(int index, enum usb_init_type init, void **controller);
int usb_lowlevel_stop(int index); int usb_lowlevel_stop(int index);
#if defined(CONFIG_MUSB_HOST) || defined(CONFIG_DM_USB) #if defined(CONFIG_MUSB_HOST) || defined(CONFIG_DM_USB)
int usb_reset_root_port(void); int usb_reset_root_port(struct usb_device *dev);
#else #else
#define usb_reset_root_port() #define usb_reset_root_port(dev)
#endif #endif
int submit_bulk_msg(struct usb_device *dev, unsigned long pipe, int submit_bulk_msg(struct usb_device *dev, unsigned long pipe,
...@@ -710,10 +710,6 @@ struct dm_usb_ops { ...@@ -710,10 +710,6 @@ struct dm_usb_ops {
#define usb_get_ops(dev) ((struct dm_usb_ops *)(dev)->driver->ops) #define usb_get_ops(dev) ((struct dm_usb_ops *)(dev)->driver->ops)
#define usb_get_emul_ops(dev) ((struct dm_usb_ops *)(dev)->driver->ops) #define usb_get_emul_ops(dev) ((struct dm_usb_ops *)(dev)->driver->ops)
#ifdef CONFIG_MUSB_HOST
int usb_reset_root_port(void);
#endif
/** /**
* usb_get_dev_index() - look up a device index number * usb_get_dev_index() - look up a device index number
* *
......
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