Commit 604efe50 authored by Mark Brown's avatar Mark Brown

regulator: Merge axp20x changes

There will be at least one incremental change on top of some MFD
overlapping device additions for this driver so merge now.

Merge tag 'ib-mfd-regulator-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into regulator-6.10
parents 54b8d095 d2ac3df7
...@@ -83,6 +83,7 @@ allOf: ...@@ -83,6 +83,7 @@ allOf:
enum: enum:
- x-powers,axp313a - x-powers,axp313a
- x-powers,axp15060 - x-powers,axp15060
- x-powers,axp717
then: then:
properties: properties:
...@@ -99,6 +100,7 @@ properties: ...@@ -99,6 +100,7 @@ properties:
- x-powers,axp221 - x-powers,axp221
- x-powers,axp223 - x-powers,axp223
- x-powers,axp313a - x-powers,axp313a
- x-powers,axp717
- x-powers,axp803 - x-powers,axp803
- x-powers,axp806 - x-powers,axp806
- x-powers,axp809 - x-powers,axp809
......
...@@ -65,6 +65,7 @@ static const struct of_device_id axp20x_i2c_of_match[] = { ...@@ -65,6 +65,7 @@ static const struct of_device_id axp20x_i2c_of_match[] = {
{ .compatible = "x-powers,axp221", .data = (void *)AXP221_ID }, { .compatible = "x-powers,axp221", .data = (void *)AXP221_ID },
{ .compatible = "x-powers,axp223", .data = (void *)AXP223_ID }, { .compatible = "x-powers,axp223", .data = (void *)AXP223_ID },
{ .compatible = "x-powers,axp313a", .data = (void *)AXP313A_ID }, { .compatible = "x-powers,axp313a", .data = (void *)AXP313A_ID },
{ .compatible = "x-powers,axp717", .data = (void *)AXP717_ID },
{ .compatible = "x-powers,axp803", .data = (void *)AXP803_ID }, { .compatible = "x-powers,axp803", .data = (void *)AXP803_ID },
{ .compatible = "x-powers,axp806", .data = (void *)AXP806_ID }, { .compatible = "x-powers,axp806", .data = (void *)AXP806_ID },
{ .compatible = "x-powers,axp15060", .data = (void *)AXP15060_ID }, { .compatible = "x-powers,axp15060", .data = (void *)AXP15060_ID },
...@@ -81,6 +82,7 @@ static const struct i2c_device_id axp20x_i2c_id[] = { ...@@ -81,6 +82,7 @@ static const struct i2c_device_id axp20x_i2c_id[] = {
{ "axp221", 0 }, { "axp221", 0 },
{ "axp223", 0 }, { "axp223", 0 },
{ "axp313a", 0 }, { "axp313a", 0 },
{ "axp717", 0 },
{ "axp803", 0 }, { "axp803", 0 },
{ "axp806", 0 }, { "axp806", 0 },
{ "axp15060", 0 }, { "axp15060", 0 },
......
...@@ -58,6 +58,7 @@ static void axp20x_rsb_remove(struct sunxi_rsb_device *rdev) ...@@ -58,6 +58,7 @@ static void axp20x_rsb_remove(struct sunxi_rsb_device *rdev)
static const struct of_device_id axp20x_rsb_of_match[] = { static const struct of_device_id axp20x_rsb_of_match[] = {
{ .compatible = "x-powers,axp223", .data = (void *)AXP223_ID }, { .compatible = "x-powers,axp223", .data = (void *)AXP223_ID },
{ .compatible = "x-powers,axp717", .data = (void *)AXP717_ID },
{ .compatible = "x-powers,axp803", .data = (void *)AXP803_ID }, { .compatible = "x-powers,axp803", .data = (void *)AXP803_ID },
{ .compatible = "x-powers,axp806", .data = (void *)AXP806_ID }, { .compatible = "x-powers,axp806", .data = (void *)AXP806_ID },
{ .compatible = "x-powers,axp809", .data = (void *)AXP809_ID }, { .compatible = "x-powers,axp809", .data = (void *)AXP809_ID },
......
...@@ -42,6 +42,7 @@ static const char * const axp20x_model_names[] = { ...@@ -42,6 +42,7 @@ static const char * const axp20x_model_names[] = {
"AXP223", "AXP223",
"AXP288", "AXP288",
"AXP313a", "AXP313a",
"AXP717",
"AXP803", "AXP803",
"AXP806", "AXP806",
"AXP809", "AXP809",
...@@ -207,6 +208,25 @@ static const struct regmap_access_table axp313a_volatile_table = { ...@@ -207,6 +208,25 @@ static const struct regmap_access_table axp313a_volatile_table = {
.n_yes_ranges = ARRAY_SIZE(axp313a_volatile_ranges), .n_yes_ranges = ARRAY_SIZE(axp313a_volatile_ranges),
}; };
static const struct regmap_range axp717_writeable_ranges[] = {
regmap_reg_range(AXP717_IRQ0_EN, AXP717_IRQ4_EN),
regmap_reg_range(AXP717_DCDC_OUTPUT_CONTROL, AXP717_CPUSLDO_CONTROL),
};
static const struct regmap_range axp717_volatile_ranges[] = {
regmap_reg_range(AXP717_IRQ0_STATE, AXP717_IRQ4_STATE),
};
static const struct regmap_access_table axp717_writeable_table = {
.yes_ranges = axp717_writeable_ranges,
.n_yes_ranges = ARRAY_SIZE(axp717_writeable_ranges),
};
static const struct regmap_access_table axp717_volatile_table = {
.yes_ranges = axp717_volatile_ranges,
.n_yes_ranges = ARRAY_SIZE(axp717_volatile_ranges),
};
static const struct regmap_range axp806_volatile_ranges[] = { static const struct regmap_range axp806_volatile_ranges[] = {
regmap_reg_range(AXP20X_IRQ1_STATE, AXP20X_IRQ2_STATE), regmap_reg_range(AXP20X_IRQ1_STATE, AXP20X_IRQ2_STATE),
}; };
...@@ -317,6 +337,11 @@ static const struct resource axp313a_pek_resources[] = { ...@@ -317,6 +337,11 @@ static const struct resource axp313a_pek_resources[] = {
DEFINE_RES_IRQ_NAMED(AXP313A_IRQ_PEK_FAL_EDGE, "PEK_DBF"), DEFINE_RES_IRQ_NAMED(AXP313A_IRQ_PEK_FAL_EDGE, "PEK_DBF"),
}; };
static const struct resource axp717_pek_resources[] = {
DEFINE_RES_IRQ_NAMED(AXP717_IRQ_PEK_RIS_EDGE, "PEK_DBR"),
DEFINE_RES_IRQ_NAMED(AXP717_IRQ_PEK_FAL_EDGE, "PEK_DBF"),
};
static const struct resource axp803_pek_resources[] = { static const struct resource axp803_pek_resources[] = {
DEFINE_RES_IRQ_NAMED(AXP803_IRQ_PEK_RIS_EDGE, "PEK_DBR"), DEFINE_RES_IRQ_NAMED(AXP803_IRQ_PEK_RIS_EDGE, "PEK_DBR"),
DEFINE_RES_IRQ_NAMED(AXP803_IRQ_PEK_FAL_EDGE, "PEK_DBF"), DEFINE_RES_IRQ_NAMED(AXP803_IRQ_PEK_FAL_EDGE, "PEK_DBF"),
...@@ -391,6 +416,15 @@ static const struct regmap_config axp313a_regmap_config = { ...@@ -391,6 +416,15 @@ static const struct regmap_config axp313a_regmap_config = {
.cache_type = REGCACHE_MAPLE, .cache_type = REGCACHE_MAPLE,
}; };
static const struct regmap_config axp717_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.wr_table = &axp717_writeable_table,
.volatile_table = &axp717_volatile_table,
.max_register = AXP717_CPUSLDO_CONTROL,
.cache_type = REGCACHE_RBTREE,
};
static const struct regmap_config axp806_regmap_config = { static const struct regmap_config axp806_regmap_config = {
.reg_bits = 8, .reg_bits = 8,
.val_bits = 8, .val_bits = 8,
...@@ -589,6 +623,40 @@ static const struct regmap_irq axp313a_regmap_irqs[] = { ...@@ -589,6 +623,40 @@ static const struct regmap_irq axp313a_regmap_irqs[] = {
INIT_REGMAP_IRQ(AXP313A, DIE_TEMP_HIGH, 0, 0), INIT_REGMAP_IRQ(AXP313A, DIE_TEMP_HIGH, 0, 0),
}; };
static const struct regmap_irq axp717_regmap_irqs[] = {
INIT_REGMAP_IRQ(AXP717, SOC_DROP_LVL2, 0, 7),
INIT_REGMAP_IRQ(AXP717, SOC_DROP_LVL1, 0, 6),
INIT_REGMAP_IRQ(AXP717, GAUGE_NEW_SOC, 0, 4),
INIT_REGMAP_IRQ(AXP717, BOOST_OVER_V, 0, 2),
INIT_REGMAP_IRQ(AXP717, VBUS_OVER_V, 0, 1),
INIT_REGMAP_IRQ(AXP717, VBUS_FAULT, 0, 0),
INIT_REGMAP_IRQ(AXP717, VBUS_PLUGIN, 1, 7),
INIT_REGMAP_IRQ(AXP717, VBUS_REMOVAL, 1, 6),
INIT_REGMAP_IRQ(AXP717, BATT_PLUGIN, 1, 5),
INIT_REGMAP_IRQ(AXP717, BATT_REMOVAL, 1, 4),
INIT_REGMAP_IRQ(AXP717, PEK_SHORT, 1, 3),
INIT_REGMAP_IRQ(AXP717, PEK_LONG, 1, 2),
INIT_REGMAP_IRQ(AXP717, PEK_FAL_EDGE, 1, 1),
INIT_REGMAP_IRQ(AXP717, PEK_RIS_EDGE, 1, 0),
INIT_REGMAP_IRQ(AXP717, WDOG_EXPIRE, 2, 7),
INIT_REGMAP_IRQ(AXP717, LDO_OVER_CURR, 2, 6),
INIT_REGMAP_IRQ(AXP717, BATT_OVER_CURR, 2, 5),
INIT_REGMAP_IRQ(AXP717, CHARG_DONE, 2, 4),
INIT_REGMAP_IRQ(AXP717, CHARG, 2, 3),
INIT_REGMAP_IRQ(AXP717, DIE_TEMP_HIGH, 2, 2),
INIT_REGMAP_IRQ(AXP717, CHARG_TIMER, 2, 1),
INIT_REGMAP_IRQ(AXP717, BATT_OVER_V, 2, 0),
INIT_REGMAP_IRQ(AXP717, BC_USB_DONE, 3, 7),
INIT_REGMAP_IRQ(AXP717, BC_USB_CHNG, 3, 6),
INIT_REGMAP_IRQ(AXP717, BATT_QUIT_TEMP_HIGH, 3, 4),
INIT_REGMAP_IRQ(AXP717, BATT_CHG_TEMP_HIGH, 3, 3),
INIT_REGMAP_IRQ(AXP717, BATT_CHG_TEMP_LOW, 3, 2),
INIT_REGMAP_IRQ(AXP717, BATT_ACT_TEMP_HIGH, 3, 1),
INIT_REGMAP_IRQ(AXP717, BATT_ACT_TEMP_LOW, 3, 0),
INIT_REGMAP_IRQ(AXP717, TYPEC_REMOVE, 4, 6),
INIT_REGMAP_IRQ(AXP717, TYPEC_PLUGIN, 4, 5),
};
static const struct regmap_irq axp803_regmap_irqs[] = { static const struct regmap_irq axp803_regmap_irqs[] = {
INIT_REGMAP_IRQ(AXP803, ACIN_OVER_V, 0, 7), INIT_REGMAP_IRQ(AXP803, ACIN_OVER_V, 0, 7),
INIT_REGMAP_IRQ(AXP803, ACIN_PLUGIN, 0, 6), INIT_REGMAP_IRQ(AXP803, ACIN_PLUGIN, 0, 6),
...@@ -776,6 +844,17 @@ static const struct regmap_irq_chip axp313a_regmap_irq_chip = { ...@@ -776,6 +844,17 @@ static const struct regmap_irq_chip axp313a_regmap_irq_chip = {
.num_regs = 1, .num_regs = 1,
}; };
static const struct regmap_irq_chip axp717_regmap_irq_chip = {
.name = "axp717_irq_chip",
.status_base = AXP717_IRQ0_STATE,
.ack_base = AXP717_IRQ0_STATE,
.unmask_base = AXP717_IRQ0_EN,
.init_ack_masked = true,
.irqs = axp717_regmap_irqs,
.num_irqs = ARRAY_SIZE(axp717_regmap_irqs),
.num_regs = 5,
};
static const struct regmap_irq_chip axp803_regmap_irq_chip = { static const struct regmap_irq_chip axp803_regmap_irq_chip = {
.name = "axp803", .name = "axp803",
.status_base = AXP20X_IRQ1_STATE, .status_base = AXP20X_IRQ1_STATE,
...@@ -941,6 +1020,11 @@ static struct mfd_cell axp313a_cells[] = { ...@@ -941,6 +1020,11 @@ static struct mfd_cell axp313a_cells[] = {
MFD_CELL_RES("axp313a-pek", axp313a_pek_resources), MFD_CELL_RES("axp313a-pek", axp313a_pek_resources),
}; };
static struct mfd_cell axp717_cells[] = {
MFD_CELL_NAME("axp20x-regulator"),
MFD_CELL_RES("axp20x-pek", axp717_pek_resources),
};
static const struct resource axp288_adc_resources[] = { static const struct resource axp288_adc_resources[] = {
DEFINE_RES_IRQ_NAMED(AXP288_IRQ_GPADC, "GPADC"), DEFINE_RES_IRQ_NAMED(AXP288_IRQ_GPADC, "GPADC"),
}; };
...@@ -1181,6 +1265,12 @@ int axp20x_match_device(struct axp20x_dev *axp20x) ...@@ -1181,6 +1265,12 @@ int axp20x_match_device(struct axp20x_dev *axp20x)
axp20x->regmap_cfg = &axp313a_regmap_config; axp20x->regmap_cfg = &axp313a_regmap_config;
axp20x->regmap_irq_chip = &axp313a_regmap_irq_chip; axp20x->regmap_irq_chip = &axp313a_regmap_irq_chip;
break; break;
case AXP717_ID:
axp20x->nr_cells = ARRAY_SIZE(axp717_cells);
axp20x->cells = axp717_cells;
axp20x->regmap_cfg = &axp717_regmap_config;
axp20x->regmap_irq_chip = &axp717_regmap_irq_chip;
break;
case AXP803_ID: case AXP803_ID:
axp20x->nr_cells = ARRAY_SIZE(axp803_cells); axp20x->nr_cells = ARRAY_SIZE(axp803_cells);
axp20x->cells = axp803_cells; axp20x->cells = axp803_cells;
......
...@@ -138,6 +138,12 @@ ...@@ -138,6 +138,12 @@
#define AXP313A_DCDC_V_OUT_MASK GENMASK(6, 0) #define AXP313A_DCDC_V_OUT_MASK GENMASK(6, 0)
#define AXP313A_LDO_V_OUT_MASK GENMASK(4, 0) #define AXP313A_LDO_V_OUT_MASK GENMASK(4, 0)
#define AXP717_DCDC1_NUM_VOLTAGES 88
#define AXP717_DCDC2_NUM_VOLTAGES 107
#define AXP717_DCDC3_NUM_VOLTAGES 104
#define AXP717_DCDC_V_OUT_MASK GENMASK(6, 0)
#define AXP717_LDO_V_OUT_MASK GENMASK(4, 0)
#define AXP803_PWR_OUT_DCDC1_MASK BIT_MASK(0) #define AXP803_PWR_OUT_DCDC1_MASK BIT_MASK(0)
#define AXP803_PWR_OUT_DCDC2_MASK BIT_MASK(1) #define AXP803_PWR_OUT_DCDC2_MASK BIT_MASK(1)
#define AXP803_PWR_OUT_DCDC3_MASK BIT_MASK(2) #define AXP803_PWR_OUT_DCDC3_MASK BIT_MASK(2)
...@@ -733,25 +739,98 @@ static const struct linear_range axp313a_dcdc3_ranges[] = { ...@@ -733,25 +739,98 @@ static const struct linear_range axp313a_dcdc3_ranges[] = {
static const struct regulator_desc axp313a_regulators[] = { static const struct regulator_desc axp313a_regulators[] = {
AXP_DESC_RANGES(AXP313A, DCDC1, "dcdc1", "vin1", AXP_DESC_RANGES(AXP313A, DCDC1, "dcdc1", "vin1",
axp313a_dcdc1_ranges, AXP313A_DCDC1_NUM_VOLTAGES, axp313a_dcdc1_ranges, AXP313A_DCDC1_NUM_VOLTAGES,
AXP313A_DCDC1_CONRTOL, AXP313A_DCDC_V_OUT_MASK, AXP313A_DCDC1_CONTROL, AXP313A_DCDC_V_OUT_MASK,
AXP313A_OUTPUT_CONTROL, BIT(0)), AXP313A_OUTPUT_CONTROL, BIT(0)),
AXP_DESC_RANGES(AXP313A, DCDC2, "dcdc2", "vin2", AXP_DESC_RANGES(AXP313A, DCDC2, "dcdc2", "vin2",
axp313a_dcdc2_ranges, AXP313A_DCDC23_NUM_VOLTAGES, axp313a_dcdc2_ranges, AXP313A_DCDC23_NUM_VOLTAGES,
AXP313A_DCDC2_CONRTOL, AXP313A_DCDC_V_OUT_MASK, AXP313A_DCDC2_CONTROL, AXP313A_DCDC_V_OUT_MASK,
AXP313A_OUTPUT_CONTROL, BIT(1)), AXP313A_OUTPUT_CONTROL, BIT(1)),
AXP_DESC_RANGES(AXP313A, DCDC3, "dcdc3", "vin3", AXP_DESC_RANGES(AXP313A, DCDC3, "dcdc3", "vin3",
axp313a_dcdc3_ranges, AXP313A_DCDC23_NUM_VOLTAGES, axp313a_dcdc3_ranges, AXP313A_DCDC23_NUM_VOLTAGES,
AXP313A_DCDC3_CONRTOL, AXP313A_DCDC_V_OUT_MASK, AXP313A_DCDC3_CONTROL, AXP313A_DCDC_V_OUT_MASK,
AXP313A_OUTPUT_CONTROL, BIT(2)), AXP313A_OUTPUT_CONTROL, BIT(2)),
AXP_DESC(AXP313A, ALDO1, "aldo1", "vin1", 500, 3500, 100, AXP_DESC(AXP313A, ALDO1, "aldo1", "vin1", 500, 3500, 100,
AXP313A_ALDO1_CONRTOL, AXP313A_LDO_V_OUT_MASK, AXP313A_ALDO1_CONTROL, AXP313A_LDO_V_OUT_MASK,
AXP313A_OUTPUT_CONTROL, BIT(3)), AXP313A_OUTPUT_CONTROL, BIT(3)),
AXP_DESC(AXP313A, DLDO1, "dldo1", "vin1", 500, 3500, 100, AXP_DESC(AXP313A, DLDO1, "dldo1", "vin1", 500, 3500, 100,
AXP313A_DLDO1_CONRTOL, AXP313A_LDO_V_OUT_MASK, AXP313A_DLDO1_CONTROL, AXP313A_LDO_V_OUT_MASK,
AXP313A_OUTPUT_CONTROL, BIT(4)), AXP313A_OUTPUT_CONTROL, BIT(4)),
AXP_DESC_FIXED(AXP313A, RTC_LDO, "rtc-ldo", "vin1", 1800), AXP_DESC_FIXED(AXP313A, RTC_LDO, "rtc-ldo", "vin1", 1800),
}; };
static const struct linear_range axp717_dcdc1_ranges[] = {
REGULATOR_LINEAR_RANGE(500000, 0, 70, 10000),
REGULATOR_LINEAR_RANGE(1220000, 71, 87, 20000),
};
static const struct linear_range axp717_dcdc2_ranges[] = {
REGULATOR_LINEAR_RANGE(500000, 0, 70, 10000),
REGULATOR_LINEAR_RANGE(1220000, 71, 87, 20000),
REGULATOR_LINEAR_RANGE(1600000, 88, 107, 100000),
};
static const struct linear_range axp717_dcdc3_ranges[] = {
REGULATOR_LINEAR_RANGE(500000, 0, 70, 10000),
REGULATOR_LINEAR_RANGE(1220000, 71, 102, 20000),
};
static const struct regulator_desc axp717_regulators[] = {
AXP_DESC_RANGES(AXP717, DCDC1, "dcdc1", "vin1",
axp717_dcdc1_ranges, AXP717_DCDC1_NUM_VOLTAGES,
AXP717_DCDC1_CONTROL, AXP717_DCDC_V_OUT_MASK,
AXP717_DCDC_OUTPUT_CONTROL, BIT(0)),
AXP_DESC_RANGES(AXP717, DCDC2, "dcdc2", "vin2",
axp717_dcdc2_ranges, AXP717_DCDC2_NUM_VOLTAGES,
AXP717_DCDC2_CONTROL, AXP717_DCDC_V_OUT_MASK,
AXP717_DCDC_OUTPUT_CONTROL, BIT(1)),
AXP_DESC_RANGES(AXP717, DCDC3, "dcdc3", "vin3",
axp717_dcdc3_ranges, AXP717_DCDC3_NUM_VOLTAGES,
AXP717_DCDC3_CONTROL, AXP717_DCDC_V_OUT_MASK,
AXP717_DCDC_OUTPUT_CONTROL, BIT(2)),
AXP_DESC(AXP717, DCDC4, "dcdc4", "vin4", 1000, 3700, 100,
AXP717_DCDC4_CONTROL, AXP717_DCDC_V_OUT_MASK,
AXP717_DCDC_OUTPUT_CONTROL, BIT(3)),
AXP_DESC(AXP717, ALDO1, "aldo1", "vin1", 500, 3500, 100,
AXP717_ALDO1_CONTROL, AXP717_LDO_V_OUT_MASK,
AXP717_LDO0_OUTPUT_CONTROL, BIT(0)),
AXP_DESC(AXP717, ALDO2, "aldo2", "vin1", 500, 3500, 100,
AXP717_ALDO2_CONTROL, AXP717_LDO_V_OUT_MASK,
AXP717_LDO0_OUTPUT_CONTROL, BIT(1)),
AXP_DESC(AXP717, ALDO3, "aldo3", "vin1", 500, 3500, 100,
AXP717_ALDO3_CONTROL, AXP717_LDO_V_OUT_MASK,
AXP717_LDO0_OUTPUT_CONTROL, BIT(2)),
AXP_DESC(AXP717, ALDO4, "aldo4", "vin1", 500, 3500, 100,
AXP717_ALDO4_CONTROL, AXP717_LDO_V_OUT_MASK,
AXP717_LDO0_OUTPUT_CONTROL, BIT(3)),
AXP_DESC(AXP717, BLDO1, "bldo1", "vin1", 500, 3500, 100,
AXP717_BLDO1_CONTROL, AXP717_LDO_V_OUT_MASK,
AXP717_LDO0_OUTPUT_CONTROL, BIT(4)),
AXP_DESC(AXP717, BLDO2, "bldo2", "vin1", 500, 3500, 100,
AXP717_BLDO2_CONTROL, AXP717_LDO_V_OUT_MASK,
AXP717_LDO0_OUTPUT_CONTROL, BIT(5)),
AXP_DESC(AXP717, BLDO3, "bldo3", "vin1", 500, 3500, 100,
AXP717_BLDO3_CONTROL, AXP717_LDO_V_OUT_MASK,
AXP717_LDO0_OUTPUT_CONTROL, BIT(6)),
AXP_DESC(AXP717, BLDO4, "bldo4", "vin1", 500, 3500, 100,
AXP717_BLDO4_CONTROL, AXP717_LDO_V_OUT_MASK,
AXP717_LDO0_OUTPUT_CONTROL, BIT(7)),
AXP_DESC(AXP717, CLDO1, "cldo1", "vin1", 500, 3500, 100,
AXP717_CLDO1_CONTROL, AXP717_LDO_V_OUT_MASK,
AXP717_LDO1_OUTPUT_CONTROL, BIT(0)),
AXP_DESC(AXP717, CLDO2, "cldo2", "vin1", 500, 3500, 100,
AXP717_CLDO2_CONTROL, AXP717_LDO_V_OUT_MASK,
AXP717_LDO1_OUTPUT_CONTROL, BIT(1)),
AXP_DESC(AXP717, CLDO3, "cldo3", "vin1", 500, 3500, 100,
AXP717_CLDO3_CONTROL, AXP717_LDO_V_OUT_MASK,
AXP717_LDO1_OUTPUT_CONTROL, BIT(2)),
AXP_DESC(AXP717, CLDO4, "cldo4", "vin1", 500, 3500, 100,
AXP717_CLDO4_CONTROL, AXP717_LDO_V_OUT_MASK,
AXP717_LDO1_OUTPUT_CONTROL, BIT(3)),
AXP_DESC(AXP717, CPUSLDO, "cpusldo", "vin1", 500, 1400, 50,
AXP717_CPUSLDO_CONTROL, AXP717_LDO_V_OUT_MASK,
AXP717_LDO1_OUTPUT_CONTROL, BIT(4)),
};
/* DCDC ranges shared with AXP813 */ /* DCDC ranges shared with AXP813 */
static const struct linear_range axp803_dcdc234_ranges[] = { static const struct linear_range axp803_dcdc234_ranges[] = {
REGULATOR_LINEAR_RANGE(500000, REGULATOR_LINEAR_RANGE(500000,
...@@ -1253,6 +1332,7 @@ static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq) ...@@ -1253,6 +1332,7 @@ static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
step = 150; step = 150;
break; break;
case AXP313A_ID: case AXP313A_ID:
case AXP717_ID:
case AXP15060_ID: case AXP15060_ID:
/* The DCDC PWM frequency seems to be fixed to 3 MHz. */ /* The DCDC PWM frequency seems to be fixed to 3 MHz. */
if (dcdcfreq != 0) { if (dcdcfreq != 0) {
...@@ -1479,6 +1559,10 @@ static int axp20x_regulator_probe(struct platform_device *pdev) ...@@ -1479,6 +1559,10 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
regulators = axp313a_regulators; regulators = axp313a_regulators;
nregulators = AXP313A_REG_ID_MAX; nregulators = AXP313A_REG_ID_MAX;
break; break;
case AXP717_ID:
regulators = axp717_regulators;
nregulators = AXP717_REG_ID_MAX;
break;
case AXP803_ID: case AXP803_ID:
regulators = axp803_regulators; regulators = axp803_regulators;
nregulators = AXP803_REG_ID_MAX; nregulators = AXP803_REG_ID_MAX;
......
...@@ -19,6 +19,7 @@ enum axp20x_variants { ...@@ -19,6 +19,7 @@ enum axp20x_variants {
AXP223_ID, AXP223_ID,
AXP288_ID, AXP288_ID,
AXP313A_ID, AXP313A_ID,
AXP717_ID,
AXP803_ID, AXP803_ID,
AXP806_ID, AXP806_ID,
AXP809_ID, AXP809_ID,
...@@ -104,15 +105,47 @@ enum axp20x_variants { ...@@ -104,15 +105,47 @@ enum axp20x_variants {
#define AXP313A_ON_INDICATE 0x00 #define AXP313A_ON_INDICATE 0x00
#define AXP313A_OUTPUT_CONTROL 0x10 #define AXP313A_OUTPUT_CONTROL 0x10
#define AXP313A_DCDC1_CONRTOL 0x13 #define AXP313A_DCDC1_CONTROL 0x13
#define AXP313A_DCDC2_CONRTOL 0x14 #define AXP313A_DCDC2_CONTROL 0x14
#define AXP313A_DCDC3_CONRTOL 0x15 #define AXP313A_DCDC3_CONTROL 0x15
#define AXP313A_ALDO1_CONRTOL 0x16 #define AXP313A_ALDO1_CONTROL 0x16
#define AXP313A_DLDO1_CONRTOL 0x17 #define AXP313A_DLDO1_CONTROL 0x17
#define AXP313A_SHUTDOWN_CTRL 0x1a #define AXP313A_SHUTDOWN_CTRL 0x1a
#define AXP313A_IRQ_EN 0x20 #define AXP313A_IRQ_EN 0x20
#define AXP313A_IRQ_STATE 0x21 #define AXP313A_IRQ_STATE 0x21
#define AXP717_ON_INDICATE 0x00
#define AXP717_IRQ0_EN 0x40
#define AXP717_IRQ1_EN 0x41
#define AXP717_IRQ2_EN 0x42
#define AXP717_IRQ3_EN 0x43
#define AXP717_IRQ4_EN 0x44
#define AXP717_IRQ0_STATE 0x48
#define AXP717_IRQ1_STATE 0x49
#define AXP717_IRQ2_STATE 0x4a
#define AXP717_IRQ3_STATE 0x4b
#define AXP717_IRQ4_STATE 0x4c
#define AXP717_DCDC_OUTPUT_CONTROL 0x80
#define AXP717_DCDC1_CONTROL 0x83
#define AXP717_DCDC2_CONTROL 0x84
#define AXP717_DCDC3_CONTROL 0x85
#define AXP717_DCDC4_CONTROL 0x86
#define AXP717_LDO0_OUTPUT_CONTROL 0x90
#define AXP717_LDO1_OUTPUT_CONTROL 0x91
#define AXP717_ALDO1_CONTROL 0x93
#define AXP717_ALDO2_CONTROL 0x94
#define AXP717_ALDO3_CONTROL 0x95
#define AXP717_ALDO4_CONTROL 0x96
#define AXP717_BLDO1_CONTROL 0x97
#define AXP717_BLDO2_CONTROL 0x98
#define AXP717_BLDO3_CONTROL 0x99
#define AXP717_BLDO4_CONTROL 0x9a
#define AXP717_CLDO1_CONTROL 0x9b
#define AXP717_CLDO2_CONTROL 0x9c
#define AXP717_CLDO3_CONTROL 0x9d
#define AXP717_CLDO4_CONTROL 0x9e
#define AXP717_CPUSLDO_CONTROL 0x9f
#define AXP806_STARTUP_SRC 0x00 #define AXP806_STARTUP_SRC 0x00
#define AXP806_CHIP_ID 0x03 #define AXP806_CHIP_ID 0x03
#define AXP806_PWR_OUT_CTRL1 0x10 #define AXP806_PWR_OUT_CTRL1 0x10
...@@ -433,6 +466,27 @@ enum { ...@@ -433,6 +466,27 @@ enum {
AXP313A_REG_ID_MAX, AXP313A_REG_ID_MAX,
}; };
enum {
AXP717_DCDC1 = 0,
AXP717_DCDC2,
AXP717_DCDC3,
AXP717_DCDC4,
AXP717_ALDO1,
AXP717_ALDO2,
AXP717_ALDO3,
AXP717_ALDO4,
AXP717_BLDO1,
AXP717_BLDO2,
AXP717_BLDO3,
AXP717_BLDO4,
AXP717_CLDO1,
AXP717_CLDO2,
AXP717_CLDO3,
AXP717_CLDO4,
AXP717_CPUSLDO,
AXP717_REG_ID_MAX,
};
enum { enum {
AXP806_DCDCA = 0, AXP806_DCDCA = 0,
AXP806_DCDCB, AXP806_DCDCB,
...@@ -732,6 +786,40 @@ enum axp313a_irqs { ...@@ -732,6 +786,40 @@ enum axp313a_irqs {
AXP313A_IRQ_PEK_RIS_EDGE, AXP313A_IRQ_PEK_RIS_EDGE,
}; };
enum axp717_irqs {
AXP717_IRQ_VBUS_FAULT,
AXP717_IRQ_VBUS_OVER_V,
AXP717_IRQ_BOOST_OVER_V,
AXP717_IRQ_GAUGE_NEW_SOC = 4,
AXP717_IRQ_SOC_DROP_LVL1 = 6,
AXP717_IRQ_SOC_DROP_LVL2,
AXP717_IRQ_PEK_RIS_EDGE,
AXP717_IRQ_PEK_FAL_EDGE,
AXP717_IRQ_PEK_LONG,
AXP717_IRQ_PEK_SHORT,
AXP717_IRQ_BATT_REMOVAL,
AXP717_IRQ_BATT_PLUGIN,
AXP717_IRQ_VBUS_REMOVAL,
AXP717_IRQ_VBUS_PLUGIN,
AXP717_IRQ_BATT_OVER_V,
AXP717_IRQ_CHARG_TIMER,
AXP717_IRQ_DIE_TEMP_HIGH,
AXP717_IRQ_CHARG,
AXP717_IRQ_CHARG_DONE,
AXP717_IRQ_BATT_OVER_CURR,
AXP717_IRQ_LDO_OVER_CURR,
AXP717_IRQ_WDOG_EXPIRE,
AXP717_IRQ_BATT_ACT_TEMP_LOW,
AXP717_IRQ_BATT_ACT_TEMP_HIGH,
AXP717_IRQ_BATT_CHG_TEMP_LOW,
AXP717_IRQ_BATT_CHG_TEMP_HIGH,
AXP717_IRQ_BATT_QUIT_TEMP_HIGH,
AXP717_IRQ_BC_USB_CHNG = 30,
AXP717_IRQ_BC_USB_DONE,
AXP717_IRQ_TYPEC_PLUGIN = 37,
AXP717_IRQ_TYPEC_REMOVE,
};
enum axp803_irqs { enum axp803_irqs {
AXP803_IRQ_ACIN_OVER_V = 1, AXP803_IRQ_ACIN_OVER_V = 1,
AXP803_IRQ_ACIN_PLUGIN, AXP803_IRQ_ACIN_PLUGIN,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment