RE: [PATCH 1/1] usb: dwc3: gadget: Set the OTG flag in dwc3 gadget driver.

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

 



Set the otg flag during dwc3 gadget init function for ceritification
test requirement.
We must set this otg flag in order to be able to return OTG descriptor
during enumeration.

Signed-off-by: Jianqiang Tang <jianqiang.tang@xxxxxxxxx>
---
 drivers/usb/dwc3/gadget.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index a58376f..955122c 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2748,6 +2748,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
 	dwc->gadget.speed		= USB_SPEED_UNKNOWN;
 	dwc->gadget.sg_supported	= true;
 	dwc->gadget.name		= "dwc3-gadget";
+	dwc->gadget.is_otg		= dwc->dr_mode == USB_DR_MODE_OTG;
 
 	/*
 	 * FIXME We might be setting max_speed to <SUPER, however versions
-- 
1.9.1


-----Original Message-----
From: linux-usb-owner@xxxxxxxxxxxxxxx [mailto:linux-usb-owner@xxxxxxxxxxxxxxx] On Behalf Of Tang, Jianqiang
Sent: Wednesday, January 13, 2016 6:24 PM
To: Felipe Balbi <balbi@xxxxxxxxxx>; Jianqiang Tang <jianqiang.tang.kernel@xxxxxxxxx>; Felipe Balbi <balbi@xxxxxx>; linux-usb@xxxxxxxxxxxxxxx
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [PATCH 1/1] usb: dwc3: gadget: Set the OTG flag in dwc3 gadget driver.

Hi Balbi,
    Thanks for the quick response and value comments. 
    I agree with your comments and will upload one new patch soon.
    Currently, this patch is the one confirmed ready for upstream, I will try to find if there are any other patches available for OTG certification.
    I only own part of the certification task inside the project.
Thanks!

-----Original Message-----
From: linux-usb-owner@xxxxxxxxxxxxxxx [mailto:linux-usb-owner@xxxxxxxxxxxxxxx] On Behalf Of Felipe Balbi
Sent: Wednesday, January 13, 2016 3:46 PM
To: Jianqiang Tang <jianqiang.tang.kernel@xxxxxxxxx>; Felipe Balbi <balbi@xxxxxx>; linux-usb@xxxxxxxxxxxxxxx
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>; Tang, Jianqiang <jianqiang.tang@xxxxxxxxx>
Subject: Re: [PATCH 1/1] usb: dwc3: gadget: Set the OTG flag in dwc3 gadget driver.


Hi,

Jianqiang Tang <jianqiang.tang.kernel@xxxxxxxxx> writes:
> Set the otg flag during dwc3 gadget init function for ceritification
                                                        certification

> test requirement.
> We must set this otg flag for ceritification test in order to be able
                                certification 

> to return OTG descriptor during enumeration.
>
> Signed-off-by: Jianqiang Tang <jianqiang.tang@xxxxxxxxx>
> ---
>  drivers/usb/dwc3/gadget.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c 
> index a58376f..72dc8dc 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -2750,6 +2750,12 @@ int dwc3_gadget_init(struct dwc3 *dwc)
>  	dwc->gadget.name		= "dwc3-gadget";
>  
>  	/*
> +	 * Set the otg flag if Controller in OTG mode for Ceritification Test
> +	 */

comment is pointless (it's clear what code is doing below) and also you're using multi-line comment style for a single line comment. Oh, and you also have the same typo ;-)

> +	if (dwc->dr_mode == USB_DR_MODE_OTG)
> +		dwc->gadget.is_otg = 1;

following is more succint:

	dwc->gadget.is_otg = dwc->dr_mode == USB_DR_MODE_OTG;

ps: which other patches do you have to get OTG certification ? Do you want, perhaps, to send those upstream ?

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