All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/8] mfd: intel_soc_pmic_bxtwc: fix TMU interrupt index
@ 2017-04-14 23:25 ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-04-14 23:25 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

TMU interrupts are registered as a separate interrupt chip, and
hence it should start its interrupt index(BXTWC_TMU_IRQ) number
from 0. But currently, BXTWC_TMU_IRQ is defined as part of enum
bxtwc_irqs_level2 and its index value is 11. Since this index
value is used when calculating .num_irqs of regmap_irq_chip_tmu,
it incorrectly reports number of irqs as 12 instead of actual
value of 1.

This patch fixes this issue by creating new enum of tmu irqs and
resetting its starting index to 0.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Changes since v1: 
 * Removed code from commit message.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 699c8c7..bb18e20 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -94,7 +94,10 @@ enum bxtwc_irqs_level2 {
 	BXTWC_GPIO0_IRQ,
 	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
-	BXTWC_TMU_IRQ,
+};
+
+enum bxtwc_irqs_tmu {
+	BXTWC_TMU_IRQ = 0,
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v2 1/8] mfd: intel_soc_pmic_bxtwc: fix TMU interrupt index
@ 2017-04-14 23:25 ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-04-14 23:25 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

TMU interrupts are registered as a separate interrupt chip, and
hence it should start its interrupt index(BXTWC_TMU_IRQ) number
from 0. But currently, BXTWC_TMU_IRQ is defined as part of enum
bxtwc_irqs_level2 and its index value is 11. Since this index
value is used when calculating .num_irqs of regmap_irq_chip_tmu,
it incorrectly reports number of irqs as 12 instead of actual
value of 1.

This patch fixes this issue by creating new enum of tmu irqs and
resetting its starting index to 0.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Changes since v1: 
 * Removed code from commit message.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 699c8c7..bb18e20 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -94,7 +94,10 @@ enum bxtwc_irqs_level2 {
 	BXTWC_GPIO0_IRQ,
 	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
-	BXTWC_TMU_IRQ,
+};
+
+enum bxtwc_irqs_tmu {
+	BXTWC_TMU_IRQ = 0,
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v2 2/8] mfd: intel_soc_pmic_bxtwc: remove thermal second level irqs
  2017-04-14 23:25 ` sathyanarayanan.kuppuswamy
@ 2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-04-14 23:25 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Since all second level thermal irqs are consumed by the same
device(bxt_wcove_thermal), there is no need to expose them as separate
interrupts. We can just export only the first level irqs for thermal and
let the device(bxt_wcove_thermal) driver handle the second level irqs
based on thermal interrupt status register. Also, just using only the
first level irq will eliminate the bug involved in requesting only the
second level irq and not explicitly enable the first level irq. For
more info on this issue please read the details at,

https://lkml.org/lkml/2017/2/27/148

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 32 ++++++++++++--------------------
 1 file changed, 12 insertions(+), 20 deletions(-)

Changes since v1:
 * None

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index bb18e20..c08d514 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -83,10 +83,7 @@ enum bxtwc_irqs {
 
 enum bxtwc_irqs_level2 {
 	/* Level 2 */
-	BXTWC_THRM0_IRQ = 0,
-	BXTWC_THRM1_IRQ,
-	BXTWC_THRM2_IRQ,
-	BXTWC_BCU_IRQ,
+	BXTWC_BCU_IRQ = 0,
 	BXTWC_ADC_IRQ,
 	BXTWC_USBC_IRQ,
 	BXTWC_CHGR0_IRQ,
@@ -113,17 +110,14 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
-	REGMAP_IRQ_REG(BXTWC_THRM0_IRQ, 0, 0xff),
-	REGMAP_IRQ_REG(BXTWC_THRM1_IRQ, 1, 0xbf),
-	REGMAP_IRQ_REG(BXTWC_THRM2_IRQ, 2, 0xff),
-	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 4, 0xff),
-	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 5, BIT(5)),
-	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 5, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 6, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 7, 0xff),
-	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 8, 0x3f),
-	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 9, 0x03),
+	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
+	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
+	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 4, 0xff),
+	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 5, 0x3f),
+	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
@@ -141,8 +135,8 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 
 static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
 	.name = "bxtwc_irq_chip_level2",
-	.status_base = BXTWC_THRM0IRQ,
-	.mask_base = BXTWC_MTHRM0IRQ,
+	.status_base = BXTWC_BCUIRQ,
+	.mask_base = BXTWC_MBCUIRQ,
 	.irqs = bxtwc_regmap_irqs_level2,
 	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
 	.num_regs = 10,
@@ -176,9 +170,7 @@ static struct resource charger_resources[] = {
 };
 
 static struct resource thermal_resources[] = {
-	DEFINE_RES_IRQ(BXTWC_THRM0_IRQ),
-	DEFINE_RES_IRQ(BXTWC_THRM1_IRQ),
-	DEFINE_RES_IRQ(BXTWC_THRM2_IRQ),
+	DEFINE_RES_IRQ(BXTWC_THRM_LVL1_IRQ),
 };
 
 static struct resource bcu_resources[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v2 2/8] mfd: intel_soc_pmic_bxtwc: remove thermal second level irqs
@ 2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-04-14 23:25 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Since all second level thermal irqs are consumed by the same
device(bxt_wcove_thermal), there is no need to expose them as separate
interrupts. We can just export only the first level irqs for thermal and
let the device(bxt_wcove_thermal) driver handle the second level irqs
based on thermal interrupt status register. Also, just using only the
first level irq will eliminate the bug involved in requesting only the
second level irq and not explicitly enable the first level irq. For
more info on this issue please read the details at,

https://lkml.org/lkml/2017/2/27/148

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 32 ++++++++++++--------------------
 1 file changed, 12 insertions(+), 20 deletions(-)

Changes since v1:
 * None

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index bb18e20..c08d514 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -83,10 +83,7 @@ enum bxtwc_irqs {
 
 enum bxtwc_irqs_level2 {
 	/* Level 2 */
-	BXTWC_THRM0_IRQ = 0,
-	BXTWC_THRM1_IRQ,
-	BXTWC_THRM2_IRQ,
-	BXTWC_BCU_IRQ,
+	BXTWC_BCU_IRQ = 0,
 	BXTWC_ADC_IRQ,
 	BXTWC_USBC_IRQ,
 	BXTWC_CHGR0_IRQ,
@@ -113,17 +110,14 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
-	REGMAP_IRQ_REG(BXTWC_THRM0_IRQ, 0, 0xff),
-	REGMAP_IRQ_REG(BXTWC_THRM1_IRQ, 1, 0xbf),
-	REGMAP_IRQ_REG(BXTWC_THRM2_IRQ, 2, 0xff),
-	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 4, 0xff),
-	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 5, BIT(5)),
-	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 5, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 6, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 7, 0xff),
-	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 8, 0x3f),
-	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 9, 0x03),
+	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
+	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
+	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 4, 0xff),
+	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 5, 0x3f),
+	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
@@ -141,8 +135,8 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 
 static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
 	.name = "bxtwc_irq_chip_level2",
-	.status_base = BXTWC_THRM0IRQ,
-	.mask_base = BXTWC_MTHRM0IRQ,
+	.status_base = BXTWC_BCUIRQ,
+	.mask_base = BXTWC_MBCUIRQ,
 	.irqs = bxtwc_regmap_irqs_level2,
 	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
 	.num_regs = 10,
@@ -176,9 +170,7 @@ static struct resource charger_resources[] = {
 };
 
 static struct resource thermal_resources[] = {
-	DEFINE_RES_IRQ(BXTWC_THRM0_IRQ),
-	DEFINE_RES_IRQ(BXTWC_THRM1_IRQ),
-	DEFINE_RES_IRQ(BXTWC_THRM2_IRQ),
+	DEFINE_RES_IRQ(BXTWC_THRM_LVL1_IRQ),
 };
 
 static struct resource bcu_resources[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v2 3/8] thermal: intel_bxt_pmic_thermal: use first level PMIC thermal irq
  2017-04-14 23:25 ` sathyanarayanan.kuppuswamy
@ 2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-04-14 23:25 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

PMIC mfd driver only exports first level irq for thermal device.
But currently we are reading the irqs from the second level irq
chip, So this patch fixes this issue by adding support to use
first level PMIC thermal irq.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
 drivers/thermal/intel_bxt_pmic_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Changes since v1:
 * None

diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c b/drivers/thermal/intel_bxt_pmic_thermal.c
index 0f19a39..ef6b322 100644
--- a/drivers/thermal/intel_bxt_pmic_thermal.c
+++ b/drivers/thermal/intel_bxt_pmic_thermal.c
@@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct platform_device *pdev)
 	}
 
 	regmap = pmic->regmap;
-	regmap_irq_chip = pmic->irq_chip_data_level2;
+	regmap_irq_chip = pmic->irq_chip_data;
 
 	pmic_irq_count = 0;
 	while ((irq = platform_get_irq(pdev, pmic_irq_count)) != -ENXIO) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v2 3/8] thermal: intel_bxt_pmic_thermal: use first level PMIC thermal irq
@ 2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-04-14 23:25 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

PMIC mfd driver only exports first level irq for thermal device.
But currently we are reading the irqs from the second level irq
chip, So this patch fixes this issue by adding support to use
first level PMIC thermal irq.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
 drivers/thermal/intel_bxt_pmic_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Changes since v1:
 * None

diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c b/drivers/thermal/intel_bxt_pmic_thermal.c
index 0f19a39..ef6b322 100644
--- a/drivers/thermal/intel_bxt_pmic_thermal.c
+++ b/drivers/thermal/intel_bxt_pmic_thermal.c
@@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct platform_device *pdev)
 	}
 
 	regmap = pmic->regmap;
-	regmap_irq_chip = pmic->irq_chip_data_level2;
+	regmap_irq_chip = pmic->irq_chip_data;
 
 	pmic_irq_count = 0;
 	while ((irq = platform_get_irq(pdev, pmic_irq_count)) != -ENXIO) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v2 4/8] mfd: intel_soc_pmic_bxtwc: remove second level irq for gpio device
  2017-04-14 23:25 ` sathyanarayanan.kuppuswamy
@ 2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-04-14 23:25 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Currently all PMIC GPIO domain irqs are consumed by the same
device(bxt_wcove_gpio), so there is no need to export them as
separate interrupts. We can just export only the first level
GPIO irq(BXTWC_GPIO_LVL1_IRQ) as an irq resource and let the
GPIO device driver(bxt_wcove_gpio) handle the GPIO sub domain
irqs based on status value of GPIO level2 interrupt status
register. Also, just using only the first level irq will eliminate
the bug involved in requesting only the second level irq and not
explicitly enable the first level irq. For more info on this
issue please read the details at,

https://lkml.org/lkml/2017/2/27/148

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Changes since v1:
 * None

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index c08d514..dc8af1d 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -88,8 +88,6 @@ enum bxtwc_irqs_level2 {
 	BXTWC_USBC_IRQ,
 	BXTWC_CHGR0_IRQ,
 	BXTWC_CHGR1_IRQ,
-	BXTWC_GPIO0_IRQ,
-	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
 };
 
@@ -115,8 +113,6 @@ static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
 	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
 	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
 	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 4, 0xff),
-	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 5, 0x3f),
 	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
@@ -152,8 +148,7 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 };
 
 static struct resource gpio_resources[] = {
-	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO0_IRQ, "GPIO0"),
-	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO1_IRQ, "GPIO1"),
+	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
 };
 
 static struct resource adc_resources[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v2 4/8] mfd: intel_soc_pmic_bxtwc: remove second level irq for gpio device
@ 2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-04-14 23:25 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Currently all PMIC GPIO domain irqs are consumed by the same
device(bxt_wcove_gpio), so there is no need to export them as
separate interrupts. We can just export only the first level
GPIO irq(BXTWC_GPIO_LVL1_IRQ) as an irq resource and let the
GPIO device driver(bxt_wcove_gpio) handle the GPIO sub domain
irqs based on status value of GPIO level2 interrupt status
register. Also, just using only the first level irq will eliminate
the bug involved in requesting only the second level irq and not
explicitly enable the first level irq. For more info on this
issue please read the details at,

https://lkml.org/lkml/2017/2/27/148

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Changes since v1:
 * None

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index c08d514..dc8af1d 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -88,8 +88,6 @@ enum bxtwc_irqs_level2 {
 	BXTWC_USBC_IRQ,
 	BXTWC_CHGR0_IRQ,
 	BXTWC_CHGR1_IRQ,
-	BXTWC_GPIO0_IRQ,
-	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
 };
 
@@ -115,8 +113,6 @@ static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
 	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
 	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
 	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 4, 0xff),
-	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 5, 0x3f),
 	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
@@ -152,8 +148,7 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 };
 
 static struct resource gpio_resources[] = {
-	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO0_IRQ, "GPIO0"),
-	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO1_IRQ, "GPIO1"),
+	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
 };
 
 static struct resource adc_resources[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v2 5/8] gpio: gpio-wcove: use first level PMIC GPIO irq
  2017-04-14 23:25 ` sathyanarayanan.kuppuswamy
@ 2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-04-14 23:25 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

PMIC mfd driver only exports first level irq for GPIO device.
But currently we are reading the irqs from the second level irq
chip, So this patch fixes this issue by adding support to use
first level PMIC GPIO irq.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
 drivers/gpio/gpio-wcove.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

Changes since v1:
 * used correct mask for GPIO0 and GPIO1 interrupts

diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c
index 97613de..fd7ad85 100644
--- a/drivers/gpio/gpio-wcove.c
+++ b/drivers/gpio/gpio-wcove.c
@@ -51,6 +51,8 @@
 #define GROUP1_NR_IRQS		6
 #define IRQ_MASK_BASE		0x4e19
 #define IRQ_STATUS_BASE		0x4e0b
+#define GPIO_IRQ0_MASK		0x7f
+#define GPIO_IRQ1_MASK		0x3f
 #define UPDATE_IRQ_TYPE		BIT(0)
 #define UPDATE_IRQ_MASK		BIT(1)
 
@@ -399,7 +401,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
 	if (!wg)
 		return -ENOMEM;
 
-	wg->regmap_irq_chip = pmic->irq_chip_data_level2;
+	wg->regmap_irq_chip = pmic->irq_chip_data;
 
 	platform_set_drvdata(pdev, wg);
 
@@ -447,6 +449,18 @@ static int wcove_gpio_probe(struct platform_device *pdev)
 
 	gpiochip_set_nested_irqchip(&wg->chip, &wcove_irqchip, virq);
 
+	/* Enable GPIO0 interrupts */
+	ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE, GPIO_IRQ0_MASK,
+				 0x00);
+	if (ret)
+		return ret;
+
+	/* Enable GPIO1 interrupts */
+	ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE + 1, GPIO_IRQ1_MASK,
+				 0x00);
+	if (ret)
+		return ret;
+
 	return 0;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v2 5/8] gpio: gpio-wcove: use first level PMIC GPIO irq
@ 2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-04-14 23:25 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

PMIC mfd driver only exports first level irq for GPIO device.
But currently we are reading the irqs from the second level irq
chip, So this patch fixes this issue by adding support to use
first level PMIC GPIO irq.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
 drivers/gpio/gpio-wcove.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

Changes since v1:
 * used correct mask for GPIO0 and GPIO1 interrupts

diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c
index 97613de..fd7ad85 100644
--- a/drivers/gpio/gpio-wcove.c
+++ b/drivers/gpio/gpio-wcove.c
@@ -51,6 +51,8 @@
 #define GROUP1_NR_IRQS		6
 #define IRQ_MASK_BASE		0x4e19
 #define IRQ_STATUS_BASE		0x4e0b
+#define GPIO_IRQ0_MASK		0x7f
+#define GPIO_IRQ1_MASK		0x3f
 #define UPDATE_IRQ_TYPE		BIT(0)
 #define UPDATE_IRQ_MASK		BIT(1)
 
@@ -399,7 +401,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
 	if (!wg)
 		return -ENOMEM;
 
-	wg->regmap_irq_chip = pmic->irq_chip_data_level2;
+	wg->regmap_irq_chip = pmic->irq_chip_data;
 
 	platform_set_drvdata(pdev, wg);
 
@@ -447,6 +449,18 @@ static int wcove_gpio_probe(struct platform_device *pdev)
 
 	gpiochip_set_nested_irqchip(&wg->chip, &wcove_irqchip, virq);
 
+	/* Enable GPIO0 interrupts */
+	ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE, GPIO_IRQ0_MASK,
+				 0x00);
+	if (ret)
+		return ret;
+
+	/* Enable GPIO1 interrupts */
+	ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE + 1, GPIO_IRQ1_MASK,
+				 0x00);
+	if (ret)
+		return ret;
+
 	return 0;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v2 6/8] mfd: intel_soc_pmic_bxtwc: utilize devm_* functions in driver probe
  2017-04-14 23:25 ` sathyanarayanan.kuppuswamy
@ 2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-04-14 23:25 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Cleanup the resource allocation/free code in probe function by using
devm_* calls.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 54 +++++++++++++-------------------------
 1 file changed, 18 insertions(+), 36 deletions(-)

Changes since v1:
 * None

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index dc8af1d..442dc29 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -400,45 +400,44 @@ static int bxtwc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip,
-				  &pmic->irq_chip_data);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip,
+				       &pmic->irq_chip_data);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add IRQ chip\n");
 		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip_level2,
-				  &pmic->irq_chip_data_level2);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip_level2,
+				       &pmic->irq_chip_data_level2);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
-		goto err_irq_chip_level2;
+		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip_tmu,
-				  &pmic->irq_chip_data_tmu);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip_tmu,
+				       &pmic->irq_chip_data_tmu);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
-		goto err_irq_chip_tmu;
+		return ret;
 	}
 
-	ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
-			      ARRAY_SIZE(bxt_wc_dev), NULL, 0,
-			      NULL);
+	ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
+				   ARRAY_SIZE(bxt_wc_dev), NULL, 0, NULL);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add devices\n");
-		goto err_mfd;
+		return ret;
 	}
 
 	ret = sysfs_create_group(&pdev->dev.kobj, &bxtwc_group);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to create sysfs group %d\n", ret);
-		goto err_sysfs;
+		return ret;
 	}
 
 	/*
@@ -452,28 +451,11 @@ static int bxtwc_probe(struct platform_device *pdev)
 				BXTWC_MIRQLVL1_MCHGR, 0);
 
 	return 0;
-
-err_sysfs:
-	mfd_remove_devices(&pdev->dev);
-err_mfd:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
-err_irq_chip_tmu:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
-err_irq_chip_level2:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-
-	return ret;
 }
 
 static int bxtwc_remove(struct platform_device *pdev)
 {
-	struct intel_soc_pmic *pmic = dev_get_drvdata(&pdev->dev);
-
 	sysfs_remove_group(&pdev->dev.kobj, &bxtwc_group);
-	mfd_remove_devices(&pdev->dev);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
 
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v2 6/8] mfd: intel_soc_pmic_bxtwc: utilize devm_* functions in driver probe
@ 2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-04-14 23:25 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Cleanup the resource allocation/free code in probe function by using
devm_* calls.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 54 +++++++++++++-------------------------
 1 file changed, 18 insertions(+), 36 deletions(-)

Changes since v1:
 * None

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index dc8af1d..442dc29 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -400,45 +400,44 @@ static int bxtwc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip,
-				  &pmic->irq_chip_data);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip,
+				       &pmic->irq_chip_data);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add IRQ chip\n");
 		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip_level2,
-				  &pmic->irq_chip_data_level2);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip_level2,
+				       &pmic->irq_chip_data_level2);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
-		goto err_irq_chip_level2;
+		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip_tmu,
-				  &pmic->irq_chip_data_tmu);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip_tmu,
+				       &pmic->irq_chip_data_tmu);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
-		goto err_irq_chip_tmu;
+		return ret;
 	}
 
-	ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
-			      ARRAY_SIZE(bxt_wc_dev), NULL, 0,
-			      NULL);
+	ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
+				   ARRAY_SIZE(bxt_wc_dev), NULL, 0, NULL);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add devices\n");
-		goto err_mfd;
+		return ret;
 	}
 
 	ret = sysfs_create_group(&pdev->dev.kobj, &bxtwc_group);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to create sysfs group %d\n", ret);
-		goto err_sysfs;
+		return ret;
 	}
 
 	/*
@@ -452,28 +451,11 @@ static int bxtwc_probe(struct platform_device *pdev)
 				BXTWC_MIRQLVL1_MCHGR, 0);
 
 	return 0;
-
-err_sysfs:
-	mfd_remove_devices(&pdev->dev);
-err_mfd:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
-err_irq_chip_tmu:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
-err_irq_chip_level2:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-
-	return ret;
 }
 
 static int bxtwc_remove(struct platform_device *pdev)
 {
-	struct intel_soc_pmic *pmic = dev_get_drvdata(&pdev->dev);
-
 	sysfs_remove_group(&pdev->dev.kobj, &bxtwc_group);
-	mfd_remove_devices(&pdev->dev);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
 
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v2 7/8] mfd: intel_soc_pmic_bxtwc: use chained irqs for second level irq chips
  2017-04-14 23:25 ` sathyanarayanan.kuppuswamy
@ 2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-04-14 23:25 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Whishkey cove PMIC has support to mask/unmask interrupts at two levels.
At first level we can mask/unmask interrupt domains like TMU, GPIO, ADC,
CHGR, BCU THERMAL and PWRBTN and at second level, it provides facility
to mask/unmask individual interrupts belong each of this domain. For
example, in case of TMU, at first level we have TMU interrupt domain,
and at second level we have two interrupts, wake alarm, system alarm that
belong to the TMU interrupt domain.

Currently, in this driver all first level irqs are registered as part of
irq chip(bxtwc_regmap_irq_chip). By default, after you register the irq
chip from your driver, all irqs in that chip will masked and can only be
enabled if that irq is requested using request_irq call. This is the
default Linux irq behavior model. And whenever a dependent device that
belongs to PMIC requests only the second level irq and not explicitly
unmask the first level irq, then in essence the second level irq will
still be disabled. For example, if TMU device driver request wake_alarm
irq and not explicitly unmask TMU level 1 irq then according to the default
Linux irq model,  wake_alarm irq will still be disabled. So the proper
solution to fix this issue is to use the chained irq chip concept. We
should chain all the second level chip irqs to the corresponding first
level irq. To do this, we need to create separate irq chips for every
group of second level irqs.

In case of TMU, when adding second level irq chip, instead of using pmic
irq we should use the corresponding first level irq. So the following
code will change from

ret = regmap_add_irq_chip(pmic->regmap, pmic->irq, ...)

to,

virq = regmap_irq_get_virq(&pmic->irq_chip_data, BXTWC_TMU_LVL1_IRQ);

ret = regmap_add_irq_chip(pmic->regmap, virq, ...)

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 174 +++++++++++++++++++++++++++++--------
 include/linux/mfd/intel_soc_pmic.h |   5 +-
 2 files changed, 144 insertions(+), 35 deletions(-)

Changes since v1:
 * Rebased on top of dev_* cleanup patch.
 * Fixed style & grammer issues reported by Lee Jones

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 442dc29..9a04187 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -81,18 +81,26 @@ enum bxtwc_irqs {
 	BXTWC_PWRBTN_IRQ,
 };
 
-enum bxtwc_irqs_level2 {
-	/* Level 2 */
+enum bxtwc_irqs_tmu {
+	BXTWC_TMU_IRQ = 0,
+};
+
+enum bxtwc_irqs_bcu {
 	BXTWC_BCU_IRQ = 0,
-	BXTWC_ADC_IRQ,
-	BXTWC_USBC_IRQ,
+};
+
+enum bxtwc_irqs_adc {
+	BXTWC_ADC_IRQ = 0,
+};
+
+enum bxtwc_irqs_chgr {
+	BXTWC_USBC_IRQ = 0,
 	BXTWC_CHGR0_IRQ,
 	BXTWC_CHGR1_IRQ,
-	BXTWC_CRIT_IRQ,
 };
 
-enum bxtwc_irqs_tmu {
-	BXTWC_TMU_IRQ = 0,
+enum bxtwc_irqs_crit {
+	BXTWC_CRIT_IRQ = 0,
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs[] = {
@@ -107,17 +115,26 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
 	REGMAP_IRQ_REG(BXTWC_PWRBTN_IRQ, 1, 0x03),
 };
 
-static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
+static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
+	REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_bcu[] = {
 	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
-	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
-	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
-static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
-	REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
+static const struct regmap_irq bxtwc_regmap_irqs_adc[] = {
+	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 0, 0xff),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_chgr[] = {
+	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 0, BIT(5)),
+	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 0, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 1, 0x1f),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_crit[] = {
+	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 0, 0x03),
 };
 
 static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
@@ -129,15 +146,6 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 	.num_regs = 2,
 };
 
-static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
-	.name = "bxtwc_irq_chip_level2",
-	.status_base = BXTWC_BCUIRQ,
-	.mask_base = BXTWC_MBCUIRQ,
-	.irqs = bxtwc_regmap_irqs_level2,
-	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
-	.num_regs = 10,
-};
-
 static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 	.name = "bxtwc_irq_chip_tmu",
 	.status_base = BXTWC_TMUIRQ,
@@ -147,6 +155,42 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 	.num_regs = 1,
 };
 
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_bcu = {
+	.name = "bxtwc_irq_chip_bcu",
+	.status_base = BXTWC_BCUIRQ,
+	.mask_base = BXTWC_MBCUIRQ,
+	.irqs = bxtwc_regmap_irqs_bcu,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_bcu),
+	.num_regs = 1,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_adc = {
+	.name = "bxtwc_irq_chip_adc",
+	.status_base = BXTWC_ADCIRQ,
+	.mask_base = BXTWC_MADCIRQ,
+	.irqs = bxtwc_regmap_irqs_adc,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_adc),
+	.num_regs = 1,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_chgr = {
+	.name = "bxtwc_irq_chip_chgr",
+	.status_base = BXTWC_CHGR0IRQ,
+	.mask_base = BXTWC_MCHGR0IRQ,
+	.irqs = bxtwc_regmap_irqs_chgr,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_chgr),
+	.num_regs = 2,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_crit = {
+	.name = "bxtwc_irq_chip_crit",
+	.status_base = BXTWC_CRITIRQ,
+	.mask_base = BXTWC_MCRITIRQ,
+	.irqs = bxtwc_regmap_irqs_crit,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_crit),
+	.num_regs = 1,
+};
+
 static struct resource gpio_resources[] = {
 	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
 };
@@ -358,6 +402,24 @@ static const struct regmap_config bxtwc_regmap_config = {
 	.reg_read = regmap_ipc_byte_reg_read,
 };
 
+static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic,
+				struct regmap_irq_chip_data *pdata,
+				int pirq, int irq_flags,
+				const struct regmap_irq_chip *chip,
+				struct regmap_irq_chip_data **data)
+{
+	int irq;
+
+	irq = regmap_irq_get_virq(pdata, pirq);
+	if (irq < 0) {
+		dev_err(pmic->dev, "failed to get virtual interrupt:%d\n", irq);
+		return irq;
+	}
+
+	return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags,
+					0, chip, data);
+}
+
 static int bxtwc_probe(struct platform_device *pdev)
 {
 	int ret;
@@ -409,21 +471,65 @@ static int bxtwc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
-				       IRQF_ONESHOT | IRQF_SHARED,
-				       0, &bxtwc_regmap_irq_chip_level2,
-				       &pmic->irq_chip_data_level2);
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_TMU_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_tmu,
+					 &pmic->irq_chip_data_tmu);
 	if (ret) {
-		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
+		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
 		return ret;
 	}
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
-				       IRQF_ONESHOT | IRQF_SHARED,
-				       0, &bxtwc_regmap_irq_chip_tmu,
-				       &pmic->irq_chip_data_tmu);
+	/* Add chained IRQ handler for BCU IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_BCU_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_bcu,
+					 &pmic->irq_chip_data_bcu);
+
+
 	if (ret) {
-		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
+		dev_err(&pdev->dev, "Failed to add BUC IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for ADC IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_ADC_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_adc,
+					 &pmic->irq_chip_data_adc);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add ADC IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for CHGR IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_CHGR_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_chgr,
+					 &pmic->irq_chip_data_chgr);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add CHGR IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for CRIT IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_CRIT_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_crit,
+					 &pmic->irq_chip_data_crit);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add CRIT IRQ chip\n");
 		return ret;
 	}
 
diff --git a/include/linux/mfd/intel_soc_pmic.h b/include/linux/mfd/intel_soc_pmic.h
index 956caa0..5aacdb0 100644
--- a/include/linux/mfd/intel_soc_pmic.h
+++ b/include/linux/mfd/intel_soc_pmic.h
@@ -25,8 +25,11 @@ struct intel_soc_pmic {
 	int irq;
 	struct regmap *regmap;
 	struct regmap_irq_chip_data *irq_chip_data;
-	struct regmap_irq_chip_data *irq_chip_data_level2;
 	struct regmap_irq_chip_data *irq_chip_data_tmu;
+	struct regmap_irq_chip_data *irq_chip_data_bcu;
+	struct regmap_irq_chip_data *irq_chip_data_adc;
+	struct regmap_irq_chip_data *irq_chip_data_chgr;
+	struct regmap_irq_chip_data *irq_chip_data_crit;
 	struct device *dev;
 };
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v2 7/8] mfd: intel_soc_pmic_bxtwc: use chained irqs for second level irq chips
@ 2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-04-14 23:25 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Whishkey cove PMIC has support to mask/unmask interrupts at two levels.
At first level we can mask/unmask interrupt domains like TMU, GPIO, ADC,
CHGR, BCU THERMAL and PWRBTN and at second level, it provides facility
to mask/unmask individual interrupts belong each of this domain. For
example, in case of TMU, at first level we have TMU interrupt domain,
and at second level we have two interrupts, wake alarm, system alarm that
belong to the TMU interrupt domain.

Currently, in this driver all first level irqs are registered as part of
irq chip(bxtwc_regmap_irq_chip). By default, after you register the irq
chip from your driver, all irqs in that chip will masked and can only be
enabled if that irq is requested using request_irq call. This is the
default Linux irq behavior model. And whenever a dependent device that
belongs to PMIC requests only the second level irq and not explicitly
unmask the first level irq, then in essence the second level irq will
still be disabled. For example, if TMU device driver request wake_alarm
irq and not explicitly unmask TMU level 1 irq then according to the default
Linux irq model,  wake_alarm irq will still be disabled. So the proper
solution to fix this issue is to use the chained irq chip concept. We
should chain all the second level chip irqs to the corresponding first
level irq. To do this, we need to create separate irq chips for every
group of second level irqs.

In case of TMU, when adding second level irq chip, instead of using pmic
irq we should use the corresponding first level irq. So the following
code will change from

ret = regmap_add_irq_chip(pmic->regmap, pmic->irq, ...)

to,

virq = regmap_irq_get_virq(&pmic->irq_chip_data, BXTWC_TMU_LVL1_IRQ);

ret = regmap_add_irq_chip(pmic->regmap, virq, ...)

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 174 +++++++++++++++++++++++++++++--------
 include/linux/mfd/intel_soc_pmic.h |   5 +-
 2 files changed, 144 insertions(+), 35 deletions(-)

Changes since v1:
 * Rebased on top of dev_* cleanup patch.
 * Fixed style & grammer issues reported by Lee Jones

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 442dc29..9a04187 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -81,18 +81,26 @@ enum bxtwc_irqs {
 	BXTWC_PWRBTN_IRQ,
 };
 
-enum bxtwc_irqs_level2 {
-	/* Level 2 */
+enum bxtwc_irqs_tmu {
+	BXTWC_TMU_IRQ = 0,
+};
+
+enum bxtwc_irqs_bcu {
 	BXTWC_BCU_IRQ = 0,
-	BXTWC_ADC_IRQ,
-	BXTWC_USBC_IRQ,
+};
+
+enum bxtwc_irqs_adc {
+	BXTWC_ADC_IRQ = 0,
+};
+
+enum bxtwc_irqs_chgr {
+	BXTWC_USBC_IRQ = 0,
 	BXTWC_CHGR0_IRQ,
 	BXTWC_CHGR1_IRQ,
-	BXTWC_CRIT_IRQ,
 };
 
-enum bxtwc_irqs_tmu {
-	BXTWC_TMU_IRQ = 0,
+enum bxtwc_irqs_crit {
+	BXTWC_CRIT_IRQ = 0,
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs[] = {
@@ -107,17 +115,26 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
 	REGMAP_IRQ_REG(BXTWC_PWRBTN_IRQ, 1, 0x03),
 };
 
-static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
+static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
+	REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_bcu[] = {
 	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
-	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
-	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
-static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
-	REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
+static const struct regmap_irq bxtwc_regmap_irqs_adc[] = {
+	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 0, 0xff),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_chgr[] = {
+	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 0, BIT(5)),
+	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 0, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 1, 0x1f),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_crit[] = {
+	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 0, 0x03),
 };
 
 static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
@@ -129,15 +146,6 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 	.num_regs = 2,
 };
 
-static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
-	.name = "bxtwc_irq_chip_level2",
-	.status_base = BXTWC_BCUIRQ,
-	.mask_base = BXTWC_MBCUIRQ,
-	.irqs = bxtwc_regmap_irqs_level2,
-	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
-	.num_regs = 10,
-};
-
 static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 	.name = "bxtwc_irq_chip_tmu",
 	.status_base = BXTWC_TMUIRQ,
@@ -147,6 +155,42 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 	.num_regs = 1,
 };
 
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_bcu = {
+	.name = "bxtwc_irq_chip_bcu",
+	.status_base = BXTWC_BCUIRQ,
+	.mask_base = BXTWC_MBCUIRQ,
+	.irqs = bxtwc_regmap_irqs_bcu,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_bcu),
+	.num_regs = 1,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_adc = {
+	.name = "bxtwc_irq_chip_adc",
+	.status_base = BXTWC_ADCIRQ,
+	.mask_base = BXTWC_MADCIRQ,
+	.irqs = bxtwc_regmap_irqs_adc,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_adc),
+	.num_regs = 1,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_chgr = {
+	.name = "bxtwc_irq_chip_chgr",
+	.status_base = BXTWC_CHGR0IRQ,
+	.mask_base = BXTWC_MCHGR0IRQ,
+	.irqs = bxtwc_regmap_irqs_chgr,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_chgr),
+	.num_regs = 2,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_crit = {
+	.name = "bxtwc_irq_chip_crit",
+	.status_base = BXTWC_CRITIRQ,
+	.mask_base = BXTWC_MCRITIRQ,
+	.irqs = bxtwc_regmap_irqs_crit,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_crit),
+	.num_regs = 1,
+};
+
 static struct resource gpio_resources[] = {
 	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
 };
@@ -358,6 +402,24 @@ static const struct regmap_config bxtwc_regmap_config = {
 	.reg_read = regmap_ipc_byte_reg_read,
 };
 
+static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic,
+				struct regmap_irq_chip_data *pdata,
+				int pirq, int irq_flags,
+				const struct regmap_irq_chip *chip,
+				struct regmap_irq_chip_data **data)
+{
+	int irq;
+
+	irq = regmap_irq_get_virq(pdata, pirq);
+	if (irq < 0) {
+		dev_err(pmic->dev, "failed to get virtual interrupt:%d\n", irq);
+		return irq;
+	}
+
+	return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags,
+					0, chip, data);
+}
+
 static int bxtwc_probe(struct platform_device *pdev)
 {
 	int ret;
@@ -409,21 +471,65 @@ static int bxtwc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
-				       IRQF_ONESHOT | IRQF_SHARED,
-				       0, &bxtwc_regmap_irq_chip_level2,
-				       &pmic->irq_chip_data_level2);
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_TMU_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_tmu,
+					 &pmic->irq_chip_data_tmu);
 	if (ret) {
-		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
+		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
 		return ret;
 	}
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
-				       IRQF_ONESHOT | IRQF_SHARED,
-				       0, &bxtwc_regmap_irq_chip_tmu,
-				       &pmic->irq_chip_data_tmu);
+	/* Add chained IRQ handler for BCU IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_BCU_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_bcu,
+					 &pmic->irq_chip_data_bcu);
+
+
 	if (ret) {
-		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
+		dev_err(&pdev->dev, "Failed to add BUC IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for ADC IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_ADC_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_adc,
+					 &pmic->irq_chip_data_adc);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add ADC IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for CHGR IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_CHGR_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_chgr,
+					 &pmic->irq_chip_data_chgr);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add CHGR IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for CRIT IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_CRIT_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_crit,
+					 &pmic->irq_chip_data_crit);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add CRIT IRQ chip\n");
 		return ret;
 	}
 
diff --git a/include/linux/mfd/intel_soc_pmic.h b/include/linux/mfd/intel_soc_pmic.h
index 956caa0..5aacdb0 100644
--- a/include/linux/mfd/intel_soc_pmic.h
+++ b/include/linux/mfd/intel_soc_pmic.h
@@ -25,8 +25,11 @@ struct intel_soc_pmic {
 	int irq;
 	struct regmap *regmap;
 	struct regmap_irq_chip_data *irq_chip_data;
-	struct regmap_irq_chip_data *irq_chip_data_level2;
 	struct regmap_irq_chip_data *irq_chip_data_tmu;
+	struct regmap_irq_chip_data *irq_chip_data_bcu;
+	struct regmap_irq_chip_data *irq_chip_data_adc;
+	struct regmap_irq_chip_data *irq_chip_data_chgr;
+	struct regmap_irq_chip_data *irq_chip_data_crit;
 	struct device *dev;
 };
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
  2017-04-14 23:25 ` sathyanarayanan.kuppuswamy
@ 2017-04-14 23:26   ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-04-14 23:26 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Currently in WCOVE PMIC mfd driver, all second level irq chips
are chained to the respective first level irqs. So there is no
need for explicitly unmasking the first level irq in this
driver. This patches removes this level 1 irq unmask support.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
 drivers/platform/x86/intel_bxtwc_tmu.c | 4 ----
 1 file changed, 4 deletions(-)

Changes since v1:
 * None

diff --git a/drivers/platform/x86/intel_bxtwc_tmu.c b/drivers/platform/x86/intel_bxtwc_tmu.c
index e202abd..ea865d4 100644
--- a/drivers/platform/x86/intel_bxtwc_tmu.c
+++ b/drivers/platform/x86/intel_bxtwc_tmu.c
@@ -92,10 +92,6 @@ static int bxt_wcove_tmu_probe(struct platform_device *pdev)
 	}
 	wctmu->irq = virq;
 
-	/* Enable TMU interrupts */
-	regmap_update_bits(wctmu->regmap, BXTWC_MIRQLVL1,
-				  BXTWC_MIRQLVL1_MTMU, 0);
-
 	/* Unmask TMU second level Wake & System alarm */
 	regmap_update_bits(wctmu->regmap, BXTWC_MTMUIRQ_REG,
 				  BXTWC_TMU_ALRM_MASK, 0);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
@ 2017-04-14 23:26   ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-04-14 23:26 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Currently in WCOVE PMIC mfd driver, all second level irq chips
are chained to the respective first level irqs. So there is no
need for explicitly unmasking the first level irq in this
driver. This patches removes this level 1 irq unmask support.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
 drivers/platform/x86/intel_bxtwc_tmu.c | 4 ----
 1 file changed, 4 deletions(-)

Changes since v1:
 * None

diff --git a/drivers/platform/x86/intel_bxtwc_tmu.c b/drivers/platform/x86/intel_bxtwc_tmu.c
index e202abd..ea865d4 100644
--- a/drivers/platform/x86/intel_bxtwc_tmu.c
+++ b/drivers/platform/x86/intel_bxtwc_tmu.c
@@ -92,10 +92,6 @@ static int bxt_wcove_tmu_probe(struct platform_device *pdev)
 	}
 	wctmu->irq = virq;
 
-	/* Enable TMU interrupts */
-	regmap_update_bits(wctmu->regmap, BXTWC_MIRQLVL1,
-				  BXTWC_MIRQLVL1_MTMU, 0);
-
 	/* Unmask TMU second level Wake & System alarm */
 	regmap_update_bits(wctmu->regmap, BXTWC_MTMUIRQ_REG,
 				  BXTWC_TMU_ALRM_MASK, 0);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
  2017-04-14 23:26   ` sathyanarayanan.kuppuswamy
  (?)
@ 2017-04-21 22:00   ` Darren Hart
  2017-04-21 22:34       ` sathyanarayanan kuppuswamy
  2017-04-24  9:26     ` Lee Jones
  -1 siblings, 2 replies; 132+ messages in thread
From: Darren Hart @ 2017-04-21 22:00 UTC (permalink / raw)
  To: sathyanarayanan.kuppuswamy
  Cc: gnurou, linus.walleij, edubezval, rui.zhang, lee.jones, andy,
	linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid

On Fri, Apr 14, 2017 at 04:26:00PM -0700, sathyanarayanan.kuppuswamy@linux.intel.com wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> 
> Currently in WCOVE PMIC mfd driver, all second level irq chips

By currently I believe you mean after the earlier patch in this series is
applied, correct? This one is dependent on the previous one?

> are chained to the respective first level irqs. So there is no
> need for explicitly unmasking the first level irq in this
> driver. This patches removes this level 1 irq unmask support.
> 
> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

For platform drivers x86:

Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org>

Are you working with a specific maintainers to pull this in as a series? With so
many subsystems, we need to coordinate to make sure we don't make a mess for
Linus. Given the interdependencies, I'd recommend someone pull the series in as
a whole - maybe into MFD? Lee, do you have a preference?

-- 
Darren Hart
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
  2017-04-21 22:00   ` Darren Hart
@ 2017-04-21 22:34       ` sathyanarayanan kuppuswamy
  2017-04-24  9:26     ` Lee Jones
  1 sibling, 0 replies; 132+ messages in thread
From: sathyanarayanan kuppuswamy @ 2017-04-21 22:34 UTC (permalink / raw)
  To: Darren Hart
  Cc: gnurou, linus.walleij, edubezval, rui.zhang, lee.jones, andy,
	linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid

Hi Darren,

Thanks for the review.


On 04/21/2017 03:00 PM, Darren Hart wrote:
> On Fri, Apr 14, 2017 at 04:26:00PM -0700, sathyanarayanan.kuppuswamy@linux.intel.com wrote:
>> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>>
>> Currently in WCOVE PMIC mfd driver, all second level irq chips
> By currently I believe you mean after the earlier patch in this series is
> applied, correct?
Yes.
> This one is dependent on the previous one?
Yes, one of my previous patch in this series fixes this problem in MFD 
driver.
>
>> are chained to the respective first level irqs. So there is no
>> need for explicitly unmasking the first level irq in this
>> driver. This patches removes this level 1 irq unmask support.
>>
>> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> For platform drivers x86:
>
> Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org>
>
> Are you working with a specific maintainers to pull this in as a series?
Thanks for brining it up. I was planning to ask either Andy or Lee 
regarding this issue after all patches in the series are reviewed.
> With so
> many subsystems, we need to coordinate to make sure we don't make a mess for
> Linus. Given the interdependencies, I'd recommend someone pull the series in as
> a whole - maybe into MFD? Lee, do you have a preference?
>

-- 
Sathyanarayanan Kuppuswamy
Android kernel developer

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
@ 2017-04-21 22:34       ` sathyanarayanan kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan kuppuswamy @ 2017-04-21 22:34 UTC (permalink / raw)
  To: Darren Hart
  Cc: gnurou, linus.walleij, edubezval, rui.zhang, lee.jones, andy,
	linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid

Hi Darren,

Thanks for the review.


On 04/21/2017 03:00 PM, Darren Hart wrote:
> On Fri, Apr 14, 2017 at 04:26:00PM -0700, sathyanarayanan.kuppuswamy@linux.intel.com wrote:
>> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>>
>> Currently in WCOVE PMIC mfd driver, all second level irq chips
> By currently I believe you mean after the earlier patch in this series is
> applied, correct?
Yes.
> This one is dependent on the previous one?
Yes, one of my previous patch in this series fixes this problem in MFD 
driver.
>
>> are chained to the respective first level irqs. So there is no
>> need for explicitly unmasking the first level irq in this
>> driver. This patches removes this level 1 irq unmask support.
>>
>> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> For platform drivers x86:
>
> Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org>
>
> Are you working with a specific maintainers to pull this in as a series?
Thanks for brining it up. I was planning to ask either Andy or Lee 
regarding this issue after all patches in the series are reviewed.
> With so
> many subsystems, we need to coordinate to make sure we don't make a mess for
> Linus. Given the interdependencies, I'd recommend someone pull the series in as
> a whole - maybe into MFD? Lee, do you have a preference?
>

-- 
Sathyanarayanan Kuppuswamy
Android kernel developer

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
  2017-04-21 22:34       ` sathyanarayanan kuppuswamy
@ 2017-04-22  2:52         ` Andy Shevchenko
  -1 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-04-22  2:52 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan
  Cc: Darren Hart, Alexandre Courbot, Linus Walleij, edubezval, Zhang,
	Rui, Lee Jones, Andy Shevchenko, linux-gpio, linux-pm,
	linux-kernel, Platform Driver,
	Sathyanarayanan Kuppuswamy Natarajan

On Sat, Apr 22, 2017 at 1:34 AM, sathyanarayanan kuppuswamy
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:

> Thanks for brining it up. I was planning to ask either Andy or Lee regarding
> this issue after all patches in the series are reviewed.

Darren, I'm planning to review this soon.

P.S. We have few series flying around regarding to Intel PMIC(s): my
for Kconfig naming, Hans' for Crystal Cove (touches Kconfig as well),
and Sathya's series. I hope Lee can collect them in proper order.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
@ 2017-04-22  2:52         ` Andy Shevchenko
  0 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-04-22  2:52 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan
  Cc: Darren Hart, Alexandre Courbot, Linus Walleij, edubezval, Zhang,
	Rui, Lee Jones, Andy Shevchenko, linux-gpio, linux-pm,
	linux-kernel, Platform Driver,
	Sathyanarayanan Kuppuswamy Natarajan

On Sat, Apr 22, 2017 at 1:34 AM, sathyanarayanan kuppuswamy
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:

> Thanks for brining it up. I was planning to ask either Andy or Lee regarding
> this issue after all patches in the series are reviewed.

Darren, I'm planning to review this soon.

P.S. We have few series flying around regarding to Intel PMIC(s): my
for Kconfig naming, Hans' for Crystal Cove (touches Kconfig as well),
and Sathya's series. I hope Lee can collect them in proper order.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
  2017-04-22  2:52         ` Andy Shevchenko
@ 2017-04-24  9:24           ` Lee Jones
  -1 siblings, 0 replies; 132+ messages in thread
From: Lee Jones @ 2017-04-24  9:24 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Kuppuswamy Sathyanarayanan, Darren Hart, Alexandre Courbot,
	Linus Walleij, edubezval, Zhang, Rui, Andy Shevchenko,
	linux-gpio, linux-pm, linux-kernel, Platform Driver,
	Sathyanarayanan Kuppuswamy Natarajan

On Sat, 22 Apr 2017, Andy Shevchenko wrote:

> On Sat, Apr 22, 2017 at 1:34 AM, sathyanarayanan kuppuswamy
> <sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> 
> > Thanks for brining it up. I was planning to ask either Andy or Lee regarding
> > this issue after all patches in the series are reviewed.
> 
> Darren, I'm planning to review this soon.
> 
> P.S. We have few series flying around regarding to Intel PMIC(s): my
> for Kconfig naming, Hans' for Crystal Cove (touches Kconfig as well),
> and Sathya's series. I hope Lee can collect them in proper order.

That could be easier said than done.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
@ 2017-04-24  9:24           ` Lee Jones
  0 siblings, 0 replies; 132+ messages in thread
From: Lee Jones @ 2017-04-24  9:24 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Kuppuswamy Sathyanarayanan, Darren Hart, Alexandre Courbot,
	Linus Walleij, edubezval, Zhang, Rui, Andy Shevchenko,
	linux-gpio, linux-pm, linux-kernel, Platform Driver,
	Sathyanarayanan Kuppuswamy Natarajan

On Sat, 22 Apr 2017, Andy Shevchenko wrote:

> On Sat, Apr 22, 2017 at 1:34 AM, sathyanarayanan kuppuswamy
> <sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> 
> > Thanks for brining it up. I was planning to ask either Andy or Lee regarding
> > this issue after all patches in the series are reviewed.
> 
> Darren, I'm planning to review this soon.
> 
> P.S. We have few series flying around regarding to Intel PMIC(s): my
> for Kconfig naming, Hans' for Crystal Cove (touches Kconfig as well),
> and Sathya's series. I hope Lee can collect them in proper order.

That could be easier said than done.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
  2017-04-21 22:00   ` Darren Hart
  2017-04-21 22:34       ` sathyanarayanan kuppuswamy
@ 2017-04-24  9:26     ` Lee Jones
  1 sibling, 0 replies; 132+ messages in thread
From: Lee Jones @ 2017-04-24  9:26 UTC (permalink / raw)
  To: Darren Hart
  Cc: sathyanarayanan.kuppuswamy, gnurou, linus.walleij, edubezval,
	rui.zhang, andy, linux-gpio, linux-pm, linux-kernel,
	platform-driver-x86, sathyaosid

On Fri, 21 Apr 2017, Darren Hart wrote:

> On Fri, Apr 14, 2017 at 04:26:00PM -0700, sathyanarayanan.kuppuswamy@linux.intel.com wrote:
> > From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> > 
> > Currently in WCOVE PMIC mfd driver, all second level irq chips
> 
> By currently I believe you mean after the earlier patch in this series is
> applied, correct? This one is dependent on the previous one?
> 
> > are chained to the respective first level irqs. So there is no
> > need for explicitly unmasking the first level irq in this
> > driver. This patches removes this level 1 irq unmask support.
> > 
> > Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> 
> For platform drivers x86:
> 
> Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org>
> 
> Are you working with a specific maintainers to pull this in as a series? With so
> many subsystems, we need to coordinate to make sure we don't make a mess for
> Linus. Given the interdependencies, I'd recommend someone pull the series in as
> a whole - maybe into MFD? Lee, do you have a preference?

I am happy to take the set, however I think v4.12 is an unlikely
candidate, since there still have quite a few patches which are yet to
receive review and the merge-window opens in 6 days.

Once we have all the required Acks, I'll push the set into -next where
it can sit for a good soak test until v4.13.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
  2017-04-24  9:24           ` Lee Jones
@ 2017-04-24  9:44             ` Andy Shevchenko
  -1 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-04-24  9:44 UTC (permalink / raw)
  To: Lee Jones
  Cc: Kuppuswamy Sathyanarayanan, Darren Hart, Alexandre Courbot,
	Linus Walleij, edubezval, Zhang, Rui, Andy Shevchenko,
	linux-gpio, linux-pm, linux-kernel, Platform Driver,
	Sathyanarayanan Kuppuswamy Natarajan

On Mon, Apr 24, 2017 at 12:24 PM, Lee Jones <lee.jones@linaro.org> wrote:
> On Sat, 22 Apr 2017, Andy Shevchenko wrote:
>
>> On Sat, Apr 22, 2017 at 1:34 AM, sathyanarayanan kuppuswamy
>> <sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
>>
>> > Thanks for brining it up. I was planning to ask either Andy or Lee regarding
>> > this issue after all patches in the series are reviewed.
>>
>> Darren, I'm planning to review this soon.
>>
>> P.S. We have few series flying around regarding to Intel PMIC(s): my
>> for Kconfig naming, Hans' for Crystal Cove (touches Kconfig as well),
>> and Sathya's series. I hope Lee can collect them in proper order.
>
> That could be easier said than done.

Some of them are already in your tree, then apply
- my Kconfig patch which makes Broxton Whiskey Cove to be built
independently of Crystal Cove (I didn't notice that patch in your
tree, though some of your mail told it had been applied)
- Hans' series regarding CherryTrail Whiskey Cove support (if it has all ACKs)
- this series after my review.

Does it sound doable?

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
@ 2017-04-24  9:44             ` Andy Shevchenko
  0 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-04-24  9:44 UTC (permalink / raw)
  To: Lee Jones
  Cc: Kuppuswamy Sathyanarayanan, Darren Hart, Alexandre Courbot,
	Linus Walleij, edubezval, Zhang, Rui, Andy Shevchenko,
	linux-gpio, linux-pm, linux-kernel, Platform Driver,
	Sathyanarayanan Kuppuswamy Natarajan

On Mon, Apr 24, 2017 at 12:24 PM, Lee Jones <lee.jones@linaro.org> wrote:
> On Sat, 22 Apr 2017, Andy Shevchenko wrote:
>
>> On Sat, Apr 22, 2017 at 1:34 AM, sathyanarayanan kuppuswamy
>> <sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
>>
>> > Thanks for brining it up. I was planning to ask either Andy or Lee regarding
>> > this issue after all patches in the series are reviewed.
>>
>> Darren, I'm planning to review this soon.
>>
>> P.S. We have few series flying around regarding to Intel PMIC(s): my
>> for Kconfig naming, Hans' for Crystal Cove (touches Kconfig as well),
>> and Sathya's series. I hope Lee can collect them in proper order.
>
> That could be easier said than done.

Some of them are already in your tree, then apply
- my Kconfig patch which makes Broxton Whiskey Cove to be built
independently of Crystal Cove (I didn't notice that patch in your
tree, though some of your mail told it had been applied)
- Hans' series regarding CherryTrail Whiskey Cove support (if it has all ACKs)
- this series after my review.

Does it sound doable?

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 6/8] mfd: intel_soc_pmic_bxtwc: utilize devm_* functions in driver probe
  2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
  (?)
@ 2017-04-24 12:03   ` Lee Jones
  -1 siblings, 0 replies; 132+ messages in thread
From: Lee Jones @ 2017-04-24 12:03 UTC (permalink / raw)
  To: sathyanarayanan.kuppuswamy
  Cc: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, andy,
	linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid

On Fri, 14 Apr 2017, sathyanarayanan.kuppuswamy@linux.intel.com wrote:

> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> 
> Cleanup the resource allocation/free code in probe function by using
> devm_* calls.
> 
> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> ---
>  drivers/mfd/intel_soc_pmic_bxtwc.c | 54 +++++++++++++-------------------------
>  1 file changed, 18 insertions(+), 36 deletions(-)

For my own reference:
  Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>

> Changes since v1:
>  * None
> 
> diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
> index dc8af1d..442dc29 100644
> --- a/drivers/mfd/intel_soc_pmic_bxtwc.c
> +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
> @@ -400,45 +400,44 @@ static int bxtwc_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>  
> -	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
> -				  IRQF_ONESHOT | IRQF_SHARED,
> -				  0, &bxtwc_regmap_irq_chip,
> -				  &pmic->irq_chip_data);
> +	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
> +				       IRQF_ONESHOT | IRQF_SHARED,
> +				       0, &bxtwc_regmap_irq_chip,
> +				       &pmic->irq_chip_data);
>  	if (ret) {
>  		dev_err(&pdev->dev, "Failed to add IRQ chip\n");
>  		return ret;
>  	}
>  
> -	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
> -				  IRQF_ONESHOT | IRQF_SHARED,
> -				  0, &bxtwc_regmap_irq_chip_level2,
> -				  &pmic->irq_chip_data_level2);
> +	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
> +				       IRQF_ONESHOT | IRQF_SHARED,
> +				       0, &bxtwc_regmap_irq_chip_level2,
> +				       &pmic->irq_chip_data_level2);
>  	if (ret) {
>  		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
> -		goto err_irq_chip_level2;
> +		return ret;
>  	}
>  
> -	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
> -				  IRQF_ONESHOT | IRQF_SHARED,
> -				  0, &bxtwc_regmap_irq_chip_tmu,
> -				  &pmic->irq_chip_data_tmu);
> +	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
> +				       IRQF_ONESHOT | IRQF_SHARED,
> +				       0, &bxtwc_regmap_irq_chip_tmu,
> +				       &pmic->irq_chip_data_tmu);
>  	if (ret) {
>  		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
> -		goto err_irq_chip_tmu;
> +		return ret;
>  	}
>  
> -	ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
> -			      ARRAY_SIZE(bxt_wc_dev), NULL, 0,
> -			      NULL);
> +	ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
> +				   ARRAY_SIZE(bxt_wc_dev), NULL, 0, NULL);
>  	if (ret) {
>  		dev_err(&pdev->dev, "Failed to add devices\n");
> -		goto err_mfd;
> +		return ret;
>  	}
>  
>  	ret = sysfs_create_group(&pdev->dev.kobj, &bxtwc_group);
>  	if (ret) {
>  		dev_err(&pdev->dev, "Failed to create sysfs group %d\n", ret);
> -		goto err_sysfs;
> +		return ret;
>  	}
>  
>  	/*
> @@ -452,28 +451,11 @@ static int bxtwc_probe(struct platform_device *pdev)
>  				BXTWC_MIRQLVL1_MCHGR, 0);
>  
>  	return 0;
> -
> -err_sysfs:
> -	mfd_remove_devices(&pdev->dev);
> -err_mfd:
> -	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
> -err_irq_chip_tmu:
> -	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
> -err_irq_chip_level2:
> -	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
> -
> -	return ret;
>  }
>  
>  static int bxtwc_remove(struct platform_device *pdev)
>  {
> -	struct intel_soc_pmic *pmic = dev_get_drvdata(&pdev->dev);
> -
>  	sysfs_remove_group(&pdev->dev.kobj, &bxtwc_group);
> -	mfd_remove_devices(&pdev->dev);
> -	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
> -	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
> -	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
>  
>  	return 0;
>  }

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 7/8] mfd: intel_soc_pmic_bxtwc: use chained irqs for second level irq chips
  2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
  (?)
@ 2017-04-24 12:04   ` Lee Jones
  -1 siblings, 0 replies; 132+ messages in thread
From: Lee Jones @ 2017-04-24 12:04 UTC (permalink / raw)
  To: sathyanarayanan.kuppuswamy
  Cc: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, andy,
	linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid

On Fri, 14 Apr 2017, sathyanarayanan.kuppuswamy@linux.intel.com wrote:

> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> 
> Whishkey cove PMIC has support to mask/unmask interrupts at two levels.
> At first level we can mask/unmask interrupt domains like TMU, GPIO, ADC,
> CHGR, BCU THERMAL and PWRBTN and at second level, it provides facility
> to mask/unmask individual interrupts belong each of this domain. For
> example, in case of TMU, at first level we have TMU interrupt domain,
> and at second level we have two interrupts, wake alarm, system alarm that
> belong to the TMU interrupt domain.
> 
> Currently, in this driver all first level irqs are registered as part of
> irq chip(bxtwc_regmap_irq_chip). By default, after you register the irq
> chip from your driver, all irqs in that chip will masked and can only be
> enabled if that irq is requested using request_irq call. This is the
> default Linux irq behavior model. And whenever a dependent device that
> belongs to PMIC requests only the second level irq and not explicitly
> unmask the first level irq, then in essence the second level irq will
> still be disabled. For example, if TMU device driver request wake_alarm
> irq and not explicitly unmask TMU level 1 irq then according to the default
> Linux irq model,  wake_alarm irq will still be disabled. So the proper
> solution to fix this issue is to use the chained irq chip concept. We
> should chain all the second level chip irqs to the corresponding first
> level irq. To do this, we need to create separate irq chips for every
> group of second level irqs.
> 
> In case of TMU, when adding second level irq chip, instead of using pmic
> irq we should use the corresponding first level irq. So the following
> code will change from
> 
> ret = regmap_add_irq_chip(pmic->regmap, pmic->irq, ...)
> 
> to,
> 
> virq = regmap_irq_get_virq(&pmic->irq_chip_data, BXTWC_TMU_LVL1_IRQ);
> 
> ret = regmap_add_irq_chip(pmic->regmap, virq, ...)
> 
> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> ---
>  drivers/mfd/intel_soc_pmic_bxtwc.c | 174 +++++++++++++++++++++++++++++--------
>  include/linux/mfd/intel_soc_pmic.h |   5 +-
>  2 files changed, 144 insertions(+), 35 deletions(-)

For my own reference:
  Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
  
> Changes since v1:
>  * Rebased on top of dev_* cleanup patch.
>  * Fixed style & grammer issues reported by Lee Jones
> 
> diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
> index 442dc29..9a04187 100644
> --- a/drivers/mfd/intel_soc_pmic_bxtwc.c
> +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
> @@ -81,18 +81,26 @@ enum bxtwc_irqs {
>  	BXTWC_PWRBTN_IRQ,
>  };
>  
> -enum bxtwc_irqs_level2 {
> -	/* Level 2 */
> +enum bxtwc_irqs_tmu {
> +	BXTWC_TMU_IRQ = 0,
> +};
> +
> +enum bxtwc_irqs_bcu {
>  	BXTWC_BCU_IRQ = 0,
> -	BXTWC_ADC_IRQ,
> -	BXTWC_USBC_IRQ,
> +};
> +
> +enum bxtwc_irqs_adc {
> +	BXTWC_ADC_IRQ = 0,
> +};
> +
> +enum bxtwc_irqs_chgr {
> +	BXTWC_USBC_IRQ = 0,
>  	BXTWC_CHGR0_IRQ,
>  	BXTWC_CHGR1_IRQ,
> -	BXTWC_CRIT_IRQ,
>  };
>  
> -enum bxtwc_irqs_tmu {
> -	BXTWC_TMU_IRQ = 0,
> +enum bxtwc_irqs_crit {
> +	BXTWC_CRIT_IRQ = 0,
>  };
>  
>  static const struct regmap_irq bxtwc_regmap_irqs[] = {
> @@ -107,17 +115,26 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
>  	REGMAP_IRQ_REG(BXTWC_PWRBTN_IRQ, 1, 0x03),
>  };
>  
> -static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
> +static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
> +	REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
> +};
> +
> +static const struct regmap_irq bxtwc_regmap_irqs_bcu[] = {
>  	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
> -	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
> -	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
> -	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
> -	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
> -	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
>  };
>  
> -static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
> -	REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
> +static const struct regmap_irq bxtwc_regmap_irqs_adc[] = {
> +	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 0, 0xff),
> +};
> +
> +static const struct regmap_irq bxtwc_regmap_irqs_chgr[] = {
> +	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 0, BIT(5)),
> +	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 0, 0x1f),
> +	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 1, 0x1f),
> +};
> +
> +static const struct regmap_irq bxtwc_regmap_irqs_crit[] = {
> +	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 0, 0x03),
>  };
>  
>  static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
> @@ -129,15 +146,6 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
>  	.num_regs = 2,
>  };
>  
> -static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
> -	.name = "bxtwc_irq_chip_level2",
> -	.status_base = BXTWC_BCUIRQ,
> -	.mask_base = BXTWC_MBCUIRQ,
> -	.irqs = bxtwc_regmap_irqs_level2,
> -	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
> -	.num_regs = 10,
> -};
> -
>  static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
>  	.name = "bxtwc_irq_chip_tmu",
>  	.status_base = BXTWC_TMUIRQ,
> @@ -147,6 +155,42 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
>  	.num_regs = 1,
>  };
>  
> +static struct regmap_irq_chip bxtwc_regmap_irq_chip_bcu = {
> +	.name = "bxtwc_irq_chip_bcu",
> +	.status_base = BXTWC_BCUIRQ,
> +	.mask_base = BXTWC_MBCUIRQ,
> +	.irqs = bxtwc_regmap_irqs_bcu,
> +	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_bcu),
> +	.num_regs = 1,
> +};
> +
> +static struct regmap_irq_chip bxtwc_regmap_irq_chip_adc = {
> +	.name = "bxtwc_irq_chip_adc",
> +	.status_base = BXTWC_ADCIRQ,
> +	.mask_base = BXTWC_MADCIRQ,
> +	.irqs = bxtwc_regmap_irqs_adc,
> +	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_adc),
> +	.num_regs = 1,
> +};
> +
> +static struct regmap_irq_chip bxtwc_regmap_irq_chip_chgr = {
> +	.name = "bxtwc_irq_chip_chgr",
> +	.status_base = BXTWC_CHGR0IRQ,
> +	.mask_base = BXTWC_MCHGR0IRQ,
> +	.irqs = bxtwc_regmap_irqs_chgr,
> +	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_chgr),
> +	.num_regs = 2,
> +};
> +
> +static struct regmap_irq_chip bxtwc_regmap_irq_chip_crit = {
> +	.name = "bxtwc_irq_chip_crit",
> +	.status_base = BXTWC_CRITIRQ,
> +	.mask_base = BXTWC_MCRITIRQ,
> +	.irqs = bxtwc_regmap_irqs_crit,
> +	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_crit),
> +	.num_regs = 1,
> +};
> +
>  static struct resource gpio_resources[] = {
>  	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
>  };
> @@ -358,6 +402,24 @@ static const struct regmap_config bxtwc_regmap_config = {
>  	.reg_read = regmap_ipc_byte_reg_read,
>  };
>  
> +static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic,
> +				struct regmap_irq_chip_data *pdata,
> +				int pirq, int irq_flags,
> +				const struct regmap_irq_chip *chip,
> +				struct regmap_irq_chip_data **data)
> +{
> +	int irq;
> +
> +	irq = regmap_irq_get_virq(pdata, pirq);
> +	if (irq < 0) {
> +		dev_err(pmic->dev, "failed to get virtual interrupt:%d\n", irq);
> +		return irq;
> +	}
> +
> +	return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags,
> +					0, chip, data);
> +}
> +
>  static int bxtwc_probe(struct platform_device *pdev)
>  {
>  	int ret;
> @@ -409,21 +471,65 @@ static int bxtwc_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>  
> -	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
> -				       IRQF_ONESHOT | IRQF_SHARED,
> -				       0, &bxtwc_regmap_irq_chip_level2,
> -				       &pmic->irq_chip_data_level2);
> +	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
> +					 BXTWC_TMU_LVL1_IRQ,
> +					 IRQF_ONESHOT,
> +					 &bxtwc_regmap_irq_chip_tmu,
> +					 &pmic->irq_chip_data_tmu);
>  	if (ret) {
> -		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
> +		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
>  		return ret;
>  	}
>  
> -	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
> -				       IRQF_ONESHOT | IRQF_SHARED,
> -				       0, &bxtwc_regmap_irq_chip_tmu,
> -				       &pmic->irq_chip_data_tmu);
> +	/* Add chained IRQ handler for BCU IRQs */
> +	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
> +					 BXTWC_BCU_LVL1_IRQ,
> +					 IRQF_ONESHOT,
> +					 &bxtwc_regmap_irq_chip_bcu,
> +					 &pmic->irq_chip_data_bcu);
> +
> +
>  	if (ret) {
> -		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
> +		dev_err(&pdev->dev, "Failed to add BUC IRQ chip\n");
> +		return ret;
> +	}
> +
> +	/* Add chained IRQ handler for ADC IRQs */
> +	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
> +					 BXTWC_ADC_LVL1_IRQ,
> +					 IRQF_ONESHOT,
> +					 &bxtwc_regmap_irq_chip_adc,
> +					 &pmic->irq_chip_data_adc);
> +
> +
> +	if (ret) {
> +		dev_err(&pdev->dev, "Failed to add ADC IRQ chip\n");
> +		return ret;
> +	}
> +
> +	/* Add chained IRQ handler for CHGR IRQs */
> +	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
> +					 BXTWC_CHGR_LVL1_IRQ,
> +					 IRQF_ONESHOT,
> +					 &bxtwc_regmap_irq_chip_chgr,
> +					 &pmic->irq_chip_data_chgr);
> +
> +
> +	if (ret) {
> +		dev_err(&pdev->dev, "Failed to add CHGR IRQ chip\n");
> +		return ret;
> +	}
> +
> +	/* Add chained IRQ handler for CRIT IRQs */
> +	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
> +					 BXTWC_CRIT_LVL1_IRQ,
> +					 IRQF_ONESHOT,
> +					 &bxtwc_regmap_irq_chip_crit,
> +					 &pmic->irq_chip_data_crit);
> +
> +
> +	if (ret) {
> +		dev_err(&pdev->dev, "Failed to add CRIT IRQ chip\n");
>  		return ret;
>  	}
>  
> diff --git a/include/linux/mfd/intel_soc_pmic.h b/include/linux/mfd/intel_soc_pmic.h
> index 956caa0..5aacdb0 100644
> --- a/include/linux/mfd/intel_soc_pmic.h
> +++ b/include/linux/mfd/intel_soc_pmic.h
> @@ -25,8 +25,11 @@ struct intel_soc_pmic {
>  	int irq;
>  	struct regmap *regmap;
>  	struct regmap_irq_chip_data *irq_chip_data;
> -	struct regmap_irq_chip_data *irq_chip_data_level2;
>  	struct regmap_irq_chip_data *irq_chip_data_tmu;
> +	struct regmap_irq_chip_data *irq_chip_data_bcu;
> +	struct regmap_irq_chip_data *irq_chip_data_adc;
> +	struct regmap_irq_chip_data *irq_chip_data_chgr;
> +	struct regmap_irq_chip_data *irq_chip_data_crit;
>  	struct device *dev;
>  };
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
  2017-04-24  9:44             ` Andy Shevchenko
@ 2017-04-24 12:24               ` Lee Jones
  -1 siblings, 0 replies; 132+ messages in thread
From: Lee Jones @ 2017-04-24 12:24 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Kuppuswamy Sathyanarayanan, Darren Hart, Alexandre Courbot,
	Linus Walleij, edubezval, Zhang, Rui, Andy Shevchenko,
	linux-gpio, linux-pm, linux-kernel, Platform Driver,
	Sathyanarayanan Kuppuswamy Natarajan

On Mon, 24 Apr 2017, Andy Shevchenko wrote:

> On Mon, Apr 24, 2017 at 12:24 PM, Lee Jones <lee.jones@linaro.org> wrote:
> > On Sat, 22 Apr 2017, Andy Shevchenko wrote:
> >
> >> On Sat, Apr 22, 2017 at 1:34 AM, sathyanarayanan kuppuswamy
> >> <sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> >>
> >> > Thanks for brining it up. I was planning to ask either Andy or Lee regarding
> >> > this issue after all patches in the series are reviewed.
> >>
> >> Darren, I'm planning to review this soon.
> >>
> >> P.S. We have few series flying around regarding to Intel PMIC(s): my
> >> for Kconfig naming, Hans' for Crystal Cove (touches Kconfig as well),
> >> and Sathya's series. I hope Lee can collect them in proper order.
> >
> > That could be easier said than done.
> 
> Some of them are already in your tree, then apply
> - my Kconfig patch which makes Broxton Whiskey Cove to be built
> independently of Crystal Cove (I didn't notice that patch in your
> tree, though some of your mail told it had been applied)
> - Hans' series regarding CherryTrail Whiskey Cove support (if it has all ACKs)
> - this series after my review.
> 
> Does it sound doable?

My Inbox is now empty, so all patches are now either applied or
waiting further Acks/Actions.

I'm pretty certain that this set is not going in before v4.13.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
@ 2017-04-24 12:24               ` Lee Jones
  0 siblings, 0 replies; 132+ messages in thread
From: Lee Jones @ 2017-04-24 12:24 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Kuppuswamy Sathyanarayanan, Darren Hart, Alexandre Courbot,
	Linus Walleij, edubezval, Zhang, Rui, Andy Shevchenko,
	linux-gpio, linux-pm, linux-kernel, Platform Driver,
	Sathyanarayanan Kuppuswamy Natarajan

On Mon, 24 Apr 2017, Andy Shevchenko wrote:

> On Mon, Apr 24, 2017 at 12:24 PM, Lee Jones <lee.jones@linaro.org> wrote:
> > On Sat, 22 Apr 2017, Andy Shevchenko wrote:
> >
> >> On Sat, Apr 22, 2017 at 1:34 AM, sathyanarayanan kuppuswamy
> >> <sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> >>
> >> > Thanks for brining it up. I was planning to ask either Andy or Lee regarding
> >> > this issue after all patches in the series are reviewed.
> >>
> >> Darren, I'm planning to review this soon.
> >>
> >> P.S. We have few series flying around regarding to Intel PMIC(s): my
> >> for Kconfig naming, Hans' for Crystal Cove (touches Kconfig as well),
> >> and Sathya's series. I hope Lee can collect them in proper order.
> >
> > That could be easier said than done.
> 
> Some of them are already in your tree, then apply
> - my Kconfig patch which makes Broxton Whiskey Cove to be built
> independently of Crystal Cove (I didn't notice that patch in your
> tree, though some of your mail told it had been applied)
> - Hans' series regarding CherryTrail Whiskey Cove support (if it has all ACKs)
> - this series after my review.
> 
> Does it sound doable?

My Inbox is now empty, so all patches are now either applied or
waiting further Acks/Actions.

I'm pretty certain that this set is not going in before v4.13.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 5/8] gpio: gpio-wcove: use first level PMIC GPIO irq
  2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
@ 2017-04-24 13:17     ` Linus Walleij
  -1 siblings, 0 replies; 132+ messages in thread
From: Linus Walleij @ 2017-04-24 13:17 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan
  Cc: Alexandre Courbot, Eduardo Valentin, Darren Hart, Zhang Rui,
	Lee Jones, andy, linux-gpio, linux-pm, linux-kernel,
	platform-driver-x86, sathyaosid

On Sat, Apr 15, 2017 at 1:25 AM,
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:

> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> PMIC mfd driver only exports first level irq for GPIO device.
> But currently we are reading the irqs from the second level irq
> chip, So this patch fixes this issue by adding support to use
> first level PMIC GPIO irq.
>
> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

I guess this gets merged into MFD because of dependencies?
If it compiles on its own and doesn't cause regressions I can
merged it into the GPIO tree.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 5/8] gpio: gpio-wcove: use first level PMIC GPIO irq
@ 2017-04-24 13:17     ` Linus Walleij
  0 siblings, 0 replies; 132+ messages in thread
From: Linus Walleij @ 2017-04-24 13:17 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan
  Cc: Alexandre Courbot, Eduardo Valentin, Darren Hart, Zhang Rui,
	Lee Jones, andy, linux-gpio, linux-pm, linux-kernel,
	platform-driver-x86, sathyaosid

On Sat, Apr 15, 2017 at 1:25 AM,
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:

> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> PMIC mfd driver only exports first level irq for GPIO device.
> But currently we are reading the irqs from the second level irq
> chip, So this patch fixes this issue by adding support to use
> first level PMIC GPIO irq.
>
> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

I guess this gets merged into MFD because of dependencies?
If it compiles on its own and doesn't cause regressions I can
merged it into the GPIO tree.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 5/8] gpio: gpio-wcove: use first level PMIC GPIO irq
  2017-04-24 13:17     ` Linus Walleij
@ 2017-04-26 15:40       ` Andy Shevchenko
  -1 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-04-26 15:40 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Kuppuswamy Sathyanarayanan, Alexandre Courbot, Eduardo Valentin,
	Darren Hart, Zhang Rui, Lee Jones, Andy Shevchenko, linux-gpio,
	linux-pm, linux-kernel, platform-driver-x86,
	Sathyanarayanan Kuppuswamy Natarajan

On Mon, Apr 24, 2017 at 4:17 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Sat, Apr 15, 2017 at 1:25 AM,
> <sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
>
>> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>>
>> PMIC mfd driver only exports first level irq for GPIO device.
>> But currently we are reading the irqs from the second level irq
>> chip, So this patch fixes this issue by adding support to use
>> first level PMIC GPIO irq.
>>
>> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>
> I guess this gets merged into MFD because of dependencies?

Yes.

> If it compiles on its own and doesn't cause regressions I can
> merged it into the GPIO tree.

I guess it will break something if put it separately.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 5/8] gpio: gpio-wcove: use first level PMIC GPIO irq
@ 2017-04-26 15:40       ` Andy Shevchenko
  0 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-04-26 15:40 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Kuppuswamy Sathyanarayanan, Alexandre Courbot, Eduardo Valentin,
	Darren Hart, Zhang Rui, Lee Jones, Andy Shevchenko, linux-gpio,
	linux-pm, linux-kernel, platform-driver-x86,
	Sathyanarayanan Kuppuswamy Natarajan

On Mon, Apr 24, 2017 at 4:17 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Sat, Apr 15, 2017 at 1:25 AM,
> <sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
>
>> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>>
>> PMIC mfd driver only exports first level irq for GPIO device.
>> But currently we are reading the irqs from the second level irq
>> chip, So this patch fixes this issue by adding support to use
>> first level PMIC GPIO irq.
>>
>> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>
> I guess this gets merged into MFD because of dependencies?

Yes.

> If it compiles on its own and doesn't cause regressions I can
> merged it into the GPIO tree.

I guess it will break something if put it separately.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
  2017-04-24 12:24               ` Lee Jones
@ 2017-04-26 15:44                 ` Andy Shevchenko
  -1 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-04-26 15:44 UTC (permalink / raw)
  To: Lee Jones
  Cc: Kuppuswamy Sathyanarayanan, Darren Hart, Alexandre Courbot,
	Linus Walleij, edubezval, Zhang, Rui, Andy Shevchenko,
	linux-gpio, linux-pm, linux-kernel, Platform Driver,
	Sathyanarayanan Kuppuswamy Natarajan

On Mon, Apr 24, 2017 at 3:24 PM, Lee Jones <lee.jones@linaro.org> wrote:
> On Mon, 24 Apr 2017, Andy Shevchenko wrote:
>
>> On Mon, Apr 24, 2017 at 12:24 PM, Lee Jones <lee.jones@linaro.org> wrote:
>> > On Sat, 22 Apr 2017, Andy Shevchenko wrote:
>> >
>> >> On Sat, Apr 22, 2017 at 1:34 AM, sathyanarayanan kuppuswamy
>> >> <sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
>> >>
>> >> > Thanks for brining it up. I was planning to ask either Andy or Lee regarding
>> >> > this issue after all patches in the series are reviewed.
>> >>
>> >> Darren, I'm planning to review this soon.
>> >>
>> >> P.S. We have few series flying around regarding to Intel PMIC(s): my
>> >> for Kconfig naming, Hans' for Crystal Cove (touches Kconfig as well),
>> >> and Sathya's series. I hope Lee can collect them in proper order.
>> >
>> > That could be easier said than done.
>>
>> Some of them are already in your tree, then apply
>> - my Kconfig patch which makes Broxton Whiskey Cove to be built
>> independently of Crystal Cove (I didn't notice that patch in your
>> tree, though some of your mail told it had been applied)
>> - Hans' series regarding CherryTrail Whiskey Cove support (if it has all ACKs)
>> - this series after my review.
>>
>> Does it sound doable?
>
> My Inbox is now empty, so all patches are now either applied or
> waiting further Acks/Actions.

I reviewed the series and found it suitable to apply.
The GPIO Whiskey Cove patch will do a conflict (in GPIO tree is
another patch that adds GPIO IRQ masks in a way by using GENMASK(),
so, we might avoid this doing the same in patch 5 here).

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

for entire series.

> I'm pretty certain that this set is not going in before v4.13.

It is now on your side :-)

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
@ 2017-04-26 15:44                 ` Andy Shevchenko
  0 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-04-26 15:44 UTC (permalink / raw)
  To: Lee Jones
  Cc: Kuppuswamy Sathyanarayanan, Darren Hart, Alexandre Courbot,
	Linus Walleij, edubezval, Zhang, Rui, Andy Shevchenko,
	linux-gpio, linux-pm, linux-kernel, Platform Driver,
	Sathyanarayanan Kuppuswamy Natarajan

On Mon, Apr 24, 2017 at 3:24 PM, Lee Jones <lee.jones@linaro.org> wrote:
> On Mon, 24 Apr 2017, Andy Shevchenko wrote:
>
>> On Mon, Apr 24, 2017 at 12:24 PM, Lee Jones <lee.jones@linaro.org> wrote:
>> > On Sat, 22 Apr 2017, Andy Shevchenko wrote:
>> >
>> >> On Sat, Apr 22, 2017 at 1:34 AM, sathyanarayanan kuppuswamy
>> >> <sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
>> >>
>> >> > Thanks for brining it up. I was planning to ask either Andy or Lee regarding
>> >> > this issue after all patches in the series are reviewed.
>> >>
>> >> Darren, I'm planning to review this soon.
>> >>
>> >> P.S. We have few series flying around regarding to Intel PMIC(s): my
>> >> for Kconfig naming, Hans' for Crystal Cove (touches Kconfig as well),
>> >> and Sathya's series. I hope Lee can collect them in proper order.
>> >
>> > That could be easier said than done.
>>
>> Some of them are already in your tree, then apply
>> - my Kconfig patch which makes Broxton Whiskey Cove to be built
>> independently of Crystal Cove (I didn't notice that patch in your
>> tree, though some of your mail told it had been applied)
>> - Hans' series regarding CherryTrail Whiskey Cove support (if it has all ACKs)
>> - this series after my review.
>>
>> Does it sound doable?
>
> My Inbox is now empty, so all patches are now either applied or
> waiting further Acks/Actions.

I reviewed the series and found it suitable to apply.
The GPIO Whiskey Cove patch will do a conflict (in GPIO tree is
another patch that adds GPIO IRQ masks in a way by using GENMASK(),
so, we might avoid this doing the same in patch 5 here).

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

for entire series.

> I'm pretty certain that this set is not going in before v4.13.

It is now on your side :-)

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 3/8] thermal: intel_bxt_pmic_thermal: use first level PMIC thermal irq
  2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
  (?)
@ 2017-05-22 10:17   ` Lee Jones
  2017-05-22 19:08       ` sathyanarayanan kuppuswamy
  -1 siblings, 1 reply; 132+ messages in thread
From: Lee Jones @ 2017-05-22 10:17 UTC (permalink / raw)
  To: sathyanarayanan.kuppuswamy
  Cc: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, andy,
	linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid

On Fri, 14 Apr 2017, sathyanarayanan.kuppuswamy@linux.intel.com wrote:

> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> 
> PMIC mfd driver only exports first level irq for thermal device.
> But currently we are reading the irqs from the second level irq
> chip, So this patch fixes this issue by adding support to use
> first level PMIC thermal irq.
> 
> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

This still needs a Maintainer Ack.

> ---
>  drivers/thermal/intel_bxt_pmic_thermal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Changes since v1:
>  * None
> 
> diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c b/drivers/thermal/intel_bxt_pmic_thermal.c
> index 0f19a39..ef6b322 100644
> --- a/drivers/thermal/intel_bxt_pmic_thermal.c
> +++ b/drivers/thermal/intel_bxt_pmic_thermal.c
> @@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct platform_device *pdev)
>  	}
>  
>  	regmap = pmic->regmap;
> -	regmap_irq_chip = pmic->irq_chip_data_level2;
> +	regmap_irq_chip = pmic->irq_chip_data;
>  
>  	pmic_irq_count = 0;
>  	while ((irq = platform_get_irq(pdev, pmic_irq_count)) != -ENXIO) {

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 3/8] thermal: intel_bxt_pmic_thermal: use first level PMIC thermal irq
  2017-05-22 10:17   ` Lee Jones
@ 2017-05-22 19:08       ` sathyanarayanan kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan kuppuswamy @ 2017-05-22 19:08 UTC (permalink / raw)
  To: Lee Jones
  Cc: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, andy,
	linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid

Hi Rui/Valentin,

Do you have any comments on this patch ? If you agree with this patch, 
Can you please Ack it ?


On 05/22/2017 03:17 AM, Lee Jones wrote:
> On Fri, 14 Apr 2017, sathyanarayanan.kuppuswamy@linux.intel.com wrote:
>
>> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>>
>> PMIC mfd driver only exports first level irq for thermal device.
>> But currently we are reading the irqs from the second level irq
>> chip, So this patch fixes this issue by adding support to use
>> first level PMIC thermal irq.
>>
>> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> This still needs a Maintainer Ack.
>
>> ---
>>   drivers/thermal/intel_bxt_pmic_thermal.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Changes since v1:
>>   * None
>>
>> diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c b/drivers/thermal/intel_bxt_pmic_thermal.c
>> index 0f19a39..ef6b322 100644
>> --- a/drivers/thermal/intel_bxt_pmic_thermal.c
>> +++ b/drivers/thermal/intel_bxt_pmic_thermal.c
>> @@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct platform_device *pdev)
>>   	}
>>   
>>   	regmap = pmic->regmap;
>> -	regmap_irq_chip = pmic->irq_chip_data_level2;
>> +	regmap_irq_chip = pmic->irq_chip_data;
>>   
>>   	pmic_irq_count = 0;
>>   	while ((irq = platform_get_irq(pdev, pmic_irq_count)) != -ENXIO) {

-- 
Sathyanarayanan Kuppuswamy
Linux kernel developer

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 3/8] thermal: intel_bxt_pmic_thermal: use first level PMIC thermal irq
@ 2017-05-22 19:08       ` sathyanarayanan kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan kuppuswamy @ 2017-05-22 19:08 UTC (permalink / raw)
  To: Lee Jones
  Cc: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, andy,
	linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid

Hi Rui/Valentin,

Do you have any comments on this patch ? If you agree with this patch, 
Can you please Ack it ?


On 05/22/2017 03:17 AM, Lee Jones wrote:
> On Fri, 14 Apr 2017, sathyanarayanan.kuppuswamy@linux.intel.com wrote:
>
>> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>>
>> PMIC mfd driver only exports first level irq for thermal device.
>> But currently we are reading the irqs from the second level irq
>> chip, So this patch fixes this issue by adding support to use
>> first level PMIC thermal irq.
>>
>> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> This still needs a Maintainer Ack.
>
>> ---
>>   drivers/thermal/intel_bxt_pmic_thermal.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Changes since v1:
>>   * None
>>
>> diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c b/drivers/thermal/intel_bxt_pmic_thermal.c
>> index 0f19a39..ef6b322 100644
>> --- a/drivers/thermal/intel_bxt_pmic_thermal.c
>> +++ b/drivers/thermal/intel_bxt_pmic_thermal.c
>> @@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct platform_device *pdev)
>>   	}
>>   
>>   	regmap = pmic->regmap;
>> -	regmap_irq_chip = pmic->irq_chip_data_level2;
>> +	regmap_irq_chip = pmic->irq_chip_data;
>>   
>>   	pmic_irq_count = 0;
>>   	while ((irq = platform_get_irq(pdev, pmic_irq_count)) != -ENXIO) {

-- 
Sathyanarayanan Kuppuswamy
Linux kernel developer

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 3/8] thermal: intel_bxt_pmic_thermal: use first level PMIC thermal irq
  2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
  (?)
  (?)
@ 2017-05-23  6:24   ` Zhang Rui
  2017-05-23  7:26     ` Lee Jones
  -1 siblings, 1 reply; 132+ messages in thread
From: Zhang Rui @ 2017-05-23  6:24 UTC (permalink / raw)
  To: sathyanarayanan.kuppuswamy, gnurou, linus.walleij, edubezval,
	dvhart, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86, sathyaosid

On Fri, 2017-04-14 at 16:25 -0700,
sathyanarayanan.kuppuswamy@linux.intel.com wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.in
> tel.com>
> 
> PMIC mfd driver only exports first level irq for thermal device.
> But currently we are reading the irqs from the second level irq
> chip, So this patch fixes this issue by adding support to use
> first level PMIC thermal irq.
> 
> Signed-off-by: Kuppuswamy Sathyanarayanan
> <sathyanarayanan.kuppuswamy@linux.intel.com>

Acked-by: Zhang Rui <rui.zhang@intel.com>

-rui
> ---
>  drivers/thermal/intel_bxt_pmic_thermal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Changes since v1:
>  * None
> 
> diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c
> b/drivers/thermal/intel_bxt_pmic_thermal.c
> index 0f19a39..ef6b322 100644
> --- a/drivers/thermal/intel_bxt_pmic_thermal.c
> +++ b/drivers/thermal/intel_bxt_pmic_thermal.c
> @@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct
> platform_device *pdev)
>  	}
>  
>  	regmap = pmic->regmap;
> -	regmap_irq_chip = pmic->irq_chip_data_level2;
> +	regmap_irq_chip = pmic->irq_chip_data;
>  
>  	pmic_irq_count = 0;
>  	while ((irq = platform_get_irq(pdev, pmic_irq_count)) !=
> -ENXIO) {

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 3/8] thermal: intel_bxt_pmic_thermal: use first level PMIC thermal irq
  2017-05-23  6:24   ` Zhang Rui
@ 2017-05-23  7:26     ` Lee Jones
  2017-05-23 17:29         ` sathyanarayanan.kuppuswamy
  0 siblings, 1 reply; 132+ messages in thread
From: Lee Jones @ 2017-05-23  7:26 UTC (permalink / raw)
  To: Zhang Rui
  Cc: sathyanarayanan.kuppuswamy, gnurou, linus.walleij, edubezval,
	dvhart, andy, linux-gpio, linux-pm, linux-kernel,
	platform-driver-x86, sathyaosid

On Tue, 23 May 2017, Zhang Rui wrote:

> On Fri, 2017-04-14 at 16:25 -0700,
> sathyanarayanan.kuppuswamy@linux.intel.com wrote:
> > From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.in
> > tel.com>
> > 
> > PMIC mfd driver only exports first level irq for thermal device.
> > But currently we are reading the irqs from the second level irq
> > chip, So this patch fixes this issue by adding support to use
> > first level PMIC thermal irq.
> > 
> > Signed-off-by: Kuppuswamy Sathyanarayanan
> > <sathyanarayanan.kuppuswamy@linux.intel.com>
> 
> Acked-by: Zhang Rui <rui.zhang@intel.com>

I think this is the last Ack.

Please collect them all and re-submit the set so I can pick it up.

> > ---
> >  drivers/thermal/intel_bxt_pmic_thermal.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > Changes since v1:
> >  * None
> > 
> > diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c
> > b/drivers/thermal/intel_bxt_pmic_thermal.c
> > index 0f19a39..ef6b322 100644
> > --- a/drivers/thermal/intel_bxt_pmic_thermal.c
> > +++ b/drivers/thermal/intel_bxt_pmic_thermal.c
> > @@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct
> > platform_device *pdev)
> >  	}
> >  
> >  	regmap = pmic->regmap;
> > -	regmap_irq_chip = pmic->irq_chip_data_level2;
> > +	regmap_irq_chip = pmic->irq_chip_data;
> >  
> >  	pmic_irq_count = 0;
> >  	while ((irq = platform_get_irq(pdev, pmic_irq_count)) !=
> > -ENXIO) {

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 132+ messages in thread

* [PATCH v3 1/8] mfd: intel_soc_pmic_bxtwc: fix TMU interrupt index
  2017-05-23  7:26     ` Lee Jones
@ 2017-05-23 17:29         ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-23 17:29 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

TMU interrupts are registered as a separate interrupt chip, and
hence it should start its interrupt index(BXTWC_TMU_IRQ) number
from 0. But currently, BXTWC_TMU_IRQ is defined as part of enum
bxtwc_irqs_level2 and its index value is 11. Since this index
value is used when calculating .num_irqs of regmap_irq_chip_tmu,
it incorrectly reports number of irqs as 12 instead of actual
value of 1.

This patch fixes this issue by creating new enum of tmu irqs and
resetting its starting index to 0.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Changes since v1: 
 * Removed code from commit message.

Changes since v2: 
 * Rebased on top of latest release.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 8c3cbf6..7cbaf1e 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -95,7 +95,10 @@ enum bxtwc_irqs_level2 {
 	BXTWC_GPIO0_IRQ,
 	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
-	BXTWC_TMU_IRQ,
+};
+
+enum bxtwc_irqs_tmu {
+	BXTWC_TMU_IRQ = 0,
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v3 1/8] mfd: intel_soc_pmic_bxtwc: fix TMU interrupt index
@ 2017-05-23 17:29         ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-23 17:29 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

TMU interrupts are registered as a separate interrupt chip, and
hence it should start its interrupt index(BXTWC_TMU_IRQ) number
from 0. But currently, BXTWC_TMU_IRQ is defined as part of enum
bxtwc_irqs_level2 and its index value is 11. Since this index
value is used when calculating .num_irqs of regmap_irq_chip_tmu,
it incorrectly reports number of irqs as 12 instead of actual
value of 1.

This patch fixes this issue by creating new enum of tmu irqs and
resetting its starting index to 0.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Changes since v1: 
 * Removed code from commit message.

Changes since v2: 
 * Rebased on top of latest release.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 8c3cbf6..7cbaf1e 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -95,7 +95,10 @@ enum bxtwc_irqs_level2 {
 	BXTWC_GPIO0_IRQ,
 	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
-	BXTWC_TMU_IRQ,
+};
+
+enum bxtwc_irqs_tmu {
+	BXTWC_TMU_IRQ = 0,
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v3 2/8] mfd: intel_soc_pmic_bxtwc: remove thermal second level irqs
  2017-05-23 17:29         ` sathyanarayanan.kuppuswamy
@ 2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-23 17:30 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Since all second level thermal irqs are consumed by the same
device(bxt_wcove_thermal), there is no need to expose them as separate
interrupts. We can just export only the first level irqs for thermal and
let the device(bxt_wcove_thermal) driver handle the second level irqs
based on thermal interrupt status register. Also, just using only the
first level irq will eliminate the bug involved in requesting only the
second level irq and not explicitly enable the first level irq. For
more info on this issue please read the details at,

https://lkml.org/lkml/2017/2/27/148

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 32 ++++++++++++--------------------
 1 file changed, 12 insertions(+), 20 deletions(-)

Changes since v1:
 * None

Changes since v2: 
 * Rebased on top of latest release.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 7cbaf1e..7c1ed27 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -84,10 +84,7 @@ enum bxtwc_irqs {
 
 enum bxtwc_irqs_level2 {
 	/* Level 2 */
-	BXTWC_THRM0_IRQ = 0,
-	BXTWC_THRM1_IRQ,
-	BXTWC_THRM2_IRQ,
-	BXTWC_BCU_IRQ,
+	BXTWC_BCU_IRQ = 0,
 	BXTWC_ADC_IRQ,
 	BXTWC_USBC_IRQ,
 	BXTWC_CHGR0_IRQ,
@@ -114,17 +111,14 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
-	REGMAP_IRQ_REG(BXTWC_THRM0_IRQ, 0, 0xff),
-	REGMAP_IRQ_REG(BXTWC_THRM1_IRQ, 1, 0xbf),
-	REGMAP_IRQ_REG(BXTWC_THRM2_IRQ, 2, 0xff),
-	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 4, 0xff),
-	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 5, BIT(5)),
-	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 5, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 6, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 7, 0xff),
-	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 8, 0x3f),
-	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 9, 0x03),
+	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
+	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
+	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 4, 0xff),
+	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 5, 0x3f),
+	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
@@ -142,8 +136,8 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 
 static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
 	.name = "bxtwc_irq_chip_level2",
-	.status_base = BXTWC_THRM0IRQ,
-	.mask_base = BXTWC_MTHRM0IRQ,
+	.status_base = BXTWC_BCUIRQ,
+	.mask_base = BXTWC_MBCUIRQ,
 	.irqs = bxtwc_regmap_irqs_level2,
 	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
 	.num_regs = 10,
@@ -177,9 +171,7 @@ static struct resource charger_resources[] = {
 };
 
 static struct resource thermal_resources[] = {
-	DEFINE_RES_IRQ(BXTWC_THRM0_IRQ),
-	DEFINE_RES_IRQ(BXTWC_THRM1_IRQ),
-	DEFINE_RES_IRQ(BXTWC_THRM2_IRQ),
+	DEFINE_RES_IRQ(BXTWC_THRM_LVL1_IRQ),
 };
 
 static struct resource bcu_resources[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v3 2/8] mfd: intel_soc_pmic_bxtwc: remove thermal second level irqs
@ 2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-23 17:30 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Since all second level thermal irqs are consumed by the same
device(bxt_wcove_thermal), there is no need to expose them as separate
interrupts. We can just export only the first level irqs for thermal and
let the device(bxt_wcove_thermal) driver handle the second level irqs
based on thermal interrupt status register. Also, just using only the
first level irq will eliminate the bug involved in requesting only the
second level irq and not explicitly enable the first level irq. For
more info on this issue please read the details at,

https://lkml.org/lkml/2017/2/27/148

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 32 ++++++++++++--------------------
 1 file changed, 12 insertions(+), 20 deletions(-)

Changes since v1:
 * None

Changes since v2: 
 * Rebased on top of latest release.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 7cbaf1e..7c1ed27 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -84,10 +84,7 @@ enum bxtwc_irqs {
 
 enum bxtwc_irqs_level2 {
 	/* Level 2 */
-	BXTWC_THRM0_IRQ = 0,
-	BXTWC_THRM1_IRQ,
-	BXTWC_THRM2_IRQ,
-	BXTWC_BCU_IRQ,
+	BXTWC_BCU_IRQ = 0,
 	BXTWC_ADC_IRQ,
 	BXTWC_USBC_IRQ,
 	BXTWC_CHGR0_IRQ,
@@ -114,17 +111,14 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
-	REGMAP_IRQ_REG(BXTWC_THRM0_IRQ, 0, 0xff),
-	REGMAP_IRQ_REG(BXTWC_THRM1_IRQ, 1, 0xbf),
-	REGMAP_IRQ_REG(BXTWC_THRM2_IRQ, 2, 0xff),
-	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 4, 0xff),
-	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 5, BIT(5)),
-	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 5, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 6, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 7, 0xff),
-	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 8, 0x3f),
-	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 9, 0x03),
+	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
+	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
+	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 4, 0xff),
+	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 5, 0x3f),
+	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
@@ -142,8 +136,8 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 
 static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
 	.name = "bxtwc_irq_chip_level2",
-	.status_base = BXTWC_THRM0IRQ,
-	.mask_base = BXTWC_MTHRM0IRQ,
+	.status_base = BXTWC_BCUIRQ,
+	.mask_base = BXTWC_MBCUIRQ,
 	.irqs = bxtwc_regmap_irqs_level2,
 	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
 	.num_regs = 10,
@@ -177,9 +171,7 @@ static struct resource charger_resources[] = {
 };
 
 static struct resource thermal_resources[] = {
-	DEFINE_RES_IRQ(BXTWC_THRM0_IRQ),
-	DEFINE_RES_IRQ(BXTWC_THRM1_IRQ),
-	DEFINE_RES_IRQ(BXTWC_THRM2_IRQ),
+	DEFINE_RES_IRQ(BXTWC_THRM_LVL1_IRQ),
 };
 
 static struct resource bcu_resources[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v3 3/8] thermal: intel_bxt_pmic_thermal: use first level PMIC thermal irq
  2017-05-23 17:29         ` sathyanarayanan.kuppuswamy
@ 2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-23 17:30 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

PMIC mfd driver only exports first level irq for thermal device.
But currently we are reading the irqs from the second level irq
chip, So this patch fixes this issue by adding support to use
first level PMIC thermal irq.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/thermal/intel_bxt_pmic_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Changes since v1:
 * None

Changes since v2: 
 * Rebased on top of latest release.

diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c b/drivers/thermal/intel_bxt_pmic_thermal.c
index 0f19a39..ef6b322 100644
--- a/drivers/thermal/intel_bxt_pmic_thermal.c
+++ b/drivers/thermal/intel_bxt_pmic_thermal.c
@@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct platform_device *pdev)
 	}
 
 	regmap = pmic->regmap;
-	regmap_irq_chip = pmic->irq_chip_data_level2;
+	regmap_irq_chip = pmic->irq_chip_data;
 
 	pmic_irq_count = 0;
 	while ((irq = platform_get_irq(pdev, pmic_irq_count)) != -ENXIO) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v3 3/8] thermal: intel_bxt_pmic_thermal: use first level PMIC thermal irq
@ 2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-23 17:30 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

PMIC mfd driver only exports first level irq for thermal device.
But currently we are reading the irqs from the second level irq
chip, So this patch fixes this issue by adding support to use
first level PMIC thermal irq.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/thermal/intel_bxt_pmic_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Changes since v1:
 * None

Changes since v2: 
 * Rebased on top of latest release.

diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c b/drivers/thermal/intel_bxt_pmic_thermal.c
index 0f19a39..ef6b322 100644
--- a/drivers/thermal/intel_bxt_pmic_thermal.c
+++ b/drivers/thermal/intel_bxt_pmic_thermal.c
@@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct platform_device *pdev)
 	}
 
 	regmap = pmic->regmap;
-	regmap_irq_chip = pmic->irq_chip_data_level2;
+	regmap_irq_chip = pmic->irq_chip_data;
 
 	pmic_irq_count = 0;
 	while ((irq = platform_get_irq(pdev, pmic_irq_count)) != -ENXIO) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v3 4/8] mfd: intel_soc_pmic_bxtwc: remove second level irq for gpio device
  2017-05-23 17:29         ` sathyanarayanan.kuppuswamy
@ 2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-23 17:30 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Currently all PMIC GPIO domain irqs are consumed by the same
device(bxt_wcove_gpio), so there is no need to export them as
separate interrupts. We can just export only the first level
GPIO irq(BXTWC_GPIO_LVL1_IRQ) as an irq resource and let the
GPIO device driver(bxt_wcove_gpio) handle the GPIO sub domain
irqs based on status value of GPIO level2 interrupt status
register. Also, just using only the first level irq will eliminate
the bug involved in requesting only the second level irq and not
explicitly enable the first level irq. For more info on this
issue please read the details at,

https://lkml.org/lkml/2017/2/27/148

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Changes since v1:
 * None

Changes since v2: 
 * Rebased on top of latest release.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 7c1ed27..af11c43 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -89,8 +89,6 @@ enum bxtwc_irqs_level2 {
 	BXTWC_USBC_IRQ,
 	BXTWC_CHGR0_IRQ,
 	BXTWC_CHGR1_IRQ,
-	BXTWC_GPIO0_IRQ,
-	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
 };
 
@@ -116,8 +114,6 @@ static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
 	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
 	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
 	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 4, 0xff),
-	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 5, 0x3f),
 	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
@@ -153,8 +149,7 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 };
 
 static struct resource gpio_resources[] = {
-	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO0_IRQ, "GPIO0"),
-	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO1_IRQ, "GPIO1"),
+	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
 };
 
 static struct resource adc_resources[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v3 4/8] mfd: intel_soc_pmic_bxtwc: remove second level irq for gpio device
@ 2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-23 17:30 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Currently all PMIC GPIO domain irqs are consumed by the same
device(bxt_wcove_gpio), so there is no need to export them as
separate interrupts. We can just export only the first level
GPIO irq(BXTWC_GPIO_LVL1_IRQ) as an irq resource and let the
GPIO device driver(bxt_wcove_gpio) handle the GPIO sub domain
irqs based on status value of GPIO level2 interrupt status
register. Also, just using only the first level irq will eliminate
the bug involved in requesting only the second level irq and not
explicitly enable the first level irq. For more info on this
issue please read the details at,

https://lkml.org/lkml/2017/2/27/148

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Changes since v1:
 * None

Changes since v2: 
 * Rebased on top of latest release.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 7c1ed27..af11c43 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -89,8 +89,6 @@ enum bxtwc_irqs_level2 {
 	BXTWC_USBC_IRQ,
 	BXTWC_CHGR0_IRQ,
 	BXTWC_CHGR1_IRQ,
-	BXTWC_GPIO0_IRQ,
-	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
 };
 
@@ -116,8 +114,6 @@ static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
 	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
 	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
 	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 4, 0xff),
-	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 5, 0x3f),
 	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
@@ -153,8 +149,7 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 };
 
 static struct resource gpio_resources[] = {
-	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO0_IRQ, "GPIO0"),
-	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO1_IRQ, "GPIO1"),
+	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
 };
 
 static struct resource adc_resources[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v3 5/8] gpio: gpio-wcove: use first level PMIC GPIO irq
  2017-05-23 17:29         ` sathyanarayanan.kuppuswamy
@ 2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-23 17:30 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

PMIC mfd driver only exports first level irq for GPIO device.
But currently we are reading the irqs from the second level irq
chip, So this patch fixes this issue by adding support to use
first level PMIC GPIO irq.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpio-wcove.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Changes since v1:
 * used correct mask for GPIO0 and GPIO1 interrupts

Changes since v2: 
 * Rebased on top of latest release.
 * Removed IRQ0 and IRQ1 mask defines.

diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c
index 7b1bc20..bba7704 100644
--- a/drivers/gpio/gpio-wcove.c
+++ b/drivers/gpio/gpio-wcove.c
@@ -401,7 +401,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
 	if (!wg)
 		return -ENOMEM;
 
-	wg->regmap_irq_chip = pmic->irq_chip_data_level2;
+	wg->regmap_irq_chip = pmic->irq_chip_data;
 
 	platform_set_drvdata(pdev, wg);
 
@@ -449,6 +449,18 @@ static int wcove_gpio_probe(struct platform_device *pdev)
 
 	gpiochip_set_nested_irqchip(&wg->chip, &wcove_irqchip, virq);
 
+	/* Enable GPIO0 interrupts */
+	ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE, GPIO_IRQ0_MASK,
+				 0x00);
+	if (ret)
+		return ret;
+
+	/* Enable GPIO1 interrupts */
+	ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE + 1, GPIO_IRQ1_MASK,
+				 0x00);
+	if (ret)
+		return ret;
+
 	return 0;
 }
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v3 5/8] gpio: gpio-wcove: use first level PMIC GPIO irq
@ 2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-23 17:30 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

PMIC mfd driver only exports first level irq for GPIO device.
But currently we are reading the irqs from the second level irq
chip, So this patch fixes this issue by adding support to use
first level PMIC GPIO irq.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpio-wcove.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Changes since v1:
 * used correct mask for GPIO0 and GPIO1 interrupts

Changes since v2: 
 * Rebased on top of latest release.
 * Removed IRQ0 and IRQ1 mask defines.

diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c
index 7b1bc20..bba7704 100644
--- a/drivers/gpio/gpio-wcove.c
+++ b/drivers/gpio/gpio-wcove.c
@@ -401,7 +401,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
 	if (!wg)
 		return -ENOMEM;
 
-	wg->regmap_irq_chip = pmic->irq_chip_data_level2;
+	wg->regmap_irq_chip = pmic->irq_chip_data;
 
 	platform_set_drvdata(pdev, wg);
 
@@ -449,6 +449,18 @@ static int wcove_gpio_probe(struct platform_device *pdev)
 
 	gpiochip_set_nested_irqchip(&wg->chip, &wcove_irqchip, virq);
 
+	/* Enable GPIO0 interrupts */
+	ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE, GPIO_IRQ0_MASK,
+				 0x00);
+	if (ret)
+		return ret;
+
+	/* Enable GPIO1 interrupts */
+	ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE + 1, GPIO_IRQ1_MASK,
+				 0x00);
+	if (ret)
+		return ret;
+
 	return 0;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v3 6/8] mfd: intel_soc_pmic_bxtwc: utilize devm_* functions in driver probe
  2017-05-23 17:29         ` sathyanarayanan.kuppuswamy
@ 2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-23 17:30 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Cleanup the resource allocation/free code in probe function by using
devm_* calls.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 54 +++++++++++++-------------------------
 1 file changed, 18 insertions(+), 36 deletions(-)

Changes since v1:
 * None

Changes since v2:
 * Rebased on top of latest release.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index af11c43..feeda6e 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -399,45 +399,44 @@ static int bxtwc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip,
-				  &pmic->irq_chip_data);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip,
+				       &pmic->irq_chip_data);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add IRQ chip\n");
 		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip_level2,
-				  &pmic->irq_chip_data_level2);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip_level2,
+				       &pmic->irq_chip_data_level2);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
-		goto err_irq_chip_level2;
+		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip_tmu,
-				  &pmic->irq_chip_data_tmu);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip_tmu,
+				       &pmic->irq_chip_data_tmu);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
-		goto err_irq_chip_tmu;
+		return ret;
 	}
 
-	ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
-			      ARRAY_SIZE(bxt_wc_dev), NULL, 0,
-			      NULL);
+	ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
+				   ARRAY_SIZE(bxt_wc_dev), NULL, 0, NULL);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add devices\n");
-		goto err_mfd;
+		return ret;
 	}
 
 	ret = sysfs_create_group(&pdev->dev.kobj, &bxtwc_group);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to create sysfs group %d\n", ret);
-		goto err_sysfs;
+		return ret;
 	}
 
 	/*
@@ -451,28 +450,11 @@ static int bxtwc_probe(struct platform_device *pdev)
 				BXTWC_MIRQLVL1_MCHGR, 0);
 
 	return 0;
-
-err_sysfs:
-	mfd_remove_devices(&pdev->dev);
-err_mfd:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
-err_irq_chip_tmu:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
-err_irq_chip_level2:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-
-	return ret;
 }
 
 static int bxtwc_remove(struct platform_device *pdev)
 {
-	struct intel_soc_pmic *pmic = dev_get_drvdata(&pdev->dev);
-
 	sysfs_remove_group(&pdev->dev.kobj, &bxtwc_group);
-	mfd_remove_devices(&pdev->dev);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
 
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v3 6/8] mfd: intel_soc_pmic_bxtwc: utilize devm_* functions in driver probe
@ 2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-23 17:30 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Cleanup the resource allocation/free code in probe function by using
devm_* calls.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 54 +++++++++++++-------------------------
 1 file changed, 18 insertions(+), 36 deletions(-)

Changes since v1:
 * None

Changes since v2:
 * Rebased on top of latest release.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index af11c43..feeda6e 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -399,45 +399,44 @@ static int bxtwc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip,
-				  &pmic->irq_chip_data);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip,
+				       &pmic->irq_chip_data);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add IRQ chip\n");
 		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip_level2,
-				  &pmic->irq_chip_data_level2);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip_level2,
+				       &pmic->irq_chip_data_level2);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
-		goto err_irq_chip_level2;
+		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip_tmu,
-				  &pmic->irq_chip_data_tmu);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip_tmu,
+				       &pmic->irq_chip_data_tmu);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
-		goto err_irq_chip_tmu;
+		return ret;
 	}
 
-	ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
-			      ARRAY_SIZE(bxt_wc_dev), NULL, 0,
-			      NULL);
+	ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
+				   ARRAY_SIZE(bxt_wc_dev), NULL, 0, NULL);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add devices\n");
-		goto err_mfd;
+		return ret;
 	}
 
 	ret = sysfs_create_group(&pdev->dev.kobj, &bxtwc_group);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to create sysfs group %d\n", ret);
-		goto err_sysfs;
+		return ret;
 	}
 
 	/*
@@ -451,28 +450,11 @@ static int bxtwc_probe(struct platform_device *pdev)
 				BXTWC_MIRQLVL1_MCHGR, 0);
 
 	return 0;
-
-err_sysfs:
-	mfd_remove_devices(&pdev->dev);
-err_mfd:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
-err_irq_chip_tmu:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
-err_irq_chip_level2:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-
-	return ret;
 }
 
 static int bxtwc_remove(struct platform_device *pdev)
 {
-	struct intel_soc_pmic *pmic = dev_get_drvdata(&pdev->dev);
-
 	sysfs_remove_group(&pdev->dev.kobj, &bxtwc_group);
-	mfd_remove_devices(&pdev->dev);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
 
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v3 7/8] mfd: intel_soc_pmic_bxtwc: use chained irqs for second level irq chips
  2017-05-23 17:29         ` sathyanarayanan.kuppuswamy
@ 2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-23 17:30 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Whishkey cove PMIC has support to mask/unmask interrupts at two levels.
At first level we can mask/unmask interrupt domains like TMU, GPIO, ADC,
CHGR, BCU THERMAL and PWRBTN and at second level, it provides facility
to mask/unmask individual interrupts belong each of this domain. For
example, in case of TMU, at first level we have TMU interrupt domain,
and at second level we have two interrupts, wake alarm, system alarm that
belong to the TMU interrupt domain.

Currently, in this driver all first level irqs are registered as part of
irq chip(bxtwc_regmap_irq_chip). By default, after you register the irq
chip from your driver, all irqs in that chip will masked and can only be
enabled if that irq is requested using request_irq call. This is the
default Linux irq behavior model. And whenever a dependent device that
belongs to PMIC requests only the second level irq and not explicitly
unmask the first level irq, then in essence the second level irq will
still be disabled. For example, if TMU device driver request wake_alarm
irq and not explicitly unmask TMU level 1 irq then according to the default
Linux irq model,  wake_alarm irq will still be disabled. So the proper
solution to fix this issue is to use the chained irq chip concept. We
should chain all the second level chip irqs to the corresponding first
level irq. To do this, we need to create separate irq chips for every
group of second level irqs.

In case of TMU, when adding second level irq chip, instead of using pmic
irq we should use the corresponding first level irq. So the following
code will change from

ret = regmap_add_irq_chip(pmic->regmap, pmic->irq, ...)

to,

virq = regmap_irq_get_virq(&pmic->irq_chip_data, BXTWC_TMU_LVL1_IRQ);

ret = regmap_add_irq_chip(pmic->regmap, virq, ...)

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 174 +++++++++++++++++++++++++++++--------
 include/linux/mfd/intel_soc_pmic.h |   5 +-
 2 files changed, 144 insertions(+), 35 deletions(-)

Changes since v1:
 * Rebased on top of dev_* cleanup patch.
 * Fixed style & grammer issues reported by Lee Jones

Changes since v2:
 * Rebased on top of latest release.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index feeda6e..bd78bef 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -82,18 +82,26 @@ enum bxtwc_irqs {
 	BXTWC_PWRBTN_IRQ,
 };
 
-enum bxtwc_irqs_level2 {
-	/* Level 2 */
+enum bxtwc_irqs_tmu {
+	BXTWC_TMU_IRQ = 0,
+};
+
+enum bxtwc_irqs_bcu {
 	BXTWC_BCU_IRQ = 0,
-	BXTWC_ADC_IRQ,
-	BXTWC_USBC_IRQ,
+};
+
+enum bxtwc_irqs_adc {
+	BXTWC_ADC_IRQ = 0,
+};
+
+enum bxtwc_irqs_chgr {
+	BXTWC_USBC_IRQ = 0,
 	BXTWC_CHGR0_IRQ,
 	BXTWC_CHGR1_IRQ,
-	BXTWC_CRIT_IRQ,
 };
 
-enum bxtwc_irqs_tmu {
-	BXTWC_TMU_IRQ = 0,
+enum bxtwc_irqs_crit {
+	BXTWC_CRIT_IRQ = 0,
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs[] = {
@@ -108,17 +116,26 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
 	REGMAP_IRQ_REG(BXTWC_PWRBTN_IRQ, 1, 0x03),
 };
 
-static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
+static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
+	REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_bcu[] = {
 	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
-	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
-	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
-static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
-	REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
+static const struct regmap_irq bxtwc_regmap_irqs_adc[] = {
+	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 0, 0xff),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_chgr[] = {
+	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 0, BIT(5)),
+	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 0, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 1, 0x1f),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_crit[] = {
+	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 0, 0x03),
 };
 
 static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
@@ -130,15 +147,6 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 	.num_regs = 2,
 };
 
-static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
-	.name = "bxtwc_irq_chip_level2",
-	.status_base = BXTWC_BCUIRQ,
-	.mask_base = BXTWC_MBCUIRQ,
-	.irqs = bxtwc_regmap_irqs_level2,
-	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
-	.num_regs = 10,
-};
-
 static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 	.name = "bxtwc_irq_chip_tmu",
 	.status_base = BXTWC_TMUIRQ,
@@ -148,6 +156,42 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 	.num_regs = 1,
 };
 
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_bcu = {
+	.name = "bxtwc_irq_chip_bcu",
+	.status_base = BXTWC_BCUIRQ,
+	.mask_base = BXTWC_MBCUIRQ,
+	.irqs = bxtwc_regmap_irqs_bcu,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_bcu),
+	.num_regs = 1,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_adc = {
+	.name = "bxtwc_irq_chip_adc",
+	.status_base = BXTWC_ADCIRQ,
+	.mask_base = BXTWC_MADCIRQ,
+	.irqs = bxtwc_regmap_irqs_adc,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_adc),
+	.num_regs = 1,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_chgr = {
+	.name = "bxtwc_irq_chip_chgr",
+	.status_base = BXTWC_CHGR0IRQ,
+	.mask_base = BXTWC_MCHGR0IRQ,
+	.irqs = bxtwc_regmap_irqs_chgr,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_chgr),
+	.num_regs = 2,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_crit = {
+	.name = "bxtwc_irq_chip_crit",
+	.status_base = BXTWC_CRITIRQ,
+	.mask_base = BXTWC_MCRITIRQ,
+	.irqs = bxtwc_regmap_irqs_crit,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_crit),
+	.num_regs = 1,
+};
+
 static struct resource gpio_resources[] = {
 	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
 };
@@ -357,6 +401,24 @@ static const struct regmap_config bxtwc_regmap_config = {
 	.reg_read = regmap_ipc_byte_reg_read,
 };
 
+static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic,
+				struct regmap_irq_chip_data *pdata,
+				int pirq, int irq_flags,
+				const struct regmap_irq_chip *chip,
+				struct regmap_irq_chip_data **data)
+{
+	int irq;
+
+	irq = regmap_irq_get_virq(pdata, pirq);
+	if (irq < 0) {
+		dev_err(pmic->dev, "failed to get virtual interrupt:%d\n", irq);
+		return irq;
+	}
+
+	return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags,
+					0, chip, data);
+}
+
 static int bxtwc_probe(struct platform_device *pdev)
 {
 	int ret;
@@ -408,21 +470,65 @@ static int bxtwc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
-				       IRQF_ONESHOT | IRQF_SHARED,
-				       0, &bxtwc_regmap_irq_chip_level2,
-				       &pmic->irq_chip_data_level2);
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_TMU_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_tmu,
+					 &pmic->irq_chip_data_tmu);
 	if (ret) {
-		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
+		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
 		return ret;
 	}
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
-				       IRQF_ONESHOT | IRQF_SHARED,
-				       0, &bxtwc_regmap_irq_chip_tmu,
-				       &pmic->irq_chip_data_tmu);
+	/* Add chained IRQ handler for BCU IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_BCU_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_bcu,
+					 &pmic->irq_chip_data_bcu);
+
+
 	if (ret) {
-		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
+		dev_err(&pdev->dev, "Failed to add BUC IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for ADC IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_ADC_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_adc,
+					 &pmic->irq_chip_data_adc);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add ADC IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for CHGR IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_CHGR_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_chgr,
+					 &pmic->irq_chip_data_chgr);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add CHGR IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for CRIT IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_CRIT_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_crit,
+					 &pmic->irq_chip_data_crit);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add CRIT IRQ chip\n");
 		return ret;
 	}
 
diff --git a/include/linux/mfd/intel_soc_pmic.h b/include/linux/mfd/intel_soc_pmic.h
index 956caa0..5aacdb0 100644
--- a/include/linux/mfd/intel_soc_pmic.h
+++ b/include/linux/mfd/intel_soc_pmic.h
@@ -25,8 +25,11 @@ struct intel_soc_pmic {
 	int irq;
 	struct regmap *regmap;
 	struct regmap_irq_chip_data *irq_chip_data;
-	struct regmap_irq_chip_data *irq_chip_data_level2;
 	struct regmap_irq_chip_data *irq_chip_data_tmu;
+	struct regmap_irq_chip_data *irq_chip_data_bcu;
+	struct regmap_irq_chip_data *irq_chip_data_adc;
+	struct regmap_irq_chip_data *irq_chip_data_chgr;
+	struct regmap_irq_chip_data *irq_chip_data_crit;
 	struct device *dev;
 };
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v3 7/8] mfd: intel_soc_pmic_bxtwc: use chained irqs for second level irq chips
@ 2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-23 17:30 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Whishkey cove PMIC has support to mask/unmask interrupts at two levels.
At first level we can mask/unmask interrupt domains like TMU, GPIO, ADC,
CHGR, BCU THERMAL and PWRBTN and at second level, it provides facility
to mask/unmask individual interrupts belong each of this domain. For
example, in case of TMU, at first level we have TMU interrupt domain,
and at second level we have two interrupts, wake alarm, system alarm that
belong to the TMU interrupt domain.

Currently, in this driver all first level irqs are registered as part of
irq chip(bxtwc_regmap_irq_chip). By default, after you register the irq
chip from your driver, all irqs in that chip will masked and can only be
enabled if that irq is requested using request_irq call. This is the
default Linux irq behavior model. And whenever a dependent device that
belongs to PMIC requests only the second level irq and not explicitly
unmask the first level irq, then in essence the second level irq will
still be disabled. For example, if TMU device driver request wake_alarm
irq and not explicitly unmask TMU level 1 irq then according to the default
Linux irq model,  wake_alarm irq will still be disabled. So the proper
solution to fix this issue is to use the chained irq chip concept. We
should chain all the second level chip irqs to the corresponding first
level irq. To do this, we need to create separate irq chips for every
group of second level irqs.

In case of TMU, when adding second level irq chip, instead of using pmic
irq we should use the corresponding first level irq. So the following
code will change from

ret = regmap_add_irq_chip(pmic->regmap, pmic->irq, ...)

to,

virq = regmap_irq_get_virq(&pmic->irq_chip_data, BXTWC_TMU_LVL1_IRQ);

ret = regmap_add_irq_chip(pmic->regmap, virq, ...)

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 174 +++++++++++++++++++++++++++++--------
 include/linux/mfd/intel_soc_pmic.h |   5 +-
 2 files changed, 144 insertions(+), 35 deletions(-)

Changes since v1:
 * Rebased on top of dev_* cleanup patch.
 * Fixed style & grammer issues reported by Lee Jones

Changes since v2:
 * Rebased on top of latest release.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index feeda6e..bd78bef 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -82,18 +82,26 @@ enum bxtwc_irqs {
 	BXTWC_PWRBTN_IRQ,
 };
 
-enum bxtwc_irqs_level2 {
-	/* Level 2 */
+enum bxtwc_irqs_tmu {
+	BXTWC_TMU_IRQ = 0,
+};
+
+enum bxtwc_irqs_bcu {
 	BXTWC_BCU_IRQ = 0,
-	BXTWC_ADC_IRQ,
-	BXTWC_USBC_IRQ,
+};
+
+enum bxtwc_irqs_adc {
+	BXTWC_ADC_IRQ = 0,
+};
+
+enum bxtwc_irqs_chgr {
+	BXTWC_USBC_IRQ = 0,
 	BXTWC_CHGR0_IRQ,
 	BXTWC_CHGR1_IRQ,
-	BXTWC_CRIT_IRQ,
 };
 
-enum bxtwc_irqs_tmu {
-	BXTWC_TMU_IRQ = 0,
+enum bxtwc_irqs_crit {
+	BXTWC_CRIT_IRQ = 0,
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs[] = {
@@ -108,17 +116,26 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
 	REGMAP_IRQ_REG(BXTWC_PWRBTN_IRQ, 1, 0x03),
 };
 
-static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
+static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
+	REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_bcu[] = {
 	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
-	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
-	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
-static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
-	REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
+static const struct regmap_irq bxtwc_regmap_irqs_adc[] = {
+	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 0, 0xff),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_chgr[] = {
+	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 0, BIT(5)),
+	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 0, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 1, 0x1f),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_crit[] = {
+	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 0, 0x03),
 };
 
 static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
@@ -130,15 +147,6 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 	.num_regs = 2,
 };
 
-static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
-	.name = "bxtwc_irq_chip_level2",
-	.status_base = BXTWC_BCUIRQ,
-	.mask_base = BXTWC_MBCUIRQ,
-	.irqs = bxtwc_regmap_irqs_level2,
-	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
-	.num_regs = 10,
-};
-
 static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 	.name = "bxtwc_irq_chip_tmu",
 	.status_base = BXTWC_TMUIRQ,
@@ -148,6 +156,42 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 	.num_regs = 1,
 };
 
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_bcu = {
+	.name = "bxtwc_irq_chip_bcu",
+	.status_base = BXTWC_BCUIRQ,
+	.mask_base = BXTWC_MBCUIRQ,
+	.irqs = bxtwc_regmap_irqs_bcu,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_bcu),
+	.num_regs = 1,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_adc = {
+	.name = "bxtwc_irq_chip_adc",
+	.status_base = BXTWC_ADCIRQ,
+	.mask_base = BXTWC_MADCIRQ,
+	.irqs = bxtwc_regmap_irqs_adc,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_adc),
+	.num_regs = 1,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_chgr = {
+	.name = "bxtwc_irq_chip_chgr",
+	.status_base = BXTWC_CHGR0IRQ,
+	.mask_base = BXTWC_MCHGR0IRQ,
+	.irqs = bxtwc_regmap_irqs_chgr,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_chgr),
+	.num_regs = 2,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_crit = {
+	.name = "bxtwc_irq_chip_crit",
+	.status_base = BXTWC_CRITIRQ,
+	.mask_base = BXTWC_MCRITIRQ,
+	.irqs = bxtwc_regmap_irqs_crit,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_crit),
+	.num_regs = 1,
+};
+
 static struct resource gpio_resources[] = {
 	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
 };
@@ -357,6 +401,24 @@ static const struct regmap_config bxtwc_regmap_config = {
 	.reg_read = regmap_ipc_byte_reg_read,
 };
 
+static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic,
+				struct regmap_irq_chip_data *pdata,
+				int pirq, int irq_flags,
+				const struct regmap_irq_chip *chip,
+				struct regmap_irq_chip_data **data)
+{
+	int irq;
+
+	irq = regmap_irq_get_virq(pdata, pirq);
+	if (irq < 0) {
+		dev_err(pmic->dev, "failed to get virtual interrupt:%d\n", irq);
+		return irq;
+	}
+
+	return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags,
+					0, chip, data);
+}
+
 static int bxtwc_probe(struct platform_device *pdev)
 {
 	int ret;
@@ -408,21 +470,65 @@ static int bxtwc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
-				       IRQF_ONESHOT | IRQF_SHARED,
-				       0, &bxtwc_regmap_irq_chip_level2,
-				       &pmic->irq_chip_data_level2);
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_TMU_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_tmu,
+					 &pmic->irq_chip_data_tmu);
 	if (ret) {
-		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
+		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
 		return ret;
 	}
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
-				       IRQF_ONESHOT | IRQF_SHARED,
-				       0, &bxtwc_regmap_irq_chip_tmu,
-				       &pmic->irq_chip_data_tmu);
+	/* Add chained IRQ handler for BCU IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_BCU_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_bcu,
+					 &pmic->irq_chip_data_bcu);
+
+
 	if (ret) {
-		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
+		dev_err(&pdev->dev, "Failed to add BUC IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for ADC IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_ADC_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_adc,
+					 &pmic->irq_chip_data_adc);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add ADC IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for CHGR IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_CHGR_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_chgr,
+					 &pmic->irq_chip_data_chgr);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add CHGR IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for CRIT IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_CRIT_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_crit,
+					 &pmic->irq_chip_data_crit);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add CRIT IRQ chip\n");
 		return ret;
 	}
 
diff --git a/include/linux/mfd/intel_soc_pmic.h b/include/linux/mfd/intel_soc_pmic.h
index 956caa0..5aacdb0 100644
--- a/include/linux/mfd/intel_soc_pmic.h
+++ b/include/linux/mfd/intel_soc_pmic.h
@@ -25,8 +25,11 @@ struct intel_soc_pmic {
 	int irq;
 	struct regmap *regmap;
 	struct regmap_irq_chip_data *irq_chip_data;
-	struct regmap_irq_chip_data *irq_chip_data_level2;
 	struct regmap_irq_chip_data *irq_chip_data_tmu;
+	struct regmap_irq_chip_data *irq_chip_data_bcu;
+	struct regmap_irq_chip_data *irq_chip_data_adc;
+	struct regmap_irq_chip_data *irq_chip_data_chgr;
+	struct regmap_irq_chip_data *irq_chip_data_crit;
 	struct device *dev;
 };
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v3 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
  2017-05-23 17:29         ` sathyanarayanan.kuppuswamy
@ 2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-23 17:30 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Currently in WCOVE PMIC mfd driver, all second level irq chips
are chained to the respective first level irqs. So there is no
need for explicitly unmasking the first level irq in this
driver. This patches removes this level 1 irq unmask support.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/platform/x86/intel_bxtwc_tmu.c | 4 ----
 1 file changed, 4 deletions(-)

Changes since v1:
 * None

Changes since v2:
 * Rebased on top of latest release.

diff --git a/drivers/platform/x86/intel_bxtwc_tmu.c b/drivers/platform/x86/intel_bxtwc_tmu.c
index e202abd..ea865d4 100644
--- a/drivers/platform/x86/intel_bxtwc_tmu.c
+++ b/drivers/platform/x86/intel_bxtwc_tmu.c
@@ -92,10 +92,6 @@ static int bxt_wcove_tmu_probe(struct platform_device *pdev)
 	}
 	wctmu->irq = virq;
 
-	/* Enable TMU interrupts */
-	regmap_update_bits(wctmu->regmap, BXTWC_MIRQLVL1,
-				  BXTWC_MIRQLVL1_MTMU, 0);
-
 	/* Unmask TMU second level Wake & System alarm */
 	regmap_update_bits(wctmu->regmap, BXTWC_MTMUIRQ_REG,
 				  BXTWC_TMU_ALRM_MASK, 0);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v3 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask
@ 2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-23 17:30 UTC (permalink / raw)
  To: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Currently in WCOVE PMIC mfd driver, all second level irq chips
are chained to the respective first level irqs. So there is no
need for explicitly unmasking the first level irq in this
driver. This patches removes this level 1 irq unmask support.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/platform/x86/intel_bxtwc_tmu.c | 4 ----
 1 file changed, 4 deletions(-)

Changes since v1:
 * None

Changes since v2:
 * Rebased on top of latest release.

diff --git a/drivers/platform/x86/intel_bxtwc_tmu.c b/drivers/platform/x86/intel_bxtwc_tmu.c
index e202abd..ea865d4 100644
--- a/drivers/platform/x86/intel_bxtwc_tmu.c
+++ b/drivers/platform/x86/intel_bxtwc_tmu.c
@@ -92,10 +92,6 @@ static int bxt_wcove_tmu_probe(struct platform_device *pdev)
 	}
 	wctmu->irq = virq;
 
-	/* Enable TMU interrupts */
-	regmap_update_bits(wctmu->regmap, BXTWC_MIRQLVL1,
-				  BXTWC_MIRQLVL1_MTMU, 0);
-
 	/* Unmask TMU second level Wake & System alarm */
 	regmap_update_bits(wctmu->regmap, BXTWC_MTMUIRQ_REG,
 				  BXTWC_TMU_ALRM_MASK, 0);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
  2017-05-23 17:29         ` sathyanarayanan.kuppuswamy
                           ` (7 preceding siblings ...)
  (?)
@ 2017-05-30  8:53         ` Lee Jones
  2017-05-31  3:38           ` Stephen Rothwell
  2017-05-31  7:02           ` Lee Jones
  -1 siblings, 2 replies; 132+ messages in thread
From: Lee Jones @ 2017-05-30  8:53 UTC (permalink / raw)
  To: sathyanarayanan.kuppuswamy
  Cc: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, andy,
	linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid

Dear fellow Maintainers,

Enjoy!

The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:

  Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13

for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:

  platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)

----------------------------------------------------------------
Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window

----------------------------------------------------------------
Kuppuswamy Sathyanarayanan (8):
      mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
      mfd: intel_soc_pmic_bxtwc: Remove thermal second level irqs
      thermal: intel_bxt_pmic_thermal: use first level PMIC thermal irq
      mfd: intel_soc_pmic_bxtwc: Remove second level irq for gpio device
      gpio: gpio-wcove: use first level PMIC GPIO irq
      mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
      mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
      platform: x86: intel_bxtwc_tmu: remove first level irq unmask

 drivers/gpio/gpio-wcove.c                |  14 +-
 drivers/mfd/intel_soc_pmic_bxtwc.c       | 234 ++++++++++++++++++++-----------
 drivers/platform/x86/intel_bxtwc_tmu.c   |   4 -
 drivers/thermal/intel_bxt_pmic_thermal.c |   2 +-
 include/linux/mfd/intel_soc_pmic.h       |   5 +-
 5 files changed, 174 insertions(+), 85 deletions(-)

Kind regards,
Lee

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 1/8] mfd: intel_soc_pmic_bxtwc: fix TMU interrupt index
  2017-04-14 23:25 ` sathyanarayanan.kuppuswamy
                   ` (7 preceding siblings ...)
  (?)
@ 2017-05-30  8:54 ` Lee Jones
  2017-05-30 18:00     ` sathyanarayanan kuppuswamy
  -1 siblings, 1 reply; 132+ messages in thread
From: Lee Jones @ 2017-05-30  8:54 UTC (permalink / raw)
  To: sathyanarayanan.kuppuswamy
  Cc: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, andy,
	linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid

For future reference, when submitting a patch-set, you really should
provide a cover letter ([PATCH 00/XX]).

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 1/8] mfd: intel_soc_pmic_bxtwc: fix TMU interrupt index
  2017-05-30  8:54 ` [PATCH v2 1/8] mfd: intel_soc_pmic_bxtwc: fix TMU interrupt index Lee Jones
@ 2017-05-30 18:00     ` sathyanarayanan kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan kuppuswamy @ 2017-05-30 18:00 UTC (permalink / raw)
  To: Lee Jones
  Cc: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, andy,
	linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid

Thanks Lee.


On 05/30/2017 01:54 AM, Lee Jones wrote:
> For future reference, when submitting a patch-set, you really should
> provide a cover letter ([PATCH 00/XX]).
Will do.
>

-- 
Sathyanarayanan Kuppuswamy
Linux kernel developer

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v2 1/8] mfd: intel_soc_pmic_bxtwc: fix TMU interrupt index
@ 2017-05-30 18:00     ` sathyanarayanan kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan kuppuswamy @ 2017-05-30 18:00 UTC (permalink / raw)
  To: Lee Jones
  Cc: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, andy,
	linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid

Thanks Lee.


On 05/30/2017 01:54 AM, Lee Jones wrote:
> For future reference, when submitting a patch-set, you really should
> provide a cover letter ([PATCH 00/XX]).
Will do.
>

-- 
Sathyanarayanan Kuppuswamy
Linux kernel developer

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
  2017-05-30  8:53         ` [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window Lee Jones
@ 2017-05-31  3:38           ` Stephen Rothwell
  2017-05-31  4:27               ` Sathyanarayanan Kuppuswamy Natarajan
                               ` (2 more replies)
  2017-05-31  7:02           ` Lee Jones
  1 sibling, 3 replies; 132+ messages in thread
From: Stephen Rothwell @ 2017-05-31  3:38 UTC (permalink / raw)
  To: Lee Jones
  Cc: sathyanarayanan.kuppuswamy, gnurou, linus.walleij, edubezval,
	dvhart, rui.zhang, andy, linux-gpio, linux-pm, linux-kernel,
	platform-driver-x86, sathyaosid

Hi all,

On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
>
> Dear fellow Maintainers,
> 
> Enjoy!
> 
> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
> 
>   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
> 
> for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
> 
>   platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
> 
> ----------------------------------------------------------------
> Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
> 
> ----------------------------------------------------------------
> Kuppuswamy Sathyanarayanan (8):
>       mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips

See my other bug report on this commit ...

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
  2017-05-31  3:38           ` Stephen Rothwell
@ 2017-05-31  4:27               ` Sathyanarayanan Kuppuswamy Natarajan
  2017-05-31  4:29               ` Sathyanarayanan Kuppuswamy Natarajan
  2017-05-31  6:50             ` Lee Jones
  2 siblings, 0 replies; 132+ messages in thread
From: Sathyanarayanan Kuppuswamy Natarajan @ 2017-05-31  4:27 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Lee Jones, Kuppuswamy Sathyanarayanan, Alexandre Courbot,
	Linus Walleij, Eduardo Valentin, dvhart, rui.zhang,
	Andy Shevchenko, linux-gpio, linux-pm, linux-kernel,
	Platform Driver

Sorry, its a mistake from my end. It looks like typec wcove driver got
merged recently and I missed to add it to my cleanup patch set.

Lee,

I have created a patch to fix this issue.

Do you want me to send the entire series again with this fix or just
send the fix alone.


On Tue, May 30, 2017 at 8:38 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi all,
>
> On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
>>
>> Dear fellow Maintainers,
>>
>> Enjoy!
>>
>> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
>>
>>   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
>>
>> are available in the git repository at:
>>
>>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
>>
>> for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
>>
>>   platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
>>
>> ----------------------------------------------------------------
>> Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
>>
>> ----------------------------------------------------------------
>> Kuppuswamy Sathyanarayanan (8):
>>       mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
>
> See my other bug report on this commit ...
>
> --
> Cheers,
> Stephen Rothwell



-- 
Sathya

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
@ 2017-05-31  4:27               ` Sathyanarayanan Kuppuswamy Natarajan
  0 siblings, 0 replies; 132+ messages in thread
From: Sathyanarayanan Kuppuswamy Natarajan @ 2017-05-31  4:27 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Lee Jones, Kuppuswamy Sathyanarayanan, Alexandre Courbot,
	Linus Walleij, Eduardo Valentin, dvhart, rui.zhang,
	Andy Shevchenko, linux-gpio, linux-pm, linux-kernel,
	Platform Driver

Sorry, its a mistake from my end. It looks like typec wcove driver got
merged recently and I missed to add it to my cleanup patch set.

Lee,

I have created a patch to fix this issue.

Do you want me to send the entire series again with this fix or just
send the fix alone.


On Tue, May 30, 2017 at 8:38 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi all,
>
> On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
>>
>> Dear fellow Maintainers,
>>
>> Enjoy!
>>
>> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
>>
>>   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
>>
>> are available in the git repository at:
>>
>>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
>>
>> for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
>>
>>   platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
>>
>> ----------------------------------------------------------------
>> Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
>>
>> ----------------------------------------------------------------
>> Kuppuswamy Sathyanarayanan (8):
>>       mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
>
> See my other bug report on this commit ...
>
> --
> Cheers,
> Stephen Rothwell



-- 
Sathya

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
  2017-05-31  3:38           ` Stephen Rothwell
@ 2017-05-31  4:29               ` Sathyanarayanan Kuppuswamy Natarajan
  2017-05-31  4:29               ` Sathyanarayanan Kuppuswamy Natarajan
  2017-05-31  6:50             ` Lee Jones
  2 siblings, 0 replies; 132+ messages in thread
From: Sathyanarayanan Kuppuswamy Natarajan @ 2017-05-31  4:29 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Lee Jones, Kuppuswamy Sathyanarayanan, Alexandre Courbot,
	Linus Walleij, Eduardo Valentin, dvhart, rui.zhang,
	Andy Shevchenko, linux-gpio, linux-pm, linux-kernel,
	Platform Driver

Hi All,

On Tue, May 30, 2017 at 8:38 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi all,
>
> On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
>>
>> Dear fellow Maintainers,
>>
>> Enjoy!
>>
>> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
>>
>>   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
>>
>> are available in the git repository at:
>>
>>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
>>
>> for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
>>
>>   platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
>>
>> ----------------------------------------------------------------
>> Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
>>
>> ----------------------------------------------------------------
>> Kuppuswamy Sathyanarayanan (8):
>>       mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
>
> See my other bug report on this commit ...

Sorry, its a mistake from my end. It looks like typec wcove driver got
merged recently and I missed to add it to my cleanup patch set.

Lee,

I have created a patch to fix this issue.

Do you want me to send the entire series again with this fix or just
send the fix alone.

>
> --
> Cheers,
> Stephen Rothwell



-- 
Sathya

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
@ 2017-05-31  4:29               ` Sathyanarayanan Kuppuswamy Natarajan
  0 siblings, 0 replies; 132+ messages in thread
From: Sathyanarayanan Kuppuswamy Natarajan @ 2017-05-31  4:29 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Lee Jones, Kuppuswamy Sathyanarayanan, Alexandre Courbot,
	Linus Walleij, Eduardo Valentin, dvhart, rui.zhang,
	Andy Shevchenko, linux-gpio, linux-pm, linux-kernel,
	Platform Driver

Hi All,

On Tue, May 30, 2017 at 8:38 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi all,
>
> On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
>>
>> Dear fellow Maintainers,
>>
>> Enjoy!
>>
>> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
>>
>>   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
>>
>> are available in the git repository at:
>>
>>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
>>
>> for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
>>
>>   platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
>>
>> ----------------------------------------------------------------
>> Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
>>
>> ----------------------------------------------------------------
>> Kuppuswamy Sathyanarayanan (8):
>>       mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
>
> See my other bug report on this commit ...

Sorry, its a mistake from my end. It looks like typec wcove driver got
merged recently and I missed to add it to my cleanup patch set.

Lee,

I have created a patch to fix this issue.

Do you want me to send the entire series again with this fix or just
send the fix alone.

>
> --
> Cheers,
> Stephen Rothwell



-- 
Sathya

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
  2017-05-31  3:38           ` Stephen Rothwell
  2017-05-31  4:27               ` Sathyanarayanan Kuppuswamy Natarajan
  2017-05-31  4:29               ` Sathyanarayanan Kuppuswamy Natarajan
@ 2017-05-31  6:50             ` Lee Jones
  2 siblings, 0 replies; 132+ messages in thread
From: Lee Jones @ 2017-05-31  6:50 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: sathyanarayanan.kuppuswamy, gnurou, linus.walleij, edubezval,
	dvhart, rui.zhang, andy, linux-gpio, linux-pm, linux-kernel,
	platform-driver-x86, sathyaosid

On Wed, 31 May 2017, Stephen Rothwell wrote:

> Hi all,
> 
> On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
> >
> > Dear fellow Maintainers,
> > 
> > Enjoy!
> > 
> > The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
> > 
> >   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
> > 
> > are available in the git repository at:
> > 
> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
> > 
> > for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
> > 
> >   platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
> > 
> > ----------------------------------------------------------------
> > Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
> > 
> > ----------------------------------------------------------------
> > Kuppuswamy Sathyanarayanan (8):
> >       mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
> 
> See my other bug report on this commit ...

Thanks Stephen.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
  2017-05-31  4:29               ` Sathyanarayanan Kuppuswamy Natarajan
@ 2017-05-31  6:57                 ` Lee Jones
  -1 siblings, 0 replies; 132+ messages in thread
From: Lee Jones @ 2017-05-31  6:57 UTC (permalink / raw)
  To: Sathyanarayanan Kuppuswamy Natarajan
  Cc: Stephen Rothwell, Kuppuswamy Sathyanarayanan, Alexandre Courbot,
	Linus Walleij, Eduardo Valentin, dvhart, rui.zhang,
	Andy Shevchenko, linux-gpio, linux-pm, linux-kernel,
	Platform Driver

On Tue, 30 May 2017, Sathyanarayanan Kuppuswamy Natarajan wrote:

> Hi All,
> 
> On Tue, May 30, 2017 at 8:38 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > Hi all,
> >
> > On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
> >>
> >> Dear fellow Maintainers,
> >>
> >> Enjoy!
> >>
> >> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
> >>
> >>   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
> >>
> >> are available in the git repository at:
> >>
> >>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
> >>
> >> for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
> >>
> >>   platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
> >>
> >> ----------------------------------------------------------------
> >> Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
> >>
> >> ----------------------------------------------------------------
> >> Kuppuswamy Sathyanarayanan (8):
> >>       mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
> >
> > See my other bug report on this commit ...
> 
> Sorry, its a mistake from my end. It looks like typec wcove driver got
> merged recently and I missed to add it to my cleanup patch set.
> 
> Lee,
> 
> I have created a patch to fix this issue.
> 
> Do you want me to send the entire series again with this fix or just
> send the fix alone.

This highlights the fact that this patch-set is not actually
bisectable.  To say that, when bisecting if we landed somewhere in the
middle of this set, we would receive build errors.

Ergo, this set is not actually acceptable in its current state.
Please squash all patches where you are a) changing the API (in the
MFD header), then b) transitioning users (child devices) over to it.

Ensure that you do not make any code changes and remember to move all
of the Acks you collected into the squashed patch.  Also, please use
the $SUBJECT lines commonly used by particular subsystems.  For MFD
the format is thus:

  mfd: <device>: Patch description starting with an uppercase character

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
@ 2017-05-31  6:57                 ` Lee Jones
  0 siblings, 0 replies; 132+ messages in thread
From: Lee Jones @ 2017-05-31  6:57 UTC (permalink / raw)
  To: Sathyanarayanan Kuppuswamy Natarajan
  Cc: Stephen Rothwell, Kuppuswamy Sathyanarayanan, Alexandre Courbot,
	Linus Walleij, Eduardo Valentin, dvhart, rui.zhang,
	Andy Shevchenko, linux-gpio, linux-pm, linux-kernel,
	Platform Driver

On Tue, 30 May 2017, Sathyanarayanan Kuppuswamy Natarajan wrote:

> Hi All,
> 
> On Tue, May 30, 2017 at 8:38 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > Hi all,
> >
> > On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
> >>
> >> Dear fellow Maintainers,
> >>
> >> Enjoy!
> >>
> >> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
> >>
> >>   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
> >>
> >> are available in the git repository at:
> >>
> >>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
> >>
> >> for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
> >>
> >>   platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
> >>
> >> ----------------------------------------------------------------
> >> Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
> >>
> >> ----------------------------------------------------------------
> >> Kuppuswamy Sathyanarayanan (8):
> >>       mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
> >
> > See my other bug report on this commit ...
> 
> Sorry, its a mistake from my end. It looks like typec wcove driver got
> merged recently and I missed to add it to my cleanup patch set.
> 
> Lee,
> 
> I have created a patch to fix this issue.
> 
> Do you want me to send the entire series again with this fix or just
> send the fix alone.

This highlights the fact that this patch-set is not actually
bisectable.  To say that, when bisecting if we landed somewhere in the
middle of this set, we would receive build errors.

Ergo, this set is not actually acceptable in its current state.
Please squash all patches where you are a) changing the API (in the
MFD header), then b) transitioning users (child devices) over to it.

Ensure that you do not make any code changes and remember to move all
of the Acks you collected into the squashed patch.  Also, please use
the $SUBJECT lines commonly used by particular subsystems.  For MFD
the format is thus:

  mfd: <device>: Patch description starting with an uppercase character

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
  2017-05-30  8:53         ` [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window Lee Jones
  2017-05-31  3:38           ` Stephen Rothwell
@ 2017-05-31  7:02           ` Lee Jones
  2017-05-31 22:37               ` sathyanarayanan.kuppuswamy
       [not found]             ` <cover.1496266871.git.sathyanarayanan.kuppuswamy-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
  1 sibling, 2 replies; 132+ messages in thread
From: Lee Jones @ 2017-05-31  7:02 UTC (permalink / raw)
  To: sathyanarayanan.kuppuswamy
  Cc: gnurou, linus.walleij, edubezval, dvhart, rui.zhang, andy,
	linux-gpio, linux-pm, linux-kernel, platform-driver-x86,
	sathyaosid

> Dear fellow Maintainers,
> 
> Enjoy!

... or not!

Please remove these patches from your tree, since they cause build
problems in the USB subsystem.

I have asked Kuppuswamy to squash all un-bisectable patches and
re-submit.  Once in my possession, the plan is to push out another
pull-request.

> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
> 
>   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
> 
> for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
> 
>   platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
> 
> ----------------------------------------------------------------
> Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
> 
> ----------------------------------------------------------------
> Kuppuswamy Sathyanarayanan (8):
>       mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
>       mfd: intel_soc_pmic_bxtwc: Remove thermal second level irqs
>       thermal: intel_bxt_pmic_thermal: use first level PMIC thermal irq
>       mfd: intel_soc_pmic_bxtwc: Remove second level irq for gpio device
>       gpio: gpio-wcove: use first level PMIC GPIO irq
>       mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
>       mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
>       platform: x86: intel_bxtwc_tmu: remove first level irq unmask
> 
>  drivers/gpio/gpio-wcove.c                |  14 +-
>  drivers/mfd/intel_soc_pmic_bxtwc.c       | 234 ++++++++++++++++++++-----------
>  drivers/platform/x86/intel_bxtwc_tmu.c   |   4 -
>  drivers/thermal/intel_bxt_pmic_thermal.c |   2 +-
>  include/linux/mfd/intel_soc_pmic.h       |   5 +-
>  5 files changed, 174 insertions(+), 85 deletions(-)
> 
> Kind regards,
> Lee
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
  2017-05-31  6:57                 ` Lee Jones
@ 2017-05-31 22:33                   ` sathyanarayanan kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan kuppuswamy @ 2017-05-31 22:33 UTC (permalink / raw)
  To: Lee Jones, Sathyanarayanan Kuppuswamy Natarajan
  Cc: Stephen Rothwell, Alexandre Courbot, Linus Walleij,
	Eduardo Valentin, dvhart, rui.zhang, Andy Shevchenko, linux-gpio,
	linux-pm, linux-kernel, Platform Driver

Hi Lee,


On 05/30/2017 11:57 PM, Lee Jones wrote:
> On Tue, 30 May 2017, Sathyanarayanan Kuppuswamy Natarajan wrote:
>
>> Hi All,
>>
>> On Tue, May 30, 2017 at 8:38 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>>> Hi all,
>>>
>>> On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
>>>> Dear fellow Maintainers,
>>>>
>>>> Enjoy!
>>>>
>>>> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
>>>>
>>>>    Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
>>>>
>>>> are available in the git repository at:
>>>>
>>>>    git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
>>>>
>>>> for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
>>>>
>>>>    platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
>>>>
>>>> ----------------------------------------------------------------
>>>> Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
>>>>
>>>> ----------------------------------------------------------------
>>>> Kuppuswamy Sathyanarayanan (8):
>>>>        mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
>>> See my other bug report on this commit ...
>> Sorry, its a mistake from my end. It looks like typec wcove driver got
>> merged recently and I missed to add it to my cleanup patch set.
>>
>> Lee,
>>
>> I have created a patch to fix this issue.
>>
>> Do you want me to send the entire series again with this fix or just
>> send the fix alone.
> This highlights the fact that this patch-set is not actually
> bisectable.
Except for the last patch set ( which has fix for typec driver 
compilation issue) that I sent yesterday,
all other patch set versions are bisectable.

The problem was when I first created this patch set, typec wcove driver 
was not merged upstream.
After creating the initial set, I was just improving the patch set and 
forgot to re-check for
child devices that depend of PMIC MFD driver.  Thats why we came across 
this compilation issue.

In future, I will try to avoid these kind of issues. I think adding 
"allyesconfig" and "allmodconfig"
compilation tests to my patch submit criteria should prevent these kind 
of issues.

> To say that, when bisecting if we landed somewhere in the
> middle of this set, we would receive build errors.
>
> Ergo, this set is not actually acceptable in its current state.
> Please squash all patches where you are a) changing the API (in the
> MFD header), then b) transitioning users (child devices) over to it.
>
> Ensure that you do not make any code changes and remember to move all
> of the Acks you collected into the squashed patch.  Also, please use
> the $SUBJECT lines commonly used by particular subsystems.  For MFD
> the format is thus:
>
>    mfd: <device>: Patch description starting with an uppercase character
yes, will include it in next update.
>

-- 
Sathyanarayanan Kuppuswamy
Linux kernel developer

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
@ 2017-05-31 22:33                   ` sathyanarayanan kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan kuppuswamy @ 2017-05-31 22:33 UTC (permalink / raw)
  To: Lee Jones, Sathyanarayanan Kuppuswamy Natarajan
  Cc: Stephen Rothwell, Alexandre Courbot, Linus Walleij,
	Eduardo Valentin, dvhart, rui.zhang, Andy Shevchenko, linux-gpio,
	linux-pm, linux-kernel, Platform Driver

Hi Lee,


On 05/30/2017 11:57 PM, Lee Jones wrote:
> On Tue, 30 May 2017, Sathyanarayanan Kuppuswamy Natarajan wrote:
>
>> Hi All,
>>
>> On Tue, May 30, 2017 at 8:38 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>>> Hi all,
>>>
>>> On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
>>>> Dear fellow Maintainers,
>>>>
>>>> Enjoy!
>>>>
>>>> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
>>>>
>>>>    Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
>>>>
>>>> are available in the git repository at:
>>>>
>>>>    git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
>>>>
>>>> for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
>>>>
>>>>    platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
>>>>
>>>> ----------------------------------------------------------------
>>>> Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
>>>>
>>>> ----------------------------------------------------------------
>>>> Kuppuswamy Sathyanarayanan (8):
>>>>        mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
>>> See my other bug report on this commit ...
>> Sorry, its a mistake from my end. It looks like typec wcove driver got
>> merged recently and I missed to add it to my cleanup patch set.
>>
>> Lee,
>>
>> I have created a patch to fix this issue.
>>
>> Do you want me to send the entire series again with this fix or just
>> send the fix alone.
> This highlights the fact that this patch-set is not actually
> bisectable.
Except for the last patch set ( which has fix for typec driver 
compilation issue) that I sent yesterday,
all other patch set versions are bisectable.

The problem was when I first created this patch set, typec wcove driver 
was not merged upstream.
After creating the initial set, I was just improving the patch set and 
forgot to re-check for
child devices that depend of PMIC MFD driver.  Thats why we came across 
this compilation issue.

In future, I will try to avoid these kind of issues. I think adding 
"allyesconfig" and "allmodconfig"
compilation tests to my patch submit criteria should prevent these kind 
of issues.

> To say that, when bisecting if we landed somewhere in the
> middle of this set, we would receive build errors.
>
> Ergo, this set is not actually acceptable in its current state.
> Please squash all patches where you are a) changing the API (in the
> MFD header), then b) transitioning users (child devices) over to it.
>
> Ensure that you do not make any code changes and remember to move all
> of the Acks you collected into the squashed patch.  Also, please use
> the $SUBJECT lines commonly used by particular subsystems.  For MFD
> the format is thus:
>
>    mfd: <device>: Patch description starting with an uppercase character
yes, will include it in next update.
>

-- 
Sathyanarayanan Kuppuswamy
Linux kernel developer

^ permalink raw reply	[flat|nested] 132+ messages in thread

* [PATCH v5 0/8] mfd: intel_soc_pmic_bxtwc: Add chained IRQ support
  2017-05-31  7:02           ` Lee Jones
@ 2017-05-31 22:37               ` sathyanarayanan.kuppuswamy
       [not found]             ` <cover.1496266871.git.sathyanarayanan.kuppuswamy-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
  1 sibling, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Following patch set adds chained IRQ support to WCOVE PMIC driver.

Changes since v3:
 * Added fix for typec wcove driver.

Changes since v4:
 * Squashed following two commits, to keep the patch set bisectable.
   usb: typec: typec_wcove: Use charger irq chip to get usbc virq
   mfd: intel_soc_pmic_bxtwc: use chained irqs for second level irq chips

Kuppuswamy Sathyanarayanan (8):
  mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
  mfd: intel_soc_pmic_bxtwc: Remove thermal second level irqs
  thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
  mfd: intel_soc_pmic_bxtwc: Remove second level irq for gpio device
  gpio: gpio-wcove: Use first level PMIC GPIO irq
  mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
  mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
  platform/x86: intel_bxtwc_tmu: Remove first level irq unmask

 drivers/gpio/gpio-wcove.c                |  14 +-
 drivers/mfd/intel_soc_pmic_bxtwc.c       | 234 ++++++++++++++++++++-----------
 drivers/platform/x86/intel_bxtwc_tmu.c   |   4 -
 drivers/thermal/intel_bxt_pmic_thermal.c |   2 +-
 drivers/usb/typec/typec_wcove.c          |   2 +-
 include/linux/mfd/intel_soc_pmic.h       |   5 +-
 6 files changed, 175 insertions(+), 86 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 132+ messages in thread

* [PATCH v5 0/8] mfd: intel_soc_pmic_bxtwc: Add chained IRQ support
@ 2017-05-31 22:37               ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Following patch set adds chained IRQ support to WCOVE PMIC driver.

Changes since v3:
 * Added fix for typec wcove driver.

Changes since v4:
 * Squashed following two commits, to keep the patch set bisectable.
   usb: typec: typec_wcove: Use charger irq chip to get usbc virq
   mfd: intel_soc_pmic_bxtwc: use chained irqs for second level irq chips

Kuppuswamy Sathyanarayanan (8):
  mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
  mfd: intel_soc_pmic_bxtwc: Remove thermal second level irqs
  thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
  mfd: intel_soc_pmic_bxtwc: Remove second level irq for gpio device
  gpio: gpio-wcove: Use first level PMIC GPIO irq
  mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
  mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
  platform/x86: intel_bxtwc_tmu: Remove first level irq unmask

 drivers/gpio/gpio-wcove.c                |  14 +-
 drivers/mfd/intel_soc_pmic_bxtwc.c       | 234 ++++++++++++++++++++-----------
 drivers/platform/x86/intel_bxtwc_tmu.c   |   4 -
 drivers/thermal/intel_bxt_pmic_thermal.c |   2 +-
 drivers/usb/typec/typec_wcove.c          |   2 +-
 include/linux/mfd/intel_soc_pmic.h       |   5 +-
 6 files changed, 175 insertions(+), 86 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 132+ messages in thread

* [PATCH v5 1/8] mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
  2017-05-31 22:37               ` sathyanarayanan.kuppuswamy
@ 2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

TMU interrupts are registered as a separate interrupt chip, and
hence it should start its interrupt index(BXTWC_TMU_IRQ) number
from 0. But currently, BXTWC_TMU_IRQ is defined as part of enum
bxtwc_irqs_level2 and its index value is 11. Since this index
value is used when calculating .num_irqs of regmap_irq_chip_tmu,
it incorrectly reports number of irqs as 12 instead of actual
value of 1.

This patch fixes this issue by creating new enum of tmu irqs and
resetting its starting index to 0.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Changes since v1: 
 * Removed code from commit message.

Changes since v2: 
 * Rebased on top of latest release.

Changes sinve v3:
 * Rebased on top of latest release.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 8c3cbf6..7cbaf1e 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -95,7 +95,10 @@ enum bxtwc_irqs_level2 {
 	BXTWC_GPIO0_IRQ,
 	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
-	BXTWC_TMU_IRQ,
+};
+
+enum bxtwc_irqs_tmu {
+	BXTWC_TMU_IRQ = 0,
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v5 1/8] mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
@ 2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

TMU interrupts are registered as a separate interrupt chip, and
hence it should start its interrupt index(BXTWC_TMU_IRQ) number
from 0. But currently, BXTWC_TMU_IRQ is defined as part of enum
bxtwc_irqs_level2 and its index value is 11. Since this index
value is used when calculating .num_irqs of regmap_irq_chip_tmu,
it incorrectly reports number of irqs as 12 instead of actual
value of 1.

This patch fixes this issue by creating new enum of tmu irqs and
resetting its starting index to 0.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Changes since v1: 
 * Removed code from commit message.

Changes since v2: 
 * Rebased on top of latest release.

Changes sinve v3:
 * Rebased on top of latest release.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 8c3cbf6..7cbaf1e 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -95,7 +95,10 @@ enum bxtwc_irqs_level2 {
 	BXTWC_GPIO0_IRQ,
 	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
-	BXTWC_TMU_IRQ,
+};
+
+enum bxtwc_irqs_tmu {
+	BXTWC_TMU_IRQ = 0,
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v5 2/8] mfd: intel_soc_pmic_bxtwc: Remove thermal second level irqs
  2017-05-31 22:37               ` sathyanarayanan.kuppuswamy
@ 2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Since all second level thermal irqs are consumed by the same
device(bxt_wcove_thermal), there is no need to expose them as separate
interrupts. We can just export only the first level irqs for thermal and
let the device(bxt_wcove_thermal) driver handle the second level irqs
based on thermal interrupt status register. Also, just using only the
first level irq will eliminate the bug involved in requesting only the
second level irq and not explicitly enable the first level irq. For
more info on this issue please read the details at,

https://lkml.org/lkml/2017/2/27/148

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 32 ++++++++++++--------------------
 1 file changed, 12 insertions(+), 20 deletions(-)

Changes since v1:
 * None

Changes since v2: 
 * Rebased on top of latest release.

Changes since v3:
 * Rebased on top of latest release.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 7cbaf1e..7c1ed27 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -84,10 +84,7 @@ enum bxtwc_irqs {
 
 enum bxtwc_irqs_level2 {
 	/* Level 2 */
-	BXTWC_THRM0_IRQ = 0,
-	BXTWC_THRM1_IRQ,
-	BXTWC_THRM2_IRQ,
-	BXTWC_BCU_IRQ,
+	BXTWC_BCU_IRQ = 0,
 	BXTWC_ADC_IRQ,
 	BXTWC_USBC_IRQ,
 	BXTWC_CHGR0_IRQ,
@@ -114,17 +111,14 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
-	REGMAP_IRQ_REG(BXTWC_THRM0_IRQ, 0, 0xff),
-	REGMAP_IRQ_REG(BXTWC_THRM1_IRQ, 1, 0xbf),
-	REGMAP_IRQ_REG(BXTWC_THRM2_IRQ, 2, 0xff),
-	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 4, 0xff),
-	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 5, BIT(5)),
-	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 5, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 6, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 7, 0xff),
-	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 8, 0x3f),
-	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 9, 0x03),
+	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
+	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
+	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 4, 0xff),
+	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 5, 0x3f),
+	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
@@ -142,8 +136,8 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 
 static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
 	.name = "bxtwc_irq_chip_level2",
-	.status_base = BXTWC_THRM0IRQ,
-	.mask_base = BXTWC_MTHRM0IRQ,
+	.status_base = BXTWC_BCUIRQ,
+	.mask_base = BXTWC_MBCUIRQ,
 	.irqs = bxtwc_regmap_irqs_level2,
 	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
 	.num_regs = 10,
@@ -177,9 +171,7 @@ static struct resource charger_resources[] = {
 };
 
 static struct resource thermal_resources[] = {
-	DEFINE_RES_IRQ(BXTWC_THRM0_IRQ),
-	DEFINE_RES_IRQ(BXTWC_THRM1_IRQ),
-	DEFINE_RES_IRQ(BXTWC_THRM2_IRQ),
+	DEFINE_RES_IRQ(BXTWC_THRM_LVL1_IRQ),
 };
 
 static struct resource bcu_resources[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v5 2/8] mfd: intel_soc_pmic_bxtwc: Remove thermal second level irqs
@ 2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Since all second level thermal irqs are consumed by the same
device(bxt_wcove_thermal), there is no need to expose them as separate
interrupts. We can just export only the first level irqs for thermal and
let the device(bxt_wcove_thermal) driver handle the second level irqs
based on thermal interrupt status register. Also, just using only the
first level irq will eliminate the bug involved in requesting only the
second level irq and not explicitly enable the first level irq. For
more info on this issue please read the details at,

https://lkml.org/lkml/2017/2/27/148

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 32 ++++++++++++--------------------
 1 file changed, 12 insertions(+), 20 deletions(-)

Changes since v1:
 * None

Changes since v2: 
 * Rebased on top of latest release.

Changes since v3:
 * Rebased on top of latest release.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 7cbaf1e..7c1ed27 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -84,10 +84,7 @@ enum bxtwc_irqs {
 
 enum bxtwc_irqs_level2 {
 	/* Level 2 */
-	BXTWC_THRM0_IRQ = 0,
-	BXTWC_THRM1_IRQ,
-	BXTWC_THRM2_IRQ,
-	BXTWC_BCU_IRQ,
+	BXTWC_BCU_IRQ = 0,
 	BXTWC_ADC_IRQ,
 	BXTWC_USBC_IRQ,
 	BXTWC_CHGR0_IRQ,
@@ -114,17 +111,14 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
-	REGMAP_IRQ_REG(BXTWC_THRM0_IRQ, 0, 0xff),
-	REGMAP_IRQ_REG(BXTWC_THRM1_IRQ, 1, 0xbf),
-	REGMAP_IRQ_REG(BXTWC_THRM2_IRQ, 2, 0xff),
-	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 4, 0xff),
-	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 5, BIT(5)),
-	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 5, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 6, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 7, 0xff),
-	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 8, 0x3f),
-	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 9, 0x03),
+	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
+	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
+	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 4, 0xff),
+	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 5, 0x3f),
+	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
@@ -142,8 +136,8 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 
 static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
 	.name = "bxtwc_irq_chip_level2",
-	.status_base = BXTWC_THRM0IRQ,
-	.mask_base = BXTWC_MTHRM0IRQ,
+	.status_base = BXTWC_BCUIRQ,
+	.mask_base = BXTWC_MBCUIRQ,
 	.irqs = bxtwc_regmap_irqs_level2,
 	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
 	.num_regs = 10,
@@ -177,9 +171,7 @@ static struct resource charger_resources[] = {
 };
 
 static struct resource thermal_resources[] = {
-	DEFINE_RES_IRQ(BXTWC_THRM0_IRQ),
-	DEFINE_RES_IRQ(BXTWC_THRM1_IRQ),
-	DEFINE_RES_IRQ(BXTWC_THRM2_IRQ),
+	DEFINE_RES_IRQ(BXTWC_THRM_LVL1_IRQ),
 };
 
 static struct resource bcu_resources[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v5 3/8] thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
  2017-05-31 22:37               ` sathyanarayanan.kuppuswamy
@ 2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

PMIC mfd driver only exports first level irq for thermal device.
But currently we are reading the irqs from the second level irq
chip, So this patch fixes this issue by adding support to use
first level PMIC thermal irq.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/thermal/intel_bxt_pmic_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Changes since v1:
 * None

Changes since v2: 
 * Rebased on top of latest release.

Changes since v3: 
 * Rebased on top of latest release.

diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c b/drivers/thermal/intel_bxt_pmic_thermal.c
index 0f19a39..ef6b322 100644
--- a/drivers/thermal/intel_bxt_pmic_thermal.c
+++ b/drivers/thermal/intel_bxt_pmic_thermal.c
@@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct platform_device *pdev)
 	}
 
 	regmap = pmic->regmap;
-	regmap_irq_chip = pmic->irq_chip_data_level2;
+	regmap_irq_chip = pmic->irq_chip_data;
 
 	pmic_irq_count = 0;
 	while ((irq = platform_get_irq(pdev, pmic_irq_count)) != -ENXIO) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v5 3/8] thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
@ 2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

PMIC mfd driver only exports first level irq for thermal device.
But currently we are reading the irqs from the second level irq
chip, So this patch fixes this issue by adding support to use
first level PMIC thermal irq.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/thermal/intel_bxt_pmic_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Changes since v1:
 * None

Changes since v2: 
 * Rebased on top of latest release.

Changes since v3: 
 * Rebased on top of latest release.

diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c b/drivers/thermal/intel_bxt_pmic_thermal.c
index 0f19a39..ef6b322 100644
--- a/drivers/thermal/intel_bxt_pmic_thermal.c
+++ b/drivers/thermal/intel_bxt_pmic_thermal.c
@@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct platform_device *pdev)
 	}
 
 	regmap = pmic->regmap;
-	regmap_irq_chip = pmic->irq_chip_data_level2;
+	regmap_irq_chip = pmic->irq_chip_data;
 
 	pmic_irq_count = 0;
 	while ((irq = platform_get_irq(pdev, pmic_irq_count)) != -ENXIO) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v5 4/8] mfd: intel_soc_pmic_bxtwc: Remove second level irq for gpio device
  2017-05-31 22:37               ` sathyanarayanan.kuppuswamy
@ 2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Currently all PMIC GPIO domain irqs are consumed by the same
device(bxt_wcove_gpio), so there is no need to export them as
separate interrupts. We can just export only the first level
GPIO irq(BXTWC_GPIO_LVL1_IRQ) as an irq resource and let the
GPIO device driver(bxt_wcove_gpio) handle the GPIO sub domain
irqs based on status value of GPIO level2 interrupt status
register. Also, just using only the first level irq will eliminate
the bug involved in requesting only the second level irq and not
explicitly enable the first level irq. For more info on this
issue please read the details at,

https://lkml.org/lkml/2017/2/27/148

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Changes since v1:
 * None

Changes since v2: 
 * Rebased on top of latest release.

Changes since v3:
 * None

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 7c1ed27..af11c43 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -89,8 +89,6 @@ enum bxtwc_irqs_level2 {
 	BXTWC_USBC_IRQ,
 	BXTWC_CHGR0_IRQ,
 	BXTWC_CHGR1_IRQ,
-	BXTWC_GPIO0_IRQ,
-	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
 };
 
@@ -116,8 +114,6 @@ static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
 	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
 	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
 	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 4, 0xff),
-	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 5, 0x3f),
 	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
@@ -153,8 +149,7 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 };
 
 static struct resource gpio_resources[] = {
-	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO0_IRQ, "GPIO0"),
-	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO1_IRQ, "GPIO1"),
+	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
 };
 
 static struct resource adc_resources[] = {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v5 4/8] mfd: intel_soc_pmic_bxtwc: Remove second level irq for gpio device
@ 2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Currently all PMIC GPIO domain irqs are consumed by the same
device(bxt_wcove_gpio), so there is no need to export them as
separate interrupts. We can just export only the first level
GPIO irq(BXTWC_GPIO_LVL1_IRQ) as an irq resource and let the
GPIO device driver(bxt_wcove_gpio) handle the GPIO sub domain
irqs based on status value of GPIO level2 interrupt status
register. Also, just using only the first level irq will eliminate
the bug involved in requesting only the second level irq and not
explicitly enable the first level irq. For more info on this
issue please read the details at,

https://lkml.org/lkml/2017/2/27/148

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Changes since v1:
 * None

Changes since v2: 
 * Rebased on top of latest release.

Changes since v3:
 * None

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 7c1ed27..af11c43 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -89,8 +89,6 @@ enum bxtwc_irqs_level2 {
 	BXTWC_USBC_IRQ,
 	BXTWC_CHGR0_IRQ,
 	BXTWC_CHGR1_IRQ,
-	BXTWC_GPIO0_IRQ,
-	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
 };
 
@@ -116,8 +114,6 @@ static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
 	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
 	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
 	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 4, 0xff),
-	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 5, 0x3f),
 	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
@@ -153,8 +149,7 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 };
 
 static struct resource gpio_resources[] = {
-	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO0_IRQ, "GPIO0"),
-	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO1_IRQ, "GPIO1"),
+	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
 };
 
 static struct resource adc_resources[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v5 5/8] gpio: gpio-wcove: Use first level PMIC GPIO irq
  2017-05-31 22:37               ` sathyanarayanan.kuppuswamy
@ 2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

PMIC mfd driver only exports first level irq for GPIO device.
But currently we are reading the irqs from the second level irq
chip, So this patch fixes this issue by adding support to use
first level PMIC GPIO irq.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpio-wcove.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Changes since v1:
 * used correct mask for GPIO0 and GPIO1 interrupts

Changes since v2: 
 * Rebased on top of latest release.
 * Removed IRQ0 and IRQ1 mask defines.

Changes since v3:
 * None

diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c
index 7b1bc20..bba7704 100644
--- a/drivers/gpio/gpio-wcove.c
+++ b/drivers/gpio/gpio-wcove.c
@@ -401,7 +401,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
 	if (!wg)
 		return -ENOMEM;
 
-	wg->regmap_irq_chip = pmic->irq_chip_data_level2;
+	wg->regmap_irq_chip = pmic->irq_chip_data;
 
 	platform_set_drvdata(pdev, wg);
 
@@ -449,6 +449,18 @@ static int wcove_gpio_probe(struct platform_device *pdev)
 
 	gpiochip_set_nested_irqchip(&wg->chip, &wcove_irqchip, virq);
 
+	/* Enable GPIO0 interrupts */
+	ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE, GPIO_IRQ0_MASK,
+				 0x00);
+	if (ret)
+		return ret;
+
+	/* Enable GPIO1 interrupts */
+	ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE + 1, GPIO_IRQ1_MASK,
+				 0x00);
+	if (ret)
+		return ret;
+
 	return 0;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v5 5/8] gpio: gpio-wcove: Use first level PMIC GPIO irq
@ 2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

PMIC mfd driver only exports first level irq for GPIO device.
But currently we are reading the irqs from the second level irq
chip, So this patch fixes this issue by adding support to use
first level PMIC GPIO irq.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpio-wcove.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Changes since v1:
 * used correct mask for GPIO0 and GPIO1 interrupts

Changes since v2: 
 * Rebased on top of latest release.
 * Removed IRQ0 and IRQ1 mask defines.

Changes since v3:
 * None

diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c
index 7b1bc20..bba7704 100644
--- a/drivers/gpio/gpio-wcove.c
+++ b/drivers/gpio/gpio-wcove.c
@@ -401,7 +401,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
 	if (!wg)
 		return -ENOMEM;
 
-	wg->regmap_irq_chip = pmic->irq_chip_data_level2;
+	wg->regmap_irq_chip = pmic->irq_chip_data;
 
 	platform_set_drvdata(pdev, wg);
 
@@ -449,6 +449,18 @@ static int wcove_gpio_probe(struct platform_device *pdev)
 
 	gpiochip_set_nested_irqchip(&wg->chip, &wcove_irqchip, virq);
 
+	/* Enable GPIO0 interrupts */
+	ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE, GPIO_IRQ0_MASK,
+				 0x00);
+	if (ret)
+		return ret;
+
+	/* Enable GPIO1 interrupts */
+	ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE + 1, GPIO_IRQ1_MASK,
+				 0x00);
+	if (ret)
+		return ret;
+
 	return 0;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v5 6/8] mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
  2017-05-31 22:37               ` sathyanarayanan.kuppuswamy
@ 2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy-VuQAYsv1563Yd54FQh9/CA @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou-Re5JQEeQqe8AvxtiuMwx3w,
	heikki.krogerus-VuQAYsv1563Yd54FQh9/CA,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
	edubezval-Re5JQEeQqe8AvxtiuMwx3w, dvhart-wEGCiKHe2LqWVfeAwA7xHQ,
	rui.zhang-ral2JQCrhuEAvxtiuMwx3w,
	lee.jones-QSEj5FYQhm4dnm+yROfE0A, andy-wEGCiKHe2LqWVfeAwA7xHQ
  Cc: linux-gpio-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	platform-driver-x86-u79uwXL29TY76Z2rM5mHXA,
	sathyaosid-Re5JQEeQqe8AvxtiuMwx3w, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>

Cleanup the resource allocation/free code in probe function by using
devm_* calls.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Acked-for-MFD-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 54 +++++++++++++-------------------------
 1 file changed, 18 insertions(+), 36 deletions(-)

Changes since v1:
 * None

Changes since v2:
 * Rebased on top of latest release.

Changes since v3:
 * None

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index af11c43..feeda6e 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -399,45 +399,44 @@ static int bxtwc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip,
-				  &pmic->irq_chip_data);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip,
+				       &pmic->irq_chip_data);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add IRQ chip\n");
 		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip_level2,
-				  &pmic->irq_chip_data_level2);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip_level2,
+				       &pmic->irq_chip_data_level2);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
-		goto err_irq_chip_level2;
+		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip_tmu,
-				  &pmic->irq_chip_data_tmu);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip_tmu,
+				       &pmic->irq_chip_data_tmu);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
-		goto err_irq_chip_tmu;
+		return ret;
 	}
 
-	ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
-			      ARRAY_SIZE(bxt_wc_dev), NULL, 0,
-			      NULL);
+	ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
+				   ARRAY_SIZE(bxt_wc_dev), NULL, 0, NULL);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add devices\n");
-		goto err_mfd;
+		return ret;
 	}
 
 	ret = sysfs_create_group(&pdev->dev.kobj, &bxtwc_group);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to create sysfs group %d\n", ret);
-		goto err_sysfs;
+		return ret;
 	}
 
 	/*
@@ -451,28 +450,11 @@ static int bxtwc_probe(struct platform_device *pdev)
 				BXTWC_MIRQLVL1_MCHGR, 0);
 
 	return 0;
-
-err_sysfs:
-	mfd_remove_devices(&pdev->dev);
-err_mfd:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
-err_irq_chip_tmu:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
-err_irq_chip_level2:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-
-	return ret;
 }
 
 static int bxtwc_remove(struct platform_device *pdev)
 {
-	struct intel_soc_pmic *pmic = dev_get_drvdata(&pdev->dev);

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v5 6/8] mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
@ 2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Cleanup the resource allocation/free code in probe function by using
devm_* calls.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 54 +++++++++++++-------------------------
 1 file changed, 18 insertions(+), 36 deletions(-)

Changes since v1:
 * None

Changes since v2:
 * Rebased on top of latest release.

Changes since v3:
 * None

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index af11c43..feeda6e 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -399,45 +399,44 @@ static int bxtwc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip,
-				  &pmic->irq_chip_data);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip,
+				       &pmic->irq_chip_data);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add IRQ chip\n");
 		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip_level2,
-				  &pmic->irq_chip_data_level2);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip_level2,
+				       &pmic->irq_chip_data_level2);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
-		goto err_irq_chip_level2;
+		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip_tmu,
-				  &pmic->irq_chip_data_tmu);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip_tmu,
+				       &pmic->irq_chip_data_tmu);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
-		goto err_irq_chip_tmu;
+		return ret;
 	}
 
-	ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
-			      ARRAY_SIZE(bxt_wc_dev), NULL, 0,
-			      NULL);
+	ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
+				   ARRAY_SIZE(bxt_wc_dev), NULL, 0, NULL);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add devices\n");
-		goto err_mfd;
+		return ret;
 	}
 
 	ret = sysfs_create_group(&pdev->dev.kobj, &bxtwc_group);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to create sysfs group %d\n", ret);
-		goto err_sysfs;
+		return ret;
 	}
 
 	/*
@@ -451,28 +450,11 @@ static int bxtwc_probe(struct platform_device *pdev)
 				BXTWC_MIRQLVL1_MCHGR, 0);
 
 	return 0;
-
-err_sysfs:
-	mfd_remove_devices(&pdev->dev);
-err_mfd:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
-err_irq_chip_tmu:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
-err_irq_chip_level2:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-
-	return ret;
 }
 
 static int bxtwc_remove(struct platform_device *pdev)
 {
-	struct intel_soc_pmic *pmic = dev_get_drvdata(&pdev->dev);
-
 	sysfs_remove_group(&pdev->dev.kobj, &bxtwc_group);
-	mfd_remove_devices(&pdev->dev);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
 
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v5 7/8] mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
  2017-05-31 22:37               ` sathyanarayanan.kuppuswamy
@ 2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Whishkey cove PMIC has support to mask/unmask interrupts at two levels.
At first level we can mask/unmask interrupt domains like TMU, GPIO, ADC,
CHGR, BCU THERMAL and PWRBTN and at second level, it provides facility
to mask/unmask individual interrupts belong each of this domain. For
example, in case of TMU, at first level we have TMU interrupt domain,
and at second level we have two interrupts, wake alarm, system alarm that
belong to the TMU interrupt domain.

Currently, in this driver all first level irqs are registered as part of
irq chip(bxtwc_regmap_irq_chip). By default, after you register the irq
chip from your driver, all irqs in that chip will masked and can only be
enabled if that irq is requested using request_irq call. This is the
default Linux irq behavior model. And whenever a dependent device that
belongs to PMIC requests only the second level irq and not explicitly
unmask the first level irq, then in essence the second level irq will
still be disabled. For example, if TMU device driver request wake_alarm
irq and not explicitly unmask TMU level 1 irq then according to the default
Linux irq model,  wake_alarm irq will still be disabled. So the proper
solution to fix this issue is to use the chained irq chip concept. We
should chain all the second level chip irqs to the corresponding first
level irq. To do this, we need to create separate irq chips for every
group of second level irqs.

In case of TMU, when adding second level irq chip, instead of using pmic
irq we should use the corresponding first level irq. So the following
code will change from

ret = regmap_add_irq_chip(pmic->regmap, pmic->irq, ...)

to,

virq = regmap_irq_get_virq(&pmic->irq_chip_data, BXTWC_TMU_LVL1_IRQ);

ret = regmap_add_irq_chip(pmic->regmap, virq, ...)

In case of typec wcove driver, Since USBC IRQ is moved under charger level2
irq chip. We should use charger irq chip(irq_chip_data_chgr) to get the USBC
virtual IRQ number.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 174 +++++++++++++++++++++++++++++--------
 drivers/usb/typec/typec_wcove.c    |   2 +-
 include/linux/mfd/intel_soc_pmic.h |   5 +-
 3 files changed, 145 insertions(+), 36 deletions(-)

Changes since v1:
 * Rebased on top of dev_* cleanup patch.
 * Fixed style & grammer issues reported by Lee Jones

Changes since v2:
 * Rebased on top of latest release.

Changes since v3:
 * None

Changes since v4:
 * Merged typec driver fix to this patch to prevent branch bisect issue.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index feeda6e..bd78bef 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -82,18 +82,26 @@ enum bxtwc_irqs {
 	BXTWC_PWRBTN_IRQ,
 };
 
-enum bxtwc_irqs_level2 {
-	/* Level 2 */
+enum bxtwc_irqs_tmu {
+	BXTWC_TMU_IRQ = 0,
+};
+
+enum bxtwc_irqs_bcu {
 	BXTWC_BCU_IRQ = 0,
-	BXTWC_ADC_IRQ,
-	BXTWC_USBC_IRQ,
+};
+
+enum bxtwc_irqs_adc {
+	BXTWC_ADC_IRQ = 0,
+};
+
+enum bxtwc_irqs_chgr {
+	BXTWC_USBC_IRQ = 0,
 	BXTWC_CHGR0_IRQ,
 	BXTWC_CHGR1_IRQ,
-	BXTWC_CRIT_IRQ,
 };
 
-enum bxtwc_irqs_tmu {
-	BXTWC_TMU_IRQ = 0,
+enum bxtwc_irqs_crit {
+	BXTWC_CRIT_IRQ = 0,
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs[] = {
@@ -108,17 +116,26 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
 	REGMAP_IRQ_REG(BXTWC_PWRBTN_IRQ, 1, 0x03),
 };
 
-static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
+static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
+	REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_bcu[] = {
 	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
-	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
-	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
-static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
-	REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
+static const struct regmap_irq bxtwc_regmap_irqs_adc[] = {
+	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 0, 0xff),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_chgr[] = {
+	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 0, BIT(5)),
+	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 0, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 1, 0x1f),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_crit[] = {
+	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 0, 0x03),
 };
 
 static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
@@ -130,15 +147,6 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 	.num_regs = 2,
 };
 
-static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
-	.name = "bxtwc_irq_chip_level2",
-	.status_base = BXTWC_BCUIRQ,
-	.mask_base = BXTWC_MBCUIRQ,
-	.irqs = bxtwc_regmap_irqs_level2,
-	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
-	.num_regs = 10,
-};
-
 static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 	.name = "bxtwc_irq_chip_tmu",
 	.status_base = BXTWC_TMUIRQ,
@@ -148,6 +156,42 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 	.num_regs = 1,
 };
 
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_bcu = {
+	.name = "bxtwc_irq_chip_bcu",
+	.status_base = BXTWC_BCUIRQ,
+	.mask_base = BXTWC_MBCUIRQ,
+	.irqs = bxtwc_regmap_irqs_bcu,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_bcu),
+	.num_regs = 1,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_adc = {
+	.name = "bxtwc_irq_chip_adc",
+	.status_base = BXTWC_ADCIRQ,
+	.mask_base = BXTWC_MADCIRQ,
+	.irqs = bxtwc_regmap_irqs_adc,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_adc),
+	.num_regs = 1,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_chgr = {
+	.name = "bxtwc_irq_chip_chgr",
+	.status_base = BXTWC_CHGR0IRQ,
+	.mask_base = BXTWC_MCHGR0IRQ,
+	.irqs = bxtwc_regmap_irqs_chgr,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_chgr),
+	.num_regs = 2,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_crit = {
+	.name = "bxtwc_irq_chip_crit",
+	.status_base = BXTWC_CRITIRQ,
+	.mask_base = BXTWC_MCRITIRQ,
+	.irqs = bxtwc_regmap_irqs_crit,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_crit),
+	.num_regs = 1,
+};
+
 static struct resource gpio_resources[] = {
 	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
 };
@@ -357,6 +401,24 @@ static const struct regmap_config bxtwc_regmap_config = {
 	.reg_read = regmap_ipc_byte_reg_read,
 };
 
+static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic,
+				struct regmap_irq_chip_data *pdata,
+				int pirq, int irq_flags,
+				const struct regmap_irq_chip *chip,
+				struct regmap_irq_chip_data **data)
+{
+	int irq;
+
+	irq = regmap_irq_get_virq(pdata, pirq);
+	if (irq < 0) {
+		dev_err(pmic->dev, "failed to get virtual interrupt:%d\n", irq);
+		return irq;
+	}
+
+	return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags,
+					0, chip, data);
+}
+
 static int bxtwc_probe(struct platform_device *pdev)
 {
 	int ret;
@@ -408,21 +470,65 @@ static int bxtwc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
-				       IRQF_ONESHOT | IRQF_SHARED,
-				       0, &bxtwc_regmap_irq_chip_level2,
-				       &pmic->irq_chip_data_level2);
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_TMU_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_tmu,
+					 &pmic->irq_chip_data_tmu);
 	if (ret) {
-		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
+		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
 		return ret;
 	}
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
-				       IRQF_ONESHOT | IRQF_SHARED,
-				       0, &bxtwc_regmap_irq_chip_tmu,
-				       &pmic->irq_chip_data_tmu);
+	/* Add chained IRQ handler for BCU IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_BCU_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_bcu,
+					 &pmic->irq_chip_data_bcu);
+
+
 	if (ret) {
-		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
+		dev_err(&pdev->dev, "Failed to add BUC IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for ADC IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_ADC_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_adc,
+					 &pmic->irq_chip_data_adc);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add ADC IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for CHGR IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_CHGR_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_chgr,
+					 &pmic->irq_chip_data_chgr);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add CHGR IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for CRIT IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_CRIT_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_crit,
+					 &pmic->irq_chip_data_crit);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add CRIT IRQ chip\n");
 		return ret;
 	}
 
diff --git a/drivers/usb/typec/typec_wcove.c b/drivers/usb/typec/typec_wcove.c
index d5a7b21..00a4bd2 100644
--- a/drivers/usb/typec/typec_wcove.c
+++ b/drivers/usb/typec/typec_wcove.c
@@ -303,7 +303,7 @@ static int wcove_typec_probe(struct platform_device *pdev)
 	wcove->dev = &pdev->dev;
 	wcove->regmap = pmic->regmap;
 
-	ret = regmap_irq_get_virq(pmic->irq_chip_data_level2,
+	ret = regmap_irq_get_virq(pmic->irq_chip_data_chgr,
 				  platform_get_irq(pdev, 0));
 	if (ret < 0)
 		return ret;
diff --git a/include/linux/mfd/intel_soc_pmic.h b/include/linux/mfd/intel_soc_pmic.h
index 956caa0..5aacdb0 100644
--- a/include/linux/mfd/intel_soc_pmic.h
+++ b/include/linux/mfd/intel_soc_pmic.h
@@ -25,8 +25,11 @@ struct intel_soc_pmic {
 	int irq;
 	struct regmap *regmap;
 	struct regmap_irq_chip_data *irq_chip_data;
-	struct regmap_irq_chip_data *irq_chip_data_level2;
 	struct regmap_irq_chip_data *irq_chip_data_tmu;
+	struct regmap_irq_chip_data *irq_chip_data_bcu;
+	struct regmap_irq_chip_data *irq_chip_data_adc;
+	struct regmap_irq_chip_data *irq_chip_data_chgr;
+	struct regmap_irq_chip_data *irq_chip_data_crit;
 	struct device *dev;
 };
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v5 7/8] mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
@ 2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Whishkey cove PMIC has support to mask/unmask interrupts at two levels.
At first level we can mask/unmask interrupt domains like TMU, GPIO, ADC,
CHGR, BCU THERMAL and PWRBTN and at second level, it provides facility
to mask/unmask individual interrupts belong each of this domain. For
example, in case of TMU, at first level we have TMU interrupt domain,
and at second level we have two interrupts, wake alarm, system alarm that
belong to the TMU interrupt domain.

Currently, in this driver all first level irqs are registered as part of
irq chip(bxtwc_regmap_irq_chip). By default, after you register the irq
chip from your driver, all irqs in that chip will masked and can only be
enabled if that irq is requested using request_irq call. This is the
default Linux irq behavior model. And whenever a dependent device that
belongs to PMIC requests only the second level irq and not explicitly
unmask the first level irq, then in essence the second level irq will
still be disabled. For example, if TMU device driver request wake_alarm
irq and not explicitly unmask TMU level 1 irq then according to the default
Linux irq model,  wake_alarm irq will still be disabled. So the proper
solution to fix this issue is to use the chained irq chip concept. We
should chain all the second level chip irqs to the corresponding first
level irq. To do this, we need to create separate irq chips for every
group of second level irqs.

In case of TMU, when adding second level irq chip, instead of using pmic
irq we should use the corresponding first level irq. So the following
code will change from

ret = regmap_add_irq_chip(pmic->regmap, pmic->irq, ...)

to,

virq = regmap_irq_get_virq(&pmic->irq_chip_data, BXTWC_TMU_LVL1_IRQ);

ret = regmap_add_irq_chip(pmic->regmap, virq, ...)

In case of typec wcove driver, Since USBC IRQ is moved under charger level2
irq chip. We should use charger irq chip(irq_chip_data_chgr) to get the USBC
virtual IRQ number.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 174 +++++++++++++++++++++++++++++--------
 drivers/usb/typec/typec_wcove.c    |   2 +-
 include/linux/mfd/intel_soc_pmic.h |   5 +-
 3 files changed, 145 insertions(+), 36 deletions(-)

Changes since v1:
 * Rebased on top of dev_* cleanup patch.
 * Fixed style & grammer issues reported by Lee Jones

Changes since v2:
 * Rebased on top of latest release.

Changes since v3:
 * None

Changes since v4:
 * Merged typec driver fix to this patch to prevent branch bisect issue.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index feeda6e..bd78bef 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -82,18 +82,26 @@ enum bxtwc_irqs {
 	BXTWC_PWRBTN_IRQ,
 };
 
-enum bxtwc_irqs_level2 {
-	/* Level 2 */
+enum bxtwc_irqs_tmu {
+	BXTWC_TMU_IRQ = 0,
+};
+
+enum bxtwc_irqs_bcu {
 	BXTWC_BCU_IRQ = 0,
-	BXTWC_ADC_IRQ,
-	BXTWC_USBC_IRQ,
+};
+
+enum bxtwc_irqs_adc {
+	BXTWC_ADC_IRQ = 0,
+};
+
+enum bxtwc_irqs_chgr {
+	BXTWC_USBC_IRQ = 0,
 	BXTWC_CHGR0_IRQ,
 	BXTWC_CHGR1_IRQ,
-	BXTWC_CRIT_IRQ,
 };
 
-enum bxtwc_irqs_tmu {
-	BXTWC_TMU_IRQ = 0,
+enum bxtwc_irqs_crit {
+	BXTWC_CRIT_IRQ = 0,
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs[] = {
@@ -108,17 +116,26 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
 	REGMAP_IRQ_REG(BXTWC_PWRBTN_IRQ, 1, 0x03),
 };
 
-static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
+static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
+	REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_bcu[] = {
 	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
-	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
-	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
-static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
-	REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
+static const struct regmap_irq bxtwc_regmap_irqs_adc[] = {
+	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 0, 0xff),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_chgr[] = {
+	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 0, BIT(5)),
+	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 0, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 1, 0x1f),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_crit[] = {
+	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 0, 0x03),
 };
 
 static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
@@ -130,15 +147,6 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 	.num_regs = 2,
 };
 
-static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
-	.name = "bxtwc_irq_chip_level2",
-	.status_base = BXTWC_BCUIRQ,
-	.mask_base = BXTWC_MBCUIRQ,
-	.irqs = bxtwc_regmap_irqs_level2,
-	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
-	.num_regs = 10,
-};
-
 static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 	.name = "bxtwc_irq_chip_tmu",
 	.status_base = BXTWC_TMUIRQ,
@@ -148,6 +156,42 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 	.num_regs = 1,
 };
 
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_bcu = {
+	.name = "bxtwc_irq_chip_bcu",
+	.status_base = BXTWC_BCUIRQ,
+	.mask_base = BXTWC_MBCUIRQ,
+	.irqs = bxtwc_regmap_irqs_bcu,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_bcu),
+	.num_regs = 1,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_adc = {
+	.name = "bxtwc_irq_chip_adc",
+	.status_base = BXTWC_ADCIRQ,
+	.mask_base = BXTWC_MADCIRQ,
+	.irqs = bxtwc_regmap_irqs_adc,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_adc),
+	.num_regs = 1,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_chgr = {
+	.name = "bxtwc_irq_chip_chgr",
+	.status_base = BXTWC_CHGR0IRQ,
+	.mask_base = BXTWC_MCHGR0IRQ,
+	.irqs = bxtwc_regmap_irqs_chgr,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_chgr),
+	.num_regs = 2,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_crit = {
+	.name = "bxtwc_irq_chip_crit",
+	.status_base = BXTWC_CRITIRQ,
+	.mask_base = BXTWC_MCRITIRQ,
+	.irqs = bxtwc_regmap_irqs_crit,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_crit),
+	.num_regs = 1,
+};
+
 static struct resource gpio_resources[] = {
 	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
 };
@@ -357,6 +401,24 @@ static const struct regmap_config bxtwc_regmap_config = {
 	.reg_read = regmap_ipc_byte_reg_read,
 };
 
+static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic,
+				struct regmap_irq_chip_data *pdata,
+				int pirq, int irq_flags,
+				const struct regmap_irq_chip *chip,
+				struct regmap_irq_chip_data **data)
+{
+	int irq;
+
+	irq = regmap_irq_get_virq(pdata, pirq);
+	if (irq < 0) {
+		dev_err(pmic->dev, "failed to get virtual interrupt:%d\n", irq);
+		return irq;
+	}
+
+	return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags,
+					0, chip, data);
+}
+
 static int bxtwc_probe(struct platform_device *pdev)
 {
 	int ret;
@@ -408,21 +470,65 @@ static int bxtwc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
-				       IRQF_ONESHOT | IRQF_SHARED,
-				       0, &bxtwc_regmap_irq_chip_level2,
-				       &pmic->irq_chip_data_level2);
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_TMU_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_tmu,
+					 &pmic->irq_chip_data_tmu);
 	if (ret) {
-		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
+		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
 		return ret;
 	}
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
-				       IRQF_ONESHOT | IRQF_SHARED,
-				       0, &bxtwc_regmap_irq_chip_tmu,
-				       &pmic->irq_chip_data_tmu);
+	/* Add chained IRQ handler for BCU IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_BCU_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_bcu,
+					 &pmic->irq_chip_data_bcu);
+
+
 	if (ret) {
-		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
+		dev_err(&pdev->dev, "Failed to add BUC IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for ADC IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_ADC_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_adc,
+					 &pmic->irq_chip_data_adc);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add ADC IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for CHGR IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_CHGR_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_chgr,
+					 &pmic->irq_chip_data_chgr);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add CHGR IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for CRIT IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_CRIT_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_crit,
+					 &pmic->irq_chip_data_crit);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add CRIT IRQ chip\n");
 		return ret;
 	}
 
diff --git a/drivers/usb/typec/typec_wcove.c b/drivers/usb/typec/typec_wcove.c
index d5a7b21..00a4bd2 100644
--- a/drivers/usb/typec/typec_wcove.c
+++ b/drivers/usb/typec/typec_wcove.c
@@ -303,7 +303,7 @@ static int wcove_typec_probe(struct platform_device *pdev)
 	wcove->dev = &pdev->dev;
 	wcove->regmap = pmic->regmap;
 
-	ret = regmap_irq_get_virq(pmic->irq_chip_data_level2,
+	ret = regmap_irq_get_virq(pmic->irq_chip_data_chgr,
 				  platform_get_irq(pdev, 0));
 	if (ret < 0)
 		return ret;
diff --git a/include/linux/mfd/intel_soc_pmic.h b/include/linux/mfd/intel_soc_pmic.h
index 956caa0..5aacdb0 100644
--- a/include/linux/mfd/intel_soc_pmic.h
+++ b/include/linux/mfd/intel_soc_pmic.h
@@ -25,8 +25,11 @@ struct intel_soc_pmic {
 	int irq;
 	struct regmap *regmap;
 	struct regmap_irq_chip_data *irq_chip_data;
-	struct regmap_irq_chip_data *irq_chip_data_level2;
 	struct regmap_irq_chip_data *irq_chip_data_tmu;
+	struct regmap_irq_chip_data *irq_chip_data_bcu;
+	struct regmap_irq_chip_data *irq_chip_data_adc;
+	struct regmap_irq_chip_data *irq_chip_data_chgr;
+	struct regmap_irq_chip_data *irq_chip_data_crit;
 	struct device *dev;
 };
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v5 8/8] platform/x86: intel_bxtwc_tmu: Remove first level irq unmask
  2017-05-31 22:37               ` sathyanarayanan.kuppuswamy
@ 2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Currently in WCOVE PMIC mfd driver, all second level irq chips
are chained to the respective first level irqs. So there is no
need for explicitly unmasking the first level irq in this
driver. This patches removes this level 1 irq unmask support.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/platform/x86/intel_bxtwc_tmu.c | 4 ----
 1 file changed, 4 deletions(-)

Changes since v1:
 * None

Changes since v2:
 * Rebased on top of latest release.

Changes since v3:
 * None

Changes since v4:
 * Changed commit subject from "platform: x86:" "to platform/x86:"

diff --git a/drivers/platform/x86/intel_bxtwc_tmu.c b/drivers/platform/x86/intel_bxtwc_tmu.c
index e202abd..ea865d4 100644
--- a/drivers/platform/x86/intel_bxtwc_tmu.c
+++ b/drivers/platform/x86/intel_bxtwc_tmu.c
@@ -92,10 +92,6 @@ static int bxt_wcove_tmu_probe(struct platform_device *pdev)
 	}
 	wctmu->irq = virq;
 
-	/* Enable TMU interrupts */
-	regmap_update_bits(wctmu->regmap, BXTWC_MIRQLVL1,
-				  BXTWC_MIRQLVL1_MTMU, 0);
-
 	/* Unmask TMU second level Wake & System alarm */
 	regmap_update_bits(wctmu->regmap, BXTWC_MTMUIRQ_REG,
 				  BXTWC_TMU_ALRM_MASK, 0);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v5 8/8] platform/x86: intel_bxtwc_tmu: Remove first level irq unmask
@ 2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-05-31 22:37 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: linux-gpio, linux-pm, linux-usb, linux-kernel,
	platform-driver-x86, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Currently in WCOVE PMIC mfd driver, all second level irq chips
are chained to the respective first level irqs. So there is no
need for explicitly unmasking the first level irq in this
driver. This patches removes this level 1 irq unmask support.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/platform/x86/intel_bxtwc_tmu.c | 4 ----
 1 file changed, 4 deletions(-)

Changes since v1:
 * None

Changes since v2:
 * Rebased on top of latest release.

Changes since v3:
 * None

Changes since v4:
 * Changed commit subject from "platform: x86:" "to platform/x86:"

diff --git a/drivers/platform/x86/intel_bxtwc_tmu.c b/drivers/platform/x86/intel_bxtwc_tmu.c
index e202abd..ea865d4 100644
--- a/drivers/platform/x86/intel_bxtwc_tmu.c
+++ b/drivers/platform/x86/intel_bxtwc_tmu.c
@@ -92,10 +92,6 @@ static int bxt_wcove_tmu_probe(struct platform_device *pdev)
 	}
 	wctmu->irq = virq;
 
-	/* Enable TMU interrupts */
-	regmap_update_bits(wctmu->regmap, BXTWC_MIRQLVL1,
-				  BXTWC_MIRQLVL1_MTMU, 0);
-
 	/* Unmask TMU second level Wake & System alarm */
 	regmap_update_bits(wctmu->regmap, BXTWC_MTMUIRQ_REG,
 				  BXTWC_TMU_ALRM_MASK, 0);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 3/8] thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
  2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
@ 2017-06-03 13:00                   ` Andy Shevchenko
  -1 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-03 13:00 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan
  Cc: Alexandre Courbot, Krogerus, Heikki, Greg Kroah-Hartman,
	Linus Walleij, edubezval, dvhart, Zhang, Rui, Lee Jones,
	Andy Shevchenko, linux-gpio, linux-pm, USB, linux-kernel,
	Platform Driver, Sathyanarayanan Kuppuswamy Natarajan

On Thu, Jun 1, 2017 at 1:37 AM,
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> PMIC mfd driver only exports first level irq for thermal device.
> But currently we are reading the irqs from the second level irq
> chip, So this patch fixes this issue by adding support to use
> first level PMIC thermal irq.
>

Shouldn't be this squashed to patch 2?

> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> Acked-by: Zhang Rui <rui.zhang@intel.com>
> ---
>  drivers/thermal/intel_bxt_pmic_thermal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Changes since v1:
>  * None
>
> Changes since v2:
>  * Rebased on top of latest release.
>
> Changes since v3:
>  * Rebased on top of latest release.
>
> diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c b/drivers/thermal/intel_bxt_pmic_thermal.c
> index 0f19a39..ef6b322 100644
> --- a/drivers/thermal/intel_bxt_pmic_thermal.c
> +++ b/drivers/thermal/intel_bxt_pmic_thermal.c
> @@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct platform_device *pdev)
>         }
>
>         regmap = pmic->regmap;
> -       regmap_irq_chip = pmic->irq_chip_data_level2;
> +       regmap_irq_chip = pmic->irq_chip_data;
>
>         pmic_irq_count = 0;
>         while ((irq = platform_get_irq(pdev, pmic_irq_count)) != -ENXIO) {
> --
> 2.7.4
>



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 3/8] thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
@ 2017-06-03 13:00                   ` Andy Shevchenko
  0 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-03 13:00 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan
  Cc: Alexandre Courbot, Krogerus, Heikki, Greg Kroah-Hartman,
	Linus Walleij, edubezval, dvhart, Zhang, Rui, Lee Jones,
	Andy Shevchenko, linux-gpio, linux-pm, USB, linux-kernel,
	Platform Driver, Sathyanarayanan Kuppuswamy Natarajan

On Thu, Jun 1, 2017 at 1:37 AM,
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> PMIC mfd driver only exports first level irq for thermal device.
> But currently we are reading the irqs from the second level irq
> chip, So this patch fixes this issue by adding support to use
> first level PMIC thermal irq.
>

Shouldn't be this squashed to patch 2?

> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> Acked-by: Zhang Rui <rui.zhang@intel.com>
> ---
>  drivers/thermal/intel_bxt_pmic_thermal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Changes since v1:
>  * None
>
> Changes since v2:
>  * Rebased on top of latest release.
>
> Changes since v3:
>  * Rebased on top of latest release.
>
> diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c b/drivers/thermal/intel_bxt_pmic_thermal.c
> index 0f19a39..ef6b322 100644
> --- a/drivers/thermal/intel_bxt_pmic_thermal.c
> +++ b/drivers/thermal/intel_bxt_pmic_thermal.c
> @@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct platform_device *pdev)
>         }
>
>         regmap = pmic->regmap;
> -       regmap_irq_chip = pmic->irq_chip_data_level2;
> +       regmap_irq_chip = pmic->irq_chip_data;
>
>         pmic_irq_count = 0;
>         while ((irq = platform_get_irq(pdev, pmic_irq_count)) != -ENXIO) {
> --
> 2.7.4
>



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 5/8] gpio: gpio-wcove: Use first level PMIC GPIO irq
  2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
@ 2017-06-03 13:01                   ` Andy Shevchenko
  -1 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-03 13:01 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan
  Cc: Alexandre Courbot, Krogerus, Heikki, Greg Kroah-Hartman,
	Linus Walleij, edubezval, dvhart, Zhang, Rui, Lee Jones,
	Andy Shevchenko, linux-gpio, linux-pm, USB, linux-kernel,
	Platform Driver, Sathyanarayanan Kuppuswamy Natarajan

On Thu, Jun 1, 2017 at 1:37 AM,
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> PMIC mfd driver only exports first level irq for GPIO device.
> But currently we are reading the irqs from the second level irq
> chip, So this patch fixes this issue by adding support to use
> first level PMIC GPIO irq.
>

Shouldn't be this squashed to patch 4?

> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/gpio/gpio-wcove.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
>
> Changes since v1:
>  * used correct mask for GPIO0 and GPIO1 interrupts
>
> Changes since v2:
>  * Rebased on top of latest release.
>  * Removed IRQ0 and IRQ1 mask defines.
>
> Changes since v3:
>  * None
>
> diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c
> index 7b1bc20..bba7704 100644
> --- a/drivers/gpio/gpio-wcove.c
> +++ b/drivers/gpio/gpio-wcove.c
> @@ -401,7 +401,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
>         if (!wg)
>                 return -ENOMEM;
>
> -       wg->regmap_irq_chip = pmic->irq_chip_data_level2;
> +       wg->regmap_irq_chip = pmic->irq_chip_data;
>
>         platform_set_drvdata(pdev, wg);
>
> @@ -449,6 +449,18 @@ static int wcove_gpio_probe(struct platform_device *pdev)
>
>         gpiochip_set_nested_irqchip(&wg->chip, &wcove_irqchip, virq);
>
> +       /* Enable GPIO0 interrupts */
> +       ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE, GPIO_IRQ0_MASK,
> +                                0x00);
> +       if (ret)
> +               return ret;
> +
> +       /* Enable GPIO1 interrupts */
> +       ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE + 1, GPIO_IRQ1_MASK,
> +                                0x00);
> +       if (ret)
> +               return ret;
> +
>         return 0;
>  }
>
> --
> 2.7.4
>



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 5/8] gpio: gpio-wcove: Use first level PMIC GPIO irq
@ 2017-06-03 13:01                   ` Andy Shevchenko
  0 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-03 13:01 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan
  Cc: Alexandre Courbot, Krogerus, Heikki, Greg Kroah-Hartman,
	Linus Walleij, edubezval, dvhart, Zhang, Rui, Lee Jones,
	Andy Shevchenko, linux-gpio, linux-pm, USB, linux-kernel,
	Platform Driver, Sathyanarayanan Kuppuswamy Natarajan

On Thu, Jun 1, 2017 at 1:37 AM,
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> PMIC mfd driver only exports first level irq for GPIO device.
> But currently we are reading the irqs from the second level irq
> chip, So this patch fixes this issue by adding support to use
> first level PMIC GPIO irq.
>

Shouldn't be this squashed to patch 4?

> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/gpio/gpio-wcove.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
>
> Changes since v1:
>  * used correct mask for GPIO0 and GPIO1 interrupts
>
> Changes since v2:
>  * Rebased on top of latest release.
>  * Removed IRQ0 and IRQ1 mask defines.
>
> Changes since v3:
>  * None
>
> diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c
> index 7b1bc20..bba7704 100644
> --- a/drivers/gpio/gpio-wcove.c
> +++ b/drivers/gpio/gpio-wcove.c
> @@ -401,7 +401,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
>         if (!wg)
>                 return -ENOMEM;
>
> -       wg->regmap_irq_chip = pmic->irq_chip_data_level2;
> +       wg->regmap_irq_chip = pmic->irq_chip_data;
>
>         platform_set_drvdata(pdev, wg);
>
> @@ -449,6 +449,18 @@ static int wcove_gpio_probe(struct platform_device *pdev)
>
>         gpiochip_set_nested_irqchip(&wg->chip, &wcove_irqchip, virq);
>
> +       /* Enable GPIO0 interrupts */
> +       ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE, GPIO_IRQ0_MASK,
> +                                0x00);
> +       if (ret)
> +               return ret;
> +
> +       /* Enable GPIO1 interrupts */
> +       ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE + 1, GPIO_IRQ1_MASK,
> +                                0x00);
> +       if (ret)
> +               return ret;
> +
>         return 0;
>  }
>
> --
> 2.7.4
>



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 6/8] mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
  2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
@ 2017-06-03 13:03                   ` Andy Shevchenko
  -1 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-03 13:03 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan
  Cc: Alexandre Courbot, Krogerus, Heikki, Greg Kroah-Hartman,
	Linus Walleij, edubezval, dvhart, Zhang, Rui, Lee Jones,
	Andy Shevchenko, linux-gpio, linux-pm, USB, linux-kernel,
	Platform Driver, Sathyanarayanan Kuppuswamy Natarajan

On Thu, Jun 1, 2017 at 1:37 AM,
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> Cleanup the resource allocation/free code in probe function by using
> devm_* calls.

This change is okay.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/intel_soc_pmic_bxtwc.c | 54 +++++++++++++-------------------------
>  1 file changed, 18 insertions(+), 36 deletions(-)
>
> Changes since v1:
>  * None
>
> Changes since v2:
>  * Rebased on top of latest release.
>
> Changes since v3:
>  * None
>
> diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
> index af11c43..feeda6e 100644
> --- a/drivers/mfd/intel_soc_pmic_bxtwc.c
> +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
> @@ -399,45 +399,44 @@ static int bxtwc_probe(struct platform_device *pdev)
>                 return ret;
>         }
>
> -       ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
> -                                 IRQF_ONESHOT | IRQF_SHARED,
> -                                 0, &bxtwc_regmap_irq_chip,
> -                                 &pmic->irq_chip_data);
> +       ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
> +                                      IRQF_ONESHOT | IRQF_SHARED,
> +                                      0, &bxtwc_regmap_irq_chip,
> +                                      &pmic->irq_chip_data);
>         if (ret) {
>                 dev_err(&pdev->dev, "Failed to add IRQ chip\n");
>                 return ret;
>         }
>
> -       ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
> -                                 IRQF_ONESHOT | IRQF_SHARED,
> -                                 0, &bxtwc_regmap_irq_chip_level2,
> -                                 &pmic->irq_chip_data_level2);
> +       ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
> +                                      IRQF_ONESHOT | IRQF_SHARED,
> +                                      0, &bxtwc_regmap_irq_chip_level2,
> +                                      &pmic->irq_chip_data_level2);
>         if (ret) {
>                 dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
> -               goto err_irq_chip_level2;
> +               return ret;
>         }
>
> -       ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
> -                                 IRQF_ONESHOT | IRQF_SHARED,
> -                                 0, &bxtwc_regmap_irq_chip_tmu,
> -                                 &pmic->irq_chip_data_tmu);
> +       ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
> +                                      IRQF_ONESHOT | IRQF_SHARED,
> +                                      0, &bxtwc_regmap_irq_chip_tmu,
> +                                      &pmic->irq_chip_data_tmu);
>         if (ret) {
>                 dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
> -               goto err_irq_chip_tmu;
> +               return ret;
>         }
>
> -       ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
> -                             ARRAY_SIZE(bxt_wc_dev), NULL, 0,
> -                             NULL);
> +       ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
> +                                  ARRAY_SIZE(bxt_wc_dev), NULL, 0, NULL);
>         if (ret) {
>                 dev_err(&pdev->dev, "Failed to add devices\n");
> -               goto err_mfd;
> +               return ret;
>         }
>
>         ret = sysfs_create_group(&pdev->dev.kobj, &bxtwc_group);
>         if (ret) {
>                 dev_err(&pdev->dev, "Failed to create sysfs group %d\n", ret);
> -               goto err_sysfs;
> +               return ret;
>         }
>
>         /*
> @@ -451,28 +450,11 @@ static int bxtwc_probe(struct platform_device *pdev)
>                                 BXTWC_MIRQLVL1_MCHGR, 0);
>
>         return 0;
> -
> -err_sysfs:
> -       mfd_remove_devices(&pdev->dev);
> -err_mfd:
> -       regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
> -err_irq_chip_tmu:
> -       regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
> -err_irq_chip_level2:
> -       regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
> -
> -       return ret;
>  }
>
>  static int bxtwc_remove(struct platform_device *pdev)
>  {
> -       struct intel_soc_pmic *pmic = dev_get_drvdata(&pdev->dev);
> -
>         sysfs_remove_group(&pdev->dev.kobj, &bxtwc_group);
> -       mfd_remove_devices(&pdev->dev);
> -       regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
> -       regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
> -       regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
>
>         return 0;
>  }
> --
> 2.7.4
>



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 6/8] mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
@ 2017-06-03 13:03                   ` Andy Shevchenko
  0 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-03 13:03 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan
  Cc: Alexandre Courbot, Krogerus, Heikki, Greg Kroah-Hartman,
	Linus Walleij, edubezval, dvhart, Zhang, Rui, Lee Jones,
	Andy Shevchenko, linux-gpio, linux-pm, USB, linux-kernel,
	Platform Driver, Sathyanarayanan Kuppuswamy Natarajan

On Thu, Jun 1, 2017 at 1:37 AM,
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> Cleanup the resource allocation/free code in probe function by using
> devm_* calls.

This change is okay.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/intel_soc_pmic_bxtwc.c | 54 +++++++++++++-------------------------
>  1 file changed, 18 insertions(+), 36 deletions(-)
>
> Changes since v1:
>  * None
>
> Changes since v2:
>  * Rebased on top of latest release.
>
> Changes since v3:
>  * None
>
> diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
> index af11c43..feeda6e 100644
> --- a/drivers/mfd/intel_soc_pmic_bxtwc.c
> +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
> @@ -399,45 +399,44 @@ static int bxtwc_probe(struct platform_device *pdev)
>                 return ret;
>         }
>
> -       ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
> -                                 IRQF_ONESHOT | IRQF_SHARED,
> -                                 0, &bxtwc_regmap_irq_chip,
> -                                 &pmic->irq_chip_data);
> +       ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
> +                                      IRQF_ONESHOT | IRQF_SHARED,
> +                                      0, &bxtwc_regmap_irq_chip,
> +                                      &pmic->irq_chip_data);
>         if (ret) {
>                 dev_err(&pdev->dev, "Failed to add IRQ chip\n");
>                 return ret;
>         }
>
> -       ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
> -                                 IRQF_ONESHOT | IRQF_SHARED,
> -                                 0, &bxtwc_regmap_irq_chip_level2,
> -                                 &pmic->irq_chip_data_level2);
> +       ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
> +                                      IRQF_ONESHOT | IRQF_SHARED,
> +                                      0, &bxtwc_regmap_irq_chip_level2,
> +                                      &pmic->irq_chip_data_level2);
>         if (ret) {
>                 dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
> -               goto err_irq_chip_level2;
> +               return ret;
>         }
>
> -       ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
> -                                 IRQF_ONESHOT | IRQF_SHARED,
> -                                 0, &bxtwc_regmap_irq_chip_tmu,
> -                                 &pmic->irq_chip_data_tmu);
> +       ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
> +                                      IRQF_ONESHOT | IRQF_SHARED,
> +                                      0, &bxtwc_regmap_irq_chip_tmu,
> +                                      &pmic->irq_chip_data_tmu);
>         if (ret) {
>                 dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
> -               goto err_irq_chip_tmu;
> +               return ret;
>         }
>
> -       ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
> -                             ARRAY_SIZE(bxt_wc_dev), NULL, 0,
> -                             NULL);
> +       ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
> +                                  ARRAY_SIZE(bxt_wc_dev), NULL, 0, NULL);
>         if (ret) {
>                 dev_err(&pdev->dev, "Failed to add devices\n");
> -               goto err_mfd;
> +               return ret;
>         }
>
>         ret = sysfs_create_group(&pdev->dev.kobj, &bxtwc_group);
>         if (ret) {
>                 dev_err(&pdev->dev, "Failed to create sysfs group %d\n", ret);
> -               goto err_sysfs;
> +               return ret;
>         }
>
>         /*
> @@ -451,28 +450,11 @@ static int bxtwc_probe(struct platform_device *pdev)
>                                 BXTWC_MIRQLVL1_MCHGR, 0);
>
>         return 0;
> -
> -err_sysfs:
> -       mfd_remove_devices(&pdev->dev);
> -err_mfd:
> -       regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
> -err_irq_chip_tmu:
> -       regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
> -err_irq_chip_level2:
> -       regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
> -
> -       return ret;
>  }
>
>  static int bxtwc_remove(struct platform_device *pdev)
>  {
> -       struct intel_soc_pmic *pmic = dev_get_drvdata(&pdev->dev);
> -
>         sysfs_remove_group(&pdev->dev.kobj, &bxtwc_group);
> -       mfd_remove_devices(&pdev->dev);
> -       regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
> -       regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
> -       regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
>
>         return 0;
>  }
> --
> 2.7.4
>



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 7/8] mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
  2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
@ 2017-06-03 13:26                   ` Andy Shevchenko
  -1 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-03 13:26 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan
  Cc: Alexandre Courbot, Krogerus, Heikki, Greg Kroah-Hartman,
	Linus Walleij, edubezval, dvhart, Zhang, Rui, Lee Jones,
	Andy Shevchenko, linux-gpio, linux-pm, USB, linux-kernel,
	Platform Driver, Sathyanarayanan Kuppuswamy Natarajan

On Thu, Jun 1, 2017 at 1:37 AM,
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> Whishkey cove PMIC has support to mask/unmask interrupts at two levels.
> At first level we can mask/unmask interrupt domains like TMU, GPIO, ADC,
> CHGR, BCU THERMAL and PWRBTN and at second level, it provides facility
> to mask/unmask individual interrupts belong each of this domain. For
> example, in case of TMU, at first level we have TMU interrupt domain,
> and at second level we have two interrupts, wake alarm, system alarm that
> belong to the TMU interrupt domain.
>
> Currently, in this driver all first level irqs are registered as part of
> irq chip(bxtwc_regmap_irq_chip). By default, after you register the irq
> chip from your driver, all irqs in that chip will masked and can only be
> enabled if that irq is requested using request_irq call. This is the
> default Linux irq behavior model. And whenever a dependent device that
> belongs to PMIC requests only the second level irq and not explicitly
> unmask the first level irq, then in essence the second level irq will
> still be disabled. For example, if TMU device driver request wake_alarm
> irq and not explicitly unmask TMU level 1 irq then according to the default
> Linux irq model,  wake_alarm irq will still be disabled. So the proper
> solution to fix this issue is to use the chained irq chip concept. We
> should chain all the second level chip irqs to the corresponding first
> level irq. To do this, we need to create separate irq chips for every
> group of second level irqs.
>
> In case of TMU, when adding second level irq chip, instead of using pmic
> irq we should use the corresponding first level irq. So the following
> code will change from

pmic -> PMIC
irq -> IRQ
irqs -> IRQs

These do apply to entire commit message.

>
> ret = regmap_add_irq_chip(pmic->regmap, pmic->irq, ...)
>
> to,
>
> virq = regmap_irq_get_virq(&pmic->irq_chip_data, BXTWC_TMU_LVL1_IRQ);
>
> ret = regmap_add_irq_chip(pmic->regmap, virq, ...)
>
> In case of typec wcove driver, Since USBC IRQ is moved under charger level2
> irq chip. We should use charger irq chip(irq_chip_data_chgr) to get the USBC
> virtual IRQ number.

typec wcove -> Whiskey Cove Type-C

> +enum bxtwc_irqs_tmu {
> +       BXTWC_TMU_IRQ = 0,
> +};

> -enum bxtwc_irqs_tmu {
> -       BXTWC_TMU_IRQ = 0,

Leave it on the same place it will make patch a bit more cleaner.

> +static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
> +       REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
> +};

> -static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
> -       REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),

Ditto.

> +static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic,
> +                               struct regmap_irq_chip_data *pdata,
> +                               int pirq, int irq_flags,
> +                               const struct regmap_irq_chip *chip,
> +                               struct regmap_irq_chip_data **data)
> +{
> +       int irq;
> +
> +       irq = regmap_irq_get_virq(pdata, pirq);
> +       if (irq < 0) {
> +               dev_err(pmic->dev, "failed to get virtual interrupt:%d\n", irq);

Follow below pattern, i.e. "Failed to ..."

Moreover, it would be useful to see for which interrupt we are trying
to get a virtual one.
chip->name + pirq I guess would give us a thing.

> +               return irq;
> +       }
> +
> +       return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags,
> +                                       0, chip, data);
> +}

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 7/8] mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
@ 2017-06-03 13:26                   ` Andy Shevchenko
  0 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-03 13:26 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan
  Cc: Alexandre Courbot, Krogerus, Heikki, Greg Kroah-Hartman,
	Linus Walleij, edubezval, dvhart, Zhang, Rui, Lee Jones,
	Andy Shevchenko, linux-gpio, linux-pm, USB, linux-kernel,
	Platform Driver, Sathyanarayanan Kuppuswamy Natarajan

On Thu, Jun 1, 2017 at 1:37 AM,
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> Whishkey cove PMIC has support to mask/unmask interrupts at two levels.
> At first level we can mask/unmask interrupt domains like TMU, GPIO, ADC,
> CHGR, BCU THERMAL and PWRBTN and at second level, it provides facility
> to mask/unmask individual interrupts belong each of this domain. For
> example, in case of TMU, at first level we have TMU interrupt domain,
> and at second level we have two interrupts, wake alarm, system alarm that
> belong to the TMU interrupt domain.
>
> Currently, in this driver all first level irqs are registered as part of
> irq chip(bxtwc_regmap_irq_chip). By default, after you register the irq
> chip from your driver, all irqs in that chip will masked and can only be
> enabled if that irq is requested using request_irq call. This is the
> default Linux irq behavior model. And whenever a dependent device that
> belongs to PMIC requests only the second level irq and not explicitly
> unmask the first level irq, then in essence the second level irq will
> still be disabled. For example, if TMU device driver request wake_alarm
> irq and not explicitly unmask TMU level 1 irq then according to the default
> Linux irq model,  wake_alarm irq will still be disabled. So the proper
> solution to fix this issue is to use the chained irq chip concept. We
> should chain all the second level chip irqs to the corresponding first
> level irq. To do this, we need to create separate irq chips for every
> group of second level irqs.
>
> In case of TMU, when adding second level irq chip, instead of using pmic
> irq we should use the corresponding first level irq. So the following
> code will change from

pmic -> PMIC
irq -> IRQ
irqs -> IRQs

These do apply to entire commit message.

>
> ret = regmap_add_irq_chip(pmic->regmap, pmic->irq, ...)
>
> to,
>
> virq = regmap_irq_get_virq(&pmic->irq_chip_data, BXTWC_TMU_LVL1_IRQ);
>
> ret = regmap_add_irq_chip(pmic->regmap, virq, ...)
>
> In case of typec wcove driver, Since USBC IRQ is moved under charger level2
> irq chip. We should use charger irq chip(irq_chip_data_chgr) to get the USBC
> virtual IRQ number.

typec wcove -> Whiskey Cove Type-C

> +enum bxtwc_irqs_tmu {
> +       BXTWC_TMU_IRQ = 0,
> +};

> -enum bxtwc_irqs_tmu {
> -       BXTWC_TMU_IRQ = 0,

Leave it on the same place it will make patch a bit more cleaner.

> +static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
> +       REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
> +};

> -static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
> -       REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),

Ditto.

> +static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic,
> +                               struct regmap_irq_chip_data *pdata,
> +                               int pirq, int irq_flags,
> +                               const struct regmap_irq_chip *chip,
> +                               struct regmap_irq_chip_data **data)
> +{
> +       int irq;
> +
> +       irq = regmap_irq_get_virq(pdata, pirq);
> +       if (irq < 0) {
> +               dev_err(pmic->dev, "failed to get virtual interrupt:%d\n", irq);

Follow below pattern, i.e. "Failed to ..."

Moreover, it would be useful to see for which interrupt we are trying
to get a virtual one.
chip->name + pirq I guess would give us a thing.

> +               return irq;
> +       }
> +
> +       return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags,
> +                                       0, chip, data);
> +}

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 0/8] mfd: intel_soc_pmic_bxtwc: Add chained IRQ support
  2017-05-31 22:37               ` sathyanarayanan.kuppuswamy
@ 2017-06-03 13:27                 ` Andy Shevchenko
  -1 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-03 13:27 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan
  Cc: Alexandre Courbot, Krogerus, Heikki, Greg Kroah-Hartman,
	Linus Walleij, edubezval, dvhart, Zhang, Rui, Lee Jones,
	Andy Shevchenko, linux-gpio, linux-pm, USB, linux-kernel,
	Platform Driver, Sathyanarayanan Kuppuswamy Natarajan

On Thu, Jun 1, 2017 at 1:37 AM,
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> Following patch set adds chained IRQ support to WCOVE PMIC driver.

I commented some patches, the rest looks okay.
Please, address and send new version.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 0/8] mfd: intel_soc_pmic_bxtwc: Add chained IRQ support
@ 2017-06-03 13:27                 ` Andy Shevchenko
  0 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-03 13:27 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan
  Cc: Alexandre Courbot, Krogerus, Heikki, Greg Kroah-Hartman,
	Linus Walleij, edubezval, dvhart, Zhang, Rui, Lee Jones,
	Andy Shevchenko, linux-gpio, linux-pm, USB, linux-kernel,
	Platform Driver, Sathyanarayanan Kuppuswamy Natarajan

On Thu, Jun 1, 2017 at 1:37 AM,
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> Following patch set adds chained IRQ support to WCOVE PMIC driver.

I commented some patches, the rest looks okay.
Please, address and send new version.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
  2017-05-31 22:33                   ` sathyanarayanan kuppuswamy
@ 2017-06-03 17:01                     ` Darren Hart
  -1 siblings, 0 replies; 132+ messages in thread
From: Darren Hart @ 2017-06-03 17:01 UTC (permalink / raw)
  To: sathyanarayanan kuppuswamy
  Cc: Lee Jones, Sathyanarayanan Kuppuswamy Natarajan,
	Stephen Rothwell, Alexandre Courbot, Linus Walleij,
	Eduardo Valentin, rui.zhang, Andy Shevchenko, linux-gpio,
	linux-pm, linux-kernel, Platform Driver

On Wed, May 31, 2017 at 03:33:48PM -0700, sathyanarayanan kuppuswamy wrote:
> Hi Lee,
> 
> 
> On 05/30/2017 11:57 PM, Lee Jones wrote:
> > On Tue, 30 May 2017, Sathyanarayanan Kuppuswamy Natarajan wrote:
> > 
> > > Hi All,
> > > 
> > > On Tue, May 30, 2017 at 8:38 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > > > Hi all,
> > > > 
> > > > On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
> > > > > Dear fellow Maintainers,
> > > > > 
> > > > > Enjoy!
> > > > > 
> > > > > The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
> > > > > 
> > > > >    Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
> > > > > 
> > > > > are available in the git repository at:
> > > > > 
> > > > >    git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
> > > > > 
> > > > > for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
> > > > > 
> > > > >    platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
> > > > > 
> > > > > ----------------------------------------------------------------
> > > > > Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
> > > > > 
> > > > > ----------------------------------------------------------------
> > > > > Kuppuswamy Sathyanarayanan (8):
> > > > >        mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
> > > > See my other bug report on this commit ...
> > > Sorry, its a mistake from my end. It looks like typec wcove driver got
> > > merged recently and I missed to add it to my cleanup patch set.
> > > 
> > > Lee,
> > > 
> > > I have created a patch to fix this issue.
> > > 
> > > Do you want me to send the entire series again with this fix or just
> > > send the fix alone.
> > This highlights the fact that this patch-set is not actually
> > bisectable.
> Except for the last patch set ( which has fix for typec driver compilation
> issue) that I sent yesterday,
> all other patch set versions are bisectable.
> 
> The problem was when I first created this patch set, typec wcove driver was
> not merged upstream.
> After creating the initial set, I was just improving the patch set and
> forgot to re-check for
> child devices that depend of PMIC MFD driver.  Thats why we came across this
> compilation issue.
> 
> In future, I will try to avoid these kind of issues. I think adding
> "allyesconfig" and "allmodconfig"
> compilation tests to my patch submit criteria should prevent these kind of
> issues.

We do this as well as 32 and 64b for the platform driver tree, I have found it
to be a reasonable sanity test.

-- 
Darren Hart
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
@ 2017-06-03 17:01                     ` Darren Hart
  0 siblings, 0 replies; 132+ messages in thread
From: Darren Hart @ 2017-06-03 17:01 UTC (permalink / raw)
  To: sathyanarayanan kuppuswamy
  Cc: Lee Jones, Sathyanarayanan Kuppuswamy Natarajan,
	Stephen Rothwell, Alexandre Courbot, Linus Walleij,
	Eduardo Valentin, rui.zhang, Andy Shevchenko, linux-gpio,
	linux-pm, linux-kernel, Platform Driver

On Wed, May 31, 2017 at 03:33:48PM -0700, sathyanarayanan kuppuswamy wrote:
> Hi Lee,
> 
> 
> On 05/30/2017 11:57 PM, Lee Jones wrote:
> > On Tue, 30 May 2017, Sathyanarayanan Kuppuswamy Natarajan wrote:
> > 
> > > Hi All,
> > > 
> > > On Tue, May 30, 2017 at 8:38 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > > > Hi all,
> > > > 
> > > > On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
> > > > > Dear fellow Maintainers,
> > > > > 
> > > > > Enjoy!
> > > > > 
> > > > > The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
> > > > > 
> > > > >    Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
> > > > > 
> > > > > are available in the git repository at:
> > > > > 
> > > > >    git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
> > > > > 
> > > > > for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
> > > > > 
> > > > >    platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
> > > > > 
> > > > > ----------------------------------------------------------------
> > > > > Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
> > > > > 
> > > > > ----------------------------------------------------------------
> > > > > Kuppuswamy Sathyanarayanan (8):
> > > > >        mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
> > > > See my other bug report on this commit ...
> > > Sorry, its a mistake from my end. It looks like typec wcove driver got
> > > merged recently and I missed to add it to my cleanup patch set.
> > > 
> > > Lee,
> > > 
> > > I have created a patch to fix this issue.
> > > 
> > > Do you want me to send the entire series again with this fix or just
> > > send the fix alone.
> > This highlights the fact that this patch-set is not actually
> > bisectable.
> Except for the last patch set ( which has fix for typec driver compilation
> issue) that I sent yesterday,
> all other patch set versions are bisectable.
> 
> The problem was when I first created this patch set, typec wcove driver was
> not merged upstream.
> After creating the initial set, I was just improving the patch set and
> forgot to re-check for
> child devices that depend of PMIC MFD driver.  Thats why we came across this
> compilation issue.
> 
> In future, I will try to avoid these kind of issues. I think adding
> "allyesconfig" and "allmodconfig"
> compilation tests to my patch submit criteria should prevent these kind of
> issues.

We do this as well as 32 and 64b for the platform driver tree, I have found it
to be a reasonable sanity test.

-- 
Darren Hart
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 3/8] thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
  2017-06-03 13:00                   ` Andy Shevchenko
@ 2017-06-03 17:28                     ` Sathyanarayanan Kuppuswamy Natarajan
  -1 siblings, 0 replies; 132+ messages in thread
From: Sathyanarayanan Kuppuswamy Natarajan @ 2017-06-03 17:28 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Kuppuswamy Sathyanarayanan, Alexandre Courbot, Krogerus, Heikki,
	Greg Kroah-Hartman, Linus Walleij, edubezval, dvhart, Zhang, Rui,
	Lee Jones, Andy Shevchenko, linux-gpio, linux-pm, USB,
	linux-kernel, Platform Driver

Hi,

On Sat, Jun 3, 2017 at 6:00 AM, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Thu, Jun 1, 2017 at 1:37 AM,
> <sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
>> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>>
>> PMIC mfd driver only exports first level irq for thermal device.
>> But currently we are reading the irqs from the second level irq
>> chip, So this patch fixes this issue by adding support to use
>> first level PMIC thermal irq.
>>
>
> Shouldn't be this squashed to patch 2?

There is no compilation dependency between patch 2 and 3. But they are
functionally dependent.

Should we squash functionally dependent patches too ?

>
>> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>> Acked-by: Zhang Rui <rui.zhang@intel.com>
>> ---
>>  drivers/thermal/intel_bxt_pmic_thermal.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Changes since v1:
>>  * None
>>
>> Changes since v2:
>>  * Rebased on top of latest release.
>>
>> Changes since v3:
>>  * Rebased on top of latest release.
>>
>> diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c b/drivers/thermal/intel_bxt_pmic_thermal.c
>> index 0f19a39..ef6b322 100644
>> --- a/drivers/thermal/intel_bxt_pmic_thermal.c
>> +++ b/drivers/thermal/intel_bxt_pmic_thermal.c
>> @@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct platform_device *pdev)
>>         }
>>
>>         regmap = pmic->regmap;
>> -       regmap_irq_chip = pmic->irq_chip_data_level2;
>> +       regmap_irq_chip = pmic->irq_chip_data;
>>
>>         pmic_irq_count = 0;
>>         while ((irq = platform_get_irq(pdev, pmic_irq_count)) != -ENXIO) {
>> --
>> 2.7.4
>>
>
>
>
> --
> With Best Regards,
> Andy Shevchenko



-- 
Sathya

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 3/8] thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
@ 2017-06-03 17:28                     ` Sathyanarayanan Kuppuswamy Natarajan
  0 siblings, 0 replies; 132+ messages in thread
From: Sathyanarayanan Kuppuswamy Natarajan @ 2017-06-03 17:28 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Kuppuswamy Sathyanarayanan, Alexandre Courbot, Krogerus, Heikki,
	Greg Kroah-Hartman, Linus Walleij, edubezval, dvhart, Zhang, Rui,
	Lee Jones, Andy Shevchenko, linux-gpio, linux-pm, USB,
	linux-kernel, Platform Driver

Hi,

On Sat, Jun 3, 2017 at 6:00 AM, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Thu, Jun 1, 2017 at 1:37 AM,
> <sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
>> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>>
>> PMIC mfd driver only exports first level irq for thermal device.
>> But currently we are reading the irqs from the second level irq
>> chip, So this patch fixes this issue by adding support to use
>> first level PMIC thermal irq.
>>
>
> Shouldn't be this squashed to patch 2?

There is no compilation dependency between patch 2 and 3. But they are
functionally dependent.

Should we squash functionally dependent patches too ?

>
>> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>> Acked-by: Zhang Rui <rui.zhang@intel.com>
>> ---
>>  drivers/thermal/intel_bxt_pmic_thermal.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Changes since v1:
>>  * None
>>
>> Changes since v2:
>>  * Rebased on top of latest release.
>>
>> Changes since v3:
>>  * Rebased on top of latest release.
>>
>> diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c b/drivers/thermal/intel_bxt_pmic_thermal.c
>> index 0f19a39..ef6b322 100644
>> --- a/drivers/thermal/intel_bxt_pmic_thermal.c
>> +++ b/drivers/thermal/intel_bxt_pmic_thermal.c
>> @@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct platform_device *pdev)
>>         }
>>
>>         regmap = pmic->regmap;
>> -       regmap_irq_chip = pmic->irq_chip_data_level2;
>> +       regmap_irq_chip = pmic->irq_chip_data;
>>
>>         pmic_irq_count = 0;
>>         while ((irq = platform_get_irq(pdev, pmic_irq_count)) != -ENXIO) {
>> --
>> 2.7.4
>>
>
>
>
> --
> With Best Regards,
> Andy Shevchenko



-- 
Sathya

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 3/8] thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
  2017-06-03 17:28                     ` Sathyanarayanan Kuppuswamy Natarajan
@ 2017-06-03 17:32                       ` Andy Shevchenko
  -1 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-03 17:32 UTC (permalink / raw)
  To: Sathyanarayanan Kuppuswamy Natarajan
  Cc: Kuppuswamy Sathyanarayanan, Alexandre Courbot, Krogerus, Heikki,
	Greg Kroah-Hartman, Linus Walleij, edubezval, dvhart, Zhang, Rui,
	Lee Jones, Andy Shevchenko, linux-gpio, linux-pm, USB,
	linux-kernel, Platform Driver

On Sat, Jun 3, 2017 at 8:28 PM, Sathyanarayanan Kuppuswamy Natarajan
<sathyaosid@gmail.com> wrote:
> Hi,
>
> On Sat, Jun 3, 2017 at 6:00 AM, Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
>> On Thu, Jun 1, 2017 at 1:37 AM,
>> <sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
>>> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>>>
>>> PMIC mfd driver only exports first level irq for thermal device.
>>> But currently we are reading the irqs from the second level irq
>>> chip, So this patch fixes this issue by adding support to use
>>> first level PMIC thermal irq.
>>>
>>
>> Shouldn't be this squashed to patch 2?
>
> There is no compilation dependency between patch 2 and 3. But they are
> functionally dependent.
>
> Should we squash functionally dependent patches too ?

Let's assume we applied patches 1 and 2, does it mean the regression
to the existing behaviour?

(For example, device worked improperly in some cases -> stopped
working completely)

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 3/8] thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
@ 2017-06-03 17:32                       ` Andy Shevchenko
  0 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-03 17:32 UTC (permalink / raw)
  To: Sathyanarayanan Kuppuswamy Natarajan
  Cc: Kuppuswamy Sathyanarayanan, Alexandre Courbot, Krogerus, Heikki,
	Greg Kroah-Hartman, Linus Walleij, edubezval, dvhart, Zhang, Rui,
	Lee Jones, Andy Shevchenko, linux-gpio, linux-pm, USB,
	linux-kernel, Platform Driver

On Sat, Jun 3, 2017 at 8:28 PM, Sathyanarayanan Kuppuswamy Natarajan
<sathyaosid@gmail.com> wrote:
> Hi,
>
> On Sat, Jun 3, 2017 at 6:00 AM, Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
>> On Thu, Jun 1, 2017 at 1:37 AM,
>> <sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
>>> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>>>
>>> PMIC mfd driver only exports first level irq for thermal device.
>>> But currently we are reading the irqs from the second level irq
>>> chip, So this patch fixes this issue by adding support to use
>>> first level PMIC thermal irq.
>>>
>>
>> Shouldn't be this squashed to patch 2?
>
> There is no compilation dependency between patch 2 and 3. But they are
> functionally dependent.
>
> Should we squash functionally dependent patches too ?

Let's assume we applied patches 1 and 2, does it mean the regression
to the existing behaviour?

(For example, device worked improperly in some cases -> stopped
working completely)

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 3/8] thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
  2017-06-03 17:32                       ` Andy Shevchenko
@ 2017-06-03 17:53                         ` Sathyanarayanan Kuppuswamy Natarajan
  -1 siblings, 0 replies; 132+ messages in thread
From: Sathyanarayanan Kuppuswamy Natarajan @ 2017-06-03 17:53 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Kuppuswamy Sathyanarayanan, Alexandre Courbot, Krogerus, Heikki,
	Greg Kroah-Hartman, Linus Walleij, edubezval, dvhart, Zhang, Rui,
	Lee Jones, Andy Shevchenko, linux-gpio, linux-pm, USB,
	linux-kernel, Platform Driver

Hi,

On Sat, Jun 3, 2017 at 10:32 AM, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Sat, Jun 3, 2017 at 8:28 PM, Sathyanarayanan Kuppuswamy Natarajan
> <sathyaosid@gmail.com> wrote:
>> Hi,
>>
>> On Sat, Jun 3, 2017 at 6:00 AM, Andy Shevchenko
>> <andy.shevchenko@gmail.com> wrote:
>>> On Thu, Jun 1, 2017 at 1:37 AM,
>>> <sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
>>>> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>>>>
>>>> PMIC mfd driver only exports first level irq for thermal device.
>>>> But currently we are reading the irqs from the second level irq
>>>> chip, So this patch fixes this issue by adding support to use
>>>> first level PMIC thermal irq.
>>>>
>>>
>>> Shouldn't be this squashed to patch 2?
>>
>> There is no compilation dependency between patch 2 and 3. But they are
>> functionally dependent.
>>
>> Should we squash functionally dependent patches too ?
>
> Let's assume we applied patches 1 and 2, does it mean the regression
> to the existing behaviour?

Yes, Just applying patch 1 & 2 and not apply patch 3 will create
regression in thermal driver.

Since there is no compilation dependency between patch 2 & 3 and they
are from two different domains, I submitted them separately to make it
easier for review.



>
> (For example, device worked improperly in some cases -> stopped
> working completely)
>
> --
> With Best Regards,
> Andy Shevchenko



-- 
Sathya

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 3/8] thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
@ 2017-06-03 17:53                         ` Sathyanarayanan Kuppuswamy Natarajan
  0 siblings, 0 replies; 132+ messages in thread
From: Sathyanarayanan Kuppuswamy Natarajan @ 2017-06-03 17:53 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Kuppuswamy Sathyanarayanan, Alexandre Courbot, Krogerus, Heikki,
	Greg Kroah-Hartman, Linus Walleij, edubezval, dvhart, Zhang, Rui,
	Lee Jones, Andy Shevchenko, linux-gpio, linux-pm, USB,
	linux-kernel, Platform Driver

Hi,

On Sat, Jun 3, 2017 at 10:32 AM, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Sat, Jun 3, 2017 at 8:28 PM, Sathyanarayanan Kuppuswamy Natarajan
> <sathyaosid@gmail.com> wrote:
>> Hi,
>>
>> On Sat, Jun 3, 2017 at 6:00 AM, Andy Shevchenko
>> <andy.shevchenko@gmail.com> wrote:
>>> On Thu, Jun 1, 2017 at 1:37 AM,
>>> <sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
>>>> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>>>>
>>>> PMIC mfd driver only exports first level irq for thermal device.
>>>> But currently we are reading the irqs from the second level irq
>>>> chip, So this patch fixes this issue by adding support to use
>>>> first level PMIC thermal irq.
>>>>
>>>
>>> Shouldn't be this squashed to patch 2?
>>
>> There is no compilation dependency between patch 2 and 3. But they are
>> functionally dependent.
>>
>> Should we squash functionally dependent patches too ?
>
> Let's assume we applied patches 1 and 2, does it mean the regression
> to the existing behaviour?

Yes, Just applying patch 1 & 2 and not apply patch 3 will create
regression in thermal driver.

Since there is no compilation dependency between patch 2 & 3 and they
are from two different domains, I submitted them separately to make it
easier for review.



>
> (For example, device worked improperly in some cases -> stopped
> working completely)
>
> --
> With Best Regards,
> Andy Shevchenko



-- 
Sathya

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 3/8] thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
  2017-06-03 17:53                         ` Sathyanarayanan Kuppuswamy Natarajan
@ 2017-06-03 18:18                           ` Andy Shevchenko
  -1 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-03 18:18 UTC (permalink / raw)
  To: Sathyanarayanan Kuppuswamy Natarajan
  Cc: Kuppuswamy Sathyanarayanan, Alexandre Courbot, Krogerus, Heikki,
	Greg Kroah-Hartman, Linus Walleij, edubezval, dvhart, Zhang, Rui,
	Lee Jones, Andy Shevchenko, linux-gpio, linux-pm, USB,
	linux-kernel, Platform Driver

On Sat, Jun 3, 2017 at 8:53 PM, Sathyanarayanan Kuppuswamy Natarajan
<sathyaosid@gmail.com> wrote:
> On Sat, Jun 3, 2017 at 10:32 AM, Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
>> On Sat, Jun 3, 2017 at 8:28 PM, Sathyanarayanan Kuppuswamy Natarajan
>> <sathyaosid@gmail.com> wrote:

>> Let's assume we applied patches 1 and 2, does it mean the regression
>> to the existing behaviour?
>
> Yes, Just applying patch 1 & 2 and not apply patch 3 will create
> regression in thermal driver.
>
> Since there is no compilation dependency between patch 2 & 3 and they
> are from two different domains, I submitted them separately to make it
> easier for review.

And this is exactly bisectability (level 2 :-) ) issue.
Basically you confirmed you need to squash them like I said.

>> (For example, device worked improperly in some cases -> stopped
>> working completely)

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v5 3/8] thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
@ 2017-06-03 18:18                           ` Andy Shevchenko
  0 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-03 18:18 UTC (permalink / raw)
  To: Sathyanarayanan Kuppuswamy Natarajan
  Cc: Kuppuswamy Sathyanarayanan, Alexandre Courbot, Krogerus, Heikki,
	Greg Kroah-Hartman, Linus Walleij, edubezval, dvhart, Zhang, Rui,
	Lee Jones, Andy Shevchenko, linux-gpio, linux-pm, USB,
	linux-kernel, Platform Driver

On Sat, Jun 3, 2017 at 8:53 PM, Sathyanarayanan Kuppuswamy Natarajan
<sathyaosid@gmail.com> wrote:
> On Sat, Jun 3, 2017 at 10:32 AM, Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
>> On Sat, Jun 3, 2017 at 8:28 PM, Sathyanarayanan Kuppuswamy Natarajan
>> <sathyaosid@gmail.com> wrote:

>> Let's assume we applied patches 1 and 2, does it mean the regression
>> to the existing behaviour?
>
> Yes, Just applying patch 1 & 2 and not apply patch 3 will create
> regression in thermal driver.
>
> Since there is no compilation dependency between patch 2 & 3 and they
> are from two different domains, I submitted them separately to make it
> easier for review.

And this is exactly bisectability (level 2 :-) ) issue.
Basically you confirmed you need to squash them like I said.

>> (For example, device worked improperly in some cases -> stopped
>> working completely)

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* [PATCH v6 0/6] mfd: intel_soc_pmic_bxtwc: Add chained IRQ support
  2017-06-03 18:18                           ` Andy Shevchenko
@ 2017-06-05 19:08                             ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-06-05 19:08 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: platform-driver-x86, linux-gpio, linux-usb, linux-kernel,
	linux-pm, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Following patch set adds chained IRQ support to WCOVE PMIC driver.

Changes since v3:
 * Added fix for typec wcove driver.

Changes since v4:
 * Squashed following two commits, to keep the patch set bisectable.
   usb: typec: typec_wcove: Use charger irq chip to get usbc virq
   mfd: intel_soc_pmic_bxtwc: use chained irqs for second level irq chips

Changes since v5:
* Changed irq->IRQ, pmic->PMIC in all commit messages.
* Squashed following two thermal driver related commits.
  mfd: intel_soc_pmic_bxtwc: Remove thermal second level irqs
  thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
* Squashed following two GPIO driver related commits.
  mfd: intel_soc_pmic_bxtwc: Remove second level irq for gpio device
  gpio: gpio-wcove: Use first level PMIC GPIO irq

Kuppuswamy Sathyanarayanan (6):
  mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
  mfd: intel_soc_pmic_bxtwc: Remove thermal second level IRQs
  mfd: intel_soc_pmic_bxtwc: Remove second level IRQ for gpio device
  mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
  mfd: intel_soc_pmic_bxtwc: Use chained IRQs for second level IRQ chips
  platform/x86: intel_bxtwc_tmu: Remove first level IRQ unmask

 drivers/gpio/gpio-wcove.c                |  14 +-
 drivers/mfd/intel_soc_pmic_bxtwc.c       | 232 +++++++++++++++++++++----------
 drivers/platform/x86/intel_bxtwc_tmu.c   |   4 -
 drivers/thermal/intel_bxt_pmic_thermal.c |   2 +-
 drivers/usb/typec/typec_wcove.c          |   2 +-
 include/linux/mfd/intel_soc_pmic.h       |   5 +-
 6 files changed, 175 insertions(+), 84 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 132+ messages in thread

* [PATCH v6 0/6] mfd: intel_soc_pmic_bxtwc: Add chained IRQ support
@ 2017-06-05 19:08                             ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-06-05 19:08 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: platform-driver-x86, linux-gpio, linux-usb, linux-kernel,
	linux-pm, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Following patch set adds chained IRQ support to WCOVE PMIC driver.

Changes since v3:
 * Added fix for typec wcove driver.

Changes since v4:
 * Squashed following two commits, to keep the patch set bisectable.
   usb: typec: typec_wcove: Use charger irq chip to get usbc virq
   mfd: intel_soc_pmic_bxtwc: use chained irqs for second level irq chips

Changes since v5:
* Changed irq->IRQ, pmic->PMIC in all commit messages.
* Squashed following two thermal driver related commits.
  mfd: intel_soc_pmic_bxtwc: Remove thermal second level irqs
  thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
* Squashed following two GPIO driver related commits.
  mfd: intel_soc_pmic_bxtwc: Remove second level irq for gpio device
  gpio: gpio-wcove: Use first level PMIC GPIO irq

Kuppuswamy Sathyanarayanan (6):
  mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
  mfd: intel_soc_pmic_bxtwc: Remove thermal second level IRQs
  mfd: intel_soc_pmic_bxtwc: Remove second level IRQ for gpio device
  mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
  mfd: intel_soc_pmic_bxtwc: Use chained IRQs for second level IRQ chips
  platform/x86: intel_bxtwc_tmu: Remove first level IRQ unmask

 drivers/gpio/gpio-wcove.c                |  14 +-
 drivers/mfd/intel_soc_pmic_bxtwc.c       | 232 +++++++++++++++++++++----------
 drivers/platform/x86/intel_bxtwc_tmu.c   |   4 -
 drivers/thermal/intel_bxt_pmic_thermal.c |   2 +-
 drivers/usb/typec/typec_wcove.c          |   2 +-
 include/linux/mfd/intel_soc_pmic.h       |   5 +-
 6 files changed, 175 insertions(+), 84 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 132+ messages in thread

* [PATCH v6 1/6] mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
  2017-06-05 19:08                             ` sathyanarayanan.kuppuswamy
@ 2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-06-05 19:08 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: platform-driver-x86, linux-gpio, linux-usb, linux-kernel,
	linux-pm, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

TMU interrupts are registered as a separate interrupt chip, and
hence it should start its interrupt index(BXTWC_TMU_IRQ) number
from 0. But currently, BXTWC_TMU_IRQ is defined as part of enum
bxtwc_irqs_level2 and its index value is 11. Since this index
value is used when calculating .num_irqs of regmap_irq_chip_tmu,
it incorrectly reports number of IRQs as 12 instead of actual
value of 1.

This patch fixes this issue by creating new enum of tmu IRQs and
resetting its starting index to 0.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Changes since v1: 
 * Removed code from commit message.

Changes since v2: 
 * Rebased on top of latest release.

Changes sinve v3:
 * Rebased on top of latest release.

Changes sinve v5:
 * Changed irq to IRQ.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 8c3cbf6..7cbaf1e 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -95,7 +95,10 @@ enum bxtwc_irqs_level2 {
 	BXTWC_GPIO0_IRQ,
 	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
-	BXTWC_TMU_IRQ,
+};
+
+enum bxtwc_irqs_tmu {
+	BXTWC_TMU_IRQ = 0,
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v6 1/6] mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
@ 2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-06-05 19:08 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: platform-driver-x86, linux-gpio, linux-usb, linux-kernel,
	linux-pm, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

TMU interrupts are registered as a separate interrupt chip, and
hence it should start its interrupt index(BXTWC_TMU_IRQ) number
from 0. But currently, BXTWC_TMU_IRQ is defined as part of enum
bxtwc_irqs_level2 and its index value is 11. Since this index
value is used when calculating .num_irqs of regmap_irq_chip_tmu,
it incorrectly reports number of IRQs as 12 instead of actual
value of 1.

This patch fixes this issue by creating new enum of tmu IRQs and
resetting its starting index to 0.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Changes since v1: 
 * Removed code from commit message.

Changes since v2: 
 * Rebased on top of latest release.

Changes sinve v3:
 * Rebased on top of latest release.

Changes sinve v5:
 * Changed irq to IRQ.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 8c3cbf6..7cbaf1e 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -95,7 +95,10 @@ enum bxtwc_irqs_level2 {
 	BXTWC_GPIO0_IRQ,
 	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
-	BXTWC_TMU_IRQ,
+};
+
+enum bxtwc_irqs_tmu {
+	BXTWC_TMU_IRQ = 0,
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v6 2/6] mfd: intel_soc_pmic_bxtwc: Remove thermal second level IRQs
  2017-06-05 19:08                             ` sathyanarayanan.kuppuswamy
@ 2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-06-05 19:08 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: platform-driver-x86, linux-gpio, linux-usb, linux-kernel,
	linux-pm, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Since all second level thermal IRQs are consumed by the same
device(bxt_wcove_thermal), there is no need to expose them as separate
interrupts. We can just export only the first level IRQs for thermal and
let the device(bxt_wcove_thermal) driver handle the second level IRQs
based on thermal interrupt status register. Also, just using only the
first level IRQ will eliminate the bug involved in requesting only the
second level IRQ and not explicitly enable the first level IRQ. For
more info on this issue please read the details at,

https://lkml.org/lkml/2017/2/27/148

This patch also makes relevant change in bxt_wcove_thermal driver to use
only first level PMIC thermal IRQ.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c       | 32 ++++++++++++--------------------
 drivers/thermal/intel_bxt_pmic_thermal.c |  2 +-
 2 files changed, 13 insertions(+), 21 deletions(-)

Changes since v1:
 * None

Changes since v2: 
 * Rebased on top of latest release.

Changes since v3:
 * Rebased on top of latest release.

Changes since v5:
 * Squashed intel_bxt_pmic_thermal driver patch.
 * Changed irq -> IRQ


diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 7cbaf1e..7c1ed27 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -84,10 +84,7 @@ enum bxtwc_irqs {
 
 enum bxtwc_irqs_level2 {
 	/* Level 2 */
-	BXTWC_THRM0_IRQ = 0,
-	BXTWC_THRM1_IRQ,
-	BXTWC_THRM2_IRQ,
-	BXTWC_BCU_IRQ,
+	BXTWC_BCU_IRQ = 0,
 	BXTWC_ADC_IRQ,
 	BXTWC_USBC_IRQ,
 	BXTWC_CHGR0_IRQ,
@@ -114,17 +111,14 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
-	REGMAP_IRQ_REG(BXTWC_THRM0_IRQ, 0, 0xff),
-	REGMAP_IRQ_REG(BXTWC_THRM1_IRQ, 1, 0xbf),
-	REGMAP_IRQ_REG(BXTWC_THRM2_IRQ, 2, 0xff),
-	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 4, 0xff),
-	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 5, BIT(5)),
-	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 5, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 6, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 7, 0xff),
-	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 8, 0x3f),
-	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 9, 0x03),
+	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
+	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
+	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 4, 0xff),
+	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 5, 0x3f),
+	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
@@ -142,8 +136,8 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 
 static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
 	.name = "bxtwc_irq_chip_level2",
-	.status_base = BXTWC_THRM0IRQ,
-	.mask_base = BXTWC_MTHRM0IRQ,
+	.status_base = BXTWC_BCUIRQ,
+	.mask_base = BXTWC_MBCUIRQ,
 	.irqs = bxtwc_regmap_irqs_level2,
 	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
 	.num_regs = 10,
@@ -177,9 +171,7 @@ static struct resource charger_resources[] = {
 };
 
 static struct resource thermal_resources[] = {
-	DEFINE_RES_IRQ(BXTWC_THRM0_IRQ),
-	DEFINE_RES_IRQ(BXTWC_THRM1_IRQ),
-	DEFINE_RES_IRQ(BXTWC_THRM2_IRQ),
+	DEFINE_RES_IRQ(BXTWC_THRM_LVL1_IRQ),
 };
 
 static struct resource bcu_resources[] = {
diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c b/drivers/thermal/intel_bxt_pmic_thermal.c
index 0f19a39..ef6b322 100644
--- a/drivers/thermal/intel_bxt_pmic_thermal.c
+++ b/drivers/thermal/intel_bxt_pmic_thermal.c
@@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct platform_device *pdev)
 	}
 
 	regmap = pmic->regmap;
-	regmap_irq_chip = pmic->irq_chip_data_level2;
+	regmap_irq_chip = pmic->irq_chip_data;
 
 	pmic_irq_count = 0;
 	while ((irq = platform_get_irq(pdev, pmic_irq_count)) != -ENXIO) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v6 2/6] mfd: intel_soc_pmic_bxtwc: Remove thermal second level IRQs
@ 2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-06-05 19:08 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: platform-driver-x86, linux-gpio, linux-usb, linux-kernel,
	linux-pm, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Since all second level thermal IRQs are consumed by the same
device(bxt_wcove_thermal), there is no need to expose them as separate
interrupts. We can just export only the first level IRQs for thermal and
let the device(bxt_wcove_thermal) driver handle the second level IRQs
based on thermal interrupt status register. Also, just using only the
first level IRQ will eliminate the bug involved in requesting only the
second level IRQ and not explicitly enable the first level IRQ. For
more info on this issue please read the details at,

https://lkml.org/lkml/2017/2/27/148

This patch also makes relevant change in bxt_wcove_thermal driver to use
only first level PMIC thermal IRQ.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c       | 32 ++++++++++++--------------------
 drivers/thermal/intel_bxt_pmic_thermal.c |  2 +-
 2 files changed, 13 insertions(+), 21 deletions(-)

Changes since v1:
 * None

Changes since v2: 
 * Rebased on top of latest release.

Changes since v3:
 * Rebased on top of latest release.

Changes since v5:
 * Squashed intel_bxt_pmic_thermal driver patch.
 * Changed irq -> IRQ


diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 7cbaf1e..7c1ed27 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -84,10 +84,7 @@ enum bxtwc_irqs {
 
 enum bxtwc_irqs_level2 {
 	/* Level 2 */
-	BXTWC_THRM0_IRQ = 0,
-	BXTWC_THRM1_IRQ,
-	BXTWC_THRM2_IRQ,
-	BXTWC_BCU_IRQ,
+	BXTWC_BCU_IRQ = 0,
 	BXTWC_ADC_IRQ,
 	BXTWC_USBC_IRQ,
 	BXTWC_CHGR0_IRQ,
@@ -114,17 +111,14 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
-	REGMAP_IRQ_REG(BXTWC_THRM0_IRQ, 0, 0xff),
-	REGMAP_IRQ_REG(BXTWC_THRM1_IRQ, 1, 0xbf),
-	REGMAP_IRQ_REG(BXTWC_THRM2_IRQ, 2, 0xff),
-	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 4, 0xff),
-	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 5, BIT(5)),
-	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 5, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 6, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 7, 0xff),
-	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 8, 0x3f),
-	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 9, 0x03),
+	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
+	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
+	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 4, 0xff),
+	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 5, 0x3f),
+	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
@@ -142,8 +136,8 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 
 static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
 	.name = "bxtwc_irq_chip_level2",
-	.status_base = BXTWC_THRM0IRQ,
-	.mask_base = BXTWC_MTHRM0IRQ,
+	.status_base = BXTWC_BCUIRQ,
+	.mask_base = BXTWC_MBCUIRQ,
 	.irqs = bxtwc_regmap_irqs_level2,
 	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
 	.num_regs = 10,
@@ -177,9 +171,7 @@ static struct resource charger_resources[] = {
 };
 
 static struct resource thermal_resources[] = {
-	DEFINE_RES_IRQ(BXTWC_THRM0_IRQ),
-	DEFINE_RES_IRQ(BXTWC_THRM1_IRQ),
-	DEFINE_RES_IRQ(BXTWC_THRM2_IRQ),
+	DEFINE_RES_IRQ(BXTWC_THRM_LVL1_IRQ),
 };
 
 static struct resource bcu_resources[] = {
diff --git a/drivers/thermal/intel_bxt_pmic_thermal.c b/drivers/thermal/intel_bxt_pmic_thermal.c
index 0f19a39..ef6b322 100644
--- a/drivers/thermal/intel_bxt_pmic_thermal.c
+++ b/drivers/thermal/intel_bxt_pmic_thermal.c
@@ -241,7 +241,7 @@ static int pmic_thermal_probe(struct platform_device *pdev)
 	}
 
 	regmap = pmic->regmap;
-	regmap_irq_chip = pmic->irq_chip_data_level2;
+	regmap_irq_chip = pmic->irq_chip_data;
 
 	pmic_irq_count = 0;
 	while ((irq = platform_get_irq(pdev, pmic_irq_count)) != -ENXIO) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v6 3/6] mfd: intel_soc_pmic_bxtwc: Remove second level IRQ for gpio device
  2017-06-05 19:08                             ` sathyanarayanan.kuppuswamy
@ 2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-06-05 19:08 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: platform-driver-x86, linux-gpio, linux-usb, linux-kernel,
	linux-pm, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Currently all PMIC GPIO domain IRQs are consumed by the same
device(bxt_wcove_gpio), so there is no need to export them as
separate interrupts. We can just export only the first level
GPIO IRQ(BXTWC_GPIO_LVL1_IRQ) as an IRQ resource and let the
GPIO device driver(bxt_wcove_gpio) handle the GPIO sub domain
IRQs based on status value of GPIO level2 interrupt status
register. Also, just using only the first level IRQ will eliminate
the bug involved in requesting only the second level IRQ and not
explicitly enable the first level IRQ. For more info on this
issue please read the details at,

https://lkml.org/lkml/2017/2/27/148

This patch also makes relevant change in Whiskey cove GPIO driver to
use only first level PMIC GPIO IRQ.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpio-wcove.c          | 14 +++++++++++++-
 drivers/mfd/intel_soc_pmic_bxtwc.c |  7 +------
 2 files changed, 14 insertions(+), 7 deletions(-)

Changes since v1:
 * None

Changes since v2: 
 * Rebased on top of latest release.

Changes since v3:
 * None

Changes since v5:
 * Squashed gpio driver patch.
 * Changes irq -> IRQ.

diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c
index 7b1bc20..bba7704 100644
--- a/drivers/gpio/gpio-wcove.c
+++ b/drivers/gpio/gpio-wcove.c
@@ -401,7 +401,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
 	if (!wg)
 		return -ENOMEM;
 
-	wg->regmap_irq_chip = pmic->irq_chip_data_level2;
+	wg->regmap_irq_chip = pmic->irq_chip_data;
 
 	platform_set_drvdata(pdev, wg);
 
@@ -449,6 +449,18 @@ static int wcove_gpio_probe(struct platform_device *pdev)
 
 	gpiochip_set_nested_irqchip(&wg->chip, &wcove_irqchip, virq);
 
+	/* Enable GPIO0 interrupts */
+	ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE, GPIO_IRQ0_MASK,
+				 0x00);
+	if (ret)
+		return ret;
+
+	/* Enable GPIO1 interrupts */
+	ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE + 1, GPIO_IRQ1_MASK,
+				 0x00);
+	if (ret)
+		return ret;
+
 	return 0;
 }
 
diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 7c1ed27..af11c43 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -89,8 +89,6 @@ enum bxtwc_irqs_level2 {
 	BXTWC_USBC_IRQ,
 	BXTWC_CHGR0_IRQ,
 	BXTWC_CHGR1_IRQ,
-	BXTWC_GPIO0_IRQ,
-	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
 };
 
@@ -116,8 +114,6 @@ static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
 	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
 	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
 	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 4, 0xff),
-	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 5, 0x3f),
 	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
@@ -153,8 +149,7 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 };
 
 static struct resource gpio_resources[] = {
-	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO0_IRQ, "GPIO0"),
-	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO1_IRQ, "GPIO1"),
+	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
 };
 
 static struct resource adc_resources[] = {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v6 3/6] mfd: intel_soc_pmic_bxtwc: Remove second level IRQ for gpio device
@ 2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-06-05 19:08 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: platform-driver-x86, linux-gpio, linux-usb, linux-kernel,
	linux-pm, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Currently all PMIC GPIO domain IRQs are consumed by the same
device(bxt_wcove_gpio), so there is no need to export them as
separate interrupts. We can just export only the first level
GPIO IRQ(BXTWC_GPIO_LVL1_IRQ) as an IRQ resource and let the
GPIO device driver(bxt_wcove_gpio) handle the GPIO sub domain
IRQs based on status value of GPIO level2 interrupt status
register. Also, just using only the first level IRQ will eliminate
the bug involved in requesting only the second level IRQ and not
explicitly enable the first level IRQ. For more info on this
issue please read the details at,

https://lkml.org/lkml/2017/2/27/148

This patch also makes relevant change in Whiskey cove GPIO driver to
use only first level PMIC GPIO IRQ.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpio-wcove.c          | 14 +++++++++++++-
 drivers/mfd/intel_soc_pmic_bxtwc.c |  7 +------
 2 files changed, 14 insertions(+), 7 deletions(-)

Changes since v1:
 * None

Changes since v2: 
 * Rebased on top of latest release.

Changes since v3:
 * None

Changes since v5:
 * Squashed gpio driver patch.
 * Changes irq -> IRQ.

diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c
index 7b1bc20..bba7704 100644
--- a/drivers/gpio/gpio-wcove.c
+++ b/drivers/gpio/gpio-wcove.c
@@ -401,7 +401,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
 	if (!wg)
 		return -ENOMEM;
 
-	wg->regmap_irq_chip = pmic->irq_chip_data_level2;
+	wg->regmap_irq_chip = pmic->irq_chip_data;
 
 	platform_set_drvdata(pdev, wg);
 
@@ -449,6 +449,18 @@ static int wcove_gpio_probe(struct platform_device *pdev)
 
 	gpiochip_set_nested_irqchip(&wg->chip, &wcove_irqchip, virq);
 
+	/* Enable GPIO0 interrupts */
+	ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE, GPIO_IRQ0_MASK,
+				 0x00);
+	if (ret)
+		return ret;
+
+	/* Enable GPIO1 interrupts */
+	ret = regmap_update_bits(wg->regmap, IRQ_MASK_BASE + 1, GPIO_IRQ1_MASK,
+				 0x00);
+	if (ret)
+		return ret;
+
 	return 0;
 }
 
diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 7c1ed27..af11c43 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -89,8 +89,6 @@ enum bxtwc_irqs_level2 {
 	BXTWC_USBC_IRQ,
 	BXTWC_CHGR0_IRQ,
 	BXTWC_CHGR1_IRQ,
-	BXTWC_GPIO0_IRQ,
-	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
 };
 
@@ -116,8 +114,6 @@ static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
 	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
 	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
 	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 4, 0xff),
-	REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 5, 0x3f),
 	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
 };
 
@@ -153,8 +149,7 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 };
 
 static struct resource gpio_resources[] = {
-	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO0_IRQ, "GPIO0"),
-	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO1_IRQ, "GPIO1"),
+	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
 };
 
 static struct resource adc_resources[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v6 4/6] mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
  2017-06-05 19:08                             ` sathyanarayanan.kuppuswamy
@ 2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-06-05 19:08 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: platform-driver-x86, linux-gpio, linux-usb, linux-kernel,
	linux-pm, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Cleanup the resource allocation/free code in probe function by using
devm_* calls.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 54 +++++++++++++-------------------------
 1 file changed, 18 insertions(+), 36 deletions(-)

Changes since v1:
 * None

Changes since v2:
 * Rebased on top of latest release.

Changes since v3:
 * None

Changes since v5:
 * None

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index af11c43..feeda6e 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -399,45 +399,44 @@ static int bxtwc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip,
-				  &pmic->irq_chip_data);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip,
+				       &pmic->irq_chip_data);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add IRQ chip\n");
 		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip_level2,
-				  &pmic->irq_chip_data_level2);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip_level2,
+				       &pmic->irq_chip_data_level2);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
-		goto err_irq_chip_level2;
+		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip_tmu,
-				  &pmic->irq_chip_data_tmu);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip_tmu,
+				       &pmic->irq_chip_data_tmu);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
-		goto err_irq_chip_tmu;
+		return ret;
 	}
 
-	ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
-			      ARRAY_SIZE(bxt_wc_dev), NULL, 0,
-			      NULL);
+	ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
+				   ARRAY_SIZE(bxt_wc_dev), NULL, 0, NULL);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add devices\n");
-		goto err_mfd;
+		return ret;
 	}
 
 	ret = sysfs_create_group(&pdev->dev.kobj, &bxtwc_group);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to create sysfs group %d\n", ret);
-		goto err_sysfs;
+		return ret;
 	}
 
 	/*
@@ -451,28 +450,11 @@ static int bxtwc_probe(struct platform_device *pdev)
 				BXTWC_MIRQLVL1_MCHGR, 0);
 
 	return 0;
-
-err_sysfs:
-	mfd_remove_devices(&pdev->dev);
-err_mfd:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
-err_irq_chip_tmu:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
-err_irq_chip_level2:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-
-	return ret;
 }
 
 static int bxtwc_remove(struct platform_device *pdev)
 {
-	struct intel_soc_pmic *pmic = dev_get_drvdata(&pdev->dev);
-
 	sysfs_remove_group(&pdev->dev.kobj, &bxtwc_group);
-	mfd_remove_devices(&pdev->dev);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
 
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v6 4/6] mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
@ 2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-06-05 19:08 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: platform-driver-x86, linux-gpio, linux-usb, linux-kernel,
	linux-pm, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Cleanup the resource allocation/free code in probe function by using
devm_* calls.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 54 +++++++++++++-------------------------
 1 file changed, 18 insertions(+), 36 deletions(-)

Changes since v1:
 * None

Changes since v2:
 * Rebased on top of latest release.

Changes since v3:
 * None

Changes since v5:
 * None

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index af11c43..feeda6e 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -399,45 +399,44 @@ static int bxtwc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip,
-				  &pmic->irq_chip_data);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip,
+				       &pmic->irq_chip_data);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add IRQ chip\n");
 		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip_level2,
-				  &pmic->irq_chip_data_level2);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip_level2,
+				       &pmic->irq_chip_data_level2);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
-		goto err_irq_chip_level2;
+		return ret;
 	}
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  IRQF_ONESHOT | IRQF_SHARED,
-				  0, &bxtwc_regmap_irq_chip_tmu,
-				  &pmic->irq_chip_data_tmu);
+	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
+				       IRQF_ONESHOT | IRQF_SHARED,
+				       0, &bxtwc_regmap_irq_chip_tmu,
+				       &pmic->irq_chip_data_tmu);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
-		goto err_irq_chip_tmu;
+		return ret;
 	}
 
-	ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
-			      ARRAY_SIZE(bxt_wc_dev), NULL, 0,
-			      NULL);
+	ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, bxt_wc_dev,
+				   ARRAY_SIZE(bxt_wc_dev), NULL, 0, NULL);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add devices\n");
-		goto err_mfd;
+		return ret;
 	}
 
 	ret = sysfs_create_group(&pdev->dev.kobj, &bxtwc_group);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to create sysfs group %d\n", ret);
-		goto err_sysfs;
+		return ret;
 	}
 
 	/*
@@ -451,28 +450,11 @@ static int bxtwc_probe(struct platform_device *pdev)
 				BXTWC_MIRQLVL1_MCHGR, 0);
 
 	return 0;
-
-err_sysfs:
-	mfd_remove_devices(&pdev->dev);
-err_mfd:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
-err_irq_chip_tmu:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
-err_irq_chip_level2:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-
-	return ret;
 }
 
 static int bxtwc_remove(struct platform_device *pdev)
 {
-	struct intel_soc_pmic *pmic = dev_get_drvdata(&pdev->dev);
-
 	sysfs_remove_group(&pdev->dev.kobj, &bxtwc_group);
-	mfd_remove_devices(&pdev->dev);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_level2);
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data_tmu);
 
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v6 5/6] mfd: intel_soc_pmic_bxtwc: Use chained IRQs for second level IRQ chips
  2017-06-05 19:08                             ` sathyanarayanan.kuppuswamy
@ 2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-06-05 19:08 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: platform-driver-x86, linux-gpio, linux-usb, linux-kernel,
	linux-pm, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Whishkey cove PMIC has support to mask/unmask interrupts at two levels.
At first level we can mask/unmask interrupt domains like TMU, GPIO, ADC,
CHGR, BCU THERMAL and PWRBTN and at second level, it provides facility
to mask/unmask individual interrupts belong each of this domain. For
example, in case of TMU, at first level we have TMU interrupt domain,
and at second level we have two interrupts, wake alarm, system alarm that
belong to the TMU interrupt domain.

Currently, in this driver all first level IRQs are registered as part of
IRQ chip(bxtwc_regmap_irq_chip). By default, after you register the IRQ
chip from your driver, all IRQs in that chip will masked and can only be
enabled if that IRQ is requested using request_irq() call. This is the
default Linux IRQ behavior model. And whenever a dependent device that
belongs to PMIC requests only the second level IRQ and not explicitly
unmask the first level IRQ, then in essence the second level IRQ will
still be disabled. For example, if TMU device driver request wake_alarm
IRQ and not explicitly unmask TMU level 1 IRQ then according to the default
Linux IRQ model,  wake_alarm IRQ will still be disabled. So the proper
solution to fix this issue is to use the chained IRQ chip concept. We
should chain all the second level chip IRQs to the corresponding first
level IRQ. To do this, we need to create separate IRQ chips for every
group of second level IRQs.

In case of TMU, when adding second level IRQ chip, instead of using PMIC
IRQ we should use the corresponding first level IRQ. So the following
code will change from

ret = regmap_add_irq_chip(pmic->regmap, pmic->irq, ...)

to,

virq = regmap_irq_get_virq(&pmic->irq_chip_data, BXTWC_TMU_LVL1_IRQ);

ret = regmap_add_irq_chip(pmic->regmap, virq, ...)

In case of Whiskey Cove Type-C driver, Since USBC IRQ is moved under
charger level2 IRQ chip. We should use charger IRQ chip(irq_chip_data_chgr)
to get the USBC virtual IRQ number.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 168 ++++++++++++++++++++++++++++++-------
 drivers/usb/typec/typec_wcove.c    |   2 +-
 include/linux/mfd/intel_soc_pmic.h |   5 +-
 3 files changed, 143 insertions(+), 32 deletions(-)

Changes since v1:
 * Rebased on top of dev_* cleanup patch.
 * Fixed style & grammer issues reported by Lee Jones

Changes since v2:
 * Rebased on top of latest release.

Changes since v3:
 * None

Changes since v4:
 * Merged typec driver fix to this patch to prevent branch bisect issue.

Changes since v5:
 * Changed irq->IRQ and pmic -> PMIC.
 * Rearranged tmu related changes to make the patch more readable.
 * Modfied the virq request failure message to include chip name and pirq.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index feeda6e..15bc052 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -82,20 +82,28 @@ enum bxtwc_irqs {
 	BXTWC_PWRBTN_IRQ,
 };
 
-enum bxtwc_irqs_level2 {
-	/* Level 2 */
+enum bxtwc_irqs_bcu {
 	BXTWC_BCU_IRQ = 0,
-	BXTWC_ADC_IRQ,
-	BXTWC_USBC_IRQ,
+};
+
+enum bxtwc_irqs_adc {
+	BXTWC_ADC_IRQ = 0,
+};
+
+enum bxtwc_irqs_chgr {
+	BXTWC_USBC_IRQ = 0,
 	BXTWC_CHGR0_IRQ,
 	BXTWC_CHGR1_IRQ,
-	BXTWC_CRIT_IRQ,
 };
 
 enum bxtwc_irqs_tmu {
 	BXTWC_TMU_IRQ = 0,
 };
 
+enum bxtwc_irqs_crit {
+	BXTWC_CRIT_IRQ = 0,
+};
+
 static const struct regmap_irq bxtwc_regmap_irqs[] = {
 	REGMAP_IRQ_REG(BXTWC_PWRBTN_LVL1_IRQ, 0, BIT(0)),
 	REGMAP_IRQ_REG(BXTWC_TMU_LVL1_IRQ, 0, BIT(1)),
@@ -108,19 +116,28 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
 	REGMAP_IRQ_REG(BXTWC_PWRBTN_IRQ, 1, 0x03),
 };
 
-static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
+static const struct regmap_irq bxtwc_regmap_irqs_bcu[] = {
 	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
-	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
-	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_adc[] = {
+	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 0, 0xff),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_chgr[] = {
+	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 0, BIT(5)),
+	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 0, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 1, 0x1f),
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
 	REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
 };
 
+static const struct regmap_irq bxtwc_regmap_irqs_crit[] = {
+	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 0, 0x03),
+};
+
 static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 	.name = "bxtwc_irq_chip",
 	.status_base = BXTWC_IRQLVL1,
@@ -130,15 +147,6 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 	.num_regs = 2,
 };
 
-static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
-	.name = "bxtwc_irq_chip_level2",
-	.status_base = BXTWC_BCUIRQ,
-	.mask_base = BXTWC_MBCUIRQ,
-	.irqs = bxtwc_regmap_irqs_level2,
-	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
-	.num_regs = 10,
-};
-
 static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 	.name = "bxtwc_irq_chip_tmu",
 	.status_base = BXTWC_TMUIRQ,
@@ -148,6 +156,42 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 	.num_regs = 1,
 };
 
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_bcu = {
+	.name = "bxtwc_irq_chip_bcu",
+	.status_base = BXTWC_BCUIRQ,
+	.mask_base = BXTWC_MBCUIRQ,
+	.irqs = bxtwc_regmap_irqs_bcu,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_bcu),
+	.num_regs = 1,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_adc = {
+	.name = "bxtwc_irq_chip_adc",
+	.status_base = BXTWC_ADCIRQ,
+	.mask_base = BXTWC_MADCIRQ,
+	.irqs = bxtwc_regmap_irqs_adc,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_adc),
+	.num_regs = 1,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_chgr = {
+	.name = "bxtwc_irq_chip_chgr",
+	.status_base = BXTWC_CHGR0IRQ,
+	.mask_base = BXTWC_MCHGR0IRQ,
+	.irqs = bxtwc_regmap_irqs_chgr,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_chgr),
+	.num_regs = 2,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_crit = {
+	.name = "bxtwc_irq_chip_crit",
+	.status_base = BXTWC_CRITIRQ,
+	.mask_base = BXTWC_MCRITIRQ,
+	.irqs = bxtwc_regmap_irqs_crit,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_crit),
+	.num_regs = 1,
+};
+
 static struct resource gpio_resources[] = {
 	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
 };
@@ -357,6 +401,26 @@ static const struct regmap_config bxtwc_regmap_config = {
 	.reg_read = regmap_ipc_byte_reg_read,
 };
 
+static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic,
+				struct regmap_irq_chip_data *pdata,
+				int pirq, int irq_flags,
+				const struct regmap_irq_chip *chip,
+				struct regmap_irq_chip_data **data)
+{
+	int irq;
+
+	irq = regmap_irq_get_virq(pdata, pirq);
+	if (irq < 0) {
+		dev_err(pmic->dev,
+			"Failed to get parent vIRQ(%d) for chip %s, ret:%d\n",
+			pirq, chip->name, irq);
+		return irq;
+	}
+
+	return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags,
+					0, chip, data);
+}
+
 static int bxtwc_probe(struct platform_device *pdev)
 {
 	int ret;
@@ -408,21 +472,65 @@ static int bxtwc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
-				       IRQF_ONESHOT | IRQF_SHARED,
-				       0, &bxtwc_regmap_irq_chip_level2,
-				       &pmic->irq_chip_data_level2);
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_TMU_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_tmu,
+					 &pmic->irq_chip_data_tmu);
 	if (ret) {
-		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
+		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
 		return ret;
 	}
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
-				       IRQF_ONESHOT | IRQF_SHARED,
-				       0, &bxtwc_regmap_irq_chip_tmu,
-				       &pmic->irq_chip_data_tmu);
+	/* Add chained IRQ handler for BCU IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_BCU_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_bcu,
+					 &pmic->irq_chip_data_bcu);
+
+
 	if (ret) {
-		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
+		dev_err(&pdev->dev, "Failed to add BUC IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for ADC IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_ADC_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_adc,
+					 &pmic->irq_chip_data_adc);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add ADC IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for CHGR IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_CHGR_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_chgr,
+					 &pmic->irq_chip_data_chgr);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add CHGR IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for CRIT IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_CRIT_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_crit,
+					 &pmic->irq_chip_data_crit);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add CRIT IRQ chip\n");
 		return ret;
 	}
 
diff --git a/drivers/usb/typec/typec_wcove.c b/drivers/usb/typec/typec_wcove.c
index d5a7b21..00a4bd2 100644
--- a/drivers/usb/typec/typec_wcove.c
+++ b/drivers/usb/typec/typec_wcove.c
@@ -303,7 +303,7 @@ static int wcove_typec_probe(struct platform_device *pdev)
 	wcove->dev = &pdev->dev;
 	wcove->regmap = pmic->regmap;
 
-	ret = regmap_irq_get_virq(pmic->irq_chip_data_level2,
+	ret = regmap_irq_get_virq(pmic->irq_chip_data_chgr,
 				  platform_get_irq(pdev, 0));
 	if (ret < 0)
 		return ret;
diff --git a/include/linux/mfd/intel_soc_pmic.h b/include/linux/mfd/intel_soc_pmic.h
index 956caa0..5aacdb0 100644
--- a/include/linux/mfd/intel_soc_pmic.h
+++ b/include/linux/mfd/intel_soc_pmic.h
@@ -25,8 +25,11 @@ struct intel_soc_pmic {
 	int irq;
 	struct regmap *regmap;
 	struct regmap_irq_chip_data *irq_chip_data;
-	struct regmap_irq_chip_data *irq_chip_data_level2;
 	struct regmap_irq_chip_data *irq_chip_data_tmu;
+	struct regmap_irq_chip_data *irq_chip_data_bcu;
+	struct regmap_irq_chip_data *irq_chip_data_adc;
+	struct regmap_irq_chip_data *irq_chip_data_chgr;
+	struct regmap_irq_chip_data *irq_chip_data_crit;
 	struct device *dev;
 };
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v6 5/6] mfd: intel_soc_pmic_bxtwc: Use chained IRQs for second level IRQ chips
@ 2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-06-05 19:08 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: platform-driver-x86, linux-gpio, linux-usb, linux-kernel,
	linux-pm, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Whishkey cove PMIC has support to mask/unmask interrupts at two levels.
At first level we can mask/unmask interrupt domains like TMU, GPIO, ADC,
CHGR, BCU THERMAL and PWRBTN and at second level, it provides facility
to mask/unmask individual interrupts belong each of this domain. For
example, in case of TMU, at first level we have TMU interrupt domain,
and at second level we have two interrupts, wake alarm, system alarm that
belong to the TMU interrupt domain.

Currently, in this driver all first level IRQs are registered as part of
IRQ chip(bxtwc_regmap_irq_chip). By default, after you register the IRQ
chip from your driver, all IRQs in that chip will masked and can only be
enabled if that IRQ is requested using request_irq() call. This is the
default Linux IRQ behavior model. And whenever a dependent device that
belongs to PMIC requests only the second level IRQ and not explicitly
unmask the first level IRQ, then in essence the second level IRQ will
still be disabled. For example, if TMU device driver request wake_alarm
IRQ and not explicitly unmask TMU level 1 IRQ then according to the default
Linux IRQ model,  wake_alarm IRQ will still be disabled. So the proper
solution to fix this issue is to use the chained IRQ chip concept. We
should chain all the second level chip IRQs to the corresponding first
level IRQ. To do this, we need to create separate IRQ chips for every
group of second level IRQs.

In case of TMU, when adding second level IRQ chip, instead of using PMIC
IRQ we should use the corresponding first level IRQ. So the following
code will change from

ret = regmap_add_irq_chip(pmic->regmap, pmic->irq, ...)

to,

virq = regmap_irq_get_virq(&pmic->irq_chip_data, BXTWC_TMU_LVL1_IRQ);

ret = regmap_add_irq_chip(pmic->regmap, virq, ...)

In case of Whiskey Cove Type-C driver, Since USBC IRQ is moved under
charger level2 IRQ chip. We should use charger IRQ chip(irq_chip_data_chgr)
to get the USBC virtual IRQ number.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 168 ++++++++++++++++++++++++++++++-------
 drivers/usb/typec/typec_wcove.c    |   2 +-
 include/linux/mfd/intel_soc_pmic.h |   5 +-
 3 files changed, 143 insertions(+), 32 deletions(-)

Changes since v1:
 * Rebased on top of dev_* cleanup patch.
 * Fixed style & grammer issues reported by Lee Jones

Changes since v2:
 * Rebased on top of latest release.

Changes since v3:
 * None

Changes since v4:
 * Merged typec driver fix to this patch to prevent branch bisect issue.

Changes since v5:
 * Changed irq->IRQ and pmic -> PMIC.
 * Rearranged tmu related changes to make the patch more readable.
 * Modfied the virq request failure message to include chip name and pirq.

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index feeda6e..15bc052 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -82,20 +82,28 @@ enum bxtwc_irqs {
 	BXTWC_PWRBTN_IRQ,
 };
 
-enum bxtwc_irqs_level2 {
-	/* Level 2 */
+enum bxtwc_irqs_bcu {
 	BXTWC_BCU_IRQ = 0,
-	BXTWC_ADC_IRQ,
-	BXTWC_USBC_IRQ,
+};
+
+enum bxtwc_irqs_adc {
+	BXTWC_ADC_IRQ = 0,
+};
+
+enum bxtwc_irqs_chgr {
+	BXTWC_USBC_IRQ = 0,
 	BXTWC_CHGR0_IRQ,
 	BXTWC_CHGR1_IRQ,
-	BXTWC_CRIT_IRQ,
 };
 
 enum bxtwc_irqs_tmu {
 	BXTWC_TMU_IRQ = 0,
 };
 
+enum bxtwc_irqs_crit {
+	BXTWC_CRIT_IRQ = 0,
+};
+
 static const struct regmap_irq bxtwc_regmap_irqs[] = {
 	REGMAP_IRQ_REG(BXTWC_PWRBTN_LVL1_IRQ, 0, BIT(0)),
 	REGMAP_IRQ_REG(BXTWC_TMU_LVL1_IRQ, 0, BIT(1)),
@@ -108,19 +116,28 @@ static const struct regmap_irq bxtwc_regmap_irqs[] = {
 	REGMAP_IRQ_REG(BXTWC_PWRBTN_IRQ, 1, 0x03),
 };
 
-static const struct regmap_irq bxtwc_regmap_irqs_level2[] = {
+static const struct regmap_irq bxtwc_regmap_irqs_bcu[] = {
 	REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 0, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 1, 0xff),
-	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 2, BIT(5)),
-	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 2, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 3, 0x1f),
-	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 6, 0x03),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_adc[] = {
+	REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 0, 0xff),
+};
+
+static const struct regmap_irq bxtwc_regmap_irqs_chgr[] = {
+	REGMAP_IRQ_REG(BXTWC_USBC_IRQ, 0, BIT(5)),
+	REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 0, 0x1f),
+	REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 1, 0x1f),
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs_tmu[] = {
 	REGMAP_IRQ_REG(BXTWC_TMU_IRQ, 0, 0x06),
 };
 
+static const struct regmap_irq bxtwc_regmap_irqs_crit[] = {
+	REGMAP_IRQ_REG(BXTWC_CRIT_IRQ, 0, 0x03),
+};
+
 static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 	.name = "bxtwc_irq_chip",
 	.status_base = BXTWC_IRQLVL1,
@@ -130,15 +147,6 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip = {
 	.num_regs = 2,
 };
 
-static struct regmap_irq_chip bxtwc_regmap_irq_chip_level2 = {
-	.name = "bxtwc_irq_chip_level2",
-	.status_base = BXTWC_BCUIRQ,
-	.mask_base = BXTWC_MBCUIRQ,
-	.irqs = bxtwc_regmap_irqs_level2,
-	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_level2),
-	.num_regs = 10,
-};
-
 static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 	.name = "bxtwc_irq_chip_tmu",
 	.status_base = BXTWC_TMUIRQ,
@@ -148,6 +156,42 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_tmu = {
 	.num_regs = 1,
 };
 
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_bcu = {
+	.name = "bxtwc_irq_chip_bcu",
+	.status_base = BXTWC_BCUIRQ,
+	.mask_base = BXTWC_MBCUIRQ,
+	.irqs = bxtwc_regmap_irqs_bcu,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_bcu),
+	.num_regs = 1,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_adc = {
+	.name = "bxtwc_irq_chip_adc",
+	.status_base = BXTWC_ADCIRQ,
+	.mask_base = BXTWC_MADCIRQ,
+	.irqs = bxtwc_regmap_irqs_adc,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_adc),
+	.num_regs = 1,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_chgr = {
+	.name = "bxtwc_irq_chip_chgr",
+	.status_base = BXTWC_CHGR0IRQ,
+	.mask_base = BXTWC_MCHGR0IRQ,
+	.irqs = bxtwc_regmap_irqs_chgr,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_chgr),
+	.num_regs = 2,
+};
+
+static struct regmap_irq_chip bxtwc_regmap_irq_chip_crit = {
+	.name = "bxtwc_irq_chip_crit",
+	.status_base = BXTWC_CRITIRQ,
+	.mask_base = BXTWC_MCRITIRQ,
+	.irqs = bxtwc_regmap_irqs_crit,
+	.num_irqs = ARRAY_SIZE(bxtwc_regmap_irqs_crit),
+	.num_regs = 1,
+};
+
 static struct resource gpio_resources[] = {
 	DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
 };
@@ -357,6 +401,26 @@ static const struct regmap_config bxtwc_regmap_config = {
 	.reg_read = regmap_ipc_byte_reg_read,
 };
 
+static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic,
+				struct regmap_irq_chip_data *pdata,
+				int pirq, int irq_flags,
+				const struct regmap_irq_chip *chip,
+				struct regmap_irq_chip_data **data)
+{
+	int irq;
+
+	irq = regmap_irq_get_virq(pdata, pirq);
+	if (irq < 0) {
+		dev_err(pmic->dev,
+			"Failed to get parent vIRQ(%d) for chip %s, ret:%d\n",
+			pirq, chip->name, irq);
+		return irq;
+	}
+
+	return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags,
+					0, chip, data);
+}
+
 static int bxtwc_probe(struct platform_device *pdev)
 {
 	int ret;
@@ -408,21 +472,65 @@ static int bxtwc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
-				       IRQF_ONESHOT | IRQF_SHARED,
-				       0, &bxtwc_regmap_irq_chip_level2,
-				       &pmic->irq_chip_data_level2);
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_TMU_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_tmu,
+					 &pmic->irq_chip_data_tmu);
 	if (ret) {
-		dev_err(&pdev->dev, "Failed to add secondary IRQ chip\n");
+		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
 		return ret;
 	}
 
-	ret = devm_regmap_add_irq_chip(&pdev->dev, pmic->regmap, pmic->irq,
-				       IRQF_ONESHOT | IRQF_SHARED,
-				       0, &bxtwc_regmap_irq_chip_tmu,
-				       &pmic->irq_chip_data_tmu);
+	/* Add chained IRQ handler for BCU IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_BCU_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_bcu,
+					 &pmic->irq_chip_data_bcu);
+
+
 	if (ret) {
-		dev_err(&pdev->dev, "Failed to add TMU IRQ chip\n");
+		dev_err(&pdev->dev, "Failed to add BUC IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for ADC IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_ADC_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_adc,
+					 &pmic->irq_chip_data_adc);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add ADC IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for CHGR IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_CHGR_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_chgr,
+					 &pmic->irq_chip_data_chgr);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add CHGR IRQ chip\n");
+		return ret;
+	}
+
+	/* Add chained IRQ handler for CRIT IRQs */
+	ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
+					 BXTWC_CRIT_LVL1_IRQ,
+					 IRQF_ONESHOT,
+					 &bxtwc_regmap_irq_chip_crit,
+					 &pmic->irq_chip_data_crit);
+
+
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to add CRIT IRQ chip\n");
 		return ret;
 	}
 
diff --git a/drivers/usb/typec/typec_wcove.c b/drivers/usb/typec/typec_wcove.c
index d5a7b21..00a4bd2 100644
--- a/drivers/usb/typec/typec_wcove.c
+++ b/drivers/usb/typec/typec_wcove.c
@@ -303,7 +303,7 @@ static int wcove_typec_probe(struct platform_device *pdev)
 	wcove->dev = &pdev->dev;
 	wcove->regmap = pmic->regmap;
 
-	ret = regmap_irq_get_virq(pmic->irq_chip_data_level2,
+	ret = regmap_irq_get_virq(pmic->irq_chip_data_chgr,
 				  platform_get_irq(pdev, 0));
 	if (ret < 0)
 		return ret;
diff --git a/include/linux/mfd/intel_soc_pmic.h b/include/linux/mfd/intel_soc_pmic.h
index 956caa0..5aacdb0 100644
--- a/include/linux/mfd/intel_soc_pmic.h
+++ b/include/linux/mfd/intel_soc_pmic.h
@@ -25,8 +25,11 @@ struct intel_soc_pmic {
 	int irq;
 	struct regmap *regmap;
 	struct regmap_irq_chip_data *irq_chip_data;
-	struct regmap_irq_chip_data *irq_chip_data_level2;
 	struct regmap_irq_chip_data *irq_chip_data_tmu;
+	struct regmap_irq_chip_data *irq_chip_data_bcu;
+	struct regmap_irq_chip_data *irq_chip_data_adc;
+	struct regmap_irq_chip_data *irq_chip_data_chgr;
+	struct regmap_irq_chip_data *irq_chip_data_crit;
 	struct device *dev;
 };
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v6 6/6] platform/x86: intel_bxtwc_tmu: Remove first level IRQ unmask
  2017-06-05 19:08                             ` sathyanarayanan.kuppuswamy
@ 2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
  -1 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-06-05 19:08 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: platform-driver-x86, linux-gpio, linux-usb, linux-kernel,
	linux-pm, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Currently in WCOVE PMIC MFD driver, all second level IRQ chips
are chained to the respective first level IRQs. So there is no
need for explicitly unmasking the first level IRQ in this
driver. This patches removes this level 1 IRQ unmask support.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/platform/x86/intel_bxtwc_tmu.c | 4 ----
 1 file changed, 4 deletions(-)

Changes since v1:
 * None

Changes since v2:
 * Rebased on top of latest release.

Changes since v3:
 * None

Changes since v4:
 * Changed commit subject from "platform: x86:" "to platform/x86:"

Changes since v5:
 * Changed irq->IRQ, mfd->MFD.

diff --git a/drivers/platform/x86/intel_bxtwc_tmu.c b/drivers/platform/x86/intel_bxtwc_tmu.c
index e202abd..ea865d4 100644
--- a/drivers/platform/x86/intel_bxtwc_tmu.c
+++ b/drivers/platform/x86/intel_bxtwc_tmu.c
@@ -92,10 +92,6 @@ static int bxt_wcove_tmu_probe(struct platform_device *pdev)
 	}
 	wctmu->irq = virq;
 
-	/* Enable TMU interrupts */
-	regmap_update_bits(wctmu->regmap, BXTWC_MIRQLVL1,
-				  BXTWC_MIRQLVL1_MTMU, 0);
-
 	/* Unmask TMU second level Wake & System alarm */
 	regmap_update_bits(wctmu->regmap, BXTWC_MTMUIRQ_REG,
 				  BXTWC_TMU_ALRM_MASK, 0);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* [PATCH v6 6/6] platform/x86: intel_bxtwc_tmu: Remove first level IRQ unmask
@ 2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
  0 siblings, 0 replies; 132+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2017-06-05 19:08 UTC (permalink / raw)
  To: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, lee.jones, andy
  Cc: platform-driver-x86, linux-gpio, linux-usb, linux-kernel,
	linux-pm, sathyaosid, Kuppuswamy Sathyanarayanan

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Currently in WCOVE PMIC MFD driver, all second level IRQ chips
are chained to the respective first level IRQs. So there is no
need for explicitly unmasking the first level IRQ in this
driver. This patches removes this level 1 IRQ unmask support.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/platform/x86/intel_bxtwc_tmu.c | 4 ----
 1 file changed, 4 deletions(-)

Changes since v1:
 * None

Changes since v2:
 * Rebased on top of latest release.

Changes since v3:
 * None

Changes since v4:
 * Changed commit subject from "platform: x86:" "to platform/x86:"

Changes since v5:
 * Changed irq->IRQ, mfd->MFD.

diff --git a/drivers/platform/x86/intel_bxtwc_tmu.c b/drivers/platform/x86/intel_bxtwc_tmu.c
index e202abd..ea865d4 100644
--- a/drivers/platform/x86/intel_bxtwc_tmu.c
+++ b/drivers/platform/x86/intel_bxtwc_tmu.c
@@ -92,10 +92,6 @@ static int bxt_wcove_tmu_probe(struct platform_device *pdev)
 	}
 	wctmu->irq = virq;
 
-	/* Enable TMU interrupts */
-	regmap_update_bits(wctmu->regmap, BXTWC_MIRQLVL1,
-				  BXTWC_MIRQLVL1_MTMU, 0);
-
 	/* Unmask TMU second level Wake & System alarm */
 	regmap_update_bits(wctmu->regmap, BXTWC_MTMUIRQ_REG,
 				  BXTWC_TMU_ALRM_MASK, 0);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 132+ messages in thread

* Re: [PATCH v6 5/6] mfd: intel_soc_pmic_bxtwc: Use chained IRQs for second level IRQ chips
  2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
  (?)
@ 2017-06-06  9:29                               ` Heikki Krogerus
  -1 siblings, 0 replies; 132+ messages in thread
From: Heikki Krogerus @ 2017-06-06  9:29 UTC (permalink / raw)
  To: sathyanarayanan.kuppuswamy
  Cc: gnurou, gregkh, linus.walleij, edubezval, dvhart, rui.zhang,
	lee.jones, andy, platform-driver-x86, linux-gpio, linux-usb,
	linux-kernel, linux-pm, sathyaosid

On Mon, Jun 05, 2017 at 12:08:05PM -0700, sathyanarayanan.kuppuswamy@linux.intel.com wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> 
> Whishkey cove PMIC has support to mask/unmask interrupts at two levels.
> At first level we can mask/unmask interrupt domains like TMU, GPIO, ADC,
> CHGR, BCU THERMAL and PWRBTN and at second level, it provides facility
> to mask/unmask individual interrupts belong each of this domain. For
> example, in case of TMU, at first level we have TMU interrupt domain,
> and at second level we have two interrupts, wake alarm, system alarm that
> belong to the TMU interrupt domain.
> 
> Currently, in this driver all first level IRQs are registered as part of
> IRQ chip(bxtwc_regmap_irq_chip). By default, after you register the IRQ
> chip from your driver, all IRQs in that chip will masked and can only be
> enabled if that IRQ is requested using request_irq() call. This is the
> default Linux IRQ behavior model. And whenever a dependent device that
> belongs to PMIC requests only the second level IRQ and not explicitly
> unmask the first level IRQ, then in essence the second level IRQ will
> still be disabled. For example, if TMU device driver request wake_alarm
> IRQ and not explicitly unmask TMU level 1 IRQ then according to the default
> Linux IRQ model,  wake_alarm IRQ will still be disabled. So the proper
> solution to fix this issue is to use the chained IRQ chip concept. We
> should chain all the second level chip IRQs to the corresponding first
> level IRQ. To do this, we need to create separate IRQ chips for every
> group of second level IRQs.
> 
> In case of TMU, when adding second level IRQ chip, instead of using PMIC
> IRQ we should use the corresponding first level IRQ. So the following
> code will change from
> 
> ret = regmap_add_irq_chip(pmic->regmap, pmic->irq, ...)
> 
> to,
> 
> virq = regmap_irq_get_virq(&pmic->irq_chip_data, BXTWC_TMU_LVL1_IRQ);
> 
> ret = regmap_add_irq_chip(pmic->regmap, virq, ...)
> 
> In case of Whiskey Cove Type-C driver, Since USBC IRQ is moved under
> charger level2 IRQ chip. We should use charger IRQ chip(irq_chip_data_chgr)
> to get the USBC virtual IRQ number.
> 
> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>

For the typec_wcove.c part:

Revieved-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>


Thanks,

-- 
heikki

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v6 0/6] mfd: intel_soc_pmic_bxtwc: Add chained IRQ support
  2017-06-05 19:08                             ` sathyanarayanan.kuppuswamy
@ 2017-06-06  9:36                               ` Andy Shevchenko
  -1 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-06  9:36 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan
  Cc: Alexandre Courbot, Krogerus, Heikki, Greg Kroah-Hartman,
	Linus Walleij, edubezval, dvhart, Zhang, Rui, Lee Jones,
	Andy Shevchenko, Platform Driver, linux-gpio, USB, linux-kernel,
	linux-pm, Sathyanarayanan Kuppuswamy Natarajan

On Mon, Jun 5, 2017 at 10:08 PM,
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> Following patch set adds chained IRQ support to WCOVE PMIC driver.

Assuming it has been tested,

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

to the patches which do not have it yet.

> Changes since v3:
>  * Added fix for typec wcove driver.
>
> Changes since v4:
>  * Squashed following two commits, to keep the patch set bisectable.
>    usb: typec: typec_wcove: Use charger irq chip to get usbc virq
>    mfd: intel_soc_pmic_bxtwc: use chained irqs for second level irq chips
>
> Changes since v5:
> * Changed irq->IRQ, pmic->PMIC in all commit messages.
> * Squashed following two thermal driver related commits.
>   mfd: intel_soc_pmic_bxtwc: Remove thermal second level irqs
>   thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
> * Squashed following two GPIO driver related commits.
>   mfd: intel_soc_pmic_bxtwc: Remove second level irq for gpio device
>   gpio: gpio-wcove: Use first level PMIC GPIO irq
>
> Kuppuswamy Sathyanarayanan (6):
>   mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
>   mfd: intel_soc_pmic_bxtwc: Remove thermal second level IRQs
>   mfd: intel_soc_pmic_bxtwc: Remove second level IRQ for gpio device
>   mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
>   mfd: intel_soc_pmic_bxtwc: Use chained IRQs for second level IRQ chips
>   platform/x86: intel_bxtwc_tmu: Remove first level IRQ unmask
>
>  drivers/gpio/gpio-wcove.c                |  14 +-
>  drivers/mfd/intel_soc_pmic_bxtwc.c       | 232 +++++++++++++++++++++----------
>  drivers/platform/x86/intel_bxtwc_tmu.c   |   4 -
>  drivers/thermal/intel_bxt_pmic_thermal.c |   2 +-
>  drivers/usb/typec/typec_wcove.c          |   2 +-
>  include/linux/mfd/intel_soc_pmic.h       |   5 +-
>  6 files changed, 175 insertions(+), 84 deletions(-)
>
> --
> 2.7.4
>



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [PATCH v6 0/6] mfd: intel_soc_pmic_bxtwc: Add chained IRQ support
@ 2017-06-06  9:36                               ` Andy Shevchenko
  0 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-06  9:36 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan
  Cc: Alexandre Courbot, Krogerus, Heikki, Greg Kroah-Hartman,
	Linus Walleij, edubezval, dvhart, Zhang, Rui, Lee Jones,
	Andy Shevchenko, Platform Driver, linux-gpio, USB, linux-kernel,
	linux-pm, Sathyanarayanan Kuppuswamy Natarajan

On Mon, Jun 5, 2017 at 10:08 PM,
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> Following patch set adds chained IRQ support to WCOVE PMIC driver.

Assuming it has been tested,

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

to the patches which do not have it yet.

> Changes since v3:
>  * Added fix for typec wcove driver.
>
> Changes since v4:
>  * Squashed following two commits, to keep the patch set bisectable.
>    usb: typec: typec_wcove: Use charger irq chip to get usbc virq
>    mfd: intel_soc_pmic_bxtwc: use chained irqs for second level irq chips
>
> Changes since v5:
> * Changed irq->IRQ, pmic->PMIC in all commit messages.
> * Squashed following two thermal driver related commits.
>   mfd: intel_soc_pmic_bxtwc: Remove thermal second level irqs
>   thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
> * Squashed following two GPIO driver related commits.
>   mfd: intel_soc_pmic_bxtwc: Remove second level irq for gpio device
>   gpio: gpio-wcove: Use first level PMIC GPIO irq
>
> Kuppuswamy Sathyanarayanan (6):
>   mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
>   mfd: intel_soc_pmic_bxtwc: Remove thermal second level IRQs
>   mfd: intel_soc_pmic_bxtwc: Remove second level IRQ for gpio device
>   mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
>   mfd: intel_soc_pmic_bxtwc: Use chained IRQs for second level IRQ chips
>   platform/x86: intel_bxtwc_tmu: Remove first level IRQ unmask
>
>  drivers/gpio/gpio-wcove.c                |  14 +-
>  drivers/mfd/intel_soc_pmic_bxtwc.c       | 232 +++++++++++++++++++++----------
>  drivers/platform/x86/intel_bxtwc_tmu.c   |   4 -
>  drivers/thermal/intel_bxt_pmic_thermal.c |   2 +-
>  drivers/usb/typec/typec_wcove.c          |   2 +-
>  include/linux/mfd/intel_soc_pmic.h       |   5 +-
>  6 files changed, 175 insertions(+), 84 deletions(-)
>
> --
> 2.7.4
>



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* [GIT PULL] Immutable branch between MFD and X86 due for the v4.13 merge window
  2017-06-05 19:08                             ` sathyanarayanan.kuppuswamy
                                               ` (7 preceding siblings ...)
  (?)
@ 2017-06-19 14:48                             ` Lee Jones
  2017-06-19 15:08                                 ` Andy Shevchenko
  -1 siblings, 1 reply; 132+ messages in thread
From: Lee Jones @ 2017-06-19 14:48 UTC (permalink / raw)
  To: sathyanarayanan.kuppuswamy
  Cc: gnurou, heikki.krogerus, gregkh, linus.walleij, edubezval,
	dvhart, rui.zhang, andy, platform-driver-x86, linux-gpio,
	linux-usb, linux-kernel, linux-pm, sathyaosid

Enjoy!

The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:

  Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-x86-v4.13

for you to fetch changes up to 94d68594a7b4fd2eec457f22110de644e1c4ee57:

  platform/x86: intel_bxtwc_tmu: Remove first level IRQ unmask (2017-06-19 15:45:30 +0100)

----------------------------------------------------------------
Immutable branch between MFD and X86 due for the v4.13 merge window

----------------------------------------------------------------
Kuppuswamy Sathyanarayanan (6):
      mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
      mfd: intel_soc_pmic_bxtwc: Remove thermal second level IRQs
      mfd: intel_soc_pmic_bxtwc: Remove second level IRQ for gpio device
      mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
      mfd: intel_soc_pmic_bxtwc: Use chained IRQs for second level IRQ chips
      platform/x86: intel_bxtwc_tmu: Remove first level IRQ unmask

 drivers/gpio/gpio-wcove.c                |  14 +-
 drivers/mfd/intel_soc_pmic_bxtwc.c       | 232 +++++++++++++++++++++----------
 drivers/platform/x86/intel_bxtwc_tmu.c   |   4 -
 drivers/thermal/intel_bxt_pmic_thermal.c |   2 +-
 drivers/usb/typec/typec_wcove.c          |   2 +-
 include/linux/mfd/intel_soc_pmic.h       |   5 +-
 6 files changed, 175 insertions(+), 84 deletions(-)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD and X86 due for the v4.13 merge window
  2017-06-19 14:48                             ` [GIT PULL] Immutable branch between MFD and X86 due for the v4.13 merge window Lee Jones
@ 2017-06-19 15:08                                 ` Andy Shevchenko
  0 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-19 15:08 UTC (permalink / raw)
  To: Lee Jones
  Cc: Kuppuswamy Sathyanarayanan, Alexandre Courbot, Krogerus, Heikki,
	Greg Kroah-Hartman, Linus Walleij, edubezval, dvhart, Zhang, Rui,
	Andy Shevchenko, Platform Driver, linux-gpio, USB, linux-kernel,
	linux-pm, Sathyanarayanan Kuppuswamy Natarajan

On Mon, Jun 19, 2017 at 5:48 PM, Lee Jones <lee.jones@linaro.org> wrote:
> Enjoy!

Thanks!

I suppose this one kbuild bot doesn't complain about :-)

Darren, do we need it or we can survive until v4.13-rc1?

>
> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
>
>   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
>
> are available in the git repository at:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-x86-v4.13
>
> for you to fetch changes up to 94d68594a7b4fd2eec457f22110de644e1c4ee57:
>
>   platform/x86: intel_bxtwc_tmu: Remove first level IRQ unmask (2017-06-19 15:45:30 +0100)
>
> ----------------------------------------------------------------
> Immutable branch between MFD and X86 due for the v4.13 merge window
>
> ----------------------------------------------------------------
> Kuppuswamy Sathyanarayanan (6):
>       mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
>       mfd: intel_soc_pmic_bxtwc: Remove thermal second level IRQs
>       mfd: intel_soc_pmic_bxtwc: Remove second level IRQ for gpio device
>       mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
>       mfd: intel_soc_pmic_bxtwc: Use chained IRQs for second level IRQ chips
>       platform/x86: intel_bxtwc_tmu: Remove first level IRQ unmask
>
>  drivers/gpio/gpio-wcove.c                |  14 +-
>  drivers/mfd/intel_soc_pmic_bxtwc.c       | 232 +++++++++++++++++++++----------
>  drivers/platform/x86/intel_bxtwc_tmu.c   |   4 -
>  drivers/thermal/intel_bxt_pmic_thermal.c |   2 +-
>  drivers/usb/typec/typec_wcove.c          |   2 +-
>  include/linux/mfd/intel_soc_pmic.h       |   5 +-
>  6 files changed, 175 insertions(+), 84 deletions(-)
>
> --
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD and X86 due for the v4.13 merge window
@ 2017-06-19 15:08                                 ` Andy Shevchenko
  0 siblings, 0 replies; 132+ messages in thread
From: Andy Shevchenko @ 2017-06-19 15:08 UTC (permalink / raw)
  To: Lee Jones
  Cc: Kuppuswamy Sathyanarayanan, Alexandre Courbot, Krogerus, Heikki,
	Greg Kroah-Hartman, Linus Walleij, edubezval, dvhart, Zhang, Rui,
	Andy Shevchenko, Platform Driver, linux-gpio, USB, linux-kernel,
	linux-pm, Sathyanarayanan Kuppuswamy Natarajan

On Mon, Jun 19, 2017 at 5:48 PM, Lee Jones <lee.jones@linaro.org> wrote:
> Enjoy!

Thanks!

I suppose this one kbuild bot doesn't complain about :-)

Darren, do we need it or we can survive until v4.13-rc1?

>
> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
>
>   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
>
> are available in the git repository at:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-x86-v4.13
>
> for you to fetch changes up to 94d68594a7b4fd2eec457f22110de644e1c4ee57:
>
>   platform/x86: intel_bxtwc_tmu: Remove first level IRQ unmask (2017-06-19 15:45:30 +0100)
>
> ----------------------------------------------------------------
> Immutable branch between MFD and X86 due for the v4.13 merge window
>
> ----------------------------------------------------------------
> Kuppuswamy Sathyanarayanan (6):
>       mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
>       mfd: intel_soc_pmic_bxtwc: Remove thermal second level IRQs
>       mfd: intel_soc_pmic_bxtwc: Remove second level IRQ for gpio device
>       mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
>       mfd: intel_soc_pmic_bxtwc: Use chained IRQs for second level IRQ chips
>       platform/x86: intel_bxtwc_tmu: Remove first level IRQ unmask
>
>  drivers/gpio/gpio-wcove.c                |  14 +-
>  drivers/mfd/intel_soc_pmic_bxtwc.c       | 232 +++++++++++++++++++++----------
>  drivers/platform/x86/intel_bxtwc_tmu.c   |   4 -
>  drivers/thermal/intel_bxt_pmic_thermal.c |   2 +-
>  drivers/usb/typec/typec_wcove.c          |   2 +-
>  include/linux/mfd/intel_soc_pmic.h       |   5 +-
>  6 files changed, 175 insertions(+), 84 deletions(-)
>
> --
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD and X86 due for the v4.13 merge window
  2017-06-19 15:08                                 ` Andy Shevchenko
@ 2017-06-19 19:54                                   ` Darren Hart
  -1 siblings, 0 replies; 132+ messages in thread
From: Darren Hart @ 2017-06-19 19:54 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Lee Jones, Kuppuswamy Sathyanarayanan, Alexandre Courbot,
	Krogerus, Heikki, Greg Kroah-Hartman, Linus Walleij, edubezval,
	Zhang, Rui, Andy Shevchenko, Platform Driver, linux-gpio, USB,
	linux-kernel, linux-pm, Sathyanarayanan Kuppuswamy Natarajan

On Mon, Jun 19, 2017 at 06:08:27PM +0300, Andy Shevchenko wrote:
> On Mon, Jun 19, 2017 at 5:48 PM, Lee Jones <lee.jones@linaro.org> wrote:
> > Enjoy!
> 
> Thanks!
> 
> I suppose this one kbuild bot doesn't complain about :-)
> 
> Darren, do we need it or we can survive until v4.13-rc1?

I suggest merging it to a local branch for safe keeping and if we see
conflicts in subsequent patches, we can apply it. I doubt it will be a problem.

-- 
Darren Hart
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 132+ messages in thread

* Re: [GIT PULL] Immutable branch between MFD and X86 due for the v4.13 merge window
@ 2017-06-19 19:54                                   ` Darren Hart
  0 siblings, 0 replies; 132+ messages in thread
From: Darren Hart @ 2017-06-19 19:54 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Lee Jones, Kuppuswamy Sathyanarayanan, Alexandre Courbot,
	Krogerus, Heikki, Greg Kroah-Hartman, Linus Walleij, edubezval,
	Zhang, Rui, Andy Shevchenko, Platform Driver, linux-gpio, USB,
	linux-kernel, linux-pm, Sathyanarayanan Kuppuswamy Natarajan

On Mon, Jun 19, 2017 at 06:08:27PM +0300, Andy Shevchenko wrote:
> On Mon, Jun 19, 2017 at 5:48 PM, Lee Jones <lee.jones@linaro.org> wrote:
> > Enjoy!
> 
> Thanks!
> 
> I suppose this one kbuild bot doesn't complain about :-)
> 
> Darren, do we need it or we can survive until v4.13-rc1?

I suggest merging it to a local branch for safe keeping and if we see
conflicts in subsequent patches, we can apply it. I doubt it will be a problem.

-- 
Darren Hart
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 132+ messages in thread

end of thread, other threads:[~2017-06-19 19:54 UTC | newest]

Thread overview: 132+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-14 23:25 [PATCH v2 1/8] mfd: intel_soc_pmic_bxtwc: fix TMU interrupt index sathyanarayanan.kuppuswamy
2017-04-14 23:25 ` sathyanarayanan.kuppuswamy
2017-04-14 23:25 ` [PATCH v2 2/8] mfd: intel_soc_pmic_bxtwc: remove thermal second level irqs sathyanarayanan.kuppuswamy
2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
2017-04-14 23:25 ` [PATCH v2 3/8] thermal: intel_bxt_pmic_thermal: use first level PMIC thermal irq sathyanarayanan.kuppuswamy
2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
2017-05-22 10:17   ` Lee Jones
2017-05-22 19:08     ` sathyanarayanan kuppuswamy
2017-05-22 19:08       ` sathyanarayanan kuppuswamy
2017-05-23  6:24   ` Zhang Rui
2017-05-23  7:26     ` Lee Jones
2017-05-23 17:29       ` [PATCH v3 1/8] mfd: intel_soc_pmic_bxtwc: fix TMU interrupt index sathyanarayanan.kuppuswamy
2017-05-23 17:29         ` sathyanarayanan.kuppuswamy
2017-05-23 17:30         ` [PATCH v3 2/8] mfd: intel_soc_pmic_bxtwc: remove thermal second level irqs sathyanarayanan.kuppuswamy
2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
2017-05-23 17:30         ` [PATCH v3 3/8] thermal: intel_bxt_pmic_thermal: use first level PMIC thermal irq sathyanarayanan.kuppuswamy
2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
2017-05-23 17:30         ` [PATCH v3 4/8] mfd: intel_soc_pmic_bxtwc: remove second level irq for gpio device sathyanarayanan.kuppuswamy
2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
2017-05-23 17:30         ` [PATCH v3 5/8] gpio: gpio-wcove: use first level PMIC GPIO irq sathyanarayanan.kuppuswamy
2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
2017-05-23 17:30         ` [PATCH v3 6/8] mfd: intel_soc_pmic_bxtwc: utilize devm_* functions in driver probe sathyanarayanan.kuppuswamy
2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
2017-05-23 17:30         ` [PATCH v3 7/8] mfd: intel_soc_pmic_bxtwc: use chained irqs for second level irq chips sathyanarayanan.kuppuswamy
2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
2017-05-23 17:30         ` [PATCH v3 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask sathyanarayanan.kuppuswamy
2017-05-23 17:30           ` sathyanarayanan.kuppuswamy
2017-05-30  8:53         ` [GIT PULL] Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window Lee Jones
2017-05-31  3:38           ` Stephen Rothwell
2017-05-31  4:27             ` Sathyanarayanan Kuppuswamy Natarajan
2017-05-31  4:27               ` Sathyanarayanan Kuppuswamy Natarajan
2017-05-31  4:29             ` Sathyanarayanan Kuppuswamy Natarajan
2017-05-31  4:29               ` Sathyanarayanan Kuppuswamy Natarajan
2017-05-31  6:57               ` Lee Jones
2017-05-31  6:57                 ` Lee Jones
2017-05-31 22:33                 ` sathyanarayanan kuppuswamy
2017-05-31 22:33                   ` sathyanarayanan kuppuswamy
2017-06-03 17:01                   ` Darren Hart
2017-06-03 17:01                     ` Darren Hart
2017-05-31  6:50             ` Lee Jones
2017-05-31  7:02           ` Lee Jones
2017-05-31 22:37             ` [PATCH v5 0/8] mfd: intel_soc_pmic_bxtwc: Add chained IRQ support sathyanarayanan.kuppuswamy
2017-05-31 22:37               ` sathyanarayanan.kuppuswamy
2017-05-31 22:37               ` [PATCH v5 1/8] mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index sathyanarayanan.kuppuswamy
2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
2017-05-31 22:37               ` [PATCH v5 2/8] mfd: intel_soc_pmic_bxtwc: Remove thermal second level irqs sathyanarayanan.kuppuswamy
2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
2017-05-31 22:37               ` [PATCH v5 3/8] thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq sathyanarayanan.kuppuswamy
2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
2017-06-03 13:00                 ` Andy Shevchenko
2017-06-03 13:00                   ` Andy Shevchenko
2017-06-03 17:28                   ` Sathyanarayanan Kuppuswamy Natarajan
2017-06-03 17:28                     ` Sathyanarayanan Kuppuswamy Natarajan
2017-06-03 17:32                     ` Andy Shevchenko
2017-06-03 17:32                       ` Andy Shevchenko
2017-06-03 17:53                       ` Sathyanarayanan Kuppuswamy Natarajan
2017-06-03 17:53                         ` Sathyanarayanan Kuppuswamy Natarajan
2017-06-03 18:18                         ` Andy Shevchenko
2017-06-03 18:18                           ` Andy Shevchenko
2017-06-05 19:08                           ` [PATCH v6 0/6] mfd: intel_soc_pmic_bxtwc: Add chained IRQ support sathyanarayanan.kuppuswamy
2017-06-05 19:08                             ` sathyanarayanan.kuppuswamy
2017-06-05 19:08                             ` [PATCH v6 1/6] mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index sathyanarayanan.kuppuswamy
2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
2017-06-05 19:08                             ` [PATCH v6 2/6] mfd: intel_soc_pmic_bxtwc: Remove thermal second level IRQs sathyanarayanan.kuppuswamy
2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
2017-06-05 19:08                             ` [PATCH v6 3/6] mfd: intel_soc_pmic_bxtwc: Remove second level IRQ for gpio device sathyanarayanan.kuppuswamy
2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
2017-06-05 19:08                             ` [PATCH v6 4/6] mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe sathyanarayanan.kuppuswamy
2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
2017-06-05 19:08                             ` [PATCH v6 5/6] mfd: intel_soc_pmic_bxtwc: Use chained IRQs for second level IRQ chips sathyanarayanan.kuppuswamy
2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
2017-06-06  9:29                               ` Heikki Krogerus
2017-06-05 19:08                             ` [PATCH v6 6/6] platform/x86: intel_bxtwc_tmu: Remove first level IRQ unmask sathyanarayanan.kuppuswamy
2017-06-05 19:08                               ` sathyanarayanan.kuppuswamy
2017-06-06  9:36                             ` [PATCH v6 0/6] mfd: intel_soc_pmic_bxtwc: Add chained IRQ support Andy Shevchenko
2017-06-06  9:36                               ` Andy Shevchenko
2017-06-19 14:48                             ` [GIT PULL] Immutable branch between MFD and X86 due for the v4.13 merge window Lee Jones
2017-06-19 15:08                               ` Andy Shevchenko
2017-06-19 15:08                                 ` Andy Shevchenko
2017-06-19 19:54                                 ` Darren Hart
2017-06-19 19:54                                   ` Darren Hart
2017-05-31 22:37               ` [PATCH v5 4/8] mfd: intel_soc_pmic_bxtwc: Remove second level irq for gpio device sathyanarayanan.kuppuswamy
2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
2017-05-31 22:37               ` [PATCH v5 5/8] gpio: gpio-wcove: Use first level PMIC GPIO irq sathyanarayanan.kuppuswamy
2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
2017-06-03 13:01                 ` Andy Shevchenko
2017-06-03 13:01                   ` Andy Shevchenko
2017-05-31 22:37               ` [PATCH v5 7/8] mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips sathyanarayanan.kuppuswamy
2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
2017-06-03 13:26                 ` Andy Shevchenko
2017-06-03 13:26                   ` Andy Shevchenko
2017-05-31 22:37               ` [PATCH v5 8/8] platform/x86: intel_bxtwc_tmu: Remove first level irq unmask sathyanarayanan.kuppuswamy
2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
2017-06-03 13:27               ` [PATCH v5 0/8] mfd: intel_soc_pmic_bxtwc: Add chained IRQ support Andy Shevchenko
2017-06-03 13:27                 ` Andy Shevchenko
     [not found]             ` <cover.1496266871.git.sathyanarayanan.kuppuswamy-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-05-31 22:37               ` [PATCH v5 6/8] mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe sathyanarayanan.kuppuswamy-VuQAYsv1563Yd54FQh9/CA
2017-05-31 22:37                 ` sathyanarayanan.kuppuswamy
2017-06-03 13:03                 ` Andy Shevchenko
2017-06-03 13:03                   ` Andy Shevchenko
2017-04-14 23:25 ` [PATCH v2 4/8] mfd: intel_soc_pmic_bxtwc: remove second level irq for gpio device sathyanarayanan.kuppuswamy
2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
2017-04-14 23:25 ` [PATCH v2 5/8] gpio: gpio-wcove: use first level PMIC GPIO irq sathyanarayanan.kuppuswamy
2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
2017-04-24 13:17   ` Linus Walleij
2017-04-24 13:17     ` Linus Walleij
2017-04-26 15:40     ` Andy Shevchenko
2017-04-26 15:40       ` Andy Shevchenko
2017-04-14 23:25 ` [PATCH v2 6/8] mfd: intel_soc_pmic_bxtwc: utilize devm_* functions in driver probe sathyanarayanan.kuppuswamy
2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
2017-04-24 12:03   ` Lee Jones
2017-04-14 23:25 ` [PATCH v2 7/8] mfd: intel_soc_pmic_bxtwc: use chained irqs for second level irq chips sathyanarayanan.kuppuswamy
2017-04-14 23:25   ` sathyanarayanan.kuppuswamy
2017-04-24 12:04   ` Lee Jones
2017-04-14 23:26 ` [PATCH v2 8/8] platform: x86: intel_bxtwc_tmu: remove first level irq unmask sathyanarayanan.kuppuswamy
2017-04-14 23:26   ` sathyanarayanan.kuppuswamy
2017-04-21 22:00   ` Darren Hart
2017-04-21 22:34     ` sathyanarayanan kuppuswamy
2017-04-21 22:34       ` sathyanarayanan kuppuswamy
2017-04-22  2:52       ` Andy Shevchenko
2017-04-22  2:52         ` Andy Shevchenko
2017-04-24  9:24         ` Lee Jones
2017-04-24  9:24           ` Lee Jones
2017-04-24  9:44           ` Andy Shevchenko
2017-04-24  9:44             ` Andy Shevchenko
2017-04-24 12:24             ` Lee Jones
2017-04-24 12:24               ` Lee Jones
2017-04-26 15:44               ` Andy Shevchenko
2017-04-26 15:44                 ` Andy Shevchenko
2017-04-24  9:26     ` Lee Jones
2017-05-30  8:54 ` [PATCH v2 1/8] mfd: intel_soc_pmic_bxtwc: fix TMU interrupt index Lee Jones
2017-05-30 18:00   ` sathyanarayanan kuppuswamy
2017-05-30 18:00     ` sathyanarayanan kuppuswamy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.