Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros
voltage.h File Reference
#include <linux/err.h>
#include <linux/platform_data/voltage-omap.h>
#include "vc.h"
#include "vp.h"

Go to the source code of this file.

Data Structures

struct  omap_vfsm_instance
 
struct  voltagedomain
 
struct  omap_voltdm_pmic
 

Macros

#define VOLTSCALE_VPFORCEUPDATE   1
 
#define VOLTSCALE_VCBYPASS   2
 
#define OMAP3_CLKSETUP   0xff
 
#define OMAP3_VOLTOFFSET   0xff
 
#define OMAP3_VOLTSETUP2   0xff
 

Functions

: Name of the voltage domain which can be used as a unique identifier.

struct voltagedomain - omap voltage domain global structure.

: Whether or not this voltage domain is scalable : list_head linking all voltage domains : list_head linking all powerdomains in this voltagedomain : pointer to VC channel associated with this voltagedomain : pointer to VP associated with this voltagedomain : read a VC/VP register : write a VC/VP register : read-modify-write a VC/VP register : system clock name/frequency, used for various timing calculations : function used to scale the voltage of the voltagedomain : current nominal voltage for this voltage domain : voltage table having the distinct voltages supported by the domain and other associated per voltage data.

void omap_voltage_get_volttable (struct voltagedomain *voltdm, struct omap_volt_data **volt_data)
 
struct omap_volt_dataomap_voltage_get_voltdata (struct voltagedomain *voltdm, unsigned long volt)
 
int omap_voltage_register_pmic (struct voltagedomain *voltdm, struct omap_voltdm_pmic *pmic)
 
void omap_change_voltscale_method (struct voltagedomain *voltdm, int voltscale_method)
 
int omap_voltage_late_init (void)
 
void omap2xxx_voltagedomains_init (void)
 
void omap3xxx_voltagedomains_init (void)
 
void am33xx_voltagedomains_init (void)
 
void omap44xx_voltagedomains_init (void)
 
struct voltagedomainvoltdm_lookup (const char *name)
 
void voltdm_init (struct voltagedomain **voltdm_list)
 
int voltdm_add_pwrdm (struct voltagedomain *voltdm, struct powerdomain *pwrdm)
 
int voltdm_for_each (int(*fn)(struct voltagedomain *voltdm, void *user), void *user)
 
int voltdm_for_each_pwrdm (struct voltagedomain *voltdm, int(*fn)(struct voltagedomain *voltdm, struct powerdomain *pwrdm))
 
int voltdm_scale (struct voltagedomain *voltdm, unsigned long target_volt)
 
void voltdm_reset (struct voltagedomain *voltdm)
 
unsigned long voltdm_get_voltage (struct voltagedomain *voltdm)
 

Macro Definition Documentation

#define OMAP3_CLKSETUP   0xff

Definition at line 34 of file voltage.h.

#define OMAP3_VOLTOFFSET   0xff

Definition at line 35 of file voltage.h.

#define OMAP3_VOLTSETUP2   0xff

Definition at line 36 of file voltage.h.

#define VOLTSCALE_VCBYPASS   2

Definition at line 28 of file voltage.h.

#define VOLTSCALE_VPFORCEUPDATE   1

Definition at line 27 of file voltage.h.

Function Documentation

void am33xx_voltagedomains_init ( void  )

Definition at line 40 of file voltagedomains33xx_data.c.

void omap2xxx_voltagedomains_init ( void  )

Definition at line 29 of file voltagedomains2xxx_data.c.

void omap3xxx_voltagedomains_init ( void  )

Definition at line 100 of file voltagedomains3xxx_data.c.

void omap44xx_voltagedomains_init ( void  )

Definition at line 94 of file voltagedomains44xx_data.c.

void omap_change_voltscale_method ( struct voltagedomain voltdm,
int  voltscale_method 
)

omap_change_voltscale_method() - API to change the voltage scaling method. : pointer to the VDD whose voltage scaling method has to be changed. : the method to be used for voltage scaling.

This API can be used by the board files to change the method of voltage scaling between vpforceupdate and vcbypass. The parameter values are defined in voltage.h

Definition at line 236 of file voltage.c.

struct omap_volt_data* omap_voltage_get_voltdata ( struct voltagedomain voltdm,
unsigned long  volt 
)
read

