Skip to content

Commit bb6642d

Browse files
andy-shevgregkh
authored andcommitted
mfd: intel_soc_pmic_bxtwc: Use IRQ domain for PMIC devices
[ Upstream commit 0350d78 ] While design wise the idea of converting the driver to use the hierarchy of the IRQ chips is correct, the implementation has (inherited) flaws. This was unveiled when platform_get_irq() had started WARN() on IRQ 0 that is supposed to be a Linux IRQ number (also known as vIRQ). Rework the driver to respect IRQ domain when creating each MFD device separately, as the domain is not the same for all of them. Fixes: 5712904 ("mfd: intel_soc_pmic_bxtwc: Use chained IRQs for second level IRQ chips") Tested-by: Zhang Ning <zhangn1985@outlook.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20241005193029.1929139-4-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent da498e0 commit bb6642d

1 file changed

Lines changed: 30 additions & 24 deletions

File tree

drivers/mfd/intel_soc_pmic_bxtwc.c

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -230,21 +230,11 @@ static const struct resource tmu_resources[] = {
230230
};
231231

232232
static struct mfd_cell bxt_wc_dev[] = {
233-
{
234-
.name = "bxt_wcove_gpadc",
235-
.num_resources = ARRAY_SIZE(adc_resources),
236-
.resources = adc_resources,
237-
},
238233
{
239234
.name = "bxt_wcove_thermal",
240235
.num_resources = ARRAY_SIZE(thermal_resources),
241236
.resources = thermal_resources,
242237
},
243-
{
244-
.name = "bxt_wcove_bcu",
245-
.num_resources = ARRAY_SIZE(bcu_resources),
246-
.resources = bcu_resources,
247-
},
248238
{
249239
.name = "bxt_wcove_gpio",
250240
.num_resources = ARRAY_SIZE(gpio_resources),
@@ -263,6 +253,22 @@ static const struct mfd_cell bxt_wc_tmu_dev[] = {
263253
},
264254
};
265255

256+
static const struct mfd_cell bxt_wc_bcu_dev[] = {
257+
{
258+
.name = "bxt_wcove_bcu",
259+
.num_resources = ARRAY_SIZE(bcu_resources),
260+
.resources = bcu_resources,
261+
},
262+
};
263+
264+
static const struct mfd_cell bxt_wc_adc_dev[] = {
265+
{
266+
.name = "bxt_wcove_gpadc",
267+
.num_resources = ARRAY_SIZE(adc_resources),
268+
.resources = adc_resources,
269+
},
270+
};
271+
266272
static struct mfd_cell bxt_wc_chgr_dev[] = {
267273
{
268274
.name = "bxt_wcove_usbc",
@@ -504,23 +510,23 @@ static int bxtwc_probe(struct platform_device *pdev)
504510
if (ret)
505511
return dev_err_probe(dev, ret, "Failed to add PWRBTN IRQ chip\n");
506512

507-
/* Add chained IRQ handler for BCU IRQs */
508-
ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
509-
BXTWC_BCU_LVL1_IRQ,
510-
IRQF_ONESHOT,
511-
&bxtwc_regmap_irq_chip_bcu,
512-
&pmic->irq_chip_data_bcu);
513+
ret = bxtwc_add_chained_devices(pmic, bxt_wc_bcu_dev, ARRAY_SIZE(bxt_wc_bcu_dev),
514+
pmic->irq_chip_data,
515+
BXTWC_BCU_LVL1_IRQ,
516+
IRQF_ONESHOT,
517+
&bxtwc_regmap_irq_chip_bcu,
518+
&pmic->irq_chip_data_bcu);
513519
if (ret)
514-
return dev_err_probe(dev, ret, "Failed to add BUC IRQ chip\n");
520+
return ret;
515521

516-
/* Add chained IRQ handler for ADC IRQs */
517-
ret = bxtwc_add_chained_irq_chip(pmic, pmic->irq_chip_data,
518-
BXTWC_ADC_LVL1_IRQ,
519-
IRQF_ONESHOT,
520-
&bxtwc_regmap_irq_chip_adc,
521-
&pmic->irq_chip_data_adc);
522+
ret = bxtwc_add_chained_devices(pmic, bxt_wc_adc_dev, ARRAY_SIZE(bxt_wc_adc_dev),
523+
pmic->irq_chip_data,
524+
BXTWC_ADC_LVL1_IRQ,
525+
IRQF_ONESHOT,
526+
&bxtwc_regmap_irq_chip_adc,
527+
&pmic->irq_chip_data_adc);
522528
if (ret)
523-
return dev_err_probe(dev, ret, "Failed to add ADC IRQ chip\n");
529+
return ret;
524530

525531
ret = bxtwc_add_chained_devices(pmic, bxt_wc_chgr_dev, ARRAY_SIZE(bxt_wc_chgr_dev),
526532
pmic->irq_chip_data,

0 commit comments

Comments
 (0)