/* * TI TPS65132 Regulator driver * * Copyright (C) 2017 NVIDIA CORPORATION. All rights reserved. * * Author: Venkat Reddy Talla <vreddytalla@nvidia.com> * Laxman Dewangan <ldewangan@nvidia.com> * * 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 "as is" WITHOUT ANY WARRANTY of any kind, * whether express or implied; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details.
*/
staticint tps65132_regulator_enable(struct regulator_dev *rdev)
{ struct tps65132_regulator *tps = rdev_get_drvdata(rdev); int id = rdev_get_id(rdev); struct tps65132_reg_pdata *rpdata = &tps->reg_pdata[id]; int ret;
if (!IS_ERR(rpdata->en_gpiod)) {
gpiod_set_value_cansleep(rpdata->en_gpiod, 1);
rpdata->ena_gpio_state = 1;
}
/* Hardware automatically enable discharge bit in enable */ if (rdev->constraints->active_discharge ==
REGULATOR_ACTIVE_DISCHARGE_DISABLE) {
ret = regulator_set_active_discharge_regmap(rdev, false); if (ret < 0) {
dev_err(tps->dev, "Failed to disable active discharge: %d\n",
ret); return ret;
}
}
return 0;
}
staticint tps65132_regulator_disable(struct regulator_dev *rdev)
{ struct tps65132_regulator *tps = rdev_get_drvdata(rdev); int id = rdev_get_id(rdev); struct tps65132_reg_pdata *rpdata = &tps->reg_pdata[id];
if (!IS_ERR(rpdata->en_gpiod)) {
gpiod_set_value_cansleep(rpdata->en_gpiod, 0);
rpdata->ena_gpio_state = 0;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.