Logo Search packages:      
Sourcecode: linux version File versions

dvfs_core.c File Reference


Detailed Description

A simplied driver for the Freescale Semiconductor MXC DVFS module.

Upon initialization, the DVFS driver initializes the DVFS hardware sets up driver nodes attaches to the DVFS interrupt and initializes internal data structures. When the DVFS interrupt occurs the driver checks the cause of the interrupt (lower frequency, increase frequency or emergency) and changes the CPU voltage according to translation table that is loaded into the driver.

Definition in file dvfs_core.c.

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/fs.h>
#include <linux/interrupt.h>
#include <linux/jiffies.h>
#include <linux/device.h>
#include <linux/sysdev.h>
#include <linux/delay.h>
#include <linux/clk.h>
#include <linux/regulator/consumer.h>
#include <linux/input.h>
#include <linux/platform_device.h>

Go to the source code of this file.

Defines

#define DVFS_LTBRSR   (2 << MXC_DVFSCNTR_LTBRSR_OFFSET)
#define MXC_DVFSCNTR_DVFEN   0x00000001
#define MXC_DVFSCNTR_DVFEV   0x10000000
#define MXC_DVFSCNTR_DVFIS   0x01000000
#define MXC_DVFSCNTR_FSVAI_MASK   0x00300000
#define MXC_DVFSCNTR_FSVAI_OFFSET   20
#define MXC_DVFSCNTR_FSVAIM   0x00400000
#define MXC_DVFSCNTR_LBFL   0x06000000
#define MXC_DVFSCNTR_LBMI   0x08000000
#define MXC_DVFSCNTR_LTBRSR_MASK   0x00000018
#define MXC_DVFSCNTR_LTBRSR_OFFSET   3
#define MXC_DVFSCNTR_MAXF_MASK   0x00040000
#define MXC_DVFSCNTR_MAXF_OFFSET   18
#define MXC_DVFSCNTR_MINF_MASK   0x00020000
#define MXC_DVFSCNTR_MINF_OFFSET   17
#define MXC_DVFSCNTR_WFIM   0x00080000
#define MXC_DVFSCNTR_WFIM_OFFSET   19
#define MXC_DVFSCOUN_DNCNT_MASK   0x00FF0000
#define MXC_DVFSCOUN_DNCNT_OFFSET   16
#define MXC_DVFSCOUN_UPCNT_MASK   0x000000FF
#define MXC_DVFSCOUN_UPCNT_OFFSET   0
#define MXC_DVFSEMAC_EMAC_MASK   0x000001FF
#define MXC_DVFSEMAC_EMAC_OFFSET   0
#define MXC_DVFSTHRS_DNTHR_MASK   0x003F0000
#define MXC_DVFSTHRS_DNTHR_OFFSET   16
#define MXC_DVFSTHRS_PNCTHR_MASK   0x0000003F
#define MXC_DVFSTHRS_PNCTHR_OFFSET   0
#define MXC_DVFSTHRS_UPTHR_MASK   0x0FC00000
#define MXC_DVFSTHRS_UPTHR_OFFSET   22
#define MXC_GPCCNTR_ADU   0x00008000
#define MXC_GPCCNTR_DVFS0CR   0x00010000
#define MXC_GPCCNTR_FUPD   0x00002000
#define MXC_GPCCNTR_GPCIRQ   0x00100000
#define MXC_GPCCNTR_HTRI_MASK   0x0000000F
#define MXC_GPCCNTR_HTRI_OFFSET   0
#define MXC_GPCCNTR_STRT   0x00004000
#define MXC_GPCVCR_VCNT_MASK   0x00007FFF
#define MXC_GPCVCR_VCNT_OFFSET   0
#define MXC_GPCVCR_VCNTU_MASK   0x00010000
#define MXC_GPCVCR_VCNTU_OFFSET   16
#define MXC_GPCVCR_VINC_MASK   0x00020000
#define MXC_GPCVCR_VINC_OFFSET   17

Enumerations

enum  { FSVAI_FREQ_NOCHANGE = 0x0, FSVAI_FREQ_INCREASE, FSVAI_FREQ_DECREASE, FSVAI_FREQ_EMERG }

Functions

 DEFINE_SPINLOCK (mxc_dvfs_core_lock)
static DEVICE_ATTR (enable, 0644, dvfs_enable_show, dvfs_enable_store)
static void __exit dvfs_cleanup (void)
static void dvfs_core_workqueue_handler (struct work_struct *work)
static ssize_t dvfs_enable_show (struct device *dev, struct device_attribute *attr, char *buf)
static ssize_t dvfs_enable_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
static int __init dvfs_init (void)
static irqreturn_t dvfs_irq (int irq, void *dev_id)
static void dvfs_load_config (void)
static int init_dvfs_controller (void)
 MODULE_AUTHOR ("Freescale Semiconductor, Inc.")
 MODULE_DESCRIPTION ("DVFS driver")
 module_exit (dvfs_cleanup)
 module_init (dvfs_init)
 MODULE_LICENSE ("GPL")
static int __devinit mxc_dvfs_core_probe (struct platform_device *pdev)
static int mxc_dvfs_core_resume (struct platform_device *pdev)
static int mxc_dvfs_core_suspend (struct platform_device *pdev, pm_message_t state)
static int start_dvfs (void)
static void stop_dvfs (void)

Variables

static struct regulator * core_regulator
static struct clk * cpu_clk
static struct cpu_wp * cpu_wp_tbl
int curr_wp
static struct clk * dvfs_clk
int dvfs_core_is_active
static struct delayed_work dvfs_core_work
static struct
mxc_dvfs_platform_data * 
dvfs_data
static struct devicedvfs_dev
static struct platform_driver mxc_dvfs_core_driver


Generated by  Doxygen 1.6.0   Back to index