Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

dvfs_v2.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_v2.c.

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/jiffies.h>
#include <linux/device.h>
#include <linux/sysdev.h>
#include <linux/delay.h>
#include <linux/clk.h>
#include <linux/pmic_external.h>
#include <mach/pmic_power.h>
#include "iomux.h"
#include "crm_regs.h"

Go to the source code of this file.

Defines

#define DVFS_DIV3CK   (3 << MXC_CCM_LTR0_DIV3CK_OFFSET)
#define DVFS_DNCNT   (0x33 << MXC_CCM_LTR1_DNCNT_OFFSET)
#define DVFS_DNTHR   (18 << MXC_CCM_LTR0_DNTHR_OFFSET)
#define DVFS_EMAC   (0x20 << MXC_CCM_LTR2_EMAC_OFFSET)
#define DVFS_LTBRSR   (1 << MXC_CCM_LTR1_LTBRSR_OFFSET)
#define DVFS_PNCTHR   (63 << MXC_CCM_LTR1_PNCTHR_OFFSET)
#define DVFS_UPCNT   (0x33 << MXC_CCM_LTR1_UPCNT_OFFSET)
#define DVFS_UPTHR   (30 << MXC_CCM_LTR0_UPTHR_OFFSET)
#define MXC_CCM_LTR0_CONFIG_MASK
#define MXC_CCM_LTR0_CONFIG_VAL   (DVFS_UPTHR | DVFS_DNTHR | DVFS_DIV3CK)
#define MXC_CCM_LTR1_CONFIG_MASK
#define MXC_CCM_LTR1_CONFIG_VAL

Enumerations

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

Functions

 DEFINE_SPINLOCK (mxc_dvfs_lock)
static void __exit dvfs_cleanup (void)
static ssize_t dvfs_debug_show (struct sys_device *dev, struct sysdev_attribute *attr, char *buf)
static ssize_t dvfs_debug_store (struct sys_device *dev, struct sysdev_attribute *attr, const char *buf, size_t size)
static ssize_t dvfs_enable_store (struct sys_device *dev, struct sysdev_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 ssize_t dvfs_status_show (struct sys_device *dev, struct sysdev_attribute *attr, char *buf)
static ssize_t dvfs_status_store (struct sys_device *dev, struct sysdev_attribute *attr, const char *buf, size_t size)
static void dvfs_sysdev_ctrl_exit (void)
static int dvfs_sysdev_ctrl_init (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")
void pmic_voltage_init (void)
static void set_gp_weight (int gp_id, u8 weight)
static int start_dvfs (void)
static void stop_dvfs (void)
static SYSDEV_ATTR (debug, 0644, dvfs_debug_show, dvfs_debug_store)
static SYSDEV_ATTR (status, 0644, dvfs_status_show, dvfs_status_store)
static SYSDEV_ATTR (enable, 0200, NULL, dvfs_enable_store)

Variables

static struct clk * ahb_clk
static struct clk * cpu_clk
static struct sys_device dvfs_device
static int dvfs_is_active
static u32 dvfs_nr_dn [4]
static u32 dvfs_nr_up [4]
static struct sysdev_class dvfs_sysclass
static const u8 ltr_gp_weight []


Generated by  Doxygen 1.6.0   Back to index