Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: dwc3: Remove of dep->regs

Remove dep->regs from struct dwc3_ep and reuse dwc->regs instead.
Thus eliminating redundant iomem addresses and making register
access more consistent across the driver.

Signed-off-by: Prashanth K <prashanth.k@oss.qualcomm.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/20260114100748.2950103-2-prashanth.k@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Prashanth K and committed by
Greg Kroah-Hartman
abdd1eef cea2a125

+15 -21
+4 -6
drivers/usb/dwc3/core.h
··· 165 165 #define DWC3_DCFG1 0xc740 /* DWC_usb32 only */ 166 166 167 167 #define DWC3_DEP_BASE(n) (0xc800 + ((n) * 0x10)) 168 - #define DWC3_DEPCMDPAR2 0x00 169 - #define DWC3_DEPCMDPAR1 0x04 170 - #define DWC3_DEPCMDPAR0 0x08 171 - #define DWC3_DEPCMD 0x0c 168 + #define DWC3_DEPCMDPAR2(n) (DWC3_DEP_BASE(n) + 0x00) 169 + #define DWC3_DEPCMDPAR1(n) (DWC3_DEP_BASE(n) + 0x04) 170 + #define DWC3_DEPCMDPAR0(n) (DWC3_DEP_BASE(n) + 0x08) 171 + #define DWC3_DEPCMD(n) (DWC3_DEP_BASE(n) + 0x0c) 172 172 173 173 #define DWC3_DEV_IMOD(n) (0xca00 + ((n) * 0x4)) 174 174 ··· 748 748 struct list_head cancelled_list; 749 749 struct list_head pending_list; 750 750 struct list_head started_list; 751 - 752 - void __iomem *regs; 753 751 754 752 struct dwc3_trb *trb_pool; 755 753 dma_addr_t trb_pool_dma;
+4 -8
drivers/usb/dwc3/debugfs.c
··· 36 36 #define dump_ep_register_set(n) \ 37 37 { \ 38 38 .name = "DEPCMDPAR2("__stringify(n)")", \ 39 - .offset = DWC3_DEP_BASE(n) + \ 40 - DWC3_DEPCMDPAR2, \ 39 + .offset = DWC3_DEPCMDPAR2(n), \ 41 40 }, \ 42 41 { \ 43 42 .name = "DEPCMDPAR1("__stringify(n)")", \ 44 - .offset = DWC3_DEP_BASE(n) + \ 45 - DWC3_DEPCMDPAR1, \ 43 + .offset = DWC3_DEPCMDPAR1(n), \ 46 44 }, \ 47 45 { \ 48 46 .name = "DEPCMDPAR0("__stringify(n)")", \ 49 - .offset = DWC3_DEP_BASE(n) + \ 50 - DWC3_DEPCMDPAR0, \ 47 + .offset = DWC3_DEPCMDPAR0(n), \ 51 48 }, \ 52 49 { \ 53 50 .name = "DEPCMD("__stringify(n)")", \ 54 - .offset = DWC3_DEP_BASE(n) + \ 55 - DWC3_DEPCMD, \ 51 + .offset = DWC3_DEPCMD(n), \ 56 52 } 57 53 58 54
+6 -6
drivers/usb/dwc3/gadget.c
··· 320 320 321 321 int cmd_status = 0; 322 322 int ret = -EINVAL; 323 + u8 epnum = dep->number; 323 324 324 325 /* 325 326 * When operating in USB 2.0 speeds (HS/FS), if GUSB2PHYCFG.ENBLSLPM or ··· 356 355 * improve performance. 357 356 */ 358 357 if (DWC3_DEPCMD_CMD(cmd) != DWC3_DEPCMD_UPDATETRANSFER) { 359 - dwc3_writel(dep->regs, DWC3_DEPCMDPAR0, params->param0); 360 - dwc3_writel(dep->regs, DWC3_DEPCMDPAR1, params->param1); 361 - dwc3_writel(dep->regs, DWC3_DEPCMDPAR2, params->param2); 358 + dwc3_writel(dwc->regs, DWC3_DEPCMDPAR0(epnum), params->param0); 359 + dwc3_writel(dwc->regs, DWC3_DEPCMDPAR1(epnum), params->param1); 360 + dwc3_writel(dwc->regs, DWC3_DEPCMDPAR2(epnum), params->param2); 362 361 } 363 362 364 363 /* ··· 382 381 else 383 382 cmd |= DWC3_DEPCMD_CMDACT; 384 383 385 - dwc3_writel(dep->regs, DWC3_DEPCMD, cmd); 384 + dwc3_writel(dwc->regs, DWC3_DEPCMD(epnum), cmd); 386 385 387 386 if (!(cmd & DWC3_DEPCMD_CMDACT) || 388 387 (DWC3_DEPCMD_CMD(cmd) == DWC3_DEPCMD_ENDTRANSFER && ··· 392 391 } 393 392 394 393 do { 395 - reg = dwc3_readl(dep->regs, DWC3_DEPCMD); 394 + reg = dwc3_readl(dwc->regs, DWC3_DEPCMD(epnum)); 396 395 if (!(reg & DWC3_DEPCMD_CMDACT)) { 397 396 cmd_status = DWC3_DEPCMD_STATUS(reg); 398 397 ··· 3382 3381 dep->dwc = dwc; 3383 3382 dep->number = epnum; 3384 3383 dep->direction = direction; 3385 - dep->regs = dwc->regs + DWC3_DEP_BASE(epnum); 3386 3384 dwc->eps[epnum] = dep; 3387 3385 dep->combo_num = 0; 3388 3386 dep->start_cmd_status = 0;
+1 -1
drivers/usb/dwc3/gadget.h
··· 132 132 { 133 133 u32 res_id; 134 134 135 - res_id = dwc3_readl(dep->regs, DWC3_DEPCMD); 135 + res_id = dwc3_readl(dep->dwc->regs, DWC3_DEPCMD(dep->number)); 136 136 dep->resource_index = DWC3_DEPCMD_GET_RSC_IDX(res_id); 137 137 } 138 138