Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6: (45 commits) regulator: missing index in PTR_ERR() in isl6271a_probe() regulator: Assign return value of mc13xxx_reg_rmw to ret regulator: Add initial per-regulator debugfs support regulator: Make regulator_has_full_constraints a bool regulator: Clean up logging a bit regulator: Optimise out noop voltage changes regulator: Add API to re-apply voltage to hardware regulator: Staticise non-exported functions in mc13892 regulator: Only notify voltage changes when they succeed regulator: Provide a selector based set_voltage_sel() operation regulator: Factor out voltage set operation into a separate function regulator: Convert WM8994 to use get_voltage_sel() regulator: Convert WM835x to use get_voltage_sel() regulator: Allow modular build of mc13xxx-core regulator: support PMIC mc13892 make mc13783 regulator code generic Change the register name definitions for mc13783 mach-ux500: Updated and connected ab8500 regulator board configuration regulators: Removed macros for initialization of ab8500 regulators regulators: Added verbose debug messages to ab8500 regulators ...
This commit is contained in:
@@ -99,8 +99,6 @@
|
||||
#define AB8500_NR_IRQS 104
|
||||
#define AB8500_NUM_IRQ_REGS 13
|
||||
|
||||
#define AB8500_NUM_REGULATORS 15
|
||||
|
||||
/**
|
||||
* struct ab8500 - ab8500 internal structure
|
||||
* @dev: parent device
|
||||
@@ -145,7 +143,8 @@ struct regulator_init_data;
|
||||
struct ab8500_platform_data {
|
||||
int irq_base;
|
||||
void (*init) (struct ab8500 *);
|
||||
struct regulator_init_data *regulator[AB8500_NUM_REGULATORS];
|
||||
int num_regulator;
|
||||
struct regulator_init_data *regulator;
|
||||
};
|
||||
|
||||
extern int __devinit ab8500_init(struct ab8500 *ab8500);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010 Yong Shen <yong.shen@linaro.org>
|
||||
* Copyright 2009-2010 Pengutronix
|
||||
* Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
|
||||
*
|
||||
@@ -122,39 +123,39 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
|
||||
unsigned int channel, unsigned int *sample);
|
||||
|
||||
|
||||
#define MC13783_SW_SW1A 0
|
||||
#define MC13783_SW_SW1B 1
|
||||
#define MC13783_SW_SW2A 2
|
||||
#define MC13783_SW_SW2B 3
|
||||
#define MC13783_SW_SW3 4
|
||||
#define MC13783_SW_PLL 5
|
||||
#define MC13783_REGU_VAUDIO 6
|
||||
#define MC13783_REGU_VIOHI 7
|
||||
#define MC13783_REGU_VIOLO 8
|
||||
#define MC13783_REGU_VDIG 9
|
||||
#define MC13783_REGU_VGEN 10
|
||||
#define MC13783_REGU_VRFDIG 11
|
||||
#define MC13783_REGU_VRFREF 12
|
||||
#define MC13783_REGU_VRFCP 13
|
||||
#define MC13783_REGU_VSIM 14
|
||||
#define MC13783_REGU_VESIM 15
|
||||
#define MC13783_REGU_VCAM 16
|
||||
#define MC13783_REGU_VRFBG 17
|
||||
#define MC13783_REGU_VVIB 18
|
||||
#define MC13783_REGU_VRF1 19
|
||||
#define MC13783_REGU_VRF2 20
|
||||
#define MC13783_REGU_VMMC1 21
|
||||
#define MC13783_REGU_VMMC2 22
|
||||
#define MC13783_REGU_GPO1 23
|
||||
#define MC13783_REGU_GPO2 24
|
||||
#define MC13783_REGU_GPO3 25
|
||||
#define MC13783_REGU_GPO4 26
|
||||
#define MC13783_REGU_V1 27
|
||||
#define MC13783_REGU_V2 28
|
||||
#define MC13783_REGU_V3 29
|
||||
#define MC13783_REGU_V4 30
|
||||
#define MC13783_REGU_PWGT1SPI 31
|
||||
#define MC13783_REGU_PWGT2SPI 32
|
||||
#define MC13783_REG_SW1A 0
|
||||
#define MC13783_REG_SW1B 1
|
||||
#define MC13783_REG_SW2A 2
|
||||
#define MC13783_REG_SW2B 3
|
||||
#define MC13783_REG_SW3 4
|
||||
#define MC13783_REG_PLL 5
|
||||
#define MC13783_REG_VAUDIO 6
|
||||
#define MC13783_REG_VIOHI 7
|
||||
#define MC13783_REG_VIOLO 8
|
||||
#define MC13783_REG_VDIG 9
|
||||
#define MC13783_REG_VGEN 10
|
||||
#define MC13783_REG_VRFDIG 11
|
||||
#define MC13783_REG_VRFREF 12
|
||||
#define MC13783_REG_VRFCP 13
|
||||
#define MC13783_REG_VSIM 14
|
||||
#define MC13783_REG_VESIM 15
|
||||
#define MC13783_REG_VCAM 16
|
||||
#define MC13783_REG_VRFBG 17
|
||||
#define MC13783_REG_VVIB 18
|
||||
#define MC13783_REG_VRF1 19
|
||||
#define MC13783_REG_VRF2 20
|
||||
#define MC13783_REG_VMMC1 21
|
||||
#define MC13783_REG_VMMC2 22
|
||||
#define MC13783_REG_GPO1 23
|
||||
#define MC13783_REG_GPO2 24
|
||||
#define MC13783_REG_GPO3 25
|
||||
#define MC13783_REG_GPO4 26
|
||||
#define MC13783_REG_V1 27
|
||||
#define MC13783_REG_V2 28
|
||||
#define MC13783_REG_V3 29
|
||||
#define MC13783_REG_V4 30
|
||||
#define MC13783_REG_PWGT1SPI 31
|
||||
#define MC13783_REG_PWGT2SPI 32
|
||||
|
||||
#define MC13783_IRQ_ADCDONE MC13XXX_IRQ_ADCDONE
|
||||
#define MC13783_IRQ_ADCBISDONE MC13XXX_IRQ_ADCBISDONE
|
||||
|
||||
39
include/linux/mfd/mc13892.h
Normal file
39
include/linux/mfd/mc13892.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 2010 Yong Shen <yong.shen@linaro.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 2 as published by the
|
||||
* Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_MFD_MC13892_H
|
||||
#define __LINUX_MFD_MC13892_H
|
||||
|
||||
#include <linux/mfd/mc13xxx.h>
|
||||
|
||||
#define MC13892_SW1 0
|
||||
#define MC13892_SW2 1
|
||||
#define MC13892_SW3 2
|
||||
#define MC13892_SW4 3
|
||||
#define MC13892_SWBST 4
|
||||
#define MC13892_VIOHI 5
|
||||
#define MC13892_VPLL 6
|
||||
#define MC13892_VDIG 7
|
||||
#define MC13892_VSD 8
|
||||
#define MC13892_VUSB2 9
|
||||
#define MC13892_VVIDEO 10
|
||||
#define MC13892_VAUDIO 11
|
||||
#define MC13892_VCAM 12
|
||||
#define MC13892_VGEN1 13
|
||||
#define MC13892_VGEN2 14
|
||||
#define MC13892_VGEN3 15
|
||||
#define MC13892_VUSB 16
|
||||
#define MC13892_GPO1 17
|
||||
#define MC13892_GPO2 18
|
||||
#define MC13892_GPO3 19
|
||||
#define MC13892_GPO4 20
|
||||
#define MC13892_PWGT1SPI 21
|
||||
#define MC13892_PWGT2SPI 22
|
||||
#define MC13892_VCOINCELL 23
|
||||
|
||||
#endif
|
||||
@@ -11,15 +11,17 @@
|
||||
#define __LINUX_MFD_AB8500_REGULATOR_H
|
||||
|
||||
/* AB8500 regulators */
|
||||
#define AB8500_LDO_AUX1 0
|
||||
#define AB8500_LDO_AUX2 1
|
||||
#define AB8500_LDO_AUX3 2
|
||||
#define AB8500_LDO_INTCORE 3
|
||||
#define AB8500_LDO_TVOUT 4
|
||||
#define AB8500_LDO_AUDIO 5
|
||||
#define AB8500_LDO_ANAMIC1 6
|
||||
#define AB8500_LDO_ANAMIC2 7
|
||||
#define AB8500_LDO_DMIC 8
|
||||
#define AB8500_LDO_ANA 9
|
||||
|
||||
enum ab8500_regulator_id {
|
||||
AB8500_LDO_AUX1,
|
||||
AB8500_LDO_AUX2,
|
||||
AB8500_LDO_AUX3,
|
||||
AB8500_LDO_INTCORE,
|
||||
AB8500_LDO_TVOUT,
|
||||
AB8500_LDO_AUDIO,
|
||||
AB8500_LDO_ANAMIC1,
|
||||
AB8500_LDO_ANAMIC2,
|
||||
AB8500_LDO_DMIC,
|
||||
AB8500_LDO_ANA,
|
||||
AB8500_NUM_REGULATORS,
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -154,6 +154,7 @@ int regulator_is_supported_voltage(struct regulator *regulator,
|
||||
int min_uV, int max_uV);
|
||||
int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV);
|
||||
int regulator_get_voltage(struct regulator *regulator);
|
||||
int regulator_sync_voltage(struct regulator *regulator);
|
||||
int regulator_set_current_limit(struct regulator *regulator,
|
||||
int min_uA, int max_uA);
|
||||
int regulator_get_current_limit(struct regulator *regulator);
|
||||
|
||||
@@ -42,7 +42,11 @@ enum regulator_status {
|
||||
*
|
||||
* @set_voltage: Set the voltage for the regulator within the range specified.
|
||||
* The driver should select the voltage closest to min_uV.
|
||||
* @set_voltage_sel: Set the voltage for the regulator using the specified
|
||||
* selector.
|
||||
* @get_voltage: Return the currently configured voltage for the regulator.
|
||||
* @get_voltage_sel: Return the currently configured voltage selector for the
|
||||
* regulator.
|
||||
* @list_voltage: Return one of the supported voltages, in microvolts; zero
|
||||
* if the selector indicates a voltage that is unusable on this system;
|
||||
* or negative errno. Selectors range from zero to one less than
|
||||
@@ -79,8 +83,11 @@ struct regulator_ops {
|
||||
int (*list_voltage) (struct regulator_dev *, unsigned selector);
|
||||
|
||||
/* get/set regulator voltage */
|
||||
int (*set_voltage) (struct regulator_dev *, int min_uV, int max_uV);
|
||||
int (*set_voltage) (struct regulator_dev *, int min_uV, int max_uV,
|
||||
unsigned *selector);
|
||||
int (*set_voltage_sel) (struct regulator_dev *, unsigned selector);
|
||||
int (*get_voltage) (struct regulator_dev *);
|
||||
int (*get_voltage_sel) (struct regulator_dev *);
|
||||
|
||||
/* get/set regulator current */
|
||||
int (*set_current_limit) (struct regulator_dev *,
|
||||
@@ -168,9 +175,9 @@ struct regulator_desc {
|
||||
*/
|
||||
struct regulator_dev {
|
||||
struct regulator_desc *desc;
|
||||
int use_count;
|
||||
int open_count;
|
||||
int exclusive;
|
||||
u32 use_count;
|
||||
u32 open_count;
|
||||
|
||||
/* lists we belong to */
|
||||
struct list_head list; /* list of all regulators */
|
||||
@@ -188,10 +195,14 @@ struct regulator_dev {
|
||||
struct regulator_dev *supply; /* for tree */
|
||||
|
||||
void *reg_data; /* regulator_dev data */
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
struct dentry *debugfs;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
|
||||
struct device *dev, struct regulator_init_data *init_data,
|
||||
struct device *dev, const struct regulator_init_data *init_data,
|
||||
void *driver_data);
|
||||
void regulator_unregister(struct regulator_dev *rdev);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user