Re: [PATCH v2 01/25] usb: otg: add unified otg_notify function for usb_otg_event notification

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

 



On 12/11/2010 11:02 AM, Greg KH wrote:
>> This is only a interface for USB host/peripheral notification, if it
>> > is no needed for some driver, they can keep it with NULL.
>> > 
>>> > >Don't they already do something like this on a per-device basis?
>> > 
>> > Not sure what's the per-device basis mentioned here. Could you provide
>> > more information? Thanks in advance.
> Again, existing notifiers.

I am not sure how other events are useful for all OTG drivers. But OTG
spec events are required for OTG state transitions.

+enum usb_otg_events {
+	/* according to OTG Spec */
+	USB_OTG_CONNECT,	/* a_conn/b_conn */
+	USB_OTG_DISCON,

The existing notifier calls USB_DEVICE_ADD event only after putting
device into configured state. But OTG state should be moved from
A_WAIT_BCON to A_HOST upon B-device connection. The timeout can be as
small as 1.1 sec. Also we should detect device disconnection with in
msec during HNP. So we can not rely on blocking notifier events.

We can also solve this problem (device connect/disconnect) by monitoring
the Port change interrupt in OTG driver. But It would good to leave that
part to ehci/ohci IRQ handlers and rely on explicit events to avoid
denouncing issues.

+	USB_OTG_HOST_SUSP,	/* bus request */
+	USB_OTG_HOST_RESU,
+	USB_OTG_DEV_SUSP,	/* bus suspend/resume event */
+	USB_OTG_DEV_RESU,
}

The above suspend/resume events are required for transition from
A_HOST->A_SUPEND and B_PERIPHERAL->b_wait_acon.

We have one such callback function called "start_hnp" in ohci_hcd
struct. This callback will be called immediately after putting the port
is suspended and HCD should take care of initiating HNP or can simply
call otg_start_hnp() to give the control to OTG driver. A similar
functionality is missing for EHCI. We don;t have any solution for
notifying the bus suspend/resume from gadget controller driver to OTG
driver.

-- 
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