Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c269bc00 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* '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
  ...
parents 2d51b753 caf18591
Loading
Loading
Loading
Loading
+34 −21
Original line number Original line Diff line number Diff line
What:		/sys/class/regulator/.../state
What:		/sys/class/regulator/.../state
Date:		April 2008
Date:		April 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		state. This holds the regulator output state.
		state. This holds the regulator output state.
@@ -27,7 +27,7 @@ Description:
What:		/sys/class/regulator/.../type
What:		/sys/class/regulator/.../type
Date:		April 2008
Date:		April 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		type. This holds the regulator type.
		type. This holds the regulator type.
@@ -51,7 +51,7 @@ Description:
What:		/sys/class/regulator/.../microvolts
What:		/sys/class/regulator/.../microvolts
Date:		April 2008
Date:		April 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		microvolts. This holds the regulator output voltage setting
		microvolts. This holds the regulator output voltage setting
@@ -65,7 +65,7 @@ Description:
What:		/sys/class/regulator/.../microamps
What:		/sys/class/regulator/.../microamps
Date:		April 2008
Date:		April 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		microamps. This holds the regulator output current limit
		microamps. This holds the regulator output current limit
@@ -79,7 +79,7 @@ Description:
What:		/sys/class/regulator/.../opmode
What:		/sys/class/regulator/.../opmode
Date:		April 2008
Date:		April 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		opmode. This holds the regulator operating mode setting.
		opmode. This holds the regulator operating mode setting.
@@ -102,7 +102,7 @@ Description:
What:		/sys/class/regulator/.../min_microvolts
What:		/sys/class/regulator/.../min_microvolts
Date:		April 2008
Date:		April 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		min_microvolts. This holds the minimum safe working regulator
		min_microvolts. This holds the minimum safe working regulator
@@ -116,7 +116,7 @@ Description:
What:		/sys/class/regulator/.../max_microvolts
What:		/sys/class/regulator/.../max_microvolts
Date:		April 2008
Date:		April 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		max_microvolts. This holds the maximum safe working regulator
		max_microvolts. This holds the maximum safe working regulator
@@ -130,7 +130,7 @@ Description:
What:		/sys/class/regulator/.../min_microamps
What:		/sys/class/regulator/.../min_microamps
Date:		April 2008
Date:		April 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		min_microamps. This holds the minimum safe working regulator
		min_microamps. This holds the minimum safe working regulator
@@ -145,7 +145,7 @@ Description:
What:		/sys/class/regulator/.../max_microamps
What:		/sys/class/regulator/.../max_microamps
Date:		April 2008
Date:		April 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		max_microamps. This holds the maximum safe working regulator
		max_microamps. This holds the maximum safe working regulator
@@ -157,10 +157,23 @@ Description:
		platform code.
		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
What:		/sys/class/regulator/.../num_users
Date:		April 2008
Date:		April 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		num_users. This holds the number of consumer devices that
		num_users. This holds the number of consumer devices that
@@ -170,7 +183,7 @@ Description:
What:		/sys/class/regulator/.../requested_microamps
What:		/sys/class/regulator/.../requested_microamps
Date:		April 2008
Date:		April 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		requested_microamps. This holds the total requested load
		requested_microamps. This holds the total requested load
@@ -181,7 +194,7 @@ Description:
What:		/sys/class/regulator/.../parent
What:		/sys/class/regulator/.../parent
Date:		April 2008
Date:		April 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Some regulator directories will contain a link called parent.
		Some regulator directories will contain a link called parent.
		This points to the parent or supply regulator if one exists.
		This points to the parent or supply regulator if one exists.
@@ -189,7 +202,7 @@ Description:
What:		/sys/class/regulator/.../suspend_mem_microvolts
What:		/sys/class/regulator/.../suspend_mem_microvolts
Date:		May 2008
Date:		May 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		suspend_mem_microvolts. This holds the regulator output
		suspend_mem_microvolts. This holds the regulator output
@@ -203,7 +216,7 @@ Description:
What:		/sys/class/regulator/.../suspend_disk_microvolts
What:		/sys/class/regulator/.../suspend_disk_microvolts
Date:		May 2008
Date:		May 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		suspend_disk_microvolts. This holds the regulator output
		suspend_disk_microvolts. This holds the regulator output
