This patch adds support for TPS65917 PMIC regulators.
The regulators set consists of 5 SMPSs and 5 LDOs. The output
voltages are configurable and are meant to supply power to the
main processor and other components.
Signed-off-by: Keerthy j-keer...@ti.com
---
drivers/regulator/Kconfig | 12 +
drivers/regulator/Makefile |1 +
drivers/regulator/tps65917-regulator.c | 815
3 files changed, 828 insertions(+)
create mode 100644 drivers/regulator/tps65917-regulator.c
Index: linux/drivers/regulator/Kconfig
===
--- linux.orig/drivers/regulator/Kconfig2014-05-26 15:21:12.269247638
+0530
+++ linux/drivers/regulator/Kconfig 2014-05-26 15:21:46.956121138 +0530
@@ -581,6 +581,18 @@
help
This driver supports TPS65912 voltage regulator chip.
+config REGULATOR_TPS65917
+ tristate TI TPS65917 PMIC Regulators
+ depends on MFD_PALMAS
+ help
+ If you wish to control the regulators on the TPS65917 series of
+ chips say Y here. This will enable support for all the software
+ controllable SMPS/LDO regulators.
+
+ The regulators available on TPS65917 series chips vary depending
+ on the muxing. This is handled automatically in the driver by
+ reading the mux info from OTP.
+
config REGULATOR_TPS80031
tristate TI TPS80031/TPS80032 power regualtor driver
depends on MFD_TPS80031
Index: linux/drivers/regulator/Makefile
===
--- linux.orig/drivers/regulator/Makefile 2014-05-26 15:21:12.269247638
+0530
+++ linux/drivers/regulator/Makefile2014-05-26 15:21:46.956121138 +0530
@@ -76,6 +76,7 @@
obj-$(CONFIG_REGULATOR_TPS6586X) += tps6586x-regulator.o
obj-$(CONFIG_REGULATOR_TPS65910) += tps65910-regulator.o
obj-$(CONFIG_REGULATOR_TPS65912) += tps65912-regulator.o
+obj-$(CONFIG_REGULATOR_TPS65917) += tps65917-regulator.o
obj-$(CONFIG_REGULATOR_TPS80031) += tps80031-regulator.o
obj-$(CONFIG_REGULATOR_TWL4030) += twl-regulator.o
obj-$(CONFIG_REGULATOR_VEXPRESS) += vexpress.o
Index: linux/drivers/regulator/tps65917-regulator.c
===
--- /dev/null 1970-01-01 00:00:00.0 +
+++ linux/drivers/regulator/tps65917-regulator.c2014-05-26
15:22:25.994853307 +0530
@@ -0,0 +1,814 @@
+/*
+ * Driver for Regulator part of TPS65917 PMIC
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * 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.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether expressed or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License version 2 for more details.
+ */
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/init.h
+#include linux/err.h
+#include linux/platform_device.h
+#include linux/regulator/driver.h
+#include linux/regulator/machine.h
+#include linux/slab.h
+#include linux/regmap.h
+#include linux/mfd/palmas.h
+#include linux/of.h
+#include linux/of_platform.h
+#include linux/regulator/of_regulator.h
+
+static const struct regulator_linear_range smps_low_ranges[] = {
+ REGULATOR_LINEAR_RANGE(50, 0x1, 0x6, 0),
+ REGULATOR_LINEAR_RANGE(51, 0x7, 0x79, 1),
+ REGULATOR_LINEAR_RANGE(165, 0x7A, 0x7f, 0),
+};
+
+static const struct regulator_linear_range smps_high_ranges[] = {
+ REGULATOR_LINEAR_RANGE(100, 0x1, 0x6, 0),
+ REGULATOR_LINEAR_RANGE(102, 0x7, 0x79, 2),
+ REGULATOR_LINEAR_RANGE(330, 0x7A, 0x7f, 0),
+};
+
+struct regs_info {
+ char*name;
+ char*sname;
+ u8 vsel_addr;
+ u8 ctrl_addr;
+ int sleep_id;
+};
+
+static const struct regs_info tps65917_regs_info[] = {
+ {
+ .name = SMPS1,
+ .sname = smps1-in,
+ .vsel_addr = TPS65917_SMPS1_VOLTAGE,
+ .ctrl_addr = TPS65917_SMPS1_CTRL,
+ .sleep_id = TPS65917_EXTERNAL_REQSTR_ID_SMPS1,
+ },
+ {
+ .name = SMPS2,
+ .sname = smps2-in,
+ .vsel_addr = TPS65917_SMPS2_VOLTAGE,
+ .ctrl_addr = TPS65917_SMPS2_CTRL,
+ .sleep_id = TPS65917_EXTERNAL_REQSTR_ID_SMPS2,
+ },
+ {
+ .name = SMPS3,
+ .sname = smps3-in,
+ .vsel_addr = TPS65917_SMPS3_VOLTAGE,
+ .ctrl_addr = TPS65917_SMPS3_CTRL,
+ .sleep_id =