Hi Hao,
On 12/3/2010 3:46 PM, Wu, Hao wrote:
need events like HNP FAILED, No response for HNP enable request, and NOT
>>> >found in TPL etc. So I prefer
>>> >to define an enum for OTG event instead of using USB_DEVICE_ADD and
>>> >USB_DEVICE_REMOVE.
>> Actually I have defined some OTG events in linux/usb/intel_mid_otg.h, they are used
>in intel langwell/penwell otg_transceiver driver.
>> I think I can purpose them for common usage, only minor concern here is that maybe
>different platforms/otg implementations may need different events to be defined.
>>
>
>I think, we should limit them to OTG spec events which are required to
>transition states,
>start/stop timers and user space notifications like the B-device is not
>in TPL, HUB class
>not supported, HNP available etc
Thanks for your suggestion, start/stop timers events are not needed in langwell/penwell_otg implementation.
and more other events needed, e.g ,event for USB charging from udc according to Battery charging spec 1.1.
Anyway, I will purpose my events list for review later. : )
One more question that, do you have any suggestion on the implementation for user space notification("No silent failures")?
I think only printk some warnings seems not good enough.
We can introduce another method in otg_transceiver struct for notifying
error from gadget and
host (includes USB core). We can provide a utility in drivers/usb/otg.c
to send these events
to userspace via uevents. I have worked on OTG2.0 for MSM chip sets. I
am in a process of sending
the basic driver patches to upstream. But if you like the idea
implemented in the below patches, I
can send them now so that your driver can use them. The below patches
introduce a method called
"send_event" in otg_transceiver struct and provided a wrapper called
otg_send_event(struct otg, event)
for USB core. The actual send_event is implemented in msm72k_otg.c But I
can move it to drivers/usb/otg.c
so that all OTG drivers can use the same function. The name "send_event"
also has to be changed. may be
"notify_error" or some thing like that is more appropriate.
https://www.codeaurora.org/gitweb/quic/la/?p=kernel/msm.git;a=commitdiff;h=f62a5d49535fb31d0824b024863dde0e32ebc84a
https://www.codeaurora.org/gitweb/quic/la/?p=kernel/msm.git;a=commitdiff;h=2a994bdea09cf2d331fe69e423b7c9fe1845242e
https://www.codeaurora.org/gitweb/quic/la/?p=kernel/msm.git;a=commitdiff;h=2a994bdea09cf2d331fe69e423b7c9fe1845242e
--
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