diff options
author | Mian Yousaf Kaukab <yousaf.kaukab@intel.com> | 2015-01-30 03:09:36 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-01-30 11:34:11 -0500 |
commit | f889f23d1c15fa73edaecc2cbce35a441eb52581 (patch) | |
tree | 48dd330543840c3a445636de369ba35d5f0f44dd /drivers/usb | |
parent | fa4a8d722bc2f0b1887ea929874a0f6754eda8b4 (diff) |
usb: dwc2: gadget: replace constants with defines
Defines are more readable and searchable than constants.
Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/dwc2/gadget.c | 24 | ||||
-rw-r--r-- | drivers/usb/dwc2/hw.h | 1 |
2 files changed, 13 insertions, 12 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 8c3f8f8f769a..f201f6d17bc7 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c | |||
@@ -2292,14 +2292,14 @@ void s3c_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg, | |||
2292 | /* set the PLL on, remove the HNP/SRP and set the PHY */ | 2292 | /* set the PLL on, remove the HNP/SRP and set the PHY */ |
2293 | val = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5; | 2293 | val = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5; |
2294 | writel(hsotg->phyif | GUSBCFG_TOUTCAL(7) | | 2294 | writel(hsotg->phyif | GUSBCFG_TOUTCAL(7) | |
2295 | (val << 10), hsotg->regs + GUSBCFG); | 2295 | (val << GUSBCFG_USBTRDTIM_SHIFT), hsotg->regs + GUSBCFG); |
2296 | 2296 | ||
2297 | s3c_hsotg_init_fifo(hsotg); | 2297 | s3c_hsotg_init_fifo(hsotg); |
2298 | 2298 | ||
2299 | if (!is_usb_reset) | 2299 | if (!is_usb_reset) |
2300 | __orr32(hsotg->regs + DCTL, DCTL_SFTDISCON); | 2300 | __orr32(hsotg->regs + DCTL, DCTL_SFTDISCON); |
2301 | 2301 | ||
2302 | writel(1 << 18 | DCFG_DEVSPD_HS, hsotg->regs + DCFG); | 2302 | writel(DCFG_EPMISCNT(1) | DCFG_DEVSPD_HS, hsotg->regs + DCFG); |
2303 | 2303 | ||
2304 | /* Clear any pending OTG interrupts */ | 2304 | /* Clear any pending OTG interrupts */ |
2305 | writel(0xffffffff, hsotg->regs + GOTGINT); | 2305 | writel(0xffffffff, hsotg->regs + GOTGINT); |
@@ -3006,7 +3006,7 @@ static void s3c_hsotg_init(struct dwc2_hsotg *hsotg) | |||
3006 | /* set the PLL on, remove the HNP/SRP and set the PHY */ | 3006 | /* set the PLL on, remove the HNP/SRP and set the PHY */ |
3007 | trdtim = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5; | 3007 | trdtim = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5; |
3008 | writel(hsotg->phyif | GUSBCFG_TOUTCAL(7) | | 3008 | writel(hsotg->phyif | GUSBCFG_TOUTCAL(7) | |
3009 | (trdtim << 10), | 3009 | (trdtim << GUSBCFG_USBTRDTIM_SHIFT), |
3010 | hsotg->regs + GUSBCFG); | 3010 | hsotg->regs + GUSBCFG); |
3011 | 3011 | ||
3012 | if (using_dma(hsotg)) | 3012 | if (using_dma(hsotg)) |
@@ -3295,7 +3295,7 @@ static int s3c_hsotg_hw_cfg(struct dwc2_hsotg *hsotg) | |||
3295 | /* check hardware configuration */ | 3295 | /* check hardware configuration */ |
3296 | 3296 | ||
3297 | cfg = readl(hsotg->regs + GHWCFG2); | 3297 | cfg = readl(hsotg->regs + GHWCFG2); |
3298 | hsotg->num_of_eps = (cfg >> 10) & 0xF; | 3298 | hsotg->num_of_eps = (cfg >> GHWCFG2_NUM_DEV_EP_SHIFT) & 0xF; |
3299 | /* Add ep0 */ | 3299 | /* Add ep0 */ |
3300 | hsotg->num_of_eps++; | 3300 | hsotg->num_of_eps++; |
3301 | 3301 | ||
@@ -3326,10 +3326,10 @@ static int s3c_hsotg_hw_cfg(struct dwc2_hsotg *hsotg) | |||
3326 | } | 3326 | } |
3327 | 3327 | ||
3328 | cfg = readl(hsotg->regs + GHWCFG3); | 3328 | cfg = readl(hsotg->regs + GHWCFG3); |
3329 | hsotg->fifo_mem = (cfg >> 16); | 3329 | hsotg->fifo_mem = (cfg >> GHWCFG3_DFIFO_DEPTH_SHIFT); |
3330 | 3330 | ||
3331 | cfg = readl(hsotg->regs + GHWCFG4); | 3331 | cfg = readl(hsotg->regs + GHWCFG4); |
3332 | hsotg->dedicated_fifos = (cfg >> 25) & 1; | 3332 | hsotg->dedicated_fifos = (cfg >> GHWCFG4_DED_FIFO_SHIFT) & 1; |
3333 | 3333 | ||
3334 | dev_info(hsotg->dev, "EPs: %d, %s fifos, %d entries in SPRAM\n", | 3334 | dev_info(hsotg->dev, "EPs: %d, %s fifos, %d entries in SPRAM\n", |
3335 | hsotg->num_of_eps, | 3335 | hsotg->num_of_eps, |
@@ -3354,8 +3354,8 @@ static void s3c_hsotg_dump(struct dwc2_hsotg *hsotg) | |||
3354 | readl(regs + DCFG), readl(regs + DCTL), | 3354 | readl(regs + DCFG), readl(regs + DCTL), |
3355 | readl(regs + DIEPMSK)); | 3355 | readl(regs + DIEPMSK)); |
3356 | 3356 | ||
3357 | dev_info(dev, "GAHBCFG=0x%08x, 0x44=0x%08x\n", | 3357 | dev_info(dev, "GAHBCFG=0x%08x, GHWCFG1=0x%08x\n", |
3358 | readl(regs + GAHBCFG), readl(regs + 0x44)); | 3358 | readl(regs + GAHBCFG), readl(regs + GHWCFG1)); |
3359 | 3359 | ||
3360 | dev_info(dev, "GRXFSIZ=0x%08x, GNPTXFSIZ=0x%08x\n", | 3360 | dev_info(dev, "GRXFSIZ=0x%08x, GNPTXFSIZ=0x%08x\n", |
3361 | readl(regs + GRXFSIZ), readl(regs + GNPTXFSIZ)); | 3361 | readl(regs + GRXFSIZ), readl(regs + GNPTXFSIZ)); |
@@ -3715,7 +3715,7 @@ static void s3c_hsotg_create_debug(struct dwc2_hsotg *hsotg) | |||
3715 | 3715 | ||
3716 | /* create general state file */ | 3716 | /* create general state file */ |
3717 | 3717 | ||
3718 | hsotg->debug_file = debugfs_create_file("state", 0444, root, | 3718 | hsotg->debug_file = debugfs_create_file("state", S_IRUGO, root, |
3719 | hsotg, &state_fops); | 3719 | hsotg, &state_fops); |
3720 | 3720 | ||
3721 | if (IS_ERR(hsotg->debug_file)) | 3721 | if (IS_ERR(hsotg->debug_file)) |
@@ -3729,7 +3729,7 @@ static void s3c_hsotg_create_debug(struct dwc2_hsotg *hsotg) | |||
3729 | dev_err(hsotg->dev, "%s: failed to create testmode\n", | 3729 | dev_err(hsotg->dev, "%s: failed to create testmode\n", |
3730 | __func__); | 3730 | __func__); |
3731 | 3731 | ||
3732 | hsotg->debug_fifo = debugfs_create_file("fifo", 0444, root, | 3732 | hsotg->debug_fifo = debugfs_create_file("fifo", S_IRUGO, root, |
3733 | hsotg, &fifo_fops); | 3733 | hsotg, &fifo_fops); |
3734 | 3734 | ||
3735 | if (IS_ERR(hsotg->debug_fifo)) | 3735 | if (IS_ERR(hsotg->debug_fifo)) |
@@ -3741,7 +3741,7 @@ static void s3c_hsotg_create_debug(struct dwc2_hsotg *hsotg) | |||
3741 | 3741 | ||
3742 | ep = hsotg->eps_out[epidx]; | 3742 | ep = hsotg->eps_out[epidx]; |
3743 | if (ep) { | 3743 | if (ep) { |
3744 | ep->debugfs = debugfs_create_file(ep->name, 0444, | 3744 | ep->debugfs = debugfs_create_file(ep->name, S_IRUGO, |
3745 | root, ep, &ep_fops); | 3745 | root, ep, &ep_fops); |
3746 | 3746 | ||
3747 | if (IS_ERR(ep->debugfs)) | 3747 | if (IS_ERR(ep->debugfs)) |
@@ -3755,7 +3755,7 @@ static void s3c_hsotg_create_debug(struct dwc2_hsotg *hsotg) | |||
3755 | 3755 | ||
3756 | ep = hsotg->eps_in[epidx]; | 3756 | ep = hsotg->eps_in[epidx]; |
3757 | if (ep) { | 3757 | if (ep) { |
3758 | ep->debugfs = debugfs_create_file(ep->name, 0444, | 3758 | ep->debugfs = debugfs_create_file(ep->name, S_IRUGO, |
3759 | root, ep, &ep_fops); | 3759 | root, ep, &ep_fops); |
3760 | 3760 | ||
3761 | if (IS_ERR(ep->debugfs)) | 3761 | if (IS_ERR(ep->debugfs)) |
diff --git a/drivers/usb/dwc2/hw.h b/drivers/usb/dwc2/hw.h index d018ebef15cc..d0a5ed8fa15a 100644 --- a/drivers/usb/dwc2/hw.h +++ b/drivers/usb/dwc2/hw.h | |||
@@ -294,6 +294,7 @@ | |||
294 | #define GHWCFG4_NUM_IN_EPS_MASK (0xf << 26) | 294 | #define GHWCFG4_NUM_IN_EPS_MASK (0xf << 26) |
295 | #define GHWCFG4_NUM_IN_EPS_SHIFT 26 | 295 | #define GHWCFG4_NUM_IN_EPS_SHIFT 26 |
296 | #define GHWCFG4_DED_FIFO_EN (1 << 25) | 296 | #define GHWCFG4_DED_FIFO_EN (1 << 25) |
297 | #define GHWCFG4_DED_FIFO_SHIFT 25 | ||
297 | #define GHWCFG4_SESSION_END_FILT_EN (1 << 24) | 298 | #define GHWCFG4_SESSION_END_FILT_EN (1 << 24) |
298 | #define GHWCFG4_B_VALID_FILT_EN (1 << 23) | 299 | #define GHWCFG4_B_VALID_FILT_EN (1 << 23) |
299 | #define GHWCFG4_A_VALID_FILT_EN (1 << 22) | 300 | #define GHWCFG4_A_VALID_FILT_EN (1 << 22) |