aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArgus Lin <argus.lin@mediatek.com>2018-09-04 08:31:54 -0400
committerMatthias Brugger <matthias.bgg@gmail.com>2018-09-25 11:36:38 -0400
commit3013b410a8f50cf251e09da00b8241fd43bb41fa (patch)
tree2489da5ac4cf15fd5b34a73227a381dd70d2232e
parent12b079b0fe8b87229939f64f66f1c9545a91535f (diff)
soc: mediatek: pwrap: add mt6357 driver for mt6765 SoCs
MT6357 is a new power management IC and it is used for mt6765 SoCs. To define mt6357_regs for pmic register mapping and pmic_mt6357 for accessing register. Signed-off-by: Argus Lin <argus.lin@mediatek.com> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
-rw-r--r--drivers/soc/mediatek/mtk-pmic-wrap.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
index 74c86d0cf1fb..8236a6c87e19 100644
--- a/drivers/soc/mediatek/mtk-pmic-wrap.c
+++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
@@ -162,6 +162,21 @@ static const u32 mt6351_regs[] = {
162 [PWRAP_DEW_RDDMY_NO] = 0x030C, 162 [PWRAP_DEW_RDDMY_NO] = 0x030C,
163}; 163};
164 164
165static const u32 mt6357_regs[] = {
166 [PWRAP_DEW_DIO_EN] = 0x040A,
167 [PWRAP_DEW_READ_TEST] = 0x040C,
168 [PWRAP_DEW_WRITE_TEST] = 0x040E,
169 [PWRAP_DEW_CRC_EN] = 0x0412,
170 [PWRAP_DEW_CRC_VAL] = 0x0414,
171 [PWRAP_DEW_CIPHER_KEY_SEL] = 0x0418,
172 [PWRAP_DEW_CIPHER_IV_SEL] = 0x041A,
173 [PWRAP_DEW_CIPHER_EN] = 0x041C,
174 [PWRAP_DEW_CIPHER_RDY] = 0x041E,
175 [PWRAP_DEW_CIPHER_MODE] = 0x0420,
176 [PWRAP_DEW_CIPHER_SWRST] = 0x0422,
177 [PWRAP_DEW_RDDMY_NO] = 0x0424,
178};
179
165static const u32 mt6358_regs[] = { 180static const u32 mt6358_regs[] = {
166 [PWRAP_SMT_CON1] = 0x0030, 181 [PWRAP_SMT_CON1] = 0x0030,
167 [PWRAP_DRV_CON1] = 0x0038, 182 [PWRAP_DRV_CON1] = 0x0038,
@@ -840,6 +855,7 @@ static int mt8183_regs[] = {
840enum pmic_type { 855enum pmic_type {
841 PMIC_MT6323, 856 PMIC_MT6323,
842 PMIC_MT6351, 857 PMIC_MT6351,
858 PMIC_MT6357,
843 PMIC_MT6358, 859 PMIC_MT6358,
844 PMIC_MT6380, 860 PMIC_MT6380,
845 PMIC_MT6397, 861 PMIC_MT6397,
@@ -1305,6 +1321,7 @@ static int pwrap_init_cipher(struct pmic_wrapper *wrp)
1305 break; 1321 break;
1306 case PMIC_MT6323: 1322 case PMIC_MT6323:
1307 case PMIC_MT6351: 1323 case PMIC_MT6351:
1324 case PMIC_MT6357:
1308 pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_CIPHER_EN], 1325 pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_CIPHER_EN],
1309 0x1); 1326 0x1);
1310 break; 1327 break;
@@ -1592,6 +1609,15 @@ static const struct pwrap_slv_type pmic_mt6351 = {
1592 .pwrap_write = pwrap_write16, 1609 .pwrap_write = pwrap_write16,
1593}; 1610};
1594 1611
1612static const struct pwrap_slv_type pmic_mt6357 = {
1613 .dew_regs = mt6357_regs,
1614 .type = PMIC_MT6357,
1615 .regmap = &pwrap_regmap_config16,
1616 .caps = 0,
1617 .pwrap_read = pwrap_read16,
1618 .pwrap_write = pwrap_write16,
1619};
1620
1595static const struct pwrap_slv_type pmic_mt6358 = { 1621static const struct pwrap_slv_type pmic_mt6358 = {
1596 .dew_regs = mt6358_regs, 1622 .dew_regs = mt6358_regs,
1597 .type = PMIC_MT6358, 1623 .type = PMIC_MT6358,
@@ -1628,6 +1654,9 @@ static const struct of_device_id of_slave_match_tbl[] = {
1628 .compatible = "mediatek,mt6351", 1654 .compatible = "mediatek,mt6351",
1629 .data = &pmic_mt6351, 1655 .data = &pmic_mt6351,
1630 }, { 1656 }, {
1657 .compatible = "mediatek,mt6357",
1658 .data = &pmic_mt6357,
1659 }, {
1631 .compatible = "mediatek,mt6358", 1660 .compatible = "mediatek,mt6358",
1632 .data = &pmic_mt6358, 1661 .data = &pmic_mt6358,
1633 }, { 1662 }, {