Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
max77686.c File Reference
#include <linux/kernel.h>
#include <linux/bug.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
#include <linux/mfd/max77686.h>
#include <linux/mfd/max77686-private.h>

Go to the source code of this file.

Data Structures

struct  max77686_data
 

Macros

#define MAX77686_LDO_MINUV   800000
 
#define MAX77686_LDO_UVSTEP   50000
 
#define MAX77686_LDO_LOW_MINUV   800000
 
#define MAX77686_LDO_LOW_UVSTEP   25000
 
#define MAX77686_BUCK_MINUV   750000
 
#define MAX77686_BUCK_UVSTEP   50000
 
#define MAX77686_RAMP_DELAY   100000 /* uV/us */
 
#define MAX77686_DVS_RAMP_DELAY   27500 /* uV/us */
 
#define MAX77686_DVS_MINUV   600000
 
#define MAX77686_DVS_UVSTEP   12500
 
#define MAX77686_OPMODE_SHIFT   6
 
#define MAX77686_OPMODE_BUCK234_SHIFT   4
 
#define MAX77686_OPMODE_MASK   0x3
 
#define MAX77686_VSEL_MASK   0x3F
 
#define MAX77686_DVS_VSEL_MASK   0xFF
 
#define MAX77686_RAMP_RATE_MASK   0xC0
 
#define MAX77686_REGULATORS   MAX77686_REG_MAX
 
#define MAX77686_LDOS   26
 
#define regulator_desc_ldo(num)
 
#define regulator_desc_ldo_low(num)
 
#define regulator_desc_buck(num)
 
#define regulator_desc_buck1(num)
 
#define regulator_desc_buck_dvs(num)
 

Enumerations

enum  max77686_ramp_rate { RAMP_RATE_13P75MV, RAMP_RATE_27P5MV, RAMP_RATE_55MV, RAMP_RATE_NO_CTRL }
 

