[PATCH] mfd: intel_soc_pmic_bxtwc: Add device for the I2C master
From: Heikki Krogerus
Date: Thu Mar 21 2019 - 10:41:40 EST
Intel WhiskeyCove PMIC has also I2C master interface that is
designed to be used for controlling a discrete battery
charger IC.
Signed-off-by: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
---
drivers/mfd/intel_soc_pmic_bxtwc.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 03fe33882441..52885e2c0d85 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -84,6 +84,7 @@ enum bxtwc_irqs_adc {
enum bxtwc_irqs_chgr {
BXTWC_USBC_IRQ = 0,
+ BXTWC_I2C_IRQ,
BXTWC_CHGR0_IRQ,
BXTWC_CHGR1_IRQ,
};
@@ -121,7 +122,8 @@ static const struct regmap_irq bxtwc_regmap_irqs_adc[] = {
static const struct regmap_irq bxtwc_regmap_irqs_chgr[] = {
REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 0, 0x20),
- REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 0, 0x1f),
+ REGMAP_IRQ_REG(BXTWC_I2C_IRQ, 0, 0x0f),
+ REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 0, 0x10),
REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 1, 0x1f),
};
@@ -208,6 +210,10 @@ static struct resource usbc_resources[] = {
DEFINE_RES_IRQ(BXTWC_USBC_IRQ),
};
+static struct resource i2c_resources[] = {
+ DEFINE_RES_IRQ(BXTWC_I2C_IRQ),
+};
+
static struct resource charger_resources[] = {
DEFINE_RES_IRQ_NAMED(BXTWC_CHGR0_IRQ, "CHARGER"),
DEFINE_RES_IRQ_NAMED(BXTWC_CHGR1_IRQ, "CHARGER1"),
@@ -241,6 +247,11 @@ static struct mfd_cell bxt_wc_dev[] = {
.num_resources = ARRAY_SIZE(usbc_resources),
.resources = usbc_resources,
},
+ {
+ .name = "bxt_wcove_i2c",
+ .num_resources = ARRAY_SIZE(i2c_resources),
+ .resources = i2c_resources,
+ },
{
.name = "bxt_wcove_ext_charger",
.num_resources = ARRAY_SIZE(charger_resources),
--
2.20.1