From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wolverine01.qualcomm.com ([199.106.114.254]:16518 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753038Ab0LFMiC (ORCPT ); Mon, 6 Dec 2010 07:38:02 -0500 From: Pavankumar Kondeti Subject: [RFC 2/2] USB: Notify OTG errors from hub driver Date: Mon, 6 Dec 2010 18:07:51 +0530 Message-Id: <1291639071-10862-2-git-send-email-pkondeti@codeaurora.org> In-Reply-To: <1291639071-10862-1-git-send-email-pkondeti@codeaurora.org> References: <1291639071-10862-1-git-send-email-pkondeti@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-ID: To: gregkh@suse.de, linux-usb@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, Pavankumar Kondeti Notify OTG errors in the following cases 1. The connected peripheral is not found in TPL. 2. HUB class device is not found in TPL. 3. When peripheral is failed to accept b_hnp_enable/a_alt_hnp feature request. Signed-off-by: Pavankumar Kondeti --- drivers/usb/core/hub.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index b98efae..4f9e781 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1243,6 +1243,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) #ifdef CONFIG_USB_OTG_BLACKLIST_HUB if (hdev->parent) { + otg_notify_error(USB_OTG_HUB_NOT_SUPPORTED_ERROR); dev_warn(&intf->dev, "ignoring external hub\n"); return -ENODEV; } @@ -1696,9 +1697,8 @@ static int usb_enumerate_device_otg(struct usb_device *udev) : USB_DEVICE_A_ALT_HNP_SUPPORT, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); if (err < 0) { - /* OTG MESSAGE: report errors here, - * customize to match your product. - */ + otg_notify_error( + USB_OTG_HNP_ENABLE_ERROR); dev_info(&udev->dev, "can't set HNP mode: %d\n", err); @@ -1710,6 +1710,7 @@ static int usb_enumerate_device_otg(struct usb_device *udev) if (!is_targeted(udev)) { + otg_notify_error(USB_OTG_DEV_NOT_SUPPORTED_ERROR); /* Maybe it can talk to us, though we can't talk to it. * (Includes HNP test device.) */ -- 1.7.1 -- Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.