X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=include%2Fpower%2Fmax77686_pmic.h;h=b0e42550a2a4eb3bfd591aca3de0a67c1c1f4e34;hb=48aead71c1ad2c93fffa182e798f1bcbb5f6dd9d;hp=fdc7ca9e5a02954f16c4dd116cea4aba4d29efee;hpb=b278c4095b59c40ff512c5433b735b000e547554;p=karo-tx-uboot.git diff --git a/include/power/max77686_pmic.h b/include/power/max77686_pmic.h index fdc7ca9e5a..b0e42550a2 100644 --- a/include/power/max77686_pmic.h +++ b/include/power/max77686_pmic.h @@ -2,28 +2,14 @@ * Copyright (C) 2012 Samsung Electronics * Rajeshwari Shinde * - * See file CREDITS for list of people who contributed to this - * project. - * - * 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., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __MAX77686_H_ #define __MAX77686_H_ +#include + enum { MAX77686_REG_PMIC_ID = 0x0, MAX77686_REG_PMIC_INTSRC, @@ -52,7 +38,7 @@ enum { MAX77686_REG_PMIC_BUCK2DVS7, MAX77686_REG_PMIC_BUCK2DVS8, MAX77686_REG_PMIC_BUCK3CTRL, - MAX77686_REG_PMIC_BUCK3DVS1, + MAX77686_REG_PMIC_BUCK3DVS1 = 0x1e, MAX77686_REG_PMIC_BUCK3DVS2, MAX77686_REG_PMIC_BUCK3DVS3, MAX77686_REG_PMIC_BUCK3DVS4, @@ -155,8 +141,39 @@ enum { EN_LDO = (0x3 << 6), }; +enum { + OPMODE_OFF = 0, + OPMODE_STANDBY, + OPMODE_LPM, + OPMODE_ON, +}; + +int max77686_set_ldo_voltage(struct pmic *p, int ldo, ulong uV); +int max77686_set_ldo_mode(struct pmic *p, int ldo, char opmode); +int max77686_set_buck_voltage(struct pmic *p, int buck, ulong uV); +int max77686_set_buck_mode(struct pmic *p, int buck, char opmode); + +#define MAX77686_LDO_VOLT_MAX_HEX 0x3f +#define MAX77686_LDO_VOLT_MASK 0x3f +#define MAX77686_LDO_MODE_MASK 0xc0 +#define MAX77686_LDO_MODE_OFF (0x00 << 0x06) +#define MAX77686_LDO_MODE_STANDBY (0x01 << 0x06) +#define MAX77686_LDO_MODE_LPM (0x02 << 0x06) +#define MAX77686_LDO_MODE_ON (0x03 << 0x06) +#define MAX77686_BUCK_VOLT_MAX_HEX 0x3f +#define MAX77686_BUCK_VOLT_MASK 0x3f +#define MAX77686_BUCK_MODE_MASK 0x03 +#define MAX77686_BUCK_MODE_SHIFT_1 0x00 +#define MAX77686_BUCK_MODE_SHIFT_2 0x04 +#define MAX77686_BUCK_MODE_OFF 0x00 +#define MAX77686_BUCK_MODE_STANDBY 0x01 +#define MAX77686_BUCK_MODE_LPM 0x02 +#define MAX77686_BUCK_MODE_ON 0x03 + /* Buck1 1 volt value */ #define MAX77686_BUCK1OUT_1V 0x5 +/* Buck1 1.05 volt value */ +#define MAX77686_BUCK1OUT_1_05V 0x6 #define MAX77686_BUCK1CTRL_EN (3 << 0) /* Buck2 1.3 volt value */ #define MAX77686_BUCK2DVS1_1_3V 0x38