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

Configure Feed

Select the types of activity you want to include in your feed.

mfd: bd96801: Support ROHM BD96805

The ROHM BD96805 is from the software perspective almost identical to
the ROHM BD96801. 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/8680097dc083f191bea56d3ac7c6fe5c005644ec.1744090658.git.mazziesaccount@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Matti Vaittinen and committed by
Lee Jones
6a309b48 55606b9b

+23
+22
drivers/mfd/rohm-bd96801.c
··· 220 220 [WDG_CELL] = { .name = "bd96801-wdt", }, 221 221 [REGULATOR_CELL] = { .name = "bd96802-regulator", }, 222 222 }; 223 + static struct mfd_cell bd96805_cells[] = { 224 + [WDG_CELL] = { .name = "bd96801-wdt", }, 225 + [REGULATOR_CELL] = { .name = "bd96805-regulator", }, 226 + }; 223 227 224 228 static const struct regmap_range bd96801_volatile_ranges[] = { 225 229 /* Status registers */ ··· 603 599 .unlock_val = BD96801_UNLOCK, 604 600 }; 605 601 602 + static const struct bd968xx bd96805_data = { 603 + .errb_irqs = bd96801_reg_errb_irqs, 604 + .intb_irqs = bd96801_reg_intb_irqs, 605 + .num_errb_irqs = ARRAY_SIZE(bd96801_reg_errb_irqs), 606 + .num_intb_irqs = ARRAY_SIZE(bd96801_reg_intb_irqs), 607 + .errb_irq_chip = &bd96801_irq_chip_errb, 608 + .intb_irq_chip = &bd96801_irq_chip_intb, 609 + .regmap_config = &bd96801_regmap_config, 610 + .cells = bd96805_cells, 611 + .num_cells = ARRAY_SIZE(bd96805_cells), 612 + .unlock_reg = BD96801_LOCK_REG, 613 + .unlock_val = BD96801_UNLOCK, 614 + }; 615 + 606 616 static int bd96801_i2c_probe(struct i2c_client *i2c) 607 617 { 608 618 struct regmap_irq_chip_data *intb_irq_data, *errb_irq_data; ··· 638 620 break; 639 621 case ROHM_CHIP_TYPE_BD96802: 640 622 ddata = &bd96802_data; 623 + break; 624 + case ROHM_CHIP_TYPE_BD96805: 625 + ddata = &bd96805_data; 641 626 break; 642 627 default: 643 628 dev_err(&i2c->dev, "Unknown IC\n"); ··· 738 717 static const struct of_device_id bd96801_of_match[] = { 739 718 { .compatible = "rohm,bd96801", .data = (void *)ROHM_CHIP_TYPE_BD96801 }, 740 719 { .compatible = "rohm,bd96802", .data = (void *)ROHM_CHIP_TYPE_BD96802 }, 720 + { .compatible = "rohm,bd96805", .data = (void *)ROHM_CHIP_TYPE_BD96805 }, 741 721 { } 742 722 }; 743 723 MODULE_DEVICE_TABLE(of, bd96801_of_match);
+1
include/linux/mfd/rohm-generic.h
··· 18 18 ROHM_CHIP_TYPE_BD71847, 19 19 ROHM_CHIP_TYPE_BD96801, 20 20 ROHM_CHIP_TYPE_BD96802, 21 + ROHM_CHIP_TYPE_BD96805, 21 22 ROHM_CHIP_TYPE_AMOUNT 22 23 }; 23 24