Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
voltage.c File Reference
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/err.h>
#include <linux/export.h>
#include <linux/debugfs.h>
#include <linux/slab.h>
#include <linux/clk.h>
#include "common.h"
#include "prm-regbits-34xx.h"
#include "prm-regbits-44xx.h"
#include "prm44xx.h"
#include "prcm44xx.h"
#include "prminst44xx.h"
#include "control.h"
#include "voltage.h"
#include "powerdomain.h"
#include "vc.h"
#include "vp.h"

Go to the source code of this file.

Functions

unsigned long voltdm_get_voltage (struct voltagedomain *voltdm)
 
int voltdm_scale (struct voltagedomain *voltdm, unsigned long target_volt)
 
void voltdm_reset (struct voltagedomain *voltdm)
 
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 __init omap_voltage_late_init (void)
 
int voltdm_add_pwrdm (struct voltagedomain *voltdm, struct powerdomain *pwrdm)
 
int voltdm_for_each_pwrdm (struct voltagedomain *voltdm, int(*fn)(struct voltagedomain *voltdm, struct powerdomain *pwrdm))
 
int voltdm_for_each (int(*fn)(struct voltagedomain *voltdm, void *user), void *user)
 
. Returns a pointer

to the struct voltagedomain if found, or NULL otherwise.

struct voltagedomainvoltdm_lookup (const char *name)
 
void voltdm_init (struct voltagedomain **voltdms)
 

Function Documentation

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 __init 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.