A generic set of FIFOSIZE_* constants was used for both the GNPTXFSIZ and HPTXFSIZ registers, even where a specific set of constants was a available for the GNPTXFSIZ register. This change adds specific constants for the HPTXFSIZ register as well, changes the code to use those specific constants and removes the generic constants. Signed-off-by: Matthijs Kooijman <matthijs@xxxxxxxx> --- drivers/staging/dwc2/core.c | 10 ++++++---- drivers/staging/dwc2/hw.h | 14 +++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/staging/dwc2/core.c b/drivers/staging/dwc2/core.c index e3a0e77..ebd0f12 100644 --- a/drivers/staging/dwc2/core.c +++ b/drivers/staging/dwc2/core.c @@ -526,9 +526,11 @@ static void dwc2_config_fifos(struct dwc2_hsotg *hsotg) dev_dbg(hsotg->dev, "initial gnptxfsiz=%08x\n", readl(hsotg->regs + GNPTXFSIZ)); nptxfsiz = params->host_nperio_tx_fifo_size << - FIFOSIZE_DEPTH_SHIFT & FIFOSIZE_DEPTH_MASK; + GNPTXFSIZ_NP_TXF_DEP_SHIFT & + GNPTXFSIZ_NP_TXF_DEP_MASK; nptxfsiz |= params->host_rx_fifo_size << - FIFOSIZE_STARTADDR_SHIFT & FIFOSIZE_STARTADDR_MASK; + GNPTXFSIZ_NP_TXF_ST_ADDR_SHIFT & + GNPTXFSIZ_NP_TXF_ST_ADDR_MASK; writel(nptxfsiz, hsotg->regs + GNPTXFSIZ); dev_dbg(hsotg->dev, "new gnptxfsiz=%08x\n", readl(hsotg->regs + GNPTXFSIZ)); @@ -537,10 +539,10 @@ static void dwc2_config_fifos(struct dwc2_hsotg *hsotg) dev_dbg(hsotg->dev, "initial hptxfsiz=%08x\n", readl(hsotg->regs + HPTXFSIZ)); ptxfsiz = params->host_perio_tx_fifo_size << - FIFOSIZE_DEPTH_SHIFT & FIFOSIZE_DEPTH_MASK; + HPTXFSIZ_P_TXF_DEP_SHIFT & HPTXFSIZ_P_TXF_DEP_MASK; ptxfsiz |= (params->host_rx_fifo_size + params->host_nperio_tx_fifo_size) << - FIFOSIZE_STARTADDR_SHIFT & FIFOSIZE_STARTADDR_MASK; + HPTXFSIZ_P_TXF_ST_ADDR_SHIFT & HPTXFSIZ_P_TXF_ST_ADDR_MASK; writel(ptxfsiz, hsotg->regs + HPTXFSIZ); dev_dbg(hsotg->dev, "new hptxfsiz=%08x\n", readl(hsotg->regs + HPTXFSIZ)); diff --git a/drivers/staging/dwc2/hw.h b/drivers/staging/dwc2/hw.h index 382a1d7..fd56963 100644 --- a/drivers/staging/dwc2/hw.h +++ b/drivers/staging/dwc2/hw.h @@ -392,6 +392,13 @@ #define HPTXFSIZ HSOTG_REG(0x100) +#define HPTXFSIZ_P_TXF_DEP_MASK (0xffff << 16) +#define HPTXFSIZ_P_TXF_DEP_SHIFT 16 +#define HPTXFSIZ_P_TXF_ST_ADDR_MASK (0xffff << 0) +#define HPTXFSIZ_P_TXF_ST_ADDR_SHIFT 0 + +/* Device mode registers */ + #define DPTXFSIZN(_a) HSOTG_REG(0x104 + (((_a) - 1) * 4)) #define DPTXFSIZN_DP_TXF_SIZE_MASK (0xffff << 16) #define DPTXFSIZN_DP_TXF_SIZE_SHIFT 16 @@ -401,13 +408,6 @@ #define DPTXFSIZN_DP_TXF_ST_ADDR_MASK (0xffff << 0) #define DPTXFSIZN_DP_TXF_ST_ADDR_SHIFT 0 -#define FIFOSIZE_DEPTH_MASK (0xffff << 16) -#define FIFOSIZE_DEPTH_SHIFT 16 -#define FIFOSIZE_STARTADDR_MASK (0xffff << 0) -#define FIFOSIZE_STARTADDR_SHIFT 0 - -/* Device mode registers */ - #define DCFG HSOTG_REG(0x800) #define DCFG_EPMISCNT_MASK (0x1f << 18) #define DCFG_EPMISCNT_SHIFT 18 -- 1.8.3.rc1 -- 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