RE: [PATCH 1/7] usb: dwc2: Add defines to support the s3c-hsotg driver

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

 



> From: dinguyen@xxxxxxxxxx [mailto:dinguyen@xxxxxxxxxx]
> Sent: Thursday, February 13, 2014 1:11 PM
> 
> In preparation of combining the dwc2/s3c-hsotg driver in a single DRD driver,
> the defines in dwc2/hw.h needs to get updated so that the s3c-hsotg driver can
> use them.

< snip >

> diff --git a/drivers/usb/dwc2/hw.h b/drivers/usb/dwc2/hw.h
> index 9c92a3c..d3ae043 100644
> --- a/drivers/usb/dwc2/hw.h
> +++ b/drivers/usb/dwc2/hw.h
> @@ -109,6 +109,7 @@
>  #define GUSBCFG_FSINTF			(1 << 5)
>  #define GUSBCFG_ULPI_UTMI_SEL		(1 << 4)
>  #define GUSBCFG_PHYIF16			(1 << 3)
> +#define GUSBCFG_PHYIF8			(0 << 3)
>  #define GUSBCFG_TOUTCAL_MASK		(0x7 << 0)
>  #define GUSBCFG_TOUTCAL_SHIFT		0
>  #define GUSBCFG_TOUTCAL_LIMIT		0x7
> @@ -169,14 +170,14 @@
>  #define GRXSTS_FN_SHIFT			25
>  #define GRXSTS_PKTSTS_MASK		(0xf << 17)
>  #define GRXSTS_PKTSTS_SHIFT		17
> -#define GRXSTS_PKTSTS_GLOBALOUTNAK	1
> -#define GRXSTS_PKTSTS_OUTRX		2
> +#define GRXSTS_PKTSTS_GLOBALOUTNAK	(0x1 << 17)
> +#define GRXSTS_PKTSTS_OUTRX		(0x2 << 17)

Changing all of these GRXSTS_PKTSTS defines to use the shifted values
doesn't make any sense, because the one place they are used, a helper
macro is defined that shifts them all back to the right by 17! So, leave
these as they are, and fix the single callsite in s3c-hsotg.c to use the
non-shifted values.

>  #define GRXSTS_PKTSTS_HCHIN		2
> -#define GRXSTS_PKTSTS_OUTDONE		3
> +#define GRXSTS_PKTSTS_OUTDONE		(0x3 << 17)
>  #define GRXSTS_PKTSTS_HCHIN_XFER_COMP	3
> -#define GRXSTS_PKTSTS_SETUPDONE		4
> +#define GRXSTS_PKTSTS_SETUPDONE		(0x4 << 17)
>  #define GRXSTS_PKTSTS_DATATOGGLEERR	5
> -#define GRXSTS_PKTSTS_SETUPRX		6
> +#define GRXSTS_PKTSTS_SETUPRX		(0x6 << 17)
>  #define GRXSTS_PKTSTS_HCHHALTED		7
>  #define GRXSTS_HCHNUM_MASK		(0xf << 0)
>  #define GRXSTS_HCHNUM_SHIFT		0
> @@ -403,6 +404,9 @@
>  #define FIFOSIZE_DEPTH_SHIFT		16
>  #define FIFOSIZE_STARTADDR_MASK		(0xffff << 0)
>  #define FIFOSIZE_STARTADDR_SHIFT	0
> +#define DPTXFSIZN_DPTXFSIZE_GET(_v)	(((_v) >> 16) & 0xffff)
> +#define DPTXFSIZN_DPTXFSIZE(_x)		((_x) << 16)
> +#define DPTXFSIZN_DPTXFADDR(_x)		((_x) << 0)

No need to define these DPTXFSIZN macros. Since in patch #2 you are
renaming macro calls in s3c-hsotg.c anyway, just redo the calls to
DPTXFSIZN_DPTXF* to use the existing FIFOSIZE* macros instead. You will
need to add a FIFOSIZE_DEPTH_GET macro to replace DPTXFSIZE_GET.

-- 
Paul

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