Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc: mediatek: pwrap: add pwrap driver for MT6779 SoCs

MT6779 is a highly integrated SoCs, it uses PMIC_MT6359 for
power management. This patch adds pwrap master driver to
access PMIC_MT6359.

Signed-off-by: Argus Lin <argus.lin@mediatek.com>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>

authored by

Argus Lin and committed by
Matthias Brugger
adc4e8fc 305ce1dc

+57
+57
drivers/soc/mediatek/mtk-pmic-wrap.c
··· 497 497 [PWRAP_DCM_DBC_PRD] = 0x1E0, 498 498 }; 499 499 500 + static int mt6779_regs[] = { 501 + [PWRAP_MUX_SEL] = 0x0, 502 + [PWRAP_WRAP_EN] = 0x4, 503 + [PWRAP_DIO_EN] = 0x8, 504 + [PWRAP_RDDMY] = 0x20, 505 + [PWRAP_CSHEXT_WRITE] = 0x24, 506 + [PWRAP_CSHEXT_READ] = 0x28, 507 + [PWRAP_CSLEXT_WRITE] = 0x2C, 508 + [PWRAP_CSLEXT_READ] = 0x30, 509 + [PWRAP_EXT_CK_WRITE] = 0x34, 510 + [PWRAP_STAUPD_CTRL] = 0x3C, 511 + [PWRAP_STAUPD_GRPEN] = 0x40, 512 + [PWRAP_EINT_STA0_ADR] = 0x44, 513 + [PWRAP_HARB_HPRIO] = 0x68, 514 + [PWRAP_HIPRIO_ARB_EN] = 0x6C, 515 + [PWRAP_MAN_EN] = 0x7C, 516 + [PWRAP_MAN_CMD] = 0x80, 517 + [PWRAP_WACS0_EN] = 0x8C, 518 + [PWRAP_INIT_DONE0] = 0x90, 519 + [PWRAP_WACS1_EN] = 0x94, 520 + [PWRAP_WACS2_EN] = 0x9C, 521 + [PWRAP_INIT_DONE1] = 0x98, 522 + [PWRAP_INIT_DONE2] = 0xA0, 523 + [PWRAP_INT_EN] = 0xBC, 524 + [PWRAP_INT_FLG_RAW] = 0xC0, 525 + [PWRAP_INT_FLG] = 0xC4, 526 + [PWRAP_INT_CLR] = 0xC8, 527 + [PWRAP_INT1_EN] = 0xCC, 528 + [PWRAP_INT1_FLG] = 0xD4, 529 + [PWRAP_INT1_CLR] = 0xD8, 530 + [PWRAP_TIMER_EN] = 0xF0, 531 + [PWRAP_WDT_UNIT] = 0xF8, 532 + [PWRAP_WDT_SRC_EN] = 0xFC, 533 + [PWRAP_WDT_SRC_EN_1] = 0x100, 534 + [PWRAP_WACS2_CMD] = 0xC20, 535 + [PWRAP_WACS2_RDATA] = 0xC24, 536 + [PWRAP_WACS2_VLDCLR] = 0xC28, 537 + }; 538 + 500 539 static int mt6797_regs[] = { 501 540 [PWRAP_MUX_SEL] = 0x0, 502 541 [PWRAP_WRAP_EN] = 0x4, ··· 984 945 enum pwrap_type { 985 946 PWRAP_MT2701, 986 947 PWRAP_MT6765, 948 + PWRAP_MT6779, 987 949 PWRAP_MT6797, 988 950 PWRAP_MT7622, 989 951 PWRAP_MT8135, ··· 1417 1377 break; 1418 1378 case PWRAP_MT2701: 1419 1379 case PWRAP_MT6765: 1380 + case PWRAP_MT6779: 1420 1381 case PWRAP_MT6797: 1421 1382 case PWRAP_MT8173: 1422 1383 case PWRAP_MT8516: ··· 1824 1783 .init_soc_specific = NULL, 1825 1784 }; 1826 1785 1786 + static const struct pmic_wrapper_type pwrap_mt6779 = { 1787 + .regs = mt6779_regs, 1788 + .type = PWRAP_MT6779, 1789 + .arb_en_all = 0xfbb7f, 1790 + .int_en_all = 0xfffffffe, 1791 + .int1_en_all = 0, 1792 + .spi_w = PWRAP_MAN_CMD_SPI_WRITE, 1793 + .wdt_src = PWRAP_WDT_SRC_MASK_ALL, 1794 + .caps = 0, 1795 + .init_reg_clock = pwrap_common_init_reg_clock, 1796 + .init_soc_specific = NULL, 1797 + }; 1798 + 1827 1799 static const struct pmic_wrapper_type pwrap_mt6797 = { 1828 1800 .regs = mt6797_regs, 1829 1801 .type = PWRAP_MT6797, ··· 1921 1867 }, { 1922 1868 .compatible = "mediatek,mt6765-pwrap", 1923 1869 .data = &pwrap_mt6765, 1870 + }, { 1871 + .compatible = "mediatek,mt6779-pwrap", 1872 + .data = &pwrap_mt6779, 1924 1873 }, { 1925 1874 .compatible = "mediatek,mt6797-pwrap", 1926 1875 .data = &pwrap_mt6797,