@@ -217,7 +230,7 @@ Description:
What:		/sys/class/regulator/.../suspend_standby_microvolts
What:		/sys/class/regulator/.../suspend_standby_microvolts
Date:		May 2008
Date:		May 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		suspend_standby_microvolts. This holds the regulator output
		suspend_standby_microvolts. This holds the regulator output
@@ -231,7 +244,7 @@ Description:
What:		/sys/class/regulator/.../suspend_mem_mode
What:		/sys/class/regulator/.../suspend_mem_mode
Date:		May 2008
Date:		May 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		suspend_mem_mode. This holds the regulator operating mode
		suspend_mem_mode. This holds the regulator operating mode
@@ -245,7 +258,7 @@ Description:
What:		/sys/class/regulator/.../suspend_disk_mode
What:		/sys/class/regulator/.../suspend_disk_mode
Date:		May 2008
Date:		May 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		suspend_disk_mode. This holds the regulator operating mode
		suspend_disk_mode. This holds the regulator operating mode
@@ -258,7 +271,7 @@ Description:
What:		/sys/class/regulator/.../suspend_standby_mode
What:		/sys/class/regulator/.../suspend_standby_mode
Date:		May 2008
Date:		May 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		suspend_standby_mode. This holds the regulator operating mode
		suspend_standby_mode. This holds the regulator operating mode
@@ -272,7 +285,7 @@ Description:
What:		/sys/class/regulator/.../suspend_mem_state
What:		/sys/class/regulator/.../suspend_mem_state
Date:		May 2008
Date:		May 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		suspend_mem_state. This holds the regulator operating state
		suspend_mem_state. This holds the regulator operating state
@@ -287,7 +300,7 @@ Description:
What:		/sys/class/regulator/.../suspend_disk_state
What:		/sys/class/regulator/.../suspend_disk_state
Date:		May 2008
Date:		May 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		suspend_disk_state. This holds the regulator operating state
		suspend_disk_state. This holds the regulator operating state
@@ -302,7 +315,7 @@ Description:
What:		/sys/class/regulator/.../suspend_standby_state
What:		/sys/class/regulator/.../suspend_standby_state
Date:		May 2008
Date:		May 2008
KernelVersion:	2.6.26
KernelVersion:	2.6.26
Contact:	Liam Girdwood <lg@opensource.wolfsonmicro.com>
Contact:	Liam Girdwood <lrg@slimlogic.co.uk>
Description:
Description:
		Each regulator directory will contain a field called
		Each regulator directory will contain a field called
		suspend_standby_state. This holds the regulator operating
		suspend_standby_state. This holds the regulator operating
+66 −74
Original line number Original line Diff line number Diff line
@@ -2,17 +2,8 @@ Regulator Machine Driver Interface
===================================
===================================


The regulator machine driver interface is intended for board/machine specific
The regulator machine driver interface is intended for board/machine specific
initialisation code to configure the regulator subsystem. Typical things that
initialisation code to configure the regulator subsystem.
machine drivers would do are :-


 1. Regulator -> Device mapping.
 2. Regulator supply configuration.
 3. Power Domain constraint setting.



1. Regulator -> device mapping
==============================
Consider the following machine :-
Consider the following machine :-


  Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V]
  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
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
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,
e.g. for the machine above
				const char *supply);


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");
static struct regulator_consumer_supply regulator2_consumers[] = {
regulator_set_device_supply("Regulator-2", devA, "Vcc");
{
	.dev	= &platform_consumerA_device.dev,
	.supply	= "Vcc",
},};


This maps Regulator-1 to the 'Vcc' supply for Consumer B and maps Regulator-2
This maps Regulator-1 to the 'Vcc' supply for Consumer B and maps Regulator-2
to the 'Vcc' supply for Consumer A.
to the 'Vcc' supply for Consumer A.


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 :-


2. Regulator supply configuration.
static struct regulator_init_data regulator1_data = {
==================================
	.constraints = {
Consider the following machine (again) :-

  Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V]
               |
               +-> [Consumer B @ 3.3V]

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,
		.min_uV = 3300000,
		.max_uV = 3300000,
		.max_uV = 3300000,
		.valid_modes_mask = REGULATOR_MODE_NORMAL,
		.valid_modes_mask = REGULATOR_MODE_NORMAL,
	},
	.num_consumer_supplies = ARRAY_SIZE(regulator1_consumers),
	.consumer_supplies = regulator1_consumers,
};
};


struct regulation_constraints domain_2 = {
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). 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,
		.min_uV = 1800000,
		.max_uV = 2000000,
		.max_uV = 2000000,
		.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
		.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
		.valid_modes_mask = REGULATOR_MODE_NORMAL,
		.valid_modes_mask = REGULATOR_MODE_NORMAL,
	},
	.num_consumer_supplies = ARRAY_SIZE(regulator2_consumers),
	.consumer_supplies = regulator2_consumers,
};

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 = &regulator1_data,
	},
},
{
	.name = "regulator",
	.id = DCDC_2,
	.dev = {
		.platform_data = &regulator2_data,
	},
},
};
};
/* register regulator 1 device */
platform_device_register(&wm8350_regulator_devices[0]);


regulator_set_platform_constraints("Regulator-1", &domain_1);
/* register regulator 2 device */
regulator_set_platform_constraints("Regulator-2", &domain_2);
platform_device_register(&wm8350_regulator_devices[1]);
+4 −4
Original line number Original line Diff line number Diff line
@@ -10,11 +10,11 @@ Registration


Drivers can register a regulator by calling :-
Drivers can register a regulator by calling :-


struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
struct regulator_dev *regulator_register(struct device *dev,
					  void *reg_data);
	struct regulator_desc *regulator_desc);


This will register the regulators capabilities and operations the regulator
This will register the regulators capabilities and operations to the regulator
core. The core does not touch reg_data (private to regulator driver).
core.


Regulators can be unregistered by calling :-
Regulators can be unregistered by calling :-


+2 −1
Original line number Original line Diff line number Diff line
@@ -4520,10 +4520,11 @@ S: Maintained


VOLTAGE AND CURRENT REGULATOR FRAMEWORK
VOLTAGE AND CURRENT REGULATOR FRAMEWORK
P:	Liam Girdwood
P:	Liam Girdwood
M:	lg@opensource.wolfsonmicro.com
M:	lrg@slimlogic.co.uk
P:	Mark Brown
P:	Mark Brown
M:	broonie@opensource.wolfsonmicro.com
M:	broonie@opensource.wolfsonmicro.com
W:	http://opensource.wolfsonmicro.com/node/15
W:	http://opensource.wolfsonmicro.com/node/15
W:	http://www.slimlogic.co.uk/?page_id=5
T:	git kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6.git
T:	git kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6.git
S:	Supported
S:	Supported


+38 −0
Original line number Original line Diff line number Diff line
@@ -87,6 +87,44 @@ config MFD_TC6393XB
	help
	help
	  Support for Toshiba Mobile IO Controller TC6393XB
	  Support for Toshiba Mobile IO Controller TC6393XB


config MFD_WM8400
	tristate "Support Wolfson Microelectronics WM8400"
	help
	  Support for the Wolfson Microelecronics WM8400 PMIC and audio
	  CODEC.  This driver adds provides common support for accessing
	  the device, additional drivers must be enabled in order to use
	  the functionality of the device.

config MFD_WM8350
	tristate

config MFD_WM8350_CONFIG_MODE_0
	bool
	depends on MFD_WM8350

config MFD_WM8350_CONFIG_MODE_1
	bool
	depends on MFD_WM8350

config MFD_WM8350_CONFIG_MODE_2
	bool
	depends on MFD_WM8350

config MFD_WM8350_CONFIG_MODE_3
	bool
	depends on MFD_WM8350

config MFD_WM8350_I2C
	tristate "Support Wolfson Microelectronics WM8350 with I2C"
	select MFD_WM8350
	depends on I2C
	help
	  The WM8350 is an integrated audio and power management
	  subsystem with watchdog and RTC functionality for embedded
	  systems.  This option enables core support for the WM8350 with
	  I2C as the control interface.  Additional options must be
	  selected to enable support for the functionality of the chip.

endmenu
endmenu


menu "Multimedia Capabilities Port drivers"
menu "Multimedia Capabilities Port drivers"
Loading