diff options
author | Terry Lv <r65388@freescale.com> | 2012-02-16 01:38:47 +0800 |
---|---|---|
committer | Terry Lv <r65388@freescale.com> | 2012-02-16 02:24:04 +0800 |
commit | c1ce2e692f4c9ac475504b4976b82de241e36b45 (patch) | |
tree | bf0f0969bac3c6f840128ed4cd557f47c823e843 /include/asm-arm/regulator.h | |
parent | 69665152823a798b3560d42e6456ce3cc041ffec (diff) | |
download | u-boot-imx-c1ce2e692f4c9ac475504b4976b82de241e36b45.zip u-boot-imx-c1ce2e692f4c9ac475504b4976b82de241e36b45.tar.gz u-boot-imx-c1ce2e692f4c9ac475504b4976b82de241e36b45.tar.bz2 |
ENGR00139213: Add read and change voltage support for mx6
dd read and change voltage support for mx6.
For help, pls type "help regul"
Detail command info:
regul list - List all regulators' name
regul show all - Display all regulators' voltage
regul show core - Show core voltage in mV
regul show periph - Show peripheral voltage in mV
regul show <regulator name> - Show regulator's voltage in mV
regul set core <voltage value> - Set core voltage in mV
regul set periph <voltage value> - Set periph voltage in mV
regul set <regulator name> <voltage value> - Set regulator's voltage in
mV
Example:
MX6Q ARM2 U-Boot > regul list
Name Voltage
vddpu
vddcore
vddsoc
vdd2p5
vdd1p1
vdd3p0
MX6Q ARM2 U-Boot > regul show all
Name Voltage
vddpu 1100000
vddcore 1100000
vddsoc 1200000
vdd2p5 2400000
vdd1p1 1100000
vdd3p0 3000000
MX6Q ARM2 U-Boot > regul show periph
Name Voltage
periph: 1100000
MX6Q ARM2 U-Boot > regul show core
Name Voltage
core: 1100000
MX6Q ARM2 U-Boot > regul set core 1100000
Set voltage succeed!
Name Voltage
core: 1100000
Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'include/asm-arm/regulator.h')
-rw-r--r-- | include/asm-arm/regulator.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/include/asm-arm/regulator.h b/include/asm-arm/regulator.h new file mode 100644 index 0000000..d3f0802 --- /dev/null +++ b/include/asm-arm/regulator.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +struct anatop_regulator_data { + char name[80]; + char *parent_name; + int (*reg_register)(struct anatop_regulator_data *sreg); + int (*set_voltage)(struct anatop_regulator_data *sreg, int uv); + int (*get_voltage)(struct anatop_regulator_data *sreg); + int (*set_current)(struct anatop_regulator_data *sreg, int uA); + int (*get_current)(struct anatop_regulator_data *sreg); + int (*enable)(struct anatop_regulator_data *sreg); + int (*disable)(struct anatop_regulator_data *sreg); + int (*is_enabled)(struct anatop_regulator_data *sreg); + int (*set_mode)(struct anatop_regulator_data *sreg, int mode); + int (*get_mode)(struct anatop_regulator_data *sreg); + int (*get_optimum_mode)(struct anatop_regulator_data *sreg, + int input_uV, int output_uV, int load_uA); + int control_reg; + int vol_bit_shift; + int vol_bit_mask; + int min_bit_val; + int min_voltage; + int max_voltage; + int max_current; +}; + +int regul_list(int show_val); +int regul_set(char *vdd_name, int uv); +int regul_get(char *vdd_name); +int regul_set_core(int uv); +int regul_get_core(void); +int regul_set_periph(int uv); +int regul_get_periph(void); |