Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
max77693-private.h
Go to the documentation of this file.
1 /*
2  * max77693-private.h - Voltage regulator driver for the Maxim 77693
3  *
4  * Copyright (C) 2012 Samsung Electrnoics
5  * SangYoung Son <[email protected]>
6  *
7  * This program is not provided / owned by Maxim Integrated Products.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22  */
23 
24 #ifndef __LINUX_MFD_MAX77693_PRIV_H
25 #define __LINUX_MFD_MAX77693_PRIV_H
26 
27 #include <linux/i2c.h>
28 
29 #define MAX77693_NUM_IRQ_MUIC_REGS 3
30 #define MAX77693_REG_INVALID (0xff)
31 
32 /* Slave addr = 0xCC: PMIC, Charger, Flash LED */
50 
60 
84 
86 };
87 
88 /* Slave addr = 0x4A: MUIC */
105 
107 };
108 
109 /* Slave addr = 0x90: Haptic */
128 
130 };
131 
133  LED_INT = 0,
139 
141 };
142 
144  /* PMIC - FLASH */
150 
151  /* PMIC - TOPSYS */
155 
156  /* PMIC - Charger */
162 
163  /* MUIC INT1 */
168 
169  /* MUIC INT2 */
176 
177  /* MUIC INT3 */
184 
186 };
187 
188 struct max77693_dev {
189  struct device *dev;
190  struct i2c_client *i2c; /* 0xCC , PMIC, Charger, Flash LED */
191  struct i2c_client *muic; /* 0x4A , MUIC */
192  struct i2c_client *haptic; /* 0x90 , Haptic */
193 
194  int type;
195 
196  struct regmap *regmap;
199 
201 
202  int irq;
203  int irq_gpio;
204  bool wakeup;
205  struct mutex irqlock;
208 };
209 
212 };
213 
214 extern int max77693_read_reg(struct regmap *map, u8 reg, u8 *dest);
215 extern int max77693_bulk_read(struct regmap *map, u8 reg, int count,
216  u8 *buf);
217 extern int max77693_write_reg(struct regmap *map, u8 reg, u8 value);
218 extern int max77693_bulk_write(struct regmap *map, u8 reg, int count,
219  u8 *buf);
220 extern int max77693_update_reg(struct regmap *map, u8 reg, u8 val, u8 mask);
221 
222 extern int max77693_irq_init(struct max77693_dev *max77686);
223 extern void max77693_irq_exit(struct max77693_dev *max77686);
224 extern int max77693_irq_resume(struct max77693_dev *max77686);
225 
226 #endif /* __LINUX_MFD_MAX77693_PRIV_H */