Re: [PATCH v2 4/9] usb: renesas: gadget: use generic map/unmap routines

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

 



Hi Felipe again

> > > So your driver threats the IN direction as "into the device" rather than
> > > "into the host" ? That's very confusing as the USB Specification states
> > > that direction is always from the point of view of the host. I will
> > > change to use usbhs_pipe_is_dir_host() and, if possible, I would like to
> > > get your Tested-by on the final set that I will send in few hours.

renesas_usbhs need "pipe" direction, since we can use it as both host/gadget.

> > --- a/drivers/usb/renesas_usbhs/pipe.c
> > +++ b/drivers/usb/renesas_usbhs/pipe.c
> > @@ -330,8 +330,7 @@ static u16 usbhsp_setup_pipecfg(struct usbhs_pipe *pipe,
> >  	if (dir_in)
> >  		usbhsp_flags_set(pipe, IS_DIR_HOST);
> >  
> > -	if ((is_host  && !dir_in) ||
> > -	    (!is_host && dir_in))
> > +	if (is_host ^ dir_in)
> >  		dir |= DIR_OUT;
> >  
> >  	if (!dir)
> > 
> > -- 
> > balbi
> 
> And this is nice !
> 
> Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>

Can you use below, or similar ?

if (!!is_host ^ !!dir_in)

These 2 are not 0/1, but 0/!0

Best regards
---
Kuninori Morimoto
--
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