From fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Tue, 22 Jan 2013 10:38:37 -0500 Subject: Added missing tegra files. --- include/linux/regulator/bq24022.h | 24 +++++ include/linux/regulator/fan53555-regulator.h | 63 ++++++++++++ include/linux/regulator/gpio-switch-regulator.h | 69 +++++++++++++ include/linux/regulator/max77663-regulator.h | 131 ++++++++++++++++++++++++ include/linux/regulator/max8907c-regulator.h | 46 +++++++++ include/linux/regulator/ricoh583-regulator.h | 63 ++++++++++++ include/linux/regulator/tps6236x-regulator.h | 54 ++++++++++ include/linux/regulator/tps65090-regulator.h | 60 +++++++++++ include/linux/regulator/tps6591x-regulator.h | 77 ++++++++++++++ include/linux/regulator/tps80031-regulator.h | 89 ++++++++++++++++ 10 files changed, 676 insertions(+) create mode 100644 include/linux/regulator/bq24022.h create mode 100644 include/linux/regulator/fan53555-regulator.h create mode 100644 include/linux/regulator/gpio-switch-regulator.h create mode 100644 include/linux/regulator/max77663-regulator.h create mode 100644 include/linux/regulator/max8907c-regulator.h create mode 100644 include/linux/regulator/ricoh583-regulator.h create mode 100644 include/linux/regulator/tps6236x-regulator.h create mode 100644 include/linux/regulator/tps65090-regulator.h create mode 100644 include/linux/regulator/tps6591x-regulator.h create mode 100644 include/linux/regulator/tps80031-regulator.h (limited to 'include/linux/regulator') diff --git a/include/linux/regulator/bq24022.h b/include/linux/regulator/bq24022.h new file mode 100644 index 00000000000..a6d014005d4 --- /dev/null +++ b/include/linux/regulator/bq24022.h @@ -0,0 +1,24 @@ +/* + * Support for TI bq24022 (bqTINY-II) Dual Input (USB/AC Adpater) + * 1-Cell Li-Ion Charger connected via GPIOs. + * + * Copyright (c) 2008 Philipp Zabel + * + * 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. + * + */ + +struct regulator_init_data; + +/** + * bq24022_mach_info - platform data for bq24022 + * @gpio_nce: GPIO line connected to the nCE pin, used to enable / disable charging + * @gpio_iset2: GPIO line connected to the ISET2 pin, used to limit charging current to 100 mA / 500 mA + */ +struct bq24022_mach_info { + int gpio_nce; + int gpio_iset2; + struct regulator_init_data *init_data; +}; diff --git a/include/linux/regulator/fan53555-regulator.h b/include/linux/regulator/fan53555-regulator.h new file mode 100644 index 00000000000..e2ed83bab4e --- /dev/null +++ b/include/linux/regulator/fan53555-regulator.h @@ -0,0 +1,63 @@ +/* + * include/linux/regulator/fan53555.h + * + * Interface for regulator driver for FairChild fan53555 Processor power supply + * + * Copyright (C) 2011 NVIDIA Corporation + * + * 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. + * + */ + +#ifndef __REGULATOR_FAN53555_H +#define __REGULATOR_FAN53555_H + +#include + +/* + * struct fan53555_regulator_platform_data - fan53555 regulator platform data. + * When VSEL pin is low, VOUT is set by the VSEL0 register. + * When VSEL pin is high, VOUT is set by the VSEL1 register + * + * @reg_init_data: The regulator init data. + * @vsel_id: Select the voltage id register. + * @vsel0_buck_en: Software Buck enable when EN=high & VSEL=low + * @vsel0_mode: Force PWM mode(1) or Allow auto-PFM mode(0) during light load + * @init_vsel0_min_uV: initial micro volts when EN=high & VSEL=low + * @init_vsel0_max_uV: initial micro volts when EN=high & VSEL=low + * @vsel1_buck_en: Software Buck enable when EN=high & VSEL=high + * @vsel1_mode: Force PWM mode(1) or Allow auto-PFM mode(0) during light load + * @init_vsel1_min_uV: initial micro volts when EN=high & VSEL=high + * @init_vsel1_max_uV: initial micro volts when EN=high & VSEL=high + * @output_discharge: when the regulator is disabled, VOUT discharges + * @slew_rate: slew rate of trasitioning from a low to high voltage + */ + +struct fan53555_regulator_platform_data { + struct regulator_init_data reg_init_data; + int vsel_id; + unsigned vsel0_buck_en:1; + unsigned vsel0_mode:1; + int init_vsel0_min_uV; + int init_vsel0_max_uV; + unsigned vsel1_buck_en:1; + unsigned vsel1_mode:1; + int init_vsel1_min_uV; + int init_vsel1_max_uV; + unsigned output_discharge:1; + unsigned slew_rate:3; +}; + +#endif /* __REGULATOR_FAN53555_H */ diff --git a/include/linux/regulator/gpio-switch-regulator.h b/include/linux/regulator/gpio-switch-regulator.h new file mode 100644 index 00000000000..68776b93ef0 --- /dev/null +++ b/include/linux/regulator/gpio-switch-regulator.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2011, NVIDIA Corporation. + * + * 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. + */ + +#ifndef _GPIO_SWITCH_REGULATOR_H +#define _GPIO_SWITCH_REGULATOR_H + +#include + +/* + * struct gpio_switch_regulator_subdev_data - Gpio switch regulator subdevice + * data. + * + * Subdevice data to register a gpio regulator switch device driver. + * + * @regulator_name: The name of regulator. + * @input_supply: Input supply name. + * @id: The id of the switch. + * @gpio_nr: Gpio nr which controls this switch. + * @active_low: true if making gpio low makes voltage output enable. + * @init_state: 1 if init_state should be active. + * @voltages: Possible voltages to set at output. The values are in millivolt. + * @n_voltages: Number of voltages. + * @num_consumer_supplies: Number of cosumer supplies. + * @consumer_supplies: List of consumer spllies. + */ +struct gpio_switch_regulator_subdev_data { + const char *regulator_name; + const char *input_supply; + int id; + int gpio_nr; + int active_low; + int pin_group; + int init_state; + int *voltages; + unsigned n_voltages; + struct regulator_consumer_supply *consumer_supplies; + int num_consumer_supplies; + struct regulation_constraints constraints; + int (*enable_rail)(struct gpio_switch_regulator_subdev_data *pdata); + int (*disable_rail)(struct gpio_switch_regulator_subdev_data *pdata); + +}; + +/** + * gpio_switch_regulator_platform_data - platform data for gpio_switch_regulator + * @num_subdevs: number of regulators used + * @subdevs: pointer to regulators used + */ +struct gpio_switch_regulator_platform_data { + int num_subdevs; + struct gpio_switch_regulator_subdev_data **subdevs; +}; + +#endif diff --git a/include/linux/regulator/max77663-regulator.h b/include/linux/regulator/max77663-regulator.h new file mode 100644 index 00000000000..d8ab389c425 --- /dev/null +++ b/include/linux/regulator/max77663-regulator.h @@ -0,0 +1,131 @@ +/* + * include/linux/regulator/max77663-regulator.h + * Maxim LDO and Buck regulators driver + * + * Copyright 2011-2012 Maxim Integrated Products, Inc. + * Copyright (C) 2011-2012 NVIDIA Corporation + * + * 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. + * + */ + +#ifndef __LINUX_REGULATOR_MAX77663_REGULATOR_H__ +#define __LINUX_REGULATOR_MAX77663_REGULATOR_H__ + +#include + +#define max77663_rails(_name) "max77663_"#_name + +enum max77663_regulator_id { + MAX77663_REGULATOR_ID_SD0, + MAX77663_REGULATOR_ID_DVSSD0, + MAX77663_REGULATOR_ID_SD1, + MAX77663_REGULATOR_ID_DVSSD1, + MAX77663_REGULATOR_ID_SD2, + MAX77663_REGULATOR_ID_SD3, + MAX77663_REGULATOR_ID_SD4, + MAX77663_REGULATOR_ID_LDO0, + MAX77663_REGULATOR_ID_LDO1, + MAX77663_REGULATOR_ID_LDO2, + MAX77663_REGULATOR_ID_LDO3, + MAX77663_REGULATOR_ID_LDO4, + MAX77663_REGULATOR_ID_LDO5, + MAX77663_REGULATOR_ID_LDO6, + MAX77663_REGULATOR_ID_LDO7, + MAX77663_REGULATOR_ID_LDO8, + MAX77663_REGULATOR_ID_NR, +}; + +/* FPS Power Up/Down Period */ +enum max77663_regulator_fps_power_period { + FPS_POWER_PERIOD_0, + FPS_POWER_PERIOD_1, + FPS_POWER_PERIOD_2, + FPS_POWER_PERIOD_3, + FPS_POWER_PERIOD_4, + FPS_POWER_PERIOD_5, + FPS_POWER_PERIOD_6, + FPS_POWER_PERIOD_7, + FPS_POWER_PERIOD_DEF = -1, +}; + +/* FPS Time Period */ +enum max77663_regulator_fps_time_period { + FPS_TIME_PERIOD_20US, + FPS_TIME_PERIOD_40US, + FPS_TIME_PERIOD_80US, + FPS_TIME_PERIOD_160US, + FPS_TIME_PERIOD_320US, + FPS_TIME_PERIOD_640US, + FPS_TIME_PERIOD_1280US, + FPS_TIME_PERIOD_2560US, + FPS_TIME_PERIOD_DEF = -1, +}; + +/* FPS Enable Source */ +enum max77663_regulator_fps_en_src { + FPS_EN_SRC_EN0, + FPS_EN_SRC_EN1, + FPS_EN_SRC_SW, + FPS_EN_SRC_RSVD, +}; + +/* FPS Source */ +enum max77663_regulator_fps_src { + FPS_SRC_0, + FPS_SRC_1, + FPS_SRC_2, + FPS_SRC_NONE, + FPS_SRC_DEF = -1, +}; + +/* + * Flags + */ +/* SD0 is controlled by EN2 */ +#define EN2_CTRL_SD0 0x01 + +/* SD Slew Rate */ +#define SD_SLEW_RATE_SLOWEST 0x02 /* 13.75mV/us */ +#define SD_SLEW_RATE_SLOW 0x04 /* 27.50mV/us */ +#define SD_SLEW_RATE_FAST 0x08 /* 55.00mV/us */ +#define SD_SLEW_RATE_FASTEST 0x10 /* 100.00mV/us */ +#define SD_SLEW_RATE_MASK 0x1E + +/* SD Forced PWM Mode */ +#define SD_FORCED_PWM_MODE 0x20 + +/* SD Failling Slew Rate Active-Discharge Mode */ +#define SD_FSRADE_DISABLE 0x40 + +/* Group Low-Power Mode */ +#define GLPM_ENABLE 0x80 + +/* Tracking for LDO4 */ +#define LDO4_EN_TRACKING 0x100 + +struct max77663_regulator_fps_cfg { + enum max77663_regulator_fps_src src; + enum max77663_regulator_fps_en_src en_src; + enum max77663_regulator_fps_time_period time_period; +}; + +struct max77663_regulator_platform_data { + struct regulator_init_data init_data; + bool init_apply; + bool init_enable; + int init_uV; + enum max77663_regulator_fps_src fps_src; + enum max77663_regulator_fps_power_period fps_pu_period; + enum max77663_regulator_fps_power_period fps_pd_period; + + int num_fps_cfgs; + struct max77663_regulator_fps_cfg *fps_cfgs; + + unsigned int flags; +}; + +#endif /* __LINUX_REGULATOR_MAX77663_REGULATOR_H__ */ diff --git a/include/linux/regulator/max8907c-regulator.h b/include/linux/regulator/max8907c-regulator.h new file mode 100644 index 00000000000..ddc5f0a6033 --- /dev/null +++ b/include/linux/regulator/max8907c-regulator.h @@ -0,0 +1,46 @@ +/* linux/regulator/max8907c-regulator.h + * + * Functions to access MAX8907C power management chip. + * + * Copyright (C) 2010 Gyungoh Yoo + * + * 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_REGULATOR_MAX8907C_H +#define __LINUX_REGULATOR_MAX8907C_H + +/* IDs */ +#define MAX8907C_SD1 0 +#define MAX8907C_SD2 1 +#define MAX8907C_SD3 2 +#define MAX8907C_LDO1 3 +#define MAX8907C_LDO2 4 +#define MAX8907C_LDO3 5 +#define MAX8907C_LDO4 6 +#define MAX8907C_LDO5 7 +#define MAX8907C_LDO6 8 +#define MAX8907C_LDO7 9 +#define MAX8907C_LDO8 10 +#define MAX8907C_LDO9 11 +#define MAX8907C_LDO10 12 +#define MAX8907C_LDO11 13 +#define MAX8907C_LDO12 14 +#define MAX8907C_LDO13 15 +#define MAX8907C_LDO14 16 +#define MAX8907C_LDO15 17 +#define MAX8907C_LDO16 18 +#define MAX8907C_LDO17 19 +#define MAX8907C_LDO18 20 +#define MAX8907C_LDO19 21 +#define MAX8907C_LDO20 22 +#define MAX8907C_OUT5V 23 +#define MAX8907C_OUT33V 24 +#define MAX8907C_BBAT 25 +#define MAX8907C_SDBY 26 +#define MAX8907C_VRTC 27 +#define MAX8907C_WLED 27 + +#endif diff --git a/include/linux/regulator/ricoh583-regulator.h b/include/linux/regulator/ricoh583-regulator.h new file mode 100644 index 00000000000..39fdb9e56e0 --- /dev/null +++ b/include/linux/regulator/ricoh583-regulator.h @@ -0,0 +1,63 @@ +/* + * linux/regulator/ricoh583-regulator.h + * + * Interface for regulator driver for RICOH583 power management chip. + * + * Copyright (C) 2011 NVIDIA Corporation + * + * Copyright (C) 2011 RICOH COMPANY,LTD + * + * 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. + * + */ + +#ifndef __LINUX_REGULATOR_RICOH583_H +#define __LINUX_REGULATOR_RICOH583_H + +#include + + +#define ricoh583_rails(_name) "RICOH583_"#_name + +/* RICHOH Regulator IDs */ +enum regulator_id { + RICOH583_ID_DC0, + RICOH583_ID_DC1, + RICOH583_ID_DC2, + RICOH583_ID_DC3, + RICOH583_ID_LDO0, + RICOH583_ID_LDO1, + RICOH583_ID_LDO2, + RICOH583_ID_LDO3, + RICOH583_ID_LDO4, + RICOH583_ID_LDO5, + RICOH583_ID_LDO6, + RICOH583_ID_LDO7, + RICOH583_ID_LDO8, + RICOH583_ID_LDO9, +}; + +struct ricoh583_regulator_platform_data { + struct regulator_init_data regulator; + int init_uV; + unsigned init_enable:1; + unsigned init_apply:1; + int deepsleep_uV; + int deepsleep_slots; + unsigned long ext_pwr_req; + unsigned long flags; +}; + +#endif diff --git a/include/linux/regulator/tps6236x-regulator.h b/include/linux/regulator/tps6236x-regulator.h new file mode 100644 index 00000000000..7e8a3752966 --- /dev/null +++ b/include/linux/regulator/tps6236x-regulator.h @@ -0,0 +1,54 @@ +/* + * include/linux/regulator/tps6236x.h + * + * Interface for regulator driver for TI TPS6236x Processor core supply + * + * Copyright (C) 2011 NVIDIA Corporation + * + * 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. + * + */ + +#ifndef __REGULATOR_TPS6236X_H +#define __REGULATOR_TPS6236X_H + +#include + +/* + * struct tps6236x_regulator_platform_data - tps6236x regulator platform data. + * + * @reg_init_data: The regulator init data. + * @internal_pd_enable: internal pull down enable or not. + * @vsel: Select the voltage id register. + * @init_uV: initial micro volts which need to be set. + * @init_enable: Enable or do not enable the rails during initialization. + * @init_apply: Init parameter applied or not. + * @is_force_pwm: Enable force pwm or not. If not then PFM mode configuration + * will be used. + * @enable_discharge: Enable discharge the output capacitor via a typ. 300Ohm + * path + */ + +struct tps6236x_regulator_platform_data { + struct regulator_init_data reg_init_data; + int internal_pd_enable; + int vsel; + int init_uV; + unsigned init_apply:1; + bool is_force_pwm; + bool enable_discharge; +}; + +#endif /* __REGULATOR_TPS6236X_H */ diff --git a/include/linux/regulator/tps65090-regulator.h b/include/linux/regulator/tps65090-regulator.h new file mode 100644 index 00000000000..341d53ec994 --- /dev/null +++ b/include/linux/regulator/tps65090-regulator.h @@ -0,0 +1,60 @@ +/* + * include/linux/regulator/tps65090-regulator.h + * + * Interface for regulator driver for TI TPS65090 PMIC family + * + * Copyright (C) 2012 NVIDIA Corporation + * + * 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 Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef __REGULATOR_TPS65090_H +#define __REGULATOR_TPS65090_H + +#include + +#define tps65090_rails(_name) "tps65090_"#_name + +enum { + TPS65090_ID_DCDC1, + TPS65090_ID_DCDC2, + TPS65090_ID_DCDC3, + TPS65090_ID_FET1, + TPS65090_ID_FET2, + TPS65090_ID_FET3, + TPS65090_ID_FET4, + TPS65090_ID_FET5, + TPS65090_ID_FET6, + TPS65090_ID_FET7, +}; + +/* + * struct tps65090_regulator_platform_data + * + * @regulator: The regulator init data. + * @init_uV: initial micro volts which need to be set. + * @init_enable: Enable or do not enable the rails during initialization. + * @init_apply: Init parameter applied or not. + * @slew_rate_uV_per_us: Slew rate microvolt per microsec. + */ + +struct tps65090_regulator_platform_data { + struct regulator_init_data regulator; + int slew_rate_uV_per_us; + unsigned int flags; +}; + +#endif /* __REGULATOR_TPS65090_H */ diff --git a/include/linux/regulator/tps6591x-regulator.h b/include/linux/regulator/tps6591x-regulator.h new file mode 100644 index 00000000000..7f7f647906d --- /dev/null +++ b/include/linux/regulator/tps6591x-regulator.h @@ -0,0 +1,77 @@ +/* + * include/linux/regulator/tps6591x-regulator.h + * + * Interface for regulator driver for TI TPS6591x PMIC family + * + * Copyright (C) 2011 NVIDIA Corporation + * + * 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. + * + */ + +#ifndef __REGULATOR_TPS6591X_H +#define __REGULATOR_TPS6591X_H + +#include + +#define tps6591x_rails(_name) "tps6591x_"#_name + +enum { + TPS6591X_ID_VIO, + TPS6591X_ID_VDD_1, + TPS6591X_ID_VDD_2, + TPS6591X_ID_VDDCTRL, + TPS6591X_ID_LDO_1, + TPS6591X_ID_LDO_2, + TPS6591X_ID_LDO_3, + TPS6591X_ID_LDO_4, + TPS6591X_ID_LDO_5, + TPS6591X_ID_LDO_6, + TPS6591X_ID_LDO_7, + TPS6591X_ID_LDO_8, +}; + +enum tps6591x_ext_control { + EXT_CTRL_NONE = 0x0, + EXT_CTRL_EN1, + EXT_CTRL_EN2, + EXT_CTRL_SLEEP_OFF, +}; + +enum tps6591x_config_flags { + LDO_LOW_POWER_ON_SUSPEND = 0x1, +}; + +/* + * struct tps6591x_regulator_platform_data - tps6591x regulator platform data. + * + * @regulator: The regulator init data. + * @init_uV: initial micro volts which need to be set. + * @init_enable: Enable or do not enable the rails during initialization. + * @init_apply: Init parameter applied or not. + * @slew_rate_uV_per_us: Slew rate microvolt per microsec. + */ + +struct tps6591x_regulator_platform_data { + struct regulator_init_data regulator; + int init_uV; + unsigned init_enable:1; + unsigned init_apply:1; + enum tps6591x_ext_control ectrl; + int slew_rate_uV_per_us; + unsigned int flags; +}; + +#endif /* __REGULATOR_TPS6591X_H */ diff --git a/include/linux/regulator/tps80031-regulator.h b/include/linux/regulator/tps80031-regulator.h new file mode 100644 index 00000000000..1670d147fc3 --- /dev/null +++ b/include/linux/regulator/tps80031-regulator.h @@ -0,0 +1,89 @@ +/* + * include/linux/regulator/tps80031-regulator.h + * + * Interface for regulator driver for TI TPS80031 + * + * Copyright (C) 2011 NVIDIA Corporation + * + * 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. + * + */ + +#ifndef __REGULATOR_TPS80031_H +#define __REGULATOR_TPS80031_H + +#include + +#define tps80031_rails(_name) "tps80031_"#_name + +enum { + TPS80031_ID_VIO, + TPS80031_ID_SMPS1, + TPS80031_ID_SMPS2, + TPS80031_ID_SMPS3, + TPS80031_ID_SMPS4, + TPS80031_ID_VANA, + TPS80031_ID_LDO1, + TPS80031_ID_LDO2, + TPS80031_ID_LDO3, + TPS80031_ID_LDO4, + TPS80031_ID_LDO5, + TPS80031_ID_LDO6, + TPS80031_ID_LDO7, + TPS80031_ID_LDOLN, + TPS80031_ID_LDOUSB, + TPS80031_ID_VBUS, + TPS80031_ID_CHARGER, +}; + + +enum { + /* USBLDO input selection */ + USBLDO_INPUT_VSYS = 0x00000001, + USBLDO_INPUT_PMID = 0x00000002, + + /* LDO3 output mode */ + LDO3_OUTPUT_VIB = 0x00000004, + + /* VBUS configuration */ + VBUS_DISCHRG_EN_PDN = 0x00000004, + VBUS_SW_ONLY = 0x00000008, + VBUS_SW_N_ID = 0x00000010, +}; + +/* + * struct tps80031_regulator_platform_data - tps80031 regulator platform data. + * + * @regulator: The regulator init data. + * @init_uV: initial micro volts which need to be set. + * @init_enable: Enable or do not enable the rails during initialization. + * @init_apply: Init parameter applied or not. + * @ext_ctrl_flag: External control flag for sleep/power request control. + * @flags: Configuration flag to configure the rails. It should be ORed of + * above enums. + * @delay_us: Delay in microsecond after setting the desired voltage. + */ + +struct tps80031_regulator_platform_data { + struct regulator_init_data regulator; + int init_uV; + unsigned init_enable:1; + unsigned init_apply:1; + unsigned int ext_ctrl_flag; + unsigned int flags; + int delay_us; +}; + +#endif /* __REGULATOR_TPS80031_H */ -- cgit v1.2.2