blob: d06c63335a2aee54580506befa23d5db8e7210af [file] [log] [blame]
Venu Byravarasu3c33be062012-03-16 11:10:19 +05301/*
2 * Core driver interface for TI TPS65090 PMIC family
3 *
4 * Copyright (C) 2012 NVIDIA Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 *
20 */
21
22#ifndef __LINUX_MFD_TPS65090_H
23#define __LINUX_MFD_TPS65090_H
24
Axel Lin06c49982012-04-17 17:08:56 +080025#include <linux/irq.h>
26
Laxman Dewangan24282a12012-10-09 15:18:59 +053027/* TPS65090 Regulator ID */
28enum {
29 TPS65090_ID_DCDC1,
30 TPS65090_ID_DCDC2,
31 TPS65090_ID_DCDC3,
32 TPS65090_ID_FET1,
33 TPS65090_ID_FET2,
34 TPS65090_ID_FET3,
35 TPS65090_ID_FET4,
36 TPS65090_ID_FET5,
37 TPS65090_ID_FET6,
38 TPS65090_ID_FET7,
39
40 /* Last entry for maximum ID */
41 TPS65090_ID_MAX,
42};
43
Axel Lin06c49982012-04-17 17:08:56 +080044struct tps65090 {
45 struct mutex lock;
46 struct device *dev;
47 struct i2c_client *client;
48 struct regmap *rmap;
49 struct irq_chip irq_chip;
50 struct mutex irq_lock;
51 int irq_base;
52 unsigned int id;
53};
54
Venu Byravarasu3c33be062012-03-16 11:10:19 +053055struct tps65090_subdev_info {
56 int id;
57 const char *name;
58 void *platform_data;
59};
60
Laxman Dewangan24282a12012-10-09 15:18:59 +053061/*
62 * struct tps65090_regulator_plat_data
63 *
64 * @reg_init_data: The regulator init data.
65 */
66
67struct tps65090_regulator_plat_data {
68 struct regulator_init_data *reg_init_data;
69};
70
Venu Byravarasu3c33be062012-03-16 11:10:19 +053071struct tps65090_platform_data {
72 int irq_base;
73 int num_subdevs;
74 struct tps65090_subdev_info *subdevs;
Laxman Dewangan24282a12012-10-09 15:18:59 +053075 struct tps65090_regulator_plat_data *reg_pdata[TPS65090_ID_MAX];
Venu Byravarasu3c33be062012-03-16 11:10:19 +053076};
77
78/*
79 * NOTE: the functions below are not intended for use outside
80 * of the TPS65090 sub-device drivers
81 */
82extern int tps65090_write(struct device *dev, int reg, uint8_t val);
83extern int tps65090_read(struct device *dev, int reg, uint8_t *val);
84extern int tps65090_set_bits(struct device *dev, int reg, uint8_t bit_num);
85extern int tps65090_clr_bits(struct device *dev, int reg, uint8_t bit_num);
86
87#endif /*__LINUX_MFD_TPS65090_H */