tps65218-regulator.c (98817a84ff1c755c347ac633ff017a623a631fad) | tps65218-regulator.c (2ca76b3e4954ea6bbb365005edc8d5237b488cf1) |
---|---|
1/* 2 * tps65218-regulator.c 3 * 4 * Regulator driver for TPS65218 PMIC 5 * | 1/* 2 * tps65218-regulator.c 3 * 4 * Regulator driver for TPS65218 PMIC 5 * |
6 * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/ | 6 * Copyright (C) 2014 Texas Instruments Incorporated - https://www.ti.com/ |
7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License version 2 as 10 * published by the Free Software Foundation. 11 * 12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any 13 * kind, whether expressed or implied; without even the implied warranty 14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- 108 unchanged lines hidden (view full) --- 123 dev->desc->enable_mask, TPS65218_PROTECT_L1); 124} 125 126static int tps65218_pmic_set_suspend_enable(struct regulator_dev *dev) 127{ 128 struct tps65218 *tps = rdev_get_drvdata(dev); 129 unsigned int rid = rdev_get_id(dev); 130 | 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License version 2 as 10 * published by the Free Software Foundation. 11 * 12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any 13 * kind, whether expressed or implied; without even the implied warranty 14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- 108 unchanged lines hidden (view full) --- 123 dev->desc->enable_mask, TPS65218_PROTECT_L1); 124} 125 126static int tps65218_pmic_set_suspend_enable(struct regulator_dev *dev) 127{ 128 struct tps65218 *tps = rdev_get_drvdata(dev); 129 unsigned int rid = rdev_get_id(dev); 130 |
131 if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) | 131 if (rid > TPS65218_LDO_1) |
132 return -EINVAL; 133 134 return tps65218_clear_bits(tps, dev->desc->bypass_reg, 135 dev->desc->bypass_mask, 136 TPS65218_PROTECT_L1); 137} 138 139static int tps65218_pmic_set_suspend_disable(struct regulator_dev *dev) 140{ 141 struct tps65218 *tps = rdev_get_drvdata(dev); 142 unsigned int rid = rdev_get_id(dev); 143 | 132 return -EINVAL; 133 134 return tps65218_clear_bits(tps, dev->desc->bypass_reg, 135 dev->desc->bypass_mask, 136 TPS65218_PROTECT_L1); 137} 138 139static int tps65218_pmic_set_suspend_disable(struct regulator_dev *dev) 140{ 141 struct tps65218 *tps = rdev_get_drvdata(dev); 142 unsigned int rid = rdev_get_id(dev); 143 |
144 if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) | 144 if (rid > TPS65218_LDO_1) |
145 return -EINVAL; 146 147 /* 148 * Certain revisions of TPS65218 will need to have DCDC3 regulator 149 * enabled always, otherwise an immediate system reboot will occur 150 * during poweroff. 151 */ 152 if (rid == TPS65218_DCDC_3 && tps->rev == TPS65218_REV_2_1) --- 218 unchanged lines hidden --- | 145 return -EINVAL; 146 147 /* 148 * Certain revisions of TPS65218 will need to have DCDC3 regulator 149 * enabled always, otherwise an immediate system reboot will occur 150 * during poweroff. 151 */ 152 if (rid == TPS65218_DCDC_3 && tps->rev == TPS65218_REV_2_1) --- 218 unchanged lines hidden --- |