[RFC 2/2] USB: Notify OTG errors from hub driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux