@@ -407,7 +407,7 @@ static int dw_mci_rk3288_execute_tuning(struct dw_mci_slot *slot, u32 opcode)
407
407
return ret ;
408
408
}
409
409
410
- static int dw_mci_rk3288_parse_dt (struct dw_mci * host )
410
+ static int dw_mci_common_parse_dt (struct dw_mci * host )
411
411
{
412
412
struct device_node * np = host -> dev -> of_node ;
413
413
struct dw_mci_rockchip_priv_data * priv ;
@@ -417,13 +417,29 @@ static int dw_mci_rk3288_parse_dt(struct dw_mci *host)
417
417
return - ENOMEM ;
418
418
419
419
if (of_property_read_u32 (np , "rockchip,desired-num-phases" ,
420
- & priv -> num_phases ))
420
+ & priv -> num_phases ))
421
421
priv -> num_phases = 360 ;
422
422
423
423
if (of_property_read_u32 (np , "rockchip,default-sample-phase" ,
424
- & priv -> default_sample_phase ))
424
+ & priv -> default_sample_phase ))
425
425
priv -> default_sample_phase = 0 ;
426
426
427
+ host -> priv = priv ;
428
+
429
+ return 0 ;
430
+ }
431
+
432
+ static int dw_mci_rk3288_parse_dt (struct dw_mci * host )
433
+ {
434
+ struct dw_mci_rockchip_priv_data * priv ;
435
+ int err ;
436
+
437
+ err = dw_mci_common_parse_dt (host );
438
+ if (err )
439
+ return err ;
440
+
441
+ priv = host -> priv ;
442
+
427
443
priv -> drv_clk = devm_clk_get (host -> dev , "ciu-drive" );
428
444
if (IS_ERR (priv -> drv_clk ))
429
445
dev_dbg (host -> dev , "ciu-drive not available\n" );
@@ -432,13 +448,25 @@ static int dw_mci_rk3288_parse_dt(struct dw_mci *host)
432
448
if (IS_ERR (priv -> sample_clk ))
433
449
dev_dbg (host -> dev , "ciu-sample not available\n" );
434
450
435
- host -> priv = priv ;
436
-
437
451
priv -> internal_phase = false;
438
452
439
453
return 0 ;
440
454
}
441
455
456
+ static int dw_mci_rk3576_parse_dt (struct dw_mci * host )
457
+ {
458
+ struct dw_mci_rockchip_priv_data * priv ;
459
+ int err = dw_mci_common_parse_dt (host );
460
+ if (err )
461
+ return err ;
462
+
463
+ priv = host -> priv ;
464
+
465
+ priv -> internal_phase = true;
466
+
467
+ return 0 ;
468
+ }
469
+
442
470
static int dw_mci_rockchip_init (struct dw_mci * host )
443
471
{
444
472
int ret , i ;
@@ -480,11 +508,21 @@ static const struct dw_mci_drv_data rk3288_drv_data = {
480
508
.init = dw_mci_rockchip_init ,
481
509
};
482
510
511
+ static const struct dw_mci_drv_data rk3576_drv_data = {
512
+ .common_caps = MMC_CAP_CMD23 ,
513
+ .set_ios = dw_mci_rk3288_set_ios ,
514
+ .execute_tuning = dw_mci_rk3288_execute_tuning ,
515
+ .parse_dt = dw_mci_rk3576_parse_dt ,
516
+ .init = dw_mci_rockchip_init ,
517
+ };
518
+
483
519
static const struct of_device_id dw_mci_rockchip_match [] = {
484
520
{ .compatible = "rockchip,rk2928-dw-mshc" ,
485
521
.data = & rk2928_drv_data },
486
522
{ .compatible = "rockchip,rk3288-dw-mshc" ,
487
523
.data = & rk3288_drv_data },
524
+ { .compatible = "rockchip,rk3576-dw-mshc" ,
525
+ .data = & rk3576_drv_data },
488
526
{},
489
527
};
490
528
MODULE_DEVICE_TABLE (of , dw_mci_rockchip_match );
0 commit comments