[RESEND PATCH] usb: max3420: add the gadget driver
Jassi Brar
jassisinghbrar at gmail.com
Thu Jun 25 19:22:24 CEST 2020
On Wed, Jun 24, 2020 at 4:24 AM Marek Vasut <marex at denx.de> wrote:
>
> On 6/24/20 6:53 AM, Jassi Brar wrote:
> > Hi Marek,
>
> Hi,
>
> > On Mon, Jun 15, 2020 at 6:49 PM Marek Vasut <marex at denx.de> wrote:
> >
> >>>> +#define MAX3420_REG_MODE 27
> >>>> +#define MAX3420_REG_PERADDR 28
> >>>> +#define MAX3420_REG_HCTL 29
> >>>> +#define MAX3420_REG_HXFR 30
> >>>> +#define MAX3420_REG_HRSL 31
> >>>> +
> >>>> +#define field(val, bit) ((val) << (bit))
> >>
> >> Is this GENMASK() ?
> >>
> > The 'val' is not a mask, otherwise we could use genmask.
>
> Ah, right. Isn't there already some such macro in include/linux/ ?
>
I am not aware if there is.
> [...]
>
> >>>> +static int max3420_udc_start(struct usb_gadget *gadget,
> >>>> + struct usb_gadget_driver *driver)
> >>>> +{
> >>>> + struct max3420_udc *udc = to_udc(gadget);
> >>>> + unsigned long flags;
> >>>> +
> >>>> + udc->driver = driver;
> >>>> + udc->remote_wkp = 0;
> >>>> + udc->softconnect = true;
> >>>> +
> >>>> + //if (udc->vbus_active)
> >>
> >> Is this intended to be commented out ?
> >>
> > Yes.
>
> Why ?
>
That was remnant of debugging. The enumeration fails randomly if we
don't always reset the chip upon connection and the spec isn't clear
about it.
Thanks.
More information about the U-Boot
mailing list