File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
drivers/usb/gadget/udc/cdns2 Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -2251,7 +2251,6 @@ static int cdns2_gadget_start(struct cdns2_device *pdev)
2251
2251
{
2252
2252
u32 max_speed ;
2253
2253
void * buf ;
2254
- int val ;
2255
2254
int ret ;
2256
2255
2257
2256
pdev -> usb_regs = pdev -> regs ;
@@ -2261,14 +2260,9 @@ static int cdns2_gadget_start(struct cdns2_device *pdev)
2261
2260
pdev -> adma_regs = pdev -> regs + CDNS2_ADMA_REGS_OFFSET ;
2262
2261
2263
2262
/* Reset controller. */
2264
- set_reg_bit_8 (& pdev -> usb_regs -> cpuctrl , CPUCTRL_SW_RST );
2265
-
2266
- ret = readl_poll_timeout_atomic (& pdev -> usb_regs -> cpuctrl , val ,
2267
- !(val & CPUCTRL_SW_RST ), 1 , 10000 );
2268
- if (ret ) {
2269
- dev_err (pdev -> dev , "Error: reset controller timeout\n" );
2270
- return - EINVAL ;
2271
- }
2263
+ writeb (CPUCTRL_SW_RST | CPUCTRL_UPCLK | CPUCTRL_WUEN ,
2264
+ & pdev -> usb_regs -> cpuctrl );
2265
+ usleep_range (5 , 10 );
2272
2266
2273
2267
usb_initialize_gadget (pdev -> dev , & pdev -> gadget , NULL );
2274
2268
Original file line number Diff line number Diff line change @@ -292,8 +292,17 @@ struct cdns2_usb_regs {
292
292
#define SPEEDCTRL_HSDISABLE BIT(7)
293
293
294
294
/* CPUCTRL- bitmasks. */
295
+ /* UP clock enable */
296
+ #define CPUCTRL_UPCLK BIT(0)
295
297
/* Controller reset bit. */
296
298
#define CPUCTRL_SW_RST BIT(1)
299
+ /**
300
+ * If the wuen bit is ‘1’, the upclken is automatically set to ‘1’ after
301
+ * detecting rising edge of wuintereq interrupt. If the wuen bit is ‘0’,
302
+ * the wuintereq interrupt is ignored.
303
+ */
304
+ #define CPUCTRL_WUEN BIT(7)
305
+
297
306
298
307
/**
299
308
* struct cdns2_adma_regs - ADMA controller registers.
You can’t perform that action at this time.
0 commit comments