@@ -120,49 +120,8 @@ struct dsps_glue {
120
120
const struct dsps_musb_wrapper * wrp ; /* wrapper register offsets */
121
121
struct timer_list timer [2 ]; /* otg_workaround timer */
122
122
unsigned long last_timer [2 ]; /* last timer data for each instance */
123
- u32 __iomem * usb_ctrl [2 ];
124
123
};
125
124
126
- #define DSPS_AM33XX_CONTROL_MODULE_PHYS_0 0x44e10620
127
- #define DSPS_AM33XX_CONTROL_MODULE_PHYS_1 0x44e10628
128
-
129
- static const resource_size_t dsps_control_module_phys [] = {
130
- DSPS_AM33XX_CONTROL_MODULE_PHYS_0 ,
131
- DSPS_AM33XX_CONTROL_MODULE_PHYS_1 ,
132
- };
133
-
134
- #define USBPHY_CM_PWRDN (1 << 0)
135
- #define USBPHY_OTG_PWRDN (1 << 1)
136
- #define USBPHY_OTGVDET_EN (1 << 19)
137
- #define USBPHY_OTGSESSEND_EN (1 << 20)
138
-
139
- /**
140
- * musb_dsps_phy_control - phy on/off
141
- * @glue: struct dsps_glue *
142
- * @id: musb instance
143
- * @on: flag for phy to be switched on or off
144
- *
145
- * This is to enable the PHY using usb_ctrl register in system control
146
- * module space.
147
- *
148
- * XXX: This function will be removed once we have a seperate driver for
149
- * control module
150
- */
151
- static void musb_dsps_phy_control (struct dsps_glue * glue , u8 id , u8 on )
152
- {
153
- u32 usbphycfg ;
154
-
155
- usbphycfg = readl (glue -> usb_ctrl [id ]);
156
-
157
- if (on ) {
158
- usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN );
159
- usbphycfg |= USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN ;
160
- } else {
161
- usbphycfg |= USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN ;
162
- }
163
-
164
- writel (usbphycfg , glue -> usb_ctrl [id ]);
165
- }
166
125
/**
167
126
* dsps_musb_enable - enable interrupts
168
127
*/
@@ -407,8 +366,7 @@ static int dsps_musb_init(struct musb *musb)
407
366
musb -> mregs += wrp -> musb_core_offset ;
408
367
409
368
/* NOP driver needs change if supporting dual instance */
410
- usb_nop_xceiv_register ();
411
- musb -> xceiv = usb_get_phy (USB_PHY_TYPE_USB2 );
369
+ musb -> xceiv = devm_usb_get_phy_by_phandle (glue -> dev , "phys" , 0 );
412
370
if (IS_ERR_OR_NULL (musb -> xceiv ))
413
371
return - EPROBE_DEFER ;
414
372
@@ -426,9 +384,6 @@ static int dsps_musb_init(struct musb *musb)
426
384
/* Reset the musb */
427
385
dsps_writel (reg_base , wrp -> control , (1 << wrp -> reset ));
428
386
429
- /* Start the on-chip PHY and its PLL. */
430
- musb_dsps_phy_control (glue , pdev -> id , 1 );
431
-
432
387
musb -> isr = dsps_interrupt ;
433
388
434
389
/* reset the otgdisable bit, needed for host mode to work */
@@ -438,8 +393,6 @@ static int dsps_musb_init(struct musb *musb)
438
393
439
394
return 0 ;
440
395
err0 :
441
- usb_put_phy (musb -> xceiv );
442
- usb_nop_xceiv_unregister ();
443
396
return status ;
444
397
}
445
398
@@ -451,14 +404,7 @@ static int dsps_musb_exit(struct musb *musb)
451
404
452
405
del_timer_sync (& glue -> timer [pdev -> id ]);
453
406
454
- /* Shutdown the on-chip PHY and its PLL. */
455
- musb_dsps_phy_control (glue , pdev -> id , 0 );
456
407
usb_phy_shutdown (musb -> xceiv );
457
-
458
- /* NOP driver needs change if supporting dual instance */
459
- usb_put_phy (musb -> xceiv );
460
- usb_nop_xceiv_unregister ();
461
-
462
408
return 0 ;
463
409
}
464
410
@@ -487,16 +433,6 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue, u8 id)
487
433
char res_name [11 ];
488
434
int ret ;
489
435
490
- resources [0 ].start = dsps_control_module_phys [id ];
491
- resources [0 ].end = resources [0 ].start + SZ_4 - 1 ;
492
- resources [0 ].flags = IORESOURCE_MEM ;
493
-
494
- glue -> usb_ctrl [id ] = devm_ioremap_resource (& pdev -> dev , resources );
495
- if (IS_ERR (glue -> usb_ctrl [id ])) {
496
- ret = PTR_ERR (glue -> usb_ctrl [id ]);
497
- goto err0 ;
498
- }
499
-
500
436
/* first resource is for usbss, so start index from 1 */
501
437
res = platform_get_resource (pdev , IORESOURCE_MEM , id + 1 );
502
438
if (!res ) {
@@ -680,36 +616,6 @@ static int dsps_remove(struct platform_device *pdev)
680
616
return 0 ;
681
617
}
682
618
683
- #ifdef CONFIG_PM_SLEEP
684
- static int dsps_suspend (struct device * dev )
685
- {
686
- struct platform_device * pdev = to_platform_device (dev -> parent );
687
- struct dsps_glue * glue = platform_get_drvdata (pdev );
688
- const struct dsps_musb_wrapper * wrp = glue -> wrp ;
689
- int i ;
690
-
691
- for (i = 0 ; i < wrp -> instances ; i ++ )
692
- musb_dsps_phy_control (glue , i , 0 );
693
-
694
- return 0 ;
695
- }
696
-
697
- static int dsps_resume (struct device * dev )
698
- {
699
- struct platform_device * pdev = to_platform_device (dev -> parent );
700
- struct dsps_glue * glue = platform_get_drvdata (pdev );
701
- const struct dsps_musb_wrapper * wrp = glue -> wrp ;
702
- int i ;
703
-
704
- for (i = 0 ; i < wrp -> instances ; i ++ )
705
- musb_dsps_phy_control (glue , i , 1 );
706
-
707
- return 0 ;
708
- }
709
- #endif
710
-
711
- static SIMPLE_DEV_PM_OPS (dsps_pm_ops , dsps_suspend , dsps_resume ) ;
712
-
713
619
static const struct dsps_musb_wrapper am33xx_driver_data = {
714
620
.revision = 0x00 ,
715
621
.control = 0x14 ,
@@ -752,7 +658,6 @@ static struct platform_driver dsps_usbss_driver = {
752
658
.remove = dsps_remove ,
753
659
.driver = {
754
660
.name = "musb-dsps" ,
755
- .pm = & dsps_pm_ops ,
756
661
.of_match_table = of_match_ptr (musb_dsps_of_match ),
757
662
},
758
663
};
0 commit comments