Skip to content

Commit

Permalink
Merge tag 'regulator-v3.17' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/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
  ...
  • Loading branch information
Linus Torvalds committed Aug 5, 2014
2 parents 1325b65 + f955c8b commit 91c2ff7
Show file tree
Hide file tree
Showing 38 changed files with 3,105 additions and 808 deletions.
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/mfd/palmas.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ twl6037 (palmas)
tps65913 (palmas)
tps65914 (palmas)
tps659038
tps65917

Required properties:
- compatible : Should be from the list
Expand All @@ -16,6 +17,7 @@ Required properties:
ti,tps65914
ti,tps80036
ti,tps659038
ti,tps65917
and also the generic series names
ti,palmas
- interrupt-controller : palmas has its own internal IRQs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
ACT8865 regulator
ACT88xx regulators
-------------------

Required properties:
- compatible: "active-semi,act8865"
- compatible: "active-semi,act8846" or "active-semi,act8865"
- reg: I2C slave address

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

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

Example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Required properties:
ti,twl6037-pmic
ti,tps65913-pmic
ti,tps65914-pmic
ti,tps65917-pmic
and also the generic series names
ti,palmas-pmic
- interrupt-parent : The parent interrupt controller which is palmas.
Expand Down
23 changes: 23 additions & 0 deletions Documentation/devicetree/bindings/regulator/tps65218.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
TPS65218 family of regulators

Required properties:
For tps65218 regulators/LDOs
- compatible:
- "ti,tps65218-dcdc1" for DCDC1
- "ti,tps65218-dcdc2" for DCDC2
- "ti,tps65218-dcdc3" for DCDC3
- "ti,tps65218-dcdc4" for DCDC4
- "ti,tps65218-dcdc5" for DCDC5
- "ti,tps65218-dcdc6" for DCDC6
- "ti,tps65218-ldo1" for LDO1

Optional properties:
- Any optional property defined in bindings/regulator/regulator.txt

Example:

xyz: regulator@0 {
compatible = "ti,tps65218-dcdc1";
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <3000000>;
};
35 changes: 35 additions & 0 deletions Documentation/power/regulator/consumer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,38 @@ int regulator_unregister_notifier(struct regulator *regulator,

Regulators use the kernel notifier framework to send event to their interested
consumers.

7. Regulator Direct Register Access
===================================
Some kinds of power management hardware or firmware are designed such that
they need to do low-level hardware access to regulators, with no involvement
from the kernel. Examples of such devices are:

- clocksource with a voltage-controlled oscillator and control logic to change
the supply voltage over I2C to achieve a desired output clock rate
- thermal management firmware that can issue an arbitrary I2C transaction to
perform system poweroff during overtemperature conditions

To set up such a device/firmware, various parameters like I2C address of the
regulator, addresses of various regulator registers etc. need to be configured
to it. The regulator framework provides the following helpers for querying
these details.

Bus-specific details, like I2C addresses or transfer rates are handled by the
regmap framework. To get the regulator's regmap (if supported), use :-

struct regmap *regulator_get_regmap(struct regulator *regulator);

To obtain the hardware register offset and bitmask for the regulator's voltage
selector register, use :-

int regulator_get_hardware_vsel_register(struct regulator *regulator,
unsigned *vsel_reg,
unsigned *vsel_mask);

To convert a regulator framework voltage selector code (used by
regulator_list_voltage) to a hardware-specific voltage selector that can be
directly written to the voltage selector register, use :-

int regulator_list_hardware_vsel(struct regulator *regulator,
unsigned selector);
13 changes: 13 additions & 0 deletions drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,19 @@ struct regmap *dev_get_regmap(struct device *dev, const char *name)
}
EXPORT_SYMBOL_GPL(dev_get_regmap);

/**
* regmap_get_device(): Obtain the device from a regmap
*
* @map: Register map to operate on.
*
* Returns the underlying device that the regmap has been created for.
*/
struct device *regmap_get_device(struct regmap *map)
{
return map->dev;
}
EXPORT_SYMBOL_GPL(regmap_get_device);

static int _regmap_select_page(struct regmap *map, unsigned int *reg,
struct regmap_range_node *range,
unsigned int val_num)
Expand Down
Loading

0 comments on commit 91c2ff7

Please sign in to comment.