mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
Add input voltage suppliers for PMIC MCP16502
Merge series from Andrei Simion <andrei.simion@microchip.com>: In this series of patches, support for the *-supply property [1] is added (correlated with supply_name [2]) from the core regulator. Link [1]: https://github.com/torvalds/linux/blob/master/drivers/regulator/core.c#L471 Link [2]: https://github.com/torvalds/linux/blob/master/drivers/regulator/core.c#L2064 I modified the mcp16502.c driver and the dts that use this PMIC. We added these improvements to provide a complete description of the board power scheme.
This commit is contained in:
commit
b31274caf3
2 changed files with 29 additions and 8 deletions
|
|
@ -28,6 +28,21 @@ properties:
|
|||
reg:
|
||||
maxItems: 1
|
||||
|
||||
lvin-supply:
|
||||
description: Input supply phandle for LDO1 and LDO2
|
||||
|
||||
pvin1-supply:
|
||||
description: Input supply phandle for VDD_IO (BUCK1)
|
||||
|
||||
pvin2-supply:
|
||||
description: Input supply phandle for VDD_DDR (BUCK2)
|
||||
|
||||
pvin3-supply:
|
||||
description: Input supply phandle for VDD_CORE (BUCK3)
|
||||
|
||||
pvin4-supply:
|
||||
description: Input supply phandle for VDD_OTHER (BUCK4)
|
||||
|
||||
regulators:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
|
|
@ -68,6 +83,11 @@ examples:
|
|||
pmic@5b {
|
||||
compatible = "microchip,mcp16502";
|
||||
reg = <0x5b>;
|
||||
lvin-supply = <®_5v>;
|
||||
pvin1-supply = <®_5v>;
|
||||
pvin2-supply = <®_5v>;
|
||||
pvin3-supply = <®_5v>;
|
||||
pvin4-supply = <®_5v>;
|
||||
|
||||
regulators {
|
||||
VDD_IO {
|
||||
|
|
|
|||
|
|
@ -107,9 +107,10 @@ static unsigned int mcp16502_of_map_mode(unsigned int mode)
|
|||
return REGULATOR_MODE_INVALID;
|
||||
}
|
||||
|
||||
#define MCP16502_REGULATOR(_name, _id, _ranges, _ops, _ramp_table) \
|
||||
#define MCP16502_REGULATOR(_name, _id, _sn, _ranges, _ops, _ramp_table) \
|
||||
[_id] = { \
|
||||
.name = _name, \
|
||||
.supply_name = #_sn, \
|
||||
.regulators_node = "regulators", \
|
||||
.id = _id, \
|
||||
.ops = &(_ops), \
|
||||
|
|
@ -467,18 +468,18 @@ static const struct linear_range b234_ranges[] = {
|
|||
};
|
||||
|
||||
static const struct regulator_desc mcp16502_desc[] = {
|
||||
/* MCP16502_REGULATOR(_name, _id, ranges, regulator_ops, ramp_table) */
|
||||
MCP16502_REGULATOR("VDD_IO", BUCK1, b1l12_ranges, mcp16502_buck_ops,
|
||||
/* MCP16502_REGULATOR(_name, _id, _sn, _ranges, _ops, _ramp_table) */
|
||||
MCP16502_REGULATOR("VDD_IO", BUCK1, pvin1, b1l12_ranges, mcp16502_buck_ops,
|
||||
mcp16502_ramp_b1l12),
|
||||
MCP16502_REGULATOR("VDD_DDR", BUCK2, b234_ranges, mcp16502_buck_ops,
|
||||
MCP16502_REGULATOR("VDD_DDR", BUCK2, pvin2, b234_ranges, mcp16502_buck_ops,
|
||||
mcp16502_ramp_b234),
|
||||
MCP16502_REGULATOR("VDD_CORE", BUCK3, b234_ranges, mcp16502_buck_ops,
|
||||
MCP16502_REGULATOR("VDD_CORE", BUCK3, pvin3, b234_ranges, mcp16502_buck_ops,
|
||||
mcp16502_ramp_b234),
|
||||
MCP16502_REGULATOR("VDD_OTHER", BUCK4, b234_ranges, mcp16502_buck_ops,
|
||||
MCP16502_REGULATOR("VDD_OTHER", BUCK4, pvin4, b234_ranges, mcp16502_buck_ops,
|
||||
mcp16502_ramp_b234),
|
||||
MCP16502_REGULATOR("LDO1", LDO1, b1l12_ranges, mcp16502_ldo_ops,
|
||||
MCP16502_REGULATOR("LDO1", LDO1, lvin, b1l12_ranges, mcp16502_ldo_ops,
|
||||
mcp16502_ramp_b1l12),
|
||||
MCP16502_REGULATOR("LDO2", LDO2, b1l12_ranges, mcp16502_ldo_ops,
|
||||
MCP16502_REGULATOR("LDO2", LDO2, lvin, b1l12_ranges, mcp16502_ldo_ops,
|
||||
mcp16502_ramp_b1l12)
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue