@@ -393,6 +393,12 @@ static const struct phy_ops rcar_gen3_phy_usb2_ops = {
393
393
.owner = THIS_MODULE ,
394
394
};
395
395
396
+ static const struct phy_ops rz_g1c_phy_usb2_ops = {
397
+ .init = rcar_gen3_phy_usb2_init ,
398
+ .exit = rcar_gen3_phy_usb2_exit ,
399
+ .owner = THIS_MODULE ,
400
+ };
401
+
396
402
static irqreturn_t rcar_gen3_phy_usb2_irq (int irq , void * _ch )
397
403
{
398
404
struct rcar_gen3_chan * ch = _ch ;
@@ -411,11 +417,27 @@ static irqreturn_t rcar_gen3_phy_usb2_irq(int irq, void *_ch)
411
417
}
412
418
413
419
static const struct of_device_id rcar_gen3_phy_usb2_match_table [] = {
414
- { .compatible = "renesas,usb2-phy-r8a7795" },
415
- { .compatible = "renesas,usb2-phy-r8a7796" },
416
- { .compatible = "renesas,usb2-phy-r8a77965" },
417
- { .compatible = "renesas,rcar-gen3-usb2-phy" },
418
- { }
420
+ {
421
+ .compatible = "renesas,usb2-phy-r8a77470" ,
422
+ .data = & rz_g1c_phy_usb2_ops ,
423
+ },
424
+ {
425
+ .compatible = "renesas,usb2-phy-r8a7795" ,
426
+ .data = & rcar_gen3_phy_usb2_ops ,
427
+ },
428
+ {
429
+ .compatible = "renesas,usb2-phy-r8a7796" ,
430
+ .data = & rcar_gen3_phy_usb2_ops ,
431
+ },
432
+ {
433
+ .compatible = "renesas,usb2-phy-r8a77965" ,
434
+ .data = & rcar_gen3_phy_usb2_ops ,
435
+ },
436
+ {
437
+ .compatible = "renesas,rcar-gen3-usb2-phy" ,
438
+ .data = & rcar_gen3_phy_usb2_ops ,
439
+ },
440
+ { /* sentinel */ },
419
441
};
420
442
MODULE_DEVICE_TABLE (of , rcar_gen3_phy_usb2_match_table );
421
443
@@ -431,6 +453,7 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
431
453
struct rcar_gen3_chan * channel ;
432
454
struct phy_provider * provider ;
433
455
struct resource * res ;
456
+ const struct phy_ops * phy_usb2_ops ;
434
457
int irq , ret = 0 ;
435
458
436
459
if (!dev -> of_node ) {
@@ -481,7 +504,11 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
481
504
* And then, phy-core will manage runtime pm for this device.
482
505
*/
483
506
pm_runtime_enable (dev );
484
- channel -> phy = devm_phy_create (dev , NULL , & rcar_gen3_phy_usb2_ops );
507
+ phy_usb2_ops = of_device_get_match_data (dev );
508
+ if (!phy_usb2_ops )
509
+ return - EINVAL ;
510
+
511
+ channel -> phy = devm_phy_create (dev , NULL , phy_usb2_ops );
485
512
if (IS_ERR (channel -> phy )) {
486
513
dev_err (dev , "Failed to create USB2 PHY\n" );
487
514
ret = PTR_ERR (channel -> phy );
0 commit comments