Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
smartreflex.c File Reference
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
#include <linux/power/smartreflex.h>
#include <plat/cpu.h>

Go to the source code of this file.

Macros

#define SMARTREFLEX_NAME_LEN   16
 
#define NVALUE_NAME_LEN   40
 
#define SR_DISABLE_TIMEOUT   200
 

Functions

int sr_configure_errgen (struct voltagedomain *voltdm)
 
int sr_disable_errgen (struct voltagedomain *voltdm)
 
int sr_configure_minmax (struct voltagedomain *voltdm)
 
int sr_enable (struct voltagedomain *voltdm, unsigned long volt)
 
void sr_disable (struct voltagedomain *voltdm)
 
int sr_register_class (struct omap_sr_class_data *class_data)
 
void omap_sr_enable (struct voltagedomain *voltdm)
 
void omap_sr_disable (struct voltagedomain *voltdm)
 
void omap_sr_disable_reset_volt (struct voltagedomain *voltdm)
 
void omap_sr_register_pmic (struct omap_sr_pmic_data *pmic_data)
 
 DEFINE_SIMPLE_ATTRIBUTE (pm_sr_fops, omap_sr_autocomp_show, omap_sr_autocomp_store,"%llu\n")
 
 late_initcall (sr_init)
 
 module_exit (sr_exit)
 
 MODULE_DESCRIPTION ("OMAP Smartreflex Driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS ("platform:"DRIVER_NAME)
 
 MODULE_AUTHOR ("Texas Instruments Inc")
 

Macro Definition Documentation

#define NVALUE_NAME_LEN   40

Definition at line 33 of file smartreflex.c.

#define SMARTREFLEX_NAME_LEN   16

Definition at line 32 of file smartreflex.c.

#define SR_DISABLE_TIMEOUT   200

Definition at line 34 of file smartreflex.c.

Function Documentation

DEFINE_SIMPLE_ATTRIBUTE ( pm_sr_fops  ,
omap_sr_autocomp_show  ,
omap_sr_autocomp_store  ,
"%llu\n"   
)
late_initcall ( sr_init  )
MODULE_ALIAS ( "platform:"  DRIVER_NAME)
MODULE_AUTHOR ( "Texas Instruments Inc"  )
MODULE_DESCRIPTION ( "OMAP Smartreflex Driver"  )
module_exit ( sr_exit  )
MODULE_LICENSE ( "GPL"  )
void omap_sr_disable ( struct voltagedomain voltdm)

omap_sr_disable() - API to disable SR without resetting the voltage processor voltage : VDD pointer to which the SR module to be configured belongs to.

This API is to be called from the kernel in order to disable a particular smartreflex module. This API will in turn call into the registered smartreflex class disable API. This API will tell the smartreflex class disable not to reset the VP voltage after disabling smartreflex.

Definition at line 753 of file smartreflex.c.

void omap_sr_disable_reset_volt ( struct voltagedomain voltdm)

omap_sr_disable_reset_volt() - API to disable SR and reset the voltage processor voltage : VDD pointer to which the SR module to be configured belongs to.

This API is to be called from the kernel in order to disable a particular smartreflex module. This API will in turn call into the registered smartreflex class disable API. This API will tell the smartreflex class disable to reset the VP voltage after disabling smartreflex.

Definition at line 785 of file smartreflex.c.

void omap_sr_enable ( struct voltagedomain voltdm)

omap_sr_enable() - API to enable SR clocks and to call into the registered smartreflex class enable API. : VDD pointer to which the SR module to be configured belongs to.

This API is to be called from the kernel in order to enable a particular smartreflex module. This API will do the initial configurations to turn on the smartreflex module and in turn call into the registered smartreflex class enable API.

Definition at line 721 of file smartreflex.c.

void omap_sr_register_pmic ( struct omap_sr_pmic_data *  pmic_data)

omap_sr_register_pmic() - API to register pmic specific info. : The structure containing pmic specific data.

This API is to be called from the PMIC specific code to register with smartreflex driver pmic specific info. Currently the only info required is the smartreflex init on the PMIC side.

Definition at line 814 of file smartreflex.c.

int sr_configure_errgen ( struct voltagedomain voltdm)

sr_configure_errgen() - Configures the smrtreflex to perform AVS using the error generator module. : VDD pointer to which the SR module to be configured belongs to.

This API is to be called from the smartreflex class driver to configure the error generator module inside the smartreflex module. SR settings if using the ERROR module inside Smartreflex. SR CLASS 3 by default uses only the ERROR module where as SR CLASS 2 can choose between ERROR module and MINMAXAVG module. Returns 0 on success and error value in case of failure.

Definition at line 382 of file smartreflex.c.

int sr_configure_minmax ( struct voltagedomain voltdm)

sr_configure_minmax() - Configures the smrtreflex to perform AVS using the minmaxavg module. : VDD pointer to which the SR module to be configured belongs to.

This API is to be called from the smartreflex class driver to configure the minmaxavg module inside the smartreflex module. SR settings if using the ERROR module inside Smartreflex. SR CLASS 3 by default uses only the ERROR module where as SR CLASS 2 can choose between ERROR module and MINMAXAVG module. Returns 0 on success and error value in case of failure.

Definition at line 500 of file smartreflex.c.

void sr_disable ( struct voltagedomain voltdm)

sr_disable() - Disables the smartreflex module. : VDD pointer to which the SR module to be configured belongs to.

This API is to be called from the smartreflex class driver to disable a smartreflex module.

Definition at line 641 of file smartreflex.c.

int sr_disable_errgen ( struct voltagedomain voltdm)

sr_disable_errgen() - Disables SmartReflex AVS module's errgen component : VDD pointer to which the SR module to be configured belongs to.

This API is to be called from the smartreflex class driver to disable the error generator module inside the smartreflex module.

Returns 0 on success and error value in case of failure.

Definition at line 451 of file smartreflex.c.

int sr_enable ( struct voltagedomain voltdm,
unsigned long  volt 
)

sr_enable() - Enables the smartreflex module. : VDD pointer to which the SR module to be configured belongs to. : The voltage at which the Voltage domain associated with the smartreflex module is operating at. This is required only to program the correct Ntarget value.

This API is to be called from the smartreflex class driver to enable a smartreflex module. Returns 0 on success. Returns error value if the voltage passed is wrong or if ntarget value is wrong.

Definition at line 585 of file smartreflex.c.

int sr_register_class ( struct omap_sr_class_data *  class_data)

sr_register_class() - API to register a smartreflex class parameters. : The structure containing various sr class specific data.

This API is to be called by the smartreflex class driver to register itself with the smartreflex driver during init. Returns 0 on success else the error value.

Definition at line 683 of file smartreflex.c.