summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2011-05-26 13:53:59 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:43:01 -0800
commit62cf98053c368f4e4339629c1ceed060eff34376 (patch)
tree24664488caaa1ee1fbdbc6790f0448ea24da4215 /include
parentfacb5b00caf9ceb034772b8ab5f04799d2daa053 (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 Original-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> Rebase-Id: Rc99a827789a7841b69a8f984efaae702de54b878
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/tps80031.h108
1 files changed, 108 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 */