Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: bd96801: Support ROHM BD96806

The ROHM BD96806 is from the software perspective almost identical to
the ROHM BD96802. The main difference is different voltage tuning
ranges. Add support differentiating these PMICs based on the compatible,
and invoking the regulator driver with correct IC type.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/ccc95ae33613648fdcba08915777d945412ac5c4.1744090658.git.mazziesaccount@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Matti Vaittinen and committed by
Lee Jones
fecc18a9 7baf818d

+24
+23
drivers/mfd/rohm-bd96801.c
··· 225 225 [REGULATOR_CELL] = { .name = "bd96805-regulator", }, 226 226 }; 227 227 228 + static struct mfd_cell bd96806_cells[] = { 229 + [WDG_CELL] = { .name = "bd96806-wdt", }, 230 + [REGULATOR_CELL] = { .name = "bd96806-regulator", }, 231 + }; 232 + 228 233 static const struct regmap_range bd96801_volatile_ranges[] = { 229 234 /* Status registers */ 230 235 regmap_reg_range(BD96801_REG_WD_FEED, BD96801_REG_WD_FAILCOUNT), ··· 622 617 .unlock_val = BD96801_UNLOCK, 623 618 }; 624 619 620 + static struct bd968xx bd96806_data = { 621 + .errb_irqs = bd96802_reg_errb_irqs, 622 + .intb_irqs = bd96802_reg_intb_irqs, 623 + .num_errb_irqs = ARRAY_SIZE(bd96802_reg_errb_irqs), 624 + .num_intb_irqs = ARRAY_SIZE(bd96802_reg_intb_irqs), 625 + .errb_irq_chip = &bd96802_irq_chip_errb, 626 + .intb_irq_chip = &bd96802_irq_chip_intb, 627 + .regmap_config = &bd96802_regmap_config, 628 + .cells = bd96806_cells, 629 + .num_cells = ARRAY_SIZE(bd96806_cells), 630 + .unlock_reg = BD96801_LOCK_REG, 631 + .unlock_val = BD96801_UNLOCK, 632 + }; 633 + 625 634 static int bd96801_i2c_probe(struct i2c_client *i2c) 626 635 { 627 636 struct regmap_irq_chip_data *intb_irq_data, *errb_irq_data; ··· 660 641 break; 661 642 case ROHM_CHIP_TYPE_BD96805: 662 643 ddata = &bd96805_data; 644 + break; 645 + case ROHM_CHIP_TYPE_BD96806: 646 + ddata = &bd96806_data; 663 647 break; 664 648 default: 665 649 dev_err(&i2c->dev, "Unknown IC\n"); ··· 761 739 { .compatible = "rohm,bd96801", .data = (void *)ROHM_CHIP_TYPE_BD96801 }, 762 740 { .compatible = "rohm,bd96802", .data = (void *)ROHM_CHIP_TYPE_BD96802 }, 763 741 { .compatible = "rohm,bd96805", .data = (void *)ROHM_CHIP_TYPE_BD96805 }, 742 + { .compatible = "rohm,bd96806", .data = (void *)ROHM_CHIP_TYPE_BD96806 }, 764 743 { } 765 744 }; 766 745 MODULE_DEVICE_TABLE(of, bd96801_of_match);
+1
include/linux/mfd/rohm-generic.h
··· 19 19 ROHM_CHIP_TYPE_BD96801, 20 20 ROHM_CHIP_TYPE_BD96802, 21 21 ROHM_CHIP_TYPE_BD96805, 22 + ROHM_CHIP_TYPE_BD96806, 22 23 ROHM_CHIP_TYPE_AMOUNT 23 24 }; 24 25