Skip to contentSkip to conversation

mfd: intel_soc_pmic_bxtwc: Add device for the I2C master

PATCH In review Heikki Krogerus 2 participants 2 messages Mar 21, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: intel_soc_pmic_bxtwc: Add device for the I2C master

Intel WhiskeyCove PMIC has also I2C master interface that is designed to be used for controlling a discrete battery charger IC.

---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/mfd/intel_soc_pmic_bxtwc.c +12 -1
index 03fe33882441..52885e2c0d85 100644
@@ -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),
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Heikki Krogerus

Intel WhiskeyCove PMIC has also I2C master interface that is designed to be used for controlling a discrete battery charger IC.

Quoted 53 lines
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/mfd/intel_soc_pmic_bxtwc.c +12 -1
index 03fe33882441..52885e2c0d85 100644
@@ -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),
Signature · 1 line
2.20.1
Signature · 2 lines
With Best Regards,
Andy Shevchenko