Functions

 MODULE_DEVICE_TABLE (platform, max77686_pmic_id)
 
 subsys_initcall (max77686_pmic_init)
 
 module_exit (max77686_pmic_cleanup)
 
 MODULE_DESCRIPTION ("MAXIM 77686 Regulator Driver")
 
 MODULE_AUTHOR ("Chiwoong Byun <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define MAX77686_BUCK_MINUV   750000

Definition at line 42 of file max77686.c.

#define MAX77686_BUCK_UVSTEP   50000

Definition at line 43 of file max77686.c.

#define MAX77686_DVS_MINUV   600000

Definition at line 46 of file max77686.c.

#define MAX77686_DVS_RAMP_DELAY   27500 /* uV/us */

Definition at line 45 of file max77686.c.

#define MAX77686_DVS_UVSTEP   12500

Definition at line 47 of file max77686.c.

#define MAX77686_DVS_VSEL_MASK   0xFF

Definition at line 54 of file max77686.c.

#define MAX77686_LDO_LOW_MINUV   800000

Definition at line 40 of file max77686.c.

#define MAX77686_LDO_LOW_UVSTEP   25000

Definition at line 41 of file max77686.c.

#define MAX77686_LDO_MINUV   800000

Definition at line 38 of file max77686.c.

#define MAX77686_LDO_UVSTEP   50000

Definition at line 39 of file max77686.c.

#define MAX77686_LDOS   26

Definition at line 59 of file max77686.c.

#define MAX77686_OPMODE_BUCK234_SHIFT   4

Definition at line 50 of file max77686.c.

#define MAX77686_OPMODE_MASK   0x3

Definition at line 51 of file max77686.c.

#define MAX77686_OPMODE_SHIFT   6

Definition at line 49 of file max77686.c.

#define MAX77686_RAMP_DELAY   100000 /* uV/us */

Definition at line 44 of file max77686.c.

#define MAX77686_RAMP_RATE_MASK   0xC0

Definition at line 56 of file max77686.c.

#define MAX77686_REGULATORS   MAX77686_REG_MAX

Definition at line 58 of file max77686.c.

#define MAX77686_VSEL_MASK   0x3F

Definition at line 53 of file max77686.c.

#define regulator_desc_buck (   num)
Value:
{ \
.name = "BUCK"#num, \
.id = MAX77686_BUCK##num, \
.ops = &max77686_ops, \
.type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \
.min_uV = MAX77686_BUCK_MINUV, \
.uV_step = MAX77686_BUCK_UVSTEP, \
.ramp_delay = MAX77686_RAMP_DELAY, \
.n_voltages = MAX77686_VSEL_MASK + 1, \
.vsel_reg = MAX77686_REG_BUCK5OUT + (num - 5) * 2, \
.vsel_mask = MAX77686_VSEL_MASK, \
.enable_reg = MAX77686_REG_BUCK5CTRL + (num - 5) * 2, \
.enable_mask = MAX77686_OPMODE_MASK, \
}

Definition at line 152 of file max77686.c.

#define regulator_desc_buck1 (   num)
Value:
{ \
.name = "BUCK"#num, \
.id = MAX77686_BUCK##num, \
.ops = &max77686_ops, \
.type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \
.min_uV = MAX77686_BUCK_MINUV, \
.uV_step = MAX77686_BUCK_UVSTEP, \
.ramp_delay = MAX77686_RAMP_DELAY, \
.n_voltages = MAX77686_VSEL_MASK + 1, \
.vsel_reg = MAX77686_REG_BUCK1OUT, \
.vsel_mask = MAX77686_VSEL_MASK, \
.enable_reg = MAX77686_REG_BUCK1CTRL, \
.enable_mask = MAX77686_OPMODE_MASK, \
}

Definition at line 167 of file max77686.c.

#define regulator_desc_buck_dvs (   num)
Value:
{ \
.name = "BUCK"#num, \
.id = MAX77686_BUCK##num, \
.ops = &max77686_buck_dvs_ops, \
.type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \
.min_uV = MAX77686_DVS_MINUV, \
.uV_step = MAX77686_DVS_UVSTEP, \
.ramp_delay = MAX77686_DVS_RAMP_DELAY, \
.n_voltages = MAX77686_DVS_VSEL_MASK + 1, \
.vsel_reg = MAX77686_REG_BUCK2DVS1 + (num - 2) * 10, \
.vsel_mask = MAX77686_DVS_VSEL_MASK, \
.enable_reg = MAX77686_REG_BUCK2CTRL1 + (num - 2) * 10, \
.enable_mask = MAX77686_OPMODE_MASK \
}

Definition at line 182 of file max77686.c.

#define regulator_desc_ldo (   num)
Value:
{ \
.name = "LDO"#num, \
.id = MAX77686_LDO##num, \
.ops = &max77686_ops, \
.type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \
.min_uV = MAX77686_LDO_MINUV, \
.uV_step = MAX77686_LDO_UVSTEP, \
.ramp_delay = MAX77686_RAMP_DELAY, \
.n_voltages = MAX77686_VSEL_MASK + 1, \
.vsel_reg = MAX77686_REG_LDO1CTRL1 + num - 1, \
.vsel_mask = MAX77686_VSEL_MASK, \
.enable_reg = MAX77686_REG_LDO1CTRL1 + num - 1, \
.enable_mask = MAX77686_OPMODE_MASK \
}

Definition at line 120 of file max77686.c.

#define regulator_desc_ldo_low (   num)
Value:
{ \
.name = "LDO"#num, \
.id = MAX77686_LDO##num, \
.ops = &max77686_ops, \
.type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \
.ramp_delay = MAX77686_RAMP_DELAY, \
.n_voltages = MAX77686_VSEL_MASK + 1, \
.vsel_reg = MAX77686_REG_LDO1CTRL1 + num - 1, \
.vsel_mask = MAX77686_VSEL_MASK, \
.enable_reg = MAX77686_REG_LDO1CTRL1 + num - 1, \
.enable_mask = MAX77686_OPMODE_MASK \
}

Definition at line 136 of file max77686.c.

Enumeration Type Documentation

Enumerator:
RAMP_RATE_13P75MV 
RAMP_RATE_27P5MV 
RAMP_RATE_55MV 
RAMP_RATE_NO_CTRL 

Definition at line 61 of file max77686.c.

Function Documentation

MODULE_AUTHOR ( "Chiwoong Byun <[email protected]>"  )
MODULE_DESCRIPTION ( "MAXIM 77686 Regulator Driver"  )
MODULE_DEVICE_TABLE ( platform  ,
max77686_pmic_id   
)
module_exit ( max77686_pmic_cleanup  )
MODULE_LICENSE ( "GPL"  )
subsys_initcall ( max77686_pmic_init  )