Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4fffe58 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

USB: EHCI: Allow more methods for overriding



Some EHCI compliant controllers may operate in Full-Speed only
mode. HCD_USB11 flag needs to be set instead of HCD_USB2 flag
for this reason. Allow controller drivers to override the
default hc_driver flags.

Some controller drivers may use root hub PM hooks to manage
the controller clocks and gpio. Allow controller drivers to
override bus_suspend and bus_resume methods.

Change-Id: I264b2173d0a48e31e581fa248b371e386c16823c
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 40a16350
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1221,8 +1221,14 @@ void ehci_init_driver(struct hc_driver *drv,

	if (over) {
		drv->hcd_priv_size += over->extra_priv_size;
		if (over->flags)
			drv->flags = over->flags;
		if (over->reset)
			drv->reset = over->reset;
		if (over->bus_suspend)
			drv->bus_suspend = over->bus_suspend;
		if (over->bus_resume)
			drv->bus_resume = over->bus_resume;
	}
}
EXPORT_SYMBOL_GPL(ehci_init_driver);
+4 −3
Original line number Diff line number Diff line
@@ -218,7 +218,7 @@ static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci,
	spin_unlock_irq(&ehci->lock);
}

static int ehci_bus_suspend (struct usb_hcd *hcd)
int ehci_bus_suspend(struct usb_hcd *hcd)
{
	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
	int			port;
@@ -359,10 +359,10 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
	hrtimer_cancel(&ehci->hrtimer);
	return 0;
}

EXPORT_SYMBOL(ehci_bus_suspend);

/* caller has locked the root hub, and should reset/reinit on error */
static int __maybe_unused ehci_bus_resume(struct usb_hcd *hcd)
int __maybe_unused ehci_bus_resume(struct usb_hcd *hcd)
{
	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
	u32			temp;
@@ -515,6 +515,7 @@ skip_clear_resume:
	spin_unlock_irq(&ehci->lock);
	return -ESHUTDOWN;
}
EXPORT_SYMBOL(ehci_bus_resume);

#else

+5 −0
Original line number Diff line number Diff line
@@ -802,7 +802,10 @@ static inline u32 hc32_to_cpup (const struct ehci_hcd *ehci, const __hc32 *x)

struct ehci_driver_overrides {
	size_t		extra_priv_size;
	int		flags;
	int		(*reset)(struct usb_hcd *hcd);
	int		(*bus_suspend)(struct usb_hcd *hcd);
	int		(*bus_resume)(struct usb_hcd *hcd);
};

extern void	ehci_init_driver(struct hc_driver *drv,
@@ -810,6 +813,8 @@ extern void ehci_init_driver(struct hc_driver *drv,
extern int	ehci_setup(struct usb_hcd *hcd);

#ifdef CONFIG_PM
extern int ehci_bus_suspend(struct usb_hcd *hcd);
extern int ehci_bus_resume(struct usb_hcd *hcd);
extern int	ehci_suspend(struct usb_hcd *hcd, bool do_wakeup);
extern int	ehci_resume(struct usb_hcd *hcd, bool hibernated);
#endif	/* CONFIG_PM */