[U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file

Marek Vasut marex at denx.de
Fri Sep 20 12:55:40 CEST 2013


Dear Troy Kisky,

> Move common definitions to udc.h
> This allows musb_udc.h to be removed as well.
> 
> Signed-off-by: Troy Kisky <troy.kisky at boundarydevices.com>
> 
> ---
> v4: updated commit message
> removed ifdef UDC_BULK_HS_PACKET_SIZE since 512
> is the only legal value, it shouldn't be overridden.

[...]

>  #endif
> diff --git a/include/usb/udc.h b/include/usb/udc.h
> new file mode 100644
> index 0000000..3bcbbbc
> --- /dev/null
> +++ b/include/usb/udc.h
> @@ -0,0 +1,61 @@
> +/*
> + * SPDX-License-Identifier:	GPL-2.0+
> + */
> +#ifndef USB_UDC_H
> +#define USB_UDC_H
> +
> +#ifndef EP0_MAX_PACKET_SIZE
> +#define EP0_MAX_PACKET_SIZE     64
> +#endif
> +
> +#ifndef EP_MAX_PACKET_SIZE
> +#define EP_MAX_PACKET_SIZE	64
> +#endif
> +
> +#ifndef UDC_OUT_PACKET_SIZE
> +#define UDC_OUT_PACKET_SIZE     EP_MAX_PACKET_SIZE
> +#endif
> +
> +#ifndef UDC_IN_PACKET_SIZE
> +#define UDC_IN_PACKET_SIZE      EP_MAX_PACKET_SIZE
> +#endif
> +
> +#ifndef UDC_INT_PACKET_SIZE
> +#define UDC_INT_PACKET_SIZE     EP_MAX_PACKET_SIZE
> +#endif
> +
> +#ifndef UDC_BULK_PACKET_SIZE
> +#define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
> +#endif

Do you expect these values to change on per-controller basis? Or why do you have 
these ifndefs here ?

> +#define UDC_BULK_HS_PACKET_SIZE	512
> +
> +#ifndef UDC_INT_ENDPOINT
> +#define UDC_INT_ENDPOINT	1
> +#endif
> +
> +#ifndef UDC_OUT_ENDPOINT
> +#define UDC_OUT_ENDPOINT	2
> +#endif
> +
> +#ifndef UDC_IN_ENDPOINT
> +#define UDC_IN_ENDPOINT		3
> +#endif

[...]

Best regards,
Marek Vasut


More information about the U-Boot mailing list