Re: [PATCH] usb: add OTG 2.0 definition and support into gadget function

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

 



Hi Peter,

2015-03-25 19:59 GMT+08:00 Peter Chen <Peter.Chen@xxxxxxxxxxxxx>:

>> +config USB_OTG20
>> +     bool "OTG20 support (EXPERIMENTAL)"
...
>> +       Select this only if your board support OTG 20's hardware requirements.
...
>> +#ifdef CONFIG_USB_OTG20
>> +             case USB_DT_OTG:
>> +                     otg_desc = (struct usb_otg_descriptor *)req->buf;
>> +                     otg_desc->bLength = sizeof(*otg_desc);
>> +                     otg_desc->bDescriptorType = USB_DT_OTG;
>> +                     otg_desc->bmAttributes = USB_OTG_SRP |
>> USB_OTG_HNP;
>> +                     otg_desc->bcdOTG = cpu_to_le16(0x0200);
>> +                     value = min_t(int, w_length,
>> +                             sizeof(struct usb_otg_descriptor));
>> +                     break;
>> +#endif
>
> How about add gadget_is_otg20 to do it?
> The udc driver can decide it if it supports otg v1.3 or otg v2.0.

To use a flexible determine method like gadget_is_otg20() will be good
and could reduce #ifdef macro.
But then we need to declare 2 usb_otg_descriptor structures in the
headers file with only 2 bytes difference.
Also, the OTG 20 supports should be adapted with OTG-A compliance
test, too, when the other upcoming patches.
Hence I choose this kind of macro with "experiment" label for avoiding
get other devices or drivers been affected.

I'll change the code to gadget_is_otg20() but I have no idea how to
configure PET device into OTG 1.3 mode to
test correctness when the code and hardware is running at OTG 1.3 mode.
Thanks. :)

-- 
Best regards,
Macpaul Lin
--
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