Skip to content

Commit 10f5c40

Browse files
AngeloGioacchino Del Regnombgg
authored andcommitted
soc: mediatek: mtk-pmic-wrap: Add support for MT6331 w/ MT6332 companion
Add support for the MT6331 PMIC and for its companion MT6332 PMIC. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Link: https://lore.kernel.org/r/20230412131216.198313-6-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
1 parent 41ae95a commit 10f5c40

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

drivers/soc/mediatek/mtk-pmic-wrap.c

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,40 @@ static const u32 mt6323_regs[] = {
170170
[PWRAP_DEW_RDDMY_NO] = 0x01a4,
171171
};
172172

173+
static const u32 mt6331_regs[] = {
174+
[PWRAP_DEW_DIO_EN] = 0x018c,
175+
[PWRAP_DEW_READ_TEST] = 0x018e,
176+
[PWRAP_DEW_WRITE_TEST] = 0x0190,
177+
[PWRAP_DEW_CRC_SWRST] = 0x0192,
178+
[PWRAP_DEW_CRC_EN] = 0x0194,
179+
[PWRAP_DEW_CRC_VAL] = 0x0196,
180+
[PWRAP_DEW_MON_GRP_SEL] = 0x0198,
181+
[PWRAP_DEW_CIPHER_KEY_SEL] = 0x019a,
182+
[PWRAP_DEW_CIPHER_IV_SEL] = 0x019c,
183+
[PWRAP_DEW_CIPHER_EN] = 0x019e,
184+
[PWRAP_DEW_CIPHER_RDY] = 0x01a0,
185+
[PWRAP_DEW_CIPHER_MODE] = 0x01a2,
186+
[PWRAP_DEW_CIPHER_SWRST] = 0x01a4,
187+
[PWRAP_DEW_RDDMY_NO] = 0x01a6,
188+
};
189+
190+
static const u32 mt6332_regs[] = {
191+
[PWRAP_DEW_DIO_EN] = 0x80f6,
192+
[PWRAP_DEW_READ_TEST] = 0x80f8,
193+
[PWRAP_DEW_WRITE_TEST] = 0x80fa,
194+
[PWRAP_DEW_CRC_SWRST] = 0x80fc,
195+
[PWRAP_DEW_CRC_EN] = 0x80fe,
196+
[PWRAP_DEW_CRC_VAL] = 0x8100,
197+
[PWRAP_DEW_MON_GRP_SEL] = 0x8102,
198+
[PWRAP_DEW_CIPHER_KEY_SEL] = 0x8104,
199+
[PWRAP_DEW_CIPHER_IV_SEL] = 0x8106,
200+
[PWRAP_DEW_CIPHER_EN] = 0x8108,
201+
[PWRAP_DEW_CIPHER_RDY] = 0x810a,
202+
[PWRAP_DEW_CIPHER_MODE] = 0x810c,
203+
[PWRAP_DEW_CIPHER_SWRST] = 0x810e,
204+
[PWRAP_DEW_RDDMY_NO] = 0x8110,
205+
};
206+
173207
static const u32 mt6351_regs[] = {
174208
[PWRAP_DEW_DIO_EN] = 0x02F2,
175209
[PWRAP_DEW_READ_TEST] = 0x02F4,
@@ -1182,6 +1216,8 @@ static int mt8186_regs[] = {
11821216

11831217
enum pmic_type {
11841218
PMIC_MT6323,
1219+
PMIC_MT6331,
1220+
PMIC_MT6332,
11851221
PMIC_MT6351,
11861222
PMIC_MT6357,
11871223
PMIC_MT6358,
@@ -2041,6 +2077,16 @@ static const struct pwrap_slv_type pmic_mt6323 = {
20412077
PWRAP_SLV_CAP_SECURITY,
20422078
};
20432079

2080+
static const struct pwrap_slv_type pmic_mt6331 = {
2081+
.dew_regs = mt6331_regs,
2082+
.type = PMIC_MT6331,
2083+
.comp_dew_regs = mt6332_regs,
2084+
.comp_type = PMIC_MT6332,
2085+
.regops = &pwrap_regops16,
2086+
.caps = PWRAP_SLV_CAP_SPI | PWRAP_SLV_CAP_DUALIO |
2087+
PWRAP_SLV_CAP_SECURITY,
2088+
};
2089+
20442090
static const struct pwrap_slv_type pmic_mt6351 = {
20452091
.dew_regs = mt6351_regs,
20462092
.type = PMIC_MT6351,
@@ -2086,6 +2132,7 @@ static const struct pwrap_slv_type pmic_mt6397 = {
20862132

20872133
static const struct of_device_id of_slave_match_tbl[] = {
20882134
{ .compatible = "mediatek,mt6323", .data = &pmic_mt6323 },
2135+
{ .compatible = "mediatek,mt6331", .data = &pmic_mt6331 },
20892136
{ .compatible = "mediatek,mt6351", .data = &pmic_mt6351 },
20902137
{ .compatible = "mediatek,mt6357", .data = &pmic_mt6357 },
20912138
{ .compatible = "mediatek,mt6358", .data = &pmic_mt6358 },

0 commit comments

Comments
 (0)