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: axp20x: Add support for AXP323

The X-Powers AXP323 is a very close sibling of the AXP313A. The only
difference seems to be the ability to dual-phase the first two DC/DC
converter, which adds another register.

Add the required boilerplate to introduce a new PMIC to the AXP MFD
driver. Where possible, this just maps into the existing structs defined
for the AXP313A, only deviating where needed.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20241007001408.27249-5-andre.przywara@arm.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Andre Przywara and committed by
Lee Jones
35fec94a e37ec321

+29
+1
drivers/mfd/axp20x-i2c.c
··· 65 65 { .compatible = "x-powers,axp221", .data = (void *)AXP221_ID }, 66 66 { .compatible = "x-powers,axp223", .data = (void *)AXP223_ID }, 67 67 { .compatible = "x-powers,axp313a", .data = (void *)AXP313A_ID }, 68 + { .compatible = "x-powers,axp323", .data = (void *)AXP323_ID }, 68 69 { .compatible = "x-powers,axp717", .data = (void *)AXP717_ID }, 69 70 { .compatible = "x-powers,axp803", .data = (void *)AXP803_ID }, 70 71 { .compatible = "x-powers,axp806", .data = (void *)AXP806_ID },
+26
drivers/mfd/axp20x.c
··· 42 42 [AXP223_ID] = "AXP223", 43 43 [AXP288_ID] = "AXP288", 44 44 [AXP313A_ID] = "AXP313a", 45 + [AXP323_ID] = "AXP323", 45 46 [AXP717_ID] = "AXP717", 46 47 [AXP803_ID] = "AXP803", 47 48 [AXP806_ID] = "AXP806", ··· 194 193 regmap_reg_range(AXP313A_ON_INDICATE, AXP313A_IRQ_STATE), 195 194 }; 196 195 196 + static const struct regmap_range axp323_writeable_ranges[] = { 197 + regmap_reg_range(AXP313A_ON_INDICATE, AXP323_DCDC_MODE_CTRL2), 198 + }; 199 + 197 200 static const struct regmap_range axp313a_volatile_ranges[] = { 198 201 regmap_reg_range(AXP313A_SHUTDOWN_CTRL, AXP313A_SHUTDOWN_CTRL), 199 202 regmap_reg_range(AXP313A_IRQ_STATE, AXP313A_IRQ_STATE), ··· 206 201 static const struct regmap_access_table axp313a_writeable_table = { 207 202 .yes_ranges = axp313a_writeable_ranges, 208 203 .n_yes_ranges = ARRAY_SIZE(axp313a_writeable_ranges), 204 + }; 205 + 206 + static const struct regmap_access_table axp323_writeable_table = { 207 + .yes_ranges = axp323_writeable_ranges, 208 + .n_yes_ranges = ARRAY_SIZE(axp323_writeable_ranges), 209 209 }; 210 210 211 211 static const struct regmap_access_table axp313a_volatile_table = { ··· 440 430 .wr_table = &axp313a_writeable_table, 441 431 .volatile_table = &axp313a_volatile_table, 442 432 .max_register = AXP313A_IRQ_STATE, 433 + .cache_type = REGCACHE_MAPLE, 434 + }; 435 + 436 + static const struct regmap_config axp323_regmap_config = { 437 + .reg_bits = 8, 438 + .val_bits = 8, 439 + .wr_table = &axp323_writeable_table, 440 + .volatile_table = &axp313a_volatile_table, 441 + .max_register = AXP323_DCDC_MODE_CTRL2, 443 442 .cache_type = REGCACHE_MAPLE, 444 443 }; 445 444 ··· 1240 1221 unsigned int shutdown_reg; 1241 1222 1242 1223 switch (axp20x->variant) { 1224 + case AXP323_ID: 1243 1225 case AXP313A_ID: 1244 1226 shutdown_reg = AXP313A_SHUTDOWN_CTRL; 1245 1227 break; ··· 1307 1287 axp20x->nr_cells = ARRAY_SIZE(axp313a_cells); 1308 1288 axp20x->cells = axp313a_cells; 1309 1289 axp20x->regmap_cfg = &axp313a_regmap_config; 1290 + axp20x->regmap_irq_chip = &axp313a_regmap_irq_chip; 1291 + break; 1292 + case AXP323_ID: 1293 + axp20x->nr_cells = ARRAY_SIZE(axp313a_cells); 1294 + axp20x->cells = axp313a_cells; 1295 + axp20x->regmap_cfg = &axp323_regmap_config; 1310 1296 axp20x->regmap_irq_chip = &axp313a_regmap_irq_chip; 1311 1297 break; 1312 1298 case AXP717_ID:
+2
include/linux/mfd/axp20x.h
··· 19 19 AXP223_ID, 20 20 AXP288_ID, 21 21 AXP313A_ID, 22 + AXP323_ID, 22 23 AXP717_ID, 23 24 AXP803_ID, 24 25 AXP806_ID, ··· 114 113 #define AXP313A_SHUTDOWN_CTRL 0x1a 115 114 #define AXP313A_IRQ_EN 0x20 116 115 #define AXP313A_IRQ_STATE 0x21 116 + #define AXP323_DCDC_MODE_CTRL2 0x22 117 117 118 118 #define AXP717_ON_INDICATE 0x00 119 119 #define AXP717_PMU_STATUS_2 0x01