summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2011-05-26 13:53:59 +0530
committerNiket Sirsi <nsirsi@nvidia.com>2011-05-26 18:59:21 -0700
commit95c2136f2d82e1e489685badad639e96603a7234 (patch)
tree2d83f13f237328c0b43cadbd0367ba7375aefa18 /include
parent407f1c7dc44937483dd3a23aeb99d76b4b1318eb (diff)
arm: mfd/regulator: Adding driver for tps80031
Adding core and regulator driver for the TI pmu device tps80031. Following functionality is added: - Basic core driver interface to access register. - Regulator driver. - gpio driver. - interrupt support from pmu. - clock 32 initialization. bug 830904 bug 829658 Change-Id: I41e732c0b5d0472209798552b5264038e5a97ee4 Reviewed-on: http://git-master/r/33109 Tested-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Thomas Cherry <tcherry@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/tps80031.h108
-rw-r--r--include/linux/regulator/tps80031-regulator.h45
2 files changed, 153 insertions, 0 deletions
diff --git a/include/linux/mfd/tps80031.h b/include/linux/mfd/tps80031.h
new file mode 100644
index 000000000000..2f1a7baf44f5
--- /dev/null
+++ b/include/linux/mfd/tps80031.h
@@ -0,0 +1,108 @@
+/*
+ * include/linux/mfd/tps80031.c
+ *
+ * Core driver interface for TI TPS80031 PMIC
+ *
+ * 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 __LINUX_MFD_TPS80031_H
+#define __LINUX_MFD_TPS80031_H
+
+#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,
+};
+
+enum {
+ TPS80031_INT_PWRON,
+ TPS80031_INT_RPWRON,
+ TPS80031_INT_SYS_VLOW,
+ TPS80031_INT_RTC_ALARM,
+ TPS80031_INT_RTC_PERIOD,
+ TPS80031_INT_HOT_DIE,
+ TPS80031_INT_VXX_SHORT,
+ TPS80031_INT_SPDURATION,
+ TPS80031_INT_WATCHDOG,
+ TPS80031_INT_BAT,
+ TPS80031_INT_SIM,
+ TPS80031_INT_MMC,
+ TPS80031_INT_RES,
+ TPS80031_INT_GPADC_RT,
+ TPS80031_INT_GPADC_SW2_EOC,
+ TPS80031_INT_CC_AUTOCAL,
+ TPS80031_INT_ID_WKUP,
+ TPS80031_INT_VBUSS_WKUP,
+ TPS80031_INT_ID,
+ TPS80031_INT_VBUS,
+ TPS80031_INT_CHRG_CTRL,
+ TPS80031_INT_EXT_CHRG,
+ TPS80031_INT_INT_CHRG,
+ TPS80031_INT_RES2,
+};
+
+struct tps80031_subdev_info {
+ int id;
+ const char *name;
+ void *platform_data;
+};
+
+struct tps80031_32kclock_plat_data {
+ unsigned en_clk32kao:1;
+ unsigned en_clk32kg:1;
+ unsigned en_clk32kaudio:1;
+};
+
+struct tps80031_platform_data {
+ int num_subdevs;
+ struct tps80031_subdev_info *subdevs;
+ int gpio_base;
+ int irq_base;
+ struct tps80031_32kclock_plat_data *clk32k_pdata;
+};
+
+/*
+ * NOTE: the functions below are not intended for use outside
+ * of the TPS80031 sub-device drivers
+ */
+extern int tps80031_write(struct device *dev, int reg, uint8_t val);
+extern int tps80031_writes(struct device *dev, int reg, int len, uint8_t *val);
+extern int tps80031_read(struct device *dev, int reg, uint8_t *val);
+extern int tps80031_reads(struct device *dev, int reg, int len, uint8_t *val);
+extern int tps80031_set_bits(struct device *dev, int reg, uint8_t bit_mask);
+extern int tps80031_clr_bits(struct device *dev, int reg, uint8_t bit_mask);
+extern int tps80031_update(struct device *dev, int reg, uint8_t val,
+ uint8_t mask);
+extern int tps80031_power_off(void);
+
+#endif /*__LINUX_MFD_TPS80031_H */
diff --git a/include/linux/regulator/tps80031-regulator.h b/include/linux/regulator/tps80031-regulator.h
new file mode 100644
index 000000000000..6e030ce01697
--- /dev/null
+++ b/include/linux/regulator/tps80031-regulator.h
@@ -0,0 +1,45 @@
+/*
+ * 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 <linux/regulator/machine.h>
+
+/*
+ * 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.
+ */
+
+struct tps80031_regulator_platform_data {
+ struct regulator_init_data regulator;
+ int init_uV;
+ unsigned init_enable:1;
+ unsigned init_apply:1;
+};
+
+#endif /* __REGULATOR_TPS80031_H */