linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavankumar Kondeti <pkondeti@codeaurora.org>
To: gregkh@suse.de, linux-usb@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org,
	Pavankumar Kondeti <pkondeti@codeaurora.org>
Subject: [RFC 2/2] USB: Notify OTG errors from hub driver
Date: Mon,  6 Dec 2010 18:07:51 +0530	[thread overview]
Message-ID: <1291639071-10862-2-git-send-email-pkondeti@codeaurora.org> (raw)
In-Reply-To: <1291639071-10862-1-git-send-email-pkondeti@codeaurora.org>

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 <pkondeti@codeaurora.org>
---
 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.

  reply	other threads:[~2010-12-06 12:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-06 12:37 [RFC 1/2] USB: Notify OTG errors to user space via uevents Pavankumar Kondeti
2010-12-06 12:37 ` Pavankumar Kondeti [this message]
2010-12-06 15:58 ` Greg KH
2010-12-07  2:32   ` pkondeti
2010-12-07  3:48     ` Pavan Kondeti
2010-12-07  4:22       ` Greg KH
2010-12-07  3:50     ` Greg KH
2010-12-07  4:20       ` Pavan Kondeti
2010-12-07  4:42         ` Greg KH
2010-12-07  5:00           ` Pavan Kondeti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1291639071-10862-2-git-send-email-pkondeti@codeaurora.org \
    --to=pkondeti@codeaurora.org \
    --cc=gregkh@suse.de \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).