diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-14 12:28:55 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-14 12:28:55 -0700 |
commit | c269bc00fcb876ae3b85f178f1e34601185c8ccc (patch) | |
tree | cae61de48c631301984a5e8be345be220adabb82 /Documentation | |
parent | 2d51b75370d83535883c66521b03fcd6a1f1f68d (diff) | |
parent | caf1859199e4360ffa826179bc0e881b0348f3ce (diff) | |
download | blackbird-op-linux-c269bc00fcb876ae3b85f178f1e34601185c8ccc.tar.gz blackbird-op-linux-c269bc00fcb876ae3b85f178f1e34601185c8ccc.zip |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6: (26 commits)
mfd: Fix warning in WM8350
mfd: Add placeholders for WM8350 client devices
da903x: add regulator support for DA9030/DA9034
mfd: Add WM8350 subdevice registration helper
regulator: Add WM8350 regulator support
mfd: Add WM8350 interrupt support
mfd: Add initialisation callback for WM8350
mfd: Add GPIO pin configuration support for WM8350
mfd: Add I2C control support for WM8350
mfd: Core support for the WM8350 AudioPlus PMIC
mfd: Add WM8350 watchdog register definitions
mfd: Add WM8350 RTC register definitions
mfd: Add WM8350 comparator register definitions
mfd: Add WM8350 PMU register definitions
mfd: Add WM8350 PMIC register definitions
mfd: Add WM8350 GPIO register definitions
mfd: Add WM8350 audio register definitions
regulator: Export regulator name via sysfs
regulator: Add WM8400 regulator support
mfd: Core support for the WM8400 AudioPlus HiFi CODEC and PMU
...
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/ABI/testing/sysfs-class-regulator | 55 | ||||
-rw-r--r-- | Documentation/power/regulator/machine.txt | 140 | ||||
-rw-r--r-- | Documentation/power/regulator/regulator.txt | 8 |
3 files changed, 104 insertions, 99 deletions
diff --git a/Documentation/ABI/testing/sysfs-class-regulator b/Documentation/ABI/testing/sysfs-class-regulator index 79a4a75b2d2c..3731f6f29bcb 100644 --- a/Documentation/ABI/testing/sysfs-class-regulator +++ b/Documentation/ABI/testing/sysfs-class-regulator @@ -1,7 +1,7 @@ What: /sys/class/regulator/.../state Date: April 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called state. This holds the regulator output state. @@ -27,7 +27,7 @@ Description: What: /sys/class/regulator/.../type Date: April 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called type. This holds the regulator type. @@ -51,7 +51,7 @@ Description: What: /sys/class/regulator/.../microvolts Date: April 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called microvolts. This holds the regulator output voltage setting @@ -65,7 +65,7 @@ Description: What: /sys/class/regulator/.../microamps Date: April 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called microamps. This holds the regulator output current limit @@ -79,7 +79,7 @@ Description: What: /sys/class/regulator/.../opmode Date: April 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called opmode. This holds the regulator operating mode setting. @@ -102,7 +102,7 @@ Description: What: /sys/class/regulator/.../min_microvolts Date: April 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called min_microvolts. This holds the minimum safe working regulator @@ -116,7 +116,7 @@ Description: What: /sys/class/regulator/.../max_microvolts Date: April 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called max_microvolts. This holds the maximum safe working regulator @@ -130,7 +130,7 @@ Description: What: /sys/class/regulator/.../min_microamps Date: April 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called min_microamps. This holds the minimum safe working regulator @@ -145,7 +145,7 @@ Description: What: /sys/class/regulator/.../max_microamps Date: April 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called max_microamps. This holds the maximum safe working regulator @@ -157,10 +157,23 @@ Description: platform code. +What: /sys/class/regulator/.../name +Date: October 2008 +KernelVersion: 2.6.28 +Contact: Liam Girdwood <lrg@slimlogic.co.uk> +Description: + Each regulator directory will contain a field called + name. This holds a string identifying the regulator for + display purposes. + + NOTE: this will be empty if no suitable name is provided + by platform or regulator drivers. + + What: /sys/class/regulator/.../num_users Date: April 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called num_users. This holds the number of consumer devices that @@ -170,7 +183,7 @@ Description: What: /sys/class/regulator/.../requested_microamps Date: April 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called requested_microamps. This holds the total requested load @@ -181,7 +194,7 @@ Description: What: /sys/class/regulator/.../parent Date: April 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Some regulator directories will contain a link called parent. This points to the parent or supply regulator if one exists. @@ -189,7 +202,7 @@ Description: What: /sys/class/regulator/.../suspend_mem_microvolts Date: May 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called suspend_mem_microvolts. This holds the regulator output @@ -203,7 +216,7 @@ Description: What: /sys/class/regulator/.../suspend_disk_microvolts Date: May 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called suspend_disk_microvolts. This holds the regulator output @@ -217,7 +230,7 @@ Description: What: /sys/class/regulator/.../suspend_standby_microvolts Date: May 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called suspend_standby_microvolts. This holds the regulator output @@ -231,7 +244,7 @@ Description: What: /sys/class/regulator/.../suspend_mem_mode Date: May 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called suspend_mem_mode. This holds the regulator operating mode @@ -245,7 +258,7 @@ Description: What: /sys/class/regulator/.../suspend_disk_mode Date: May 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called suspend_disk_mode. This holds the regulator operating mode @@ -258,7 +271,7 @@ Description: What: /sys/class/regulator/.../suspend_standby_mode Date: May 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called suspend_standby_mode. This holds the regulator operating mode @@ -272,7 +285,7 @@ Description: What: /sys/class/regulator/.../suspend_mem_state Date: May 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called suspend_mem_state. This holds the regulator operating state @@ -287,7 +300,7 @@ Description: What: /sys/class/regulator/.../suspend_disk_state Date: May 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called suspend_disk_state. This holds the regulator operating state @@ -302,7 +315,7 @@ Description: What: /sys/class/regulator/.../suspend_standby_state Date: May 2008 KernelVersion: 2.6.26 -Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> +Contact: Liam Girdwood <lrg@slimlogic.co.uk> Description: Each regulator directory will contain a field called suspend_standby_state. This holds the regulator operating diff --git a/Documentation/power/regulator/machine.txt b/Documentation/power/regulator/machine.txt index c9a35665cf70..ce3487d99abe 100644 --- a/Documentation/power/regulator/machine.txt +++ b/Documentation/power/regulator/machine.txt @@ -2,17 +2,8 @@ Regulator Machine Driver Interface =================================== The regulator machine driver interface is intended for board/machine specific -initialisation code to configure the regulator subsystem. Typical things that -machine drivers would do are :- +initialisation code to configure the regulator subsystem. - 1. Regulator -> Device mapping. - 2. Regulator supply configuration. - 3. Power Domain constraint setting. - - - -1. Regulator -> device mapping -============================== Consider the following machine :- Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V] @@ -21,81 +12,82 @@ Consider the following machine :- The drivers for consumers A & B must be mapped to the correct regulator in order to control their power supply. This mapping can be achieved in machine -initialisation code by calling :- +initialisation code by creating a struct regulator_consumer_supply for +each regulator. + +struct regulator_consumer_supply { + struct device *dev; /* consumer */ + const char *supply; /* consumer supply - e.g. "vcc" */ +}; -int regulator_set_device_supply(const char *regulator, struct device *dev, - const char *supply); +e.g. for the machine above -and is shown with the following code :- +static struct regulator_consumer_supply regulator1_consumers[] = { +{ + .dev = &platform_consumerB_device.dev, + .supply = "Vcc", +},}; -regulator_set_device_supply("Regulator-1", devB, "Vcc"); -regulator_set_device_supply("Regulator-2", devA, "Vcc"); +static struct regulator_consumer_supply regulator2_consumers[] = { +{ + .dev = &platform_consumerA_device.dev, + .supply = "Vcc", +},}; This maps Regulator-1 to the 'Vcc' supply for Consumer B and maps Regulator-2 to the 'Vcc' supply for Consumer A. - -2. Regulator supply configuration. -================================== -Consider the following machine (again) :- - - Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V] - | - +-> [Consumer B @ 3.3V] +Constraints can now be registered by defining a struct regulator_init_data +for each regulator power domain. This structure also maps the consumers +to their supply regulator :- + +static struct regulator_init_data regulator1_data = { + .constraints = { + .min_uV = 3300000, + .max_uV = 3300000, + .valid_modes_mask = REGULATOR_MODE_NORMAL, + }, + .num_consumer_supplies = ARRAY_SIZE(regulator1_consumers), + .consumer_supplies = regulator1_consumers, +}; Regulator-1 supplies power to Regulator-2. This relationship must be registered with the core so that Regulator-1 is also enabled when Consumer A enables it's -supply (Regulator-2). - -This relationship can be register with the core via :- - -int regulator_set_supply(const char *regulator, const char *regulator_supply); - -In this example we would use the following code :- - -regulator_set_supply("Regulator-2", "Regulator-1"); - -Relationships can be queried by calling :- - -const char *regulator_get_supply(const char *regulator); - - -3. Power Domain constraint setting. -=================================== -Each power domain within a system has physical constraints on voltage and -current. This must be defined in software so that the power domain is always -operated within specifications. - -Consider the following machine (again) :- - - Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V] - | - +-> [Consumer B @ 3.3V] - -This gives us two regulators and two power domains: - - Domain 1: Regulator-2, Consumer B. - Domain 2: Consumer A. - -Constraints can be registered by calling :- - -int regulator_set_platform_constraints(const char *regulator, - struct regulation_constraints *constraints); - -The example is defined as follows :- - -struct regulation_constraints domain_1 = { - .min_uV = 3300000, - .max_uV = 3300000, - .valid_modes_mask = REGULATOR_MODE_NORMAL, +supply (Regulator-2). The supply regulator is set by the supply_regulator_dev +field below:- + +static struct regulator_init_data regulator2_data = { + .supply_regulator_dev = &platform_regulator1_device.dev, + .constraints = { + .min_uV = 1800000, + .max_uV = 2000000, + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, + .valid_modes_mask = REGULATOR_MODE_NORMAL, + }, + .num_consumer_supplies = ARRAY_SIZE(regulator2_consumers), + .consumer_supplies = regulator2_consumers, }; -struct regulation_constraints domain_2 = { - .min_uV = 1800000, - .max_uV = 2000000, - .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, - .valid_modes_mask = REGULATOR_MODE_NORMAL, +Finally the regulator devices must be registered in the usual manner. + +static struct platform_device regulator_devices[] = { +{ + .name = "regulator", + .id = DCDC_1, + .dev = { + .platform_data = ®ulator1_data, + }, +}, +{ + .name = "regulator", + .id = DCDC_2, + .dev = { + .platform_data = ®ulator2_data, + }, +}, }; +/* register regulator 1 device */ +platform_device_register(&wm8350_regulator_devices[0]); -regulator_set_platform_constraints("Regulator-1", &domain_1); -regulator_set_platform_constraints("Regulator-2", &domain_2); +/* register regulator 2 device */ +platform_device_register(&wm8350_regulator_devices[1]); diff --git a/Documentation/power/regulator/regulator.txt b/Documentation/power/regulator/regulator.txt index a69050143592..4200accb9bba 100644 --- a/Documentation/power/regulator/regulator.txt +++ b/Documentation/power/regulator/regulator.txt @@ -10,11 +10,11 @@ Registration Drivers can register a regulator by calling :- -struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, - void *reg_data); +struct regulator_dev *regulator_register(struct device *dev, + struct regulator_desc *regulator_desc); -This will register the regulators capabilities and operations the regulator -core. The core does not touch reg_data (private to regulator driver). +This will register the regulators capabilities and operations to the regulator +core. Regulators can be unregistered by calling :- |