Skip to content

Commit

Permalink
regulator: Add AXP717 boost support
Browse files Browse the repository at this point in the history
Merge series from Andre Przywara <[email protected]>:

This is remainder of the AXP717 fix series, containing support for the
boost regulator. This is meant to increase the battery voltage to the 5
volts required to provide the USB VBUS power.
It's the usual trinity of DT bindings patch (1/3), the MFD part
describing the PMIC registers (2/3) and the final patch to model the
regulator (3/3).
Compared to v2, this drops the merged patches, and just retains the
boost related parts. It also changes the internal name of the register
to AXP717_MODULE_EN_CONTROL_2, since there is another control register
we will need later for battery support.
  • Loading branch information
broonie committed Sep 7, 2024
2 parents 401d078 + 22dfe2e commit 8651db0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ properties:
Defines the work frequency of DC-DC in kHz.
patternProperties:
"^(([a-f])?ldo[0-9]|dcdc[0-7a-e]|ldo(_|-)io(0|1)|(dc1)?sw|rtc(_|-)ldo|cpusldo|drivevbus|dc5ldo)$":
"^(([a-f])?ldo[0-9]|dcdc[0-7a-e]|ldo(_|-)io(0|1)|(dc1)?sw|rtc(_|-)ldo|cpusldo|drivevbus|dc5ldo|boost)$":
$ref: /schemas/regulator/regulator.yaml#
type: object
unevaluatedProperties: false
Expand Down
2 changes: 2 additions & 0 deletions drivers/mfd/axp20x.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ static const struct regmap_access_table axp313a_volatile_table = {
};

static const struct regmap_range axp717_writeable_ranges[] = {
regmap_reg_range(AXP717_MODULE_EN_CONTROL_2, AXP717_MODULE_EN_CONTROL_2),
regmap_reg_range(AXP717_BOOST_CONTROL, AXP717_BOOST_CONTROL),
regmap_reg_range(AXP717_IRQ0_EN, AXP717_IRQ4_EN),
regmap_reg_range(AXP717_IRQ0_STATE, AXP717_IRQ4_STATE),
regmap_reg_range(AXP717_DCDC_OUTPUT_CONTROL, AXP717_CPUSLDO_CONTROL),
Expand Down
4 changes: 4 additions & 0 deletions drivers/regulator/axp20x-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
#define AXP717_DCDC3_NUM_VOLTAGES 103
#define AXP717_DCDC_V_OUT_MASK GENMASK(6, 0)
#define AXP717_LDO_V_OUT_MASK GENMASK(4, 0)
#define AXP717_BOOST_V_OUT_MASK GENMASK(7, 4)

#define AXP803_PWR_OUT_DCDC1_MASK BIT_MASK(0)
#define AXP803_PWR_OUT_DCDC2_MASK BIT_MASK(1)
Expand Down Expand Up @@ -834,6 +835,9 @@ static const struct regulator_desc axp717_regulators[] = {
AXP_DESC(AXP717, CPUSLDO, "cpusldo", "vin1", 500, 1400, 50,
AXP717_CPUSLDO_CONTROL, AXP717_LDO_V_OUT_MASK,
AXP717_LDO1_OUTPUT_CONTROL, BIT(4)),
AXP_DESC(AXP717, BOOST, "boost", "vin1", 4550, 5510, 64,
AXP717_BOOST_CONTROL, AXP717_BOOST_V_OUT_MASK,
AXP717_MODULE_EN_CONTROL_2, BIT(4)),
};

/* DCDC ranges shared with AXP813 */
Expand Down
3 changes: 3 additions & 0 deletions include/linux/mfd/axp20x.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ enum axp20x_variants {
#define AXP313A_IRQ_STATE 0x21

#define AXP717_ON_INDICATE 0x00
#define AXP717_MODULE_EN_CONTROL_2 0x19
#define AXP717_BOOST_CONTROL 0x1e
#define AXP717_IRQ0_EN 0x40
#define AXP717_IRQ1_EN 0x41
#define AXP717_IRQ2_EN 0x42
Expand Down Expand Up @@ -484,6 +486,7 @@ enum {
AXP717_CLDO3,
AXP717_CLDO4,
AXP717_CPUSLDO,
AXP717_BOOST,
AXP717_REG_ID_MAX,
};

Expand Down

0 comments on commit 8651db0

Please sign in to comment.