omap_voltage_get_voltdata() - API to get the voltage table entry for a particular voltage : pointer to the VDD whose voltage table has to be searched : the voltage to be searched in the voltage table

This API searches through the voltage table for the required voltage domain and tries to find a matching entry for the passed voltage volt. If a matching entry is found volt_data is populated with that entry. This API searches only through the non-compensated voltages int the voltage table. Returns pointer to the voltage table entry corresponding to volt on success. Returns -ENODATA if no voltage table exisits for the passed voltage domain or if there is no matching entry.

Definition at line 177 of file voltage.c.

void omap_voltage_get_volttable ( struct voltagedomain voltdm,
struct omap_volt_data **  volt_data 
)

omap_voltage_get_volttable() - API to get the voltage table associated with a particular voltage domain. : pointer to the VDD for which the voltage table is required : the voltage table for the particular vdd which is to be populated by this API

This API populates the voltage table associated with a VDD into the passed parameter pointer. Returns the count of distinct voltages supported by this vdd.

Definition at line 151 of file voltage.c.

int omap_voltage_late_init ( void  )

omap_voltage_late_init() - Init the various voltage parameters

This API is to be called in the later stages of the system boot to init the voltage controller and voltage processors.

Definition at line 264 of file voltage.c.

int omap_voltage_register_pmic ( struct voltagedomain voltdm,
struct omap_voltdm_pmic pmic 
)

omap_voltage_register_pmic() - API to register PMIC specific data : pointer to the VDD for which the PMIC specific data is to be registered : the structure containing pmic info

This API is to be called by the SOC/PMIC file to specify the pmic specific info as present in omap_voltdm_pmic structure.

Definition at line 213 of file voltage.c.

int voltdm_add_pwrdm ( struct voltagedomain voltdm,
struct powerdomain pwrdm 
)

voltdm_add_pwrdm - add a powerdomain to a voltagedomain : struct voltagedomain * to add the powerdomain to : struct powerdomain * to associate with a voltagedomain

Associate the powerdomain with a voltagedomain . This enables the use of voltdm_for_each_pwrdm(). Returns -EINVAL if presented with invalid pointers; -ENOMEM if memory could not be allocated; or 0 upon success.

Definition at line 329 of file voltage.c.

int voltdm_for_each ( int(*)(struct voltagedomain *voltdm, void *user fn,
void user 
)

Definition at line 379 of file voltage.c.

int voltdm_for_each_pwrdm ( struct voltagedomain voltdm,
int(*)(struct voltagedomain *voltdm, struct powerdomain *pwrdm)  fn 
)

Definition at line 353 of file voltage.c.

unsigned long voltdm_get_voltage ( struct voltagedomain voltdm)

voltdm_get_voltage() - Gets the current non-auto-compensated voltage : pointer to the voltdm for which current voltage info is needed

API to get the current non-auto-compensated voltage for a voltage domain. Returns 0 in case of error else returns the current voltage.

Definition at line 55 of file voltage.c.

void voltdm_init ( struct voltagedomain **  voltdms)

voltdm_init - set up the voltagedomain layer : array of struct voltagedomain pointers to register

Loop through the array of voltagedomains , registering all that are available on the current CPU. If voltdm_list is supplied and not null, all of the referenced voltagedomains will be registered. No return value.

Definition at line 438 of file voltage.c.

struct voltagedomain* voltdm_lookup ( const char name)
read

Definition at line 417 of file voltage.c.

void voltdm_reset ( struct voltagedomain voltdm)

voltdm_reset() - Resets the voltage of a particular voltage domain to that of the current OPP. : pointer to the voltage domain whose voltage is to be reset.

This API finds out the correct voltage the voltage domain is supposed to be at and resets the voltage to that level. Should be used especially while disabling any voltage compensation modules.

Definition at line 120 of file voltage.c.

int voltdm_scale ( struct voltagedomain voltdm,
unsigned long  target_volt 
)

voltdm_scale() - API to scale voltage of a particular voltage domain. : pointer to the voltage domain which is to be scaled. : The target voltage of the voltage domain

This API should be called by the kernel to do the voltage scaling for a particular voltage domain during DVFS.

Definition at line 73 of file voltage.c.