MFD: mt6397: add support for the MT6392 type-c driver
Signed-off-by: Fabien Parent <fparent@baylibre.com>
diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
index ddffa55..0f2a196 100644
--- a/drivers/mfd/mt6397-core.c
+++ b/drivers/mfd/mt6397-core.c
@@ -31,6 +31,8 @@
#define MT6358_RTC_WRTGR_OFFSET 0x3a
#define MT6392_RTC_BASE 0x8000
#define MT6392_RTC_SIZE 0x3e
+#define MT6392_TYPEC_BASE 0x0800
+#define MT6392_TYPEC_SIZE 0x100
#define MT6397_RTC_BASE 0xe000
#define MT6397_RTC_SIZE 0x3e
#define MT6397_RTC_WRTGR_OFFSET 0x3c
@@ -58,6 +60,11 @@
DEFINE_RES_IRQ(MT6392_IRQ_RTC),
};
+static const struct resource mt6392_typec_resources[] = {
+ DEFINE_RES_MEM(MT6392_TYPEC_BASE, MT6392_TYPEC_SIZE),
+ DEFINE_RES_IRQ(MT6392_IRQ_TYPE_C_CC),
+};
+
static const struct resource mt6397_rtc_resources[] = {
{
.start = MT6397_RTC_BASE,
@@ -96,6 +103,11 @@
.name = "mt6392-regulator",
.of_compatible = "mediatek,mt6392-regulator",
}, {
+ .name = "mt6392-typec",
+ .num_resources = ARRAY_SIZE(mt6392_typec_resources),
+ .resources = mt6392_typec_resources,
+ .of_compatible = "mediatek,mt6392-typec",
+ }, {
.name = "mt6397-rtc",
.num_resources = ARRAY_SIZE(mt6392_rtc_resources),
.resources = mt6392_rtc_resources,