From 3f124d233e97db96d9471d1fb346335d43d8650d Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Wed, 14 Aug 2013 12:44:07 +0300 Subject: usb: chipidea: add role init and destroy APIs - The role's init will be called at probe procedure. - The role's destroy will be called at fail patch at probe and driver's removal. - The role's start/stop will be called when specific role has started. Tested-by: Marek Vasut Signed-off-by: Peter Chen Signed-off-by: Alexander Shishkin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/chipidea/host.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/usb/chipidea/host.c') diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c index 8cf8d28c88d6..6f96795dd20c 100644 --- a/drivers/usb/chipidea/host.c +++ b/drivers/usb/chipidea/host.c @@ -106,6 +106,13 @@ static void host_stop(struct ci_hdrc *ci) regulator_disable(ci->platdata->reg_vbus); } + +void ci_hdrc_host_destroy(struct ci_hdrc *ci) +{ + if (ci->role == CI_ROLE_HOST) + host_stop(ci); +} + int ci_hdrc_host_init(struct ci_hdrc *ci) { struct ci_role_driver *rdrv; -- cgit v1.2.3