Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Enumerations
driver.h File Reference
#include <linux/device.h>
#include <linux/notifier.h>
#include <linux/regulator/consumer.h>

Go to the source code of this file.

Data Structures

struct  regulator_ops
 
struct  regulator_desc
 
struct  regulator_config
 
struct  regulator_dev
 

Enumerations

enum  regulator_status {
  REGULATOR_STATUS_OFF, REGULATOR_STATUS_ON, REGULATOR_STATUS_ERROR, REGULATOR_STATUS_FAST,
  REGULATOR_STATUS_NORMAL, REGULATOR_STATUS_IDLE, REGULATOR_STATUS_STANDBY, REGULATOR_STATUS_BYPASS,
  REGULATOR_STATUS_UNDEFINED
}
 
enum  regulator_type { REGULATOR_VOLTAGE, REGULATOR_CURRENT }
 

Functions

: Identifying name for the regulator.

struct regulator_desc - Static regulator descriptor

Each regulator registered with the core is described with a structure of this type and a struct regulator_config. This structure contains the non-varying parts of the regulator description.

: Identifying the regulator supply : Numerical identifier for the regulator. : Regulator operations table. : Interrupt number for the regulator. : Indicates if the regulator is a voltage or current regulator. : Module providing the regulator, used for refcounting.

: Number of selectors available for ops.list_voltage().

: Voltage given by the lowest selector (if linear mapping) : Voltage increase with each selector (if linear mapping) : Time to settle down after voltage change (unit: uV/us) : Voltage mapping table (if table based mapping)

: Register for selector when using regulator_regmap_X_voltage_ : Mask for register bitfield used for selector : Register for control when using regmap enable/disable ops : Mask for control when using regmap enable/disable ops

: Time taken for initial enable of regulator (in uS).

struct regulator_devregulator_register (const struct regulator_desc *regulator_desc, const struct regulator_config *config)
 
void regulator_unregister (struct regulator_dev *rdev)
 
int regulator_notifier_call_chain (struct regulator_dev *rdev, unsigned long event, void *data)
 
voidrdev_get_drvdata (struct regulator_dev *rdev)
 
struct devicerdev_get_dev (struct regulator_dev *rdev)
 
int rdev_get_id (struct regulator_dev *rdev)
 
int regulator_mode_to_status (unsigned int)
 
int regulator_list_voltage_linear (struct regulator_dev *rdev, unsigned int selector)
 
int regulator_list_voltage_table (struct regulator_dev *rdev, unsigned int selector)
 
int regulator_map_voltage_linear (struct regulator_dev *rdev, int min_uV, int max_uV)
 
int regulator_map_voltage_iterate (struct regulator_dev *rdev, int min_uV, int max_uV)
 
int regulator_get_voltage_sel_regmap (struct regulator_dev *rdev)
 
int regulator_set_voltage_sel_regmap (struct regulator_dev *rdev, unsigned sel)
 
int regulator_is_enabled_regmap (struct regulator_dev *rdev)
 
int regulator_enable_regmap (struct regulator_dev *rdev)
 
int regulator_disable_regmap (struct regulator_dev *rdev)
 
int regulator_set_voltage_time_sel (struct regulator_dev *rdev, unsigned int old_selector, unsigned int new_selector)
 
int regulator_set_bypass_regmap (struct regulator_dev *rdev, bool enable)
 
int regulator_get_bypass_regmap (struct regulator_dev *rdev, bool *enable)
 
voidregulator_get_init_drvdata (struct regulator_init_data *reg_init_data)
 

Enumeration Type Documentation

Enumerator:
REGULATOR_STATUS_OFF 
REGULATOR_STATUS_ON 
REGULATOR_STATUS_ERROR 
REGULATOR_STATUS_FAST 
REGULATOR_STATUS_NORMAL 
REGULATOR_STATUS_IDLE 
REGULATOR_STATUS_STANDBY 
REGULATOR_STATUS_BYPASS 
REGULATOR_STATUS_UNDEFINED 

Definition at line 26 of file driver.h.

Enumerator:
REGULATOR_VOLTAGE 
REGULATOR_CURRENT 

Definition at line 163 of file driver.h.

Function Documentation

struct device* rdev_get_dev ( struct regulator_dev rdev)
read

Definition at line 3653 of file core.c.

void* rdev_get_drvdata ( struct regulator_dev rdev)

rdev_get_drvdata - get rdev regulator driver data : regulator

Get rdev regulator driver private data. This call can be used in the regulator driver context.

Definition at line 3613 of file core.c.

int rdev_get_id ( struct regulator_dev rdev)

regulator_get_id - get regulator ID : regulator

Definition at line 3647 of file core.c.

int regulator_disable_regmap ( struct regulator_dev rdev)

regulator_disable_regmap - standard disable() for regmap users

: regulator to operate on

Regulators that use regmap for their register I/O can set the enable_reg and enable_mask fields in their descriptor and then use this as their disable() operation, saving some code.

Definition at line 1822 of file core.c.

int regulator_enable_regmap ( struct regulator_dev rdev)

regulator_enable_regmap - standard enable() for regmap users

: regulator to operate on

Regulators that use regmap for their register I/O can set the enable_reg and enable_mask fields in their descriptor and then use this as their enable() operation, saving some code.

Definition at line 1805 of file core.c.

int regulator_get_bypass_regmap ( struct regulator_dev rdev,
bool enable 
)

regulator_get_bypass_regmap - Default get_bypass() using regmap

: device to operate on. : current state.

Definition at line 2745 of file core.c.

void* regulator_get_init_drvdata ( struct regulator_init_data reg_init_data)

Definition at line 3659 of file core.c.

int regulator_get_voltage_sel_regmap ( struct regulator_dev rdev)

regulator_get_voltage_sel_regmap - standard get_voltage_sel for regmap users

: regulator to operate on

Regulators that use regmap for their register I/O can set the vsel_reg and vsel_mask fields in their descriptor and then use this as their get_voltage_vsel operation, saving some code.

Definition at line 2013 of file core.c.

int regulator_is_enabled_regmap ( struct regulator_dev rdev)

regulator_is_enabled_regmap - standard is_enabled() for regmap users

: regulator to operate on

Regulators that use regmap for their register I/O can set the enable_reg and enable_mask fields in their descriptor and then use this as their is_enabled operation, saving some code.

Definition at line 1783 of file core.c.

int regulator_list_voltage_linear ( struct regulator_dev rdev,
unsigned int  selector 
)

regulator_list_voltage_linear - List voltages with simple calculation

: Regulator device : Selector to convert into a voltage

Regulators with a simple linear mapping between voltages and selectors can set min_uV and uV_step in the regulator descriptor and then use this function as their list_voltage() operation,

Definition at line 1895 of file core.c.

int regulator_list_voltage_table ( struct regulator_dev rdev,
unsigned int  selector 
)

regulator_list_voltage_table - List voltages with table based mapping

: Regulator device : Selector to convert into a voltage

Regulators with table based mapping between voltages and selectors can set volt_table in the regulator descriptor and then use this function as their list_voltage() operation.

Definition at line 1915 of file core.c.

int regulator_map_voltage_iterate ( struct regulator_dev rdev,
int  min_uV,
int  max_uV 
)

regulator_map_voltage_iterate - map_voltage() based on list_voltage()

: Regulator to operate on : Lower bound for voltage : Upper bound for voltage

Drivers implementing set_voltage_sel() and list_voltage() can use this as their map_voltage() operation. It will find a suitable voltage by calling list_voltage() until it gets something in bounds for the requested voltages.

Definition at line 2060 of file core.c.

int regulator_map_voltage_linear ( struct regulator_dev rdev,
int  min_uV,
int  max_uV 
)

regulator_map_voltage_linear - map_voltage() for simple linear mappings

: Regulator to operate on : Lower bound for voltage : Upper bound for voltage

Drivers providing min_uV and uV_step in their regulator_desc can use this as their map_voltage() operation.

Definition at line 2098 of file core.c.

int regulator_mode_to_status ( unsigned int  mode)

regulator_mode_to_status - convert a regulator mode into a status

: Mode to convert

Convert a regulator mode into a status.

Definition at line 3122 of file core.c.

int regulator_notifier_call_chain ( struct regulator_dev rdev,
unsigned long  event,
void data 
)

regulator_notifier_call_chain - call regulator event notifier : regulator source : notifier block : callback-specific data.

Called by regulator drivers to notify clients a regulator event has occurred. We also notify regulator clients downstream. Note lock must be held by caller.

Definition at line 3106 of file core.c.

struct regulator_dev* regulator_register ( const struct regulator_desc regulator_desc,
const struct regulator_config config 
)
read

regulator_register - register regulator : regulator to register : runtime configuration for regulator

Called by regulator drivers to register a regulator. Returns 0 on success.

Definition at line 3283 of file core.c.

int regulator_set_bypass_regmap ( struct regulator_dev rdev,
bool  enable 
)

regulator_set_bypass_regmap - Default set_bypass() using regmap

: device to operate on. : state to set.

Definition at line 2725 of file core.c.

int regulator_set_voltage_sel_regmap ( struct regulator_dev rdev,
unsigned  sel 
)

regulator_set_voltage_sel_regmap - standard set_voltage_sel for regmap users

: regulator to operate on : Selector to set

Regulators that use regmap for their register I/O can set the vsel_reg and vsel_mask fields in their descriptor and then use this as their set_voltage_vsel operation, saving some code.

Definition at line 2039 of file core.c.

int regulator_set_voltage_time_sel ( struct regulator_dev rdev,
unsigned int  old_selector,
unsigned int  new_selector 
)

regulator_set_voltage_time_sel - get raise/fall time : regulator source device : selector for starting voltage : selector for target voltage

Provided with the starting and target voltage selectors, this function returns time in microseconds required to rise or fall to this new voltage

Drivers providing ramp_delay in regulation_constraints can use this as their set_voltage_time_sel() operation.

Definition at line 2346 of file core.c.

void regulator_unregister ( struct regulator_dev rdev)

regulator_unregister - unregister regulator : regulator to unregister

Called by regulator drivers to unregister a regulator.

Definition at line 3477 of file core.c.