Skip to content

Commit 91c2ff7

Browse files
committed
Merge tag 'regulator-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown: "A couple of nice new features this month, the ability to map regulators in order to allow voltage control by external coprocessors is something people have been asking for for a long time. - improved support for switch only "regulators", allowing current state to be read from the parent regulator but no setting. - support for obtaining the register access method used to set voltages, for use in systems which can offload control of this to a coprocessor (typically for DVFS). - support for Active-Semi AC8846, Dialog DA9211 and Texas Instruments TPS65917" * tag 'regulator-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (58 commits) regulator: act8865: fix build when OF is not enabled regulator: act8865: add act8846 to DT binding documentation regulator: act8865: add support for act8846 regulator: act8865: prepare support for other act88xx devices regulator: act8865: set correct number of regulators in pdata regulator: act8865: Remove error variable in act8865_pmic_probe regulator: act8865: fix parsing of platform data regulator: tps65090: Set voltage for fixed regulators regulator: core: Allow to get voltage count and list from parent regulator: core: Get voltage from parent if not available regulator: Add missing statics and inlines for stub functions regulator: lp872x: Don't set constraints within the regulator driver regmap: Fix return code for stub regmap_get_device() regulator: s2mps11: Update module description and Kconfig to add S2MPU02 support regulator: Add helpers for low-level register access regmap: Allow regmap_get_device() to be used by modules regmap: Add regmap_get_device regulator: da9211: Remove unnecessary devm_regulator_unregister() calls regulator: Add DT bindings for tps65218 PMIC regulators. regulator: da9211: new regulator driver ...
2 parents 1325b65 + f955c8b commit 91c2ff7

38 files changed

Lines changed: 3105 additions & 808 deletions

‎Documentation/devicetree/bindings/mfd/palmas.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ twl6037 (palmas)
66
tps65913 (palmas)
77
tps65914 (palmas)
88
tps659038
9+
tps65917
910

1011
Required properties:
1112
- compatible : Should be from the list
@@ -16,6 +17,7 @@ Required properties:
1617
ti,tps65914
1718
ti,tps80036
1819
ti,tps659038
20+
ti,tps65917
1921
and also the generic series names
2022
ti,palmas
2123
- interrupt-controller : palmas has its own internal IRQs

‎Documentation/devicetree/bindings/regulator/act8865-regulator.txt‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
ACT8865 regulator
1+
ACT88xx regulators
22
-------------------
33

44
Required properties:
5-
- compatible: "active-semi,act8865"
5+
- compatible: "active-semi,act8846" or "active-semi,act8865"
66
- reg: I2C slave address
77

88
Any standard regulator properties can be used to configure the single regulator.
99

1010
The valid names for regulators are:
11+
- for act8846:
12+
REG1, REG2, REG3, REG4, REG5, REG6, REG7, REG8, REG9, REG10, REG11, REG12
13+
- for act8865:
1114
DCDC_REG1, DCDC_REG2, DCDC_REG3, LDO_REG1, LDO_REG2, LDO_REG3, LDO_REG4.
1215

1316
Example:

‎Documentation/devicetree/bindings/regulator/palmas-pmic.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Required properties:
77
ti,twl6037-pmic
88
ti,tps65913-pmic
99
ti,tps65914-pmic
10+
ti,tps65917-pmic
1011
and also the generic series names
1112
ti,palmas-pmic
1213
- interrupt-parent : The parent interrupt controller which is palmas.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
TPS65218 family of regulators
2+
3+
Required properties:
4+
For tps65218 regulators/LDOs
5+
- compatible:
6+
- "ti,tps65218-dcdc1" for DCDC1
7+
- "ti,tps65218-dcdc2" for DCDC2
8+
- "ti,tps65218-dcdc3" for DCDC3
9+
- "ti,tps65218-dcdc4" for DCDC4
10+
- "ti,tps65218-dcdc5" for DCDC5
11+
- "ti,tps65218-dcdc6" for DCDC6
12+
- "ti,tps65218-ldo1" for LDO1
13+
14+
Optional properties:
15+
- Any optional property defined in bindings/regulator/regulator.txt
16+
17+
Example:
18+
19+
xyz: regulator@0 {
20+
compatible = "ti,tps65218-dcdc1";
21+
regulator-min-microvolt = <1000000>;
22+
regulator-max-microvolt = <3000000>;
23+
};

‎Documentation/power/regulator/consumer.txt‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,38 @@ int regulator_unregister_notifier(struct regulator *regulator,
180180

181181
Regulators use the kernel notifier framework to send event to their interested
182182
consumers.
183+
184+
7. Regulator Direct Register Access
185+
===================================
186+
Some kinds of power management hardware or firmware are designed such that
187+
they need to do low-level hardware access to regulators, with no involvement
188+
from the kernel. Examples of such devices are:
189+
190+
- clocksource with a voltage-controlled oscillator and control logic to change
191+
the supply voltage over I2C to achieve a desired output clock rate
192+
- thermal management firmware that can issue an arbitrary I2C transaction to
193+
perform system poweroff during overtemperature conditions
194+
195+
To set up such a device/firmware, various parameters like I2C address of the
196+
regulator, addresses of various regulator registers etc. need to be configured
197+
to it. The regulator framework provides the following helpers for querying
198+
these details.
199+
200+
Bus-specific details, like I2C addresses or transfer rates are handled by the
201+
regmap framework. To get the regulator's regmap (if supported), use :-
202+
203+
struct regmap *regulator_get_regmap(struct regulator *regulator);
204+
205+
To obtain the hardware register offset and bitmask for the regulator's voltage
206+
selector register, use :-
207+
208+
int regulator_get_hardware_vsel_register(struct regulator *regulator,
209+
unsigned *vsel_reg,
210+
unsigned *vsel_mask);
211+
212+
To convert a regulator framework voltage selector code (used by
213+
regulator_list_voltage) to a hardware-specific voltage selector that can be
214+
directly written to the voltage selector register, use :-
215+
216+
int regulator_list_hardware_vsel(struct regulator *regulator,
217+
unsigned selector);

‎drivers/base/regmap/regmap.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,19 @@ struct regmap *dev_get_regmap(struct device *dev, const char *name)
10731073
}
10741074
EXPORT_SYMBOL_GPL(dev_get_regmap);
10751075

1076+
/**
1077+
* regmap_get_device(): Obtain the device from a regmap
1078+
*
1079+
* @map: Register map to operate on.
1080+
*
1081+
* Returns the underlying device that the regmap has been created for.
1082+
*/
1083+
struct device *regmap_get_device(struct regmap *map)
1084+
{
1085+
return map->dev;
1086+
}
1087+
EXPORT_SYMBOL_GPL(regmap_get_device);
1088+
10761089
static int _regmap_select_page(struct regmap *map, unsigned int *reg,
10771090
struct regmap_range_node *range,
10781091
unsigned int val_num)

0 commit comments

Comments
 (0)