aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/rtl8411.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/rtl8411.c')
-rw-r--r--drivers/mfd/rtl8411.c53
1 files changed, 13 insertions, 40 deletions
diff --git a/drivers/mfd/rtl8411.c b/drivers/mfd/rtl8411.c
index 1ee867591ee4..327c8894fd4a 100644
--- a/drivers/mfd/rtl8411.c
+++ b/drivers/mfd/rtl8411.c
@@ -441,12 +441,10 @@ static const u32 rtl8411b_qfn48_ms_pull_ctl_disable_tbl[] = {
441 0, 441 0,
442}; 442};
443 443
444void rtl8411_init_params(struct rtsx_pcr *pcr) 444void rtl8411_init_common_params(struct rtsx_pcr *pcr)
445{ 445{
446 pcr->extra_caps = EXTRA_CAPS_SD_SDR50 | EXTRA_CAPS_SD_SDR104; 446 pcr->extra_caps = EXTRA_CAPS_SD_SDR50 | EXTRA_CAPS_SD_SDR104;
447 pcr->num_slots = 2; 447 pcr->num_slots = 2;
448 pcr->ops = &rtl8411_pcr_ops;
449
450 pcr->flags = 0; 448 pcr->flags = 0;
451 pcr->card_drive_sel = RTL8411_CARD_DRIVE_DEFAULT; 449 pcr->card_drive_sel = RTL8411_CARD_DRIVE_DEFAULT;
452 pcr->sd30_drive_sel_1v8 = DRIVER_TYPE_B; 450 pcr->sd30_drive_sel_1v8 = DRIVER_TYPE_B;
@@ -454,47 +452,22 @@ void rtl8411_init_params(struct rtsx_pcr *pcr)
454 pcr->aspm_en = ASPM_L1_EN; 452 pcr->aspm_en = ASPM_L1_EN;
455 pcr->tx_initial_phase = SET_CLOCK_PHASE(23, 7, 14); 453 pcr->tx_initial_phase = SET_CLOCK_PHASE(23, 7, 14);
456 pcr->rx_initial_phase = SET_CLOCK_PHASE(4, 3, 10); 454 pcr->rx_initial_phase = SET_CLOCK_PHASE(4, 3, 10);
457
458 pcr->ic_version = rtl8411_get_ic_version(pcr); 455 pcr->ic_version = rtl8411_get_ic_version(pcr);
459 pcr->sd_pull_ctl_enable_tbl = rtl8411_sd_pull_ctl_enable_tbl; 456}
460 pcr->sd_pull_ctl_disable_tbl = rtl8411_sd_pull_ctl_disable_tbl; 457
461 pcr->ms_pull_ctl_enable_tbl = rtl8411_ms_pull_ctl_enable_tbl; 458void rtl8411_init_params(struct rtsx_pcr *pcr)
462 pcr->ms_pull_ctl_disable_tbl = rtl8411_ms_pull_ctl_disable_tbl; 459{
460 rtl8411_init_common_params(pcr);
461 pcr->ops = &rtl8411_pcr_ops;
462 set_pull_ctrl_tables(pcr, rtl8411);
463} 463}
464 464
465void rtl8411b_init_params(struct rtsx_pcr *pcr) 465void rtl8411b_init_params(struct rtsx_pcr *pcr)
466{ 466{
467 pcr->extra_caps = EXTRA_CAPS_SD_SDR50 | EXTRA_CAPS_SD_SDR104; 467 rtl8411_init_common_params(pcr);
468 pcr->num_slots = 2;
469 pcr->ops = &rtl8411b_pcr_ops; 468 pcr->ops = &rtl8411b_pcr_ops;
470 469 if (rtl8411b_is_qfn48(pcr))
471 pcr->flags = 0; 470 set_pull_ctrl_tables(pcr, rtl8411b_qfn48);
472 pcr->card_drive_sel = RTL8411_CARD_DRIVE_DEFAULT; 471 else
473 pcr->sd30_drive_sel_1v8 = DRIVER_TYPE_B; 472 set_pull_ctrl_tables(pcr, rtl8411b_qfn64);
474 pcr->sd30_drive_sel_3v3 = DRIVER_TYPE_D;
475 pcr->aspm_en = ASPM_L1_EN;
476 pcr->tx_initial_phase = SET_CLOCK_PHASE(23, 7, 14);
477 pcr->rx_initial_phase = SET_CLOCK_PHASE(4, 3, 10);
478
479 pcr->ic_version = rtl8411_get_ic_version(pcr);
480
481 if (rtl8411b_is_qfn48(pcr)) {
482 pcr->sd_pull_ctl_enable_tbl =
483 rtl8411b_qfn48_sd_pull_ctl_enable_tbl;
484 pcr->sd_pull_ctl_disable_tbl =
485 rtl8411b_qfn48_sd_pull_ctl_disable_tbl;
486 pcr->ms_pull_ctl_enable_tbl =
487 rtl8411b_qfn48_ms_pull_ctl_enable_tbl;
488 pcr->ms_pull_ctl_disable_tbl =
489 rtl8411b_qfn48_ms_pull_ctl_disable_tbl;
490 } else {
491 pcr->sd_pull_ctl_enable_tbl =
492 rtl8411b_qfn64_sd_pull_ctl_enable_tbl;
493 pcr->sd_pull_ctl_disable_tbl =
494 rtl8411b_qfn64_sd_pull_ctl_disable_tbl;
495 pcr->ms_pull_ctl_enable_tbl =
496 rtl8411b_qfn64_ms_pull_ctl_enable_tbl;
497 pcr->ms_pull_ctl_disable_tbl =
498 rtl8411b_qfn64_ms_pull_ctl_disable_tbl;
499 }
500} 473}