max8997-private.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. /*
  2. * max8997-private.h - Voltage regulator driver for the Maxim 8997
  3. *
  4. * Copyright (C) 2010 Samsung Electrnoics
  5. * MyungJoo Ham <myungjoo.ham@samsung.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #ifndef __LINUX_MFD_MAX8997_PRIV_H
  22. #define __LINUX_MFD_MAX8997_PRIV_H
  23. #include <linux/i2c.h>
  24. #include <linux/export.h>
  25. #include <linux/irqdomain.h>
  26. #define MAX8997_REG_INVALID (0xff)
  27. enum max8997_pmic_reg {
  28. MAX8997_REG_PMIC_ID0 = 0x00,
  29. MAX8997_REG_PMIC_ID1 = 0x01,
  30. MAX8997_REG_INTSRC = 0x02,
  31. MAX8997_REG_INT1 = 0x03,
  32. MAX8997_REG_INT2 = 0x04,
  33. MAX8997_REG_INT3 = 0x05,
  34. MAX8997_REG_INT4 = 0x06,
  35. MAX8997_REG_INT1MSK = 0x08,
  36. MAX8997_REG_INT2MSK = 0x09,
  37. MAX8997_REG_INT3MSK = 0x0a,
  38. MAX8997_REG_INT4MSK = 0x0b,
  39. MAX8997_REG_STATUS1 = 0x0d,
  40. MAX8997_REG_STATUS2 = 0x0e,
  41. MAX8997_REG_STATUS3 = 0x0f,
  42. MAX8997_REG_STATUS4 = 0x10,
  43. MAX8997_REG_MAINCON1 = 0x13,
  44. MAX8997_REG_MAINCON2 = 0x14,
  45. MAX8997_REG_BUCKRAMP = 0x15,
  46. MAX8997_REG_BUCK1CTRL = 0x18,
  47. MAX8997_REG_BUCK1DVS1 = 0x19,
  48. MAX8997_REG_BUCK1DVS2 = 0x1a,
  49. MAX8997_REG_BUCK1DVS3 = 0x1b,
  50. MAX8997_REG_BUCK1DVS4 = 0x1c,
  51. MAX8997_REG_BUCK1DVS5 = 0x1d,
  52. MAX8997_REG_BUCK1DVS6 = 0x1e,
  53. MAX8997_REG_BUCK1DVS7 = 0x1f,
  54. MAX8997_REG_BUCK1DVS8 = 0x20,
  55. MAX8997_REG_BUCK2CTRL = 0x21,
  56. MAX8997_REG_BUCK2DVS1 = 0x22,
  57. MAX8997_REG_BUCK2DVS2 = 0x23,
  58. MAX8997_REG_BUCK2DVS3 = 0x24,
  59. MAX8997_REG_BUCK2DVS4 = 0x25,
  60. MAX8997_REG_BUCK2DVS5 = 0x26,
  61. MAX8997_REG_BUCK2DVS6 = 0x27,
  62. MAX8997_REG_BUCK2DVS7 = 0x28,
  63. MAX8997_REG_BUCK2DVS8 = 0x29,
  64. MAX8997_REG_BUCK3CTRL = 0x2a,
  65. MAX8997_REG_BUCK3DVS = 0x2b,
  66. MAX8997_REG_BUCK4CTRL = 0x2c,
  67. MAX8997_REG_BUCK4DVS = 0x2d,
  68. MAX8997_REG_BUCK5CTRL = 0x2e,
  69. MAX8997_REG_BUCK5DVS1 = 0x2f,
  70. MAX8997_REG_BUCK5DVS2 = 0x30,
  71. MAX8997_REG_BUCK5DVS3 = 0x31,
  72. MAX8997_REG_BUCK5DVS4 = 0x32,
  73. MAX8997_REG_BUCK5DVS5 = 0x33,
  74. MAX8997_REG_BUCK5DVS6 = 0x34,
  75. MAX8997_REG_BUCK5DVS7 = 0x35,
  76. MAX8997_REG_BUCK5DVS8 = 0x36,
  77. MAX8997_REG_BUCK6CTRL = 0x37,
  78. MAX8997_REG_BUCK6BPSKIPCTRL = 0x38,
  79. MAX8997_REG_BUCK7CTRL = 0x39,
  80. MAX8997_REG_BUCK7DVS = 0x3a,
  81. MAX8997_REG_LDO1CTRL = 0x3b,
  82. MAX8997_REG_LDO2CTRL = 0x3c,
  83. MAX8997_REG_LDO3CTRL = 0x3d,
  84. MAX8997_REG_LDO4CTRL = 0x3e,
  85. MAX8997_REG_LDO5CTRL = 0x3f,
  86. MAX8997_REG_LDO6CTRL = 0x40,
  87. MAX8997_REG_LDO7CTRL = 0x41,
  88. MAX8997_REG_LDO8CTRL = 0x42,
  89. MAX8997_REG_LDO9CTRL = 0x43,
  90. MAX8997_REG_LDO10CTRL = 0x44,
  91. MAX8997_REG_LDO11CTRL = 0x45,
  92. MAX8997_REG_LDO12CTRL = 0x46,
  93. MAX8997_REG_LDO13CTRL = 0x47,
  94. MAX8997_REG_LDO14CTRL = 0x48,
  95. MAX8997_REG_LDO15CTRL = 0x49,
  96. MAX8997_REG_LDO16CTRL = 0x4a,
  97. MAX8997_REG_LDO17CTRL = 0x4b,
  98. MAX8997_REG_LDO18CTRL = 0x4c,
  99. MAX8997_REG_LDO21CTRL = 0x4d,
  100. MAX8997_REG_MBCCTRL1 = 0x50,
  101. MAX8997_REG_MBCCTRL2 = 0x51,
  102. MAX8997_REG_MBCCTRL3 = 0x52,
  103. MAX8997_REG_MBCCTRL4 = 0x53,
  104. MAX8997_REG_MBCCTRL5 = 0x54,
  105. MAX8997_REG_MBCCTRL6 = 0x55,
  106. MAX8997_REG_OTPCGHCVS = 0x56,
  107. MAX8997_REG_SAFEOUTCTRL = 0x5a,
  108. MAX8997_REG_LBCNFG1 = 0x5e,
  109. MAX8997_REG_LBCNFG2 = 0x5f,
  110. MAX8997_REG_BBCCTRL = 0x60,
  111. MAX8997_REG_FLASH1_CUR = 0x63, /* 0x63 ~ 0x6e for FLASH */
  112. MAX8997_REG_FLASH2_CUR = 0x64,
  113. MAX8997_REG_MOVIE_CUR = 0x65,
  114. MAX8997_REG_GSMB_CUR = 0x66,
  115. MAX8997_REG_BOOST_CNTL = 0x67,
  116. MAX8997_REG_LEN_CNTL = 0x68,
  117. MAX8997_REG_FLASH_CNTL = 0x69,
  118. MAX8997_REG_WDT_CNTL = 0x6a,
  119. MAX8997_REG_MAXFLASH1 = 0x6b,
  120. MAX8997_REG_MAXFLASH2 = 0x6c,
  121. MAX8997_REG_FLASHSTATUS = 0x6d,
  122. MAX8997_REG_FLASHSTATUSMASK = 0x6e,
  123. MAX8997_REG_GPIOCNTL1 = 0x70,
  124. MAX8997_REG_GPIOCNTL2 = 0x71,
  125. MAX8997_REG_GPIOCNTL3 = 0x72,
  126. MAX8997_REG_GPIOCNTL4 = 0x73,
  127. MAX8997_REG_GPIOCNTL5 = 0x74,
  128. MAX8997_REG_GPIOCNTL6 = 0x75,
  129. MAX8997_REG_GPIOCNTL7 = 0x76,
  130. MAX8997_REG_GPIOCNTL8 = 0x77,
  131. MAX8997_REG_GPIOCNTL9 = 0x78,
  132. MAX8997_REG_GPIOCNTL10 = 0x79,
  133. MAX8997_REG_GPIOCNTL11 = 0x7a,
  134. MAX8997_REG_GPIOCNTL12 = 0x7b,
  135. MAX8997_REG_LDO1CONFIG = 0x80,
  136. MAX8997_REG_LDO2CONFIG = 0x81,
  137. MAX8997_REG_LDO3CONFIG = 0x82,
  138. MAX8997_REG_LDO4CONFIG = 0x83,
  139. MAX8997_REG_LDO5CONFIG = 0x84,
  140. MAX8997_REG_LDO6CONFIG = 0x85,
  141. MAX8997_REG_LDO7CONFIG = 0x86,
  142. MAX8997_REG_LDO8CONFIG = 0x87,
  143. MAX8997_REG_LDO9CONFIG = 0x88,
  144. MAX8997_REG_LDO10CONFIG = 0x89,
  145. MAX8997_REG_LDO11CONFIG = 0x8a,
  146. MAX8997_REG_LDO12CONFIG = 0x8b,
  147. MAX8997_REG_LDO13CONFIG = 0x8c,
  148. MAX8997_REG_LDO14CONFIG = 0x8d,
  149. MAX8997_REG_LDO15CONFIG = 0x8e,
  150. MAX8997_REG_LDO16CONFIG = 0x8f,
  151. MAX8997_REG_LDO17CONFIG = 0x90,
  152. MAX8997_REG_LDO18CONFIG = 0x91,
  153. MAX8997_REG_LDO21CONFIG = 0x92,
  154. MAX8997_REG_DVSOKTIMER1 = 0x97,
  155. MAX8997_REG_DVSOKTIMER2 = 0x98,
  156. MAX8997_REG_DVSOKTIMER4 = 0x99,
  157. MAX8997_REG_DVSOKTIMER5 = 0x9a,
  158. MAX8997_REG_PMIC_END = 0x9b,
  159. };
  160. enum max8997_muic_reg {
  161. MAX8997_MUIC_REG_ID = 0x0,
  162. MAX8997_MUIC_REG_INT1 = 0x1,
  163. MAX8997_MUIC_REG_INT2 = 0x2,
  164. MAX8997_MUIC_REG_INT3 = 0x3,
  165. MAX8997_MUIC_REG_STATUS1 = 0x4,
  166. MAX8997_MUIC_REG_STATUS2 = 0x5,
  167. MAX8997_MUIC_REG_STATUS3 = 0x6,
  168. MAX8997_MUIC_REG_INTMASK1 = 0x7,
  169. MAX8997_MUIC_REG_INTMASK2 = 0x8,
  170. MAX8997_MUIC_REG_INTMASK3 = 0x9,
  171. MAX8997_MUIC_REG_CDETCTRL = 0xa,
  172. MAX8997_MUIC_REG_CONTROL1 = 0xc,
  173. MAX8997_MUIC_REG_CONTROL2 = 0xd,
  174. MAX8997_MUIC_REG_CONTROL3 = 0xe,
  175. MAX8997_MUIC_REG_END = 0xf,
  176. };
  177. /* MAX8997-MUIC STATUS1 register */
  178. #define STATUS1_ADC_SHIFT 0
  179. #define STATUS1_ADCLOW_SHIFT 5
  180. #define STATUS1_ADCERR_SHIFT 6
  181. #define STATUS1_ADC_MASK (0x1f << STATUS1_ADC_SHIFT)
  182. #define STATUS1_ADCLOW_MASK (0x1 << STATUS1_ADCLOW_SHIFT)
  183. #define STATUS1_ADCERR_MASK (0x1 << STATUS1_ADCERR_SHIFT)
  184. /* MAX8997-MUIC STATUS2 register */
  185. #define STATUS2_CHGTYP_SHIFT 0
  186. #define STATUS2_CHGDETRUN_SHIFT 3
  187. #define STATUS2_DCDTMR_SHIFT 4
  188. #define STATUS2_DBCHG_SHIFT 5
  189. #define STATUS2_VBVOLT_SHIFT 6
  190. #define STATUS2_CHGTYP_MASK (0x7 << STATUS2_CHGTYP_SHIFT)
  191. #define STATUS2_CHGDETRUN_MASK (0x1 << STATUS2_CHGDETRUN_SHIFT)
  192. #define STATUS2_DCDTMR_MASK (0x1 << STATUS2_DCDTMR_SHIFT)
  193. #define STATUS2_DBCHG_MASK (0x1 << STATUS2_DBCHG_SHIFT)
  194. #define STATUS2_VBVOLT_MASK (0x1 << STATUS2_VBVOLT_SHIFT)
  195. /* MAX8997-MUIC STATUS3 register */
  196. #define STATUS3_OVP_SHIFT 2
  197. #define STATUS3_OVP_MASK (0x1 << STATUS3_OVP_SHIFT)
  198. /* MAX8997-MUIC CONTROL1 register */
  199. #define COMN1SW_SHIFT 0
  200. #define COMP2SW_SHIFT 3
  201. #define COMN1SW_MASK (0x7 << COMN1SW_SHIFT)
  202. #define COMP2SW_MASK (0x7 << COMP2SW_SHIFT)
  203. #define COMP_SW_MASK (COMP2SW_MASK | COMN1SW_MASK)
  204. #define CONTROL1_SW_USB ((1 << COMP2SW_SHIFT) \
  205. | (1 << COMN1SW_SHIFT))
  206. #define CONTROL1_SW_AUDIO ((2 << COMP2SW_SHIFT) \
  207. | (2 << COMN1SW_SHIFT))
  208. #define CONTROL1_SW_UART ((3 << COMP2SW_SHIFT) \
  209. | (3 << COMN1SW_SHIFT))
  210. #define CONTROL1_SW_OPEN ((0 << COMP2SW_SHIFT) \
  211. | (0 << COMN1SW_SHIFT))
  212. #define CONTROL2_LOWPWR_SHIFT (0)
  213. #define CONTROL2_ADCEN_SHIFT (1)
  214. #define CONTROL2_CPEN_SHIFT (2)
  215. #define CONTROL2_SFOUTASRT_SHIFT (3)
  216. #define CONTROL2_SFOUTORD_SHIFT (4)
  217. #define CONTROL2_ACCDET_SHIFT (5)
  218. #define CONTROL2_USBCPINT_SHIFT (6)
  219. #define CONTROL2_RCPS_SHIFT (7)
  220. #define CONTROL2_LOWPWR_MASK (0x1 << CONTROL2_LOWPWR_SHIFT)
  221. #define CONTROL2_ADCEN_MASK (0x1 << CONTROL2_ADCEN_SHIFT)
  222. #define CONTROL2_CPEN_MASK (0x1 << CONTROL2_CPEN_SHIFT)
  223. #define CONTROL2_SFOUTASRT_MASK (0x1 << CONTROL2_SFOUTASRT_SHIFT)
  224. #define CONTROL2_SFOUTORD_MASK (0x1 << CONTROL2_SFOUTORD_SHIFT)
  225. #define CONTROL2_ACCDET_MASK (0x1 << CONTROL2_ACCDET_SHIFT)
  226. #define CONTROL2_USBCPINT_MASK (0x1 << CONTROL2_USBCPINT_SHIFT)
  227. #define CONTROL2_RCPS_MASK (0x1 << CONTROL2_RCPS_SHIFT)
  228. #define CONTROL3_JIGSET_SHIFT (0)
  229. #define CONTROL3_BTLDSET_SHIFT (2)
  230. #define CONTROL3_ADCDBSET_SHIFT (4)
  231. #define CONTROL3_JIGSET_MASK (0x3 << CONTROL3_JIGSET_SHIFT)
  232. #define CONTROL3_BTLDSET_MASK (0x3 << CONTROL3_BTLDSET_SHIFT)
  233. #define CONTROL3_ADCDBSET_MASK (0x3 << CONTROL3_ADCDBSET_SHIFT)
  234. enum max8997_haptic_reg {
  235. MAX8997_HAPTIC_REG_GENERAL = 0x00,
  236. MAX8997_HAPTIC_REG_CONF1 = 0x01,
  237. MAX8997_HAPTIC_REG_CONF2 = 0x02,
  238. MAX8997_HAPTIC_REG_DRVCONF = 0x03,
  239. MAX8997_HAPTIC_REG_CYCLECONF1 = 0x04,
  240. MAX8997_HAPTIC_REG_CYCLECONF2 = 0x05,
  241. MAX8997_HAPTIC_REG_SIGCONF1 = 0x06,
  242. MAX8997_HAPTIC_REG_SIGCONF2 = 0x07,
  243. MAX8997_HAPTIC_REG_SIGCONF3 = 0x08,
  244. MAX8997_HAPTIC_REG_SIGCONF4 = 0x09,
  245. MAX8997_HAPTIC_REG_SIGDC1 = 0x0a,
  246. MAX8997_HAPTIC_REG_SIGDC2 = 0x0b,
  247. MAX8997_HAPTIC_REG_SIGPWMDC1 = 0x0c,
  248. MAX8997_HAPTIC_REG_SIGPWMDC2 = 0x0d,
  249. MAX8997_HAPTIC_REG_SIGPWMDC3 = 0x0e,
  250. MAX8997_HAPTIC_REG_SIGPWMDC4 = 0x0f,
  251. MAX8997_HAPTIC_REG_MTR_REV = 0x10,
  252. MAX8997_HAPTIC_REG_END = 0x11,
  253. };
  254. /* slave addr = 0x0c: using "2nd part" of rev4 datasheet */
  255. enum max8997_rtc_reg {
  256. MAX8997_RTC_CTRLMASK = 0x02,
  257. MAX8997_RTC_CTRL = 0x03,
  258. MAX8997_RTC_UPDATE1 = 0x04,
  259. MAX8997_RTC_UPDATE2 = 0x05,
  260. MAX8997_RTC_WTSR_SMPL = 0x06,
  261. MAX8997_RTC_SEC = 0x10,
  262. MAX8997_RTC_MIN = 0x11,
  263. MAX8997_RTC_HOUR = 0x12,
  264. MAX8997_RTC_DAY_OF_WEEK = 0x13,
  265. MAX8997_RTC_MONTH = 0x14,
  266. MAX8997_RTC_YEAR = 0x15,
  267. MAX8997_RTC_DAY_OF_MONTH = 0x16,
  268. MAX8997_RTC_ALARM1_SEC = 0x17,
  269. MAX8997_RTC_ALARM1_MIN = 0x18,
  270. MAX8997_RTC_ALARM1_HOUR = 0x19,
  271. MAX8997_RTC_ALARM1_DAY_OF_WEEK = 0x1a,
  272. MAX8997_RTC_ALARM1_MONTH = 0x1b,
  273. MAX8997_RTC_ALARM1_YEAR = 0x1c,
  274. MAX8997_RTC_ALARM1_DAY_OF_MONTH = 0x1d,
  275. MAX8997_RTC_ALARM2_SEC = 0x1e,
  276. MAX8997_RTC_ALARM2_MIN = 0x1f,
  277. MAX8997_RTC_ALARM2_HOUR = 0x20,
  278. MAX8997_RTC_ALARM2_DAY_OF_WEEK = 0x21,
  279. MAX8997_RTC_ALARM2_MONTH = 0x22,
  280. MAX8997_RTC_ALARM2_YEAR = 0x23,
  281. MAX8997_RTC_ALARM2_DAY_OF_MONTH = 0x24,
  282. };
  283. enum max8997_irq_source {
  284. PMIC_INT1 = 0,
  285. PMIC_INT2,
  286. PMIC_INT3,
  287. PMIC_INT4,
  288. FUEL_GAUGE, /* Ignored (MAX17042 driver handles) */
  289. MUIC_INT1,
  290. MUIC_INT2,
  291. MUIC_INT3,
  292. GPIO_LOW, /* Not implemented */
  293. GPIO_HI, /* Not implemented */
  294. FLASH_STATUS, /* Not implemented */
  295. MAX8997_IRQ_GROUP_NR,
  296. };
  297. enum max8997_irq {
  298. MAX8997_PMICIRQ_PWRONR,
  299. MAX8997_PMICIRQ_PWRONF,
  300. MAX8997_PMICIRQ_PWRON1SEC,
  301. MAX8997_PMICIRQ_JIGONR,
  302. MAX8997_PMICIRQ_JIGONF,
  303. MAX8997_PMICIRQ_LOWBAT2,
  304. MAX8997_PMICIRQ_LOWBAT1,
  305. MAX8997_PMICIRQ_JIGR,
  306. MAX8997_PMICIRQ_JIGF,
  307. MAX8997_PMICIRQ_MR,
  308. MAX8997_PMICIRQ_DVS1OK,
  309. MAX8997_PMICIRQ_DVS2OK,
  310. MAX8997_PMICIRQ_DVS3OK,
  311. MAX8997_PMICIRQ_DVS4OK,
  312. MAX8997_PMICIRQ_CHGINS,
  313. MAX8997_PMICIRQ_CHGRM,
  314. MAX8997_PMICIRQ_DCINOVP,
  315. MAX8997_PMICIRQ_TOPOFFR,
  316. MAX8997_PMICIRQ_CHGRSTF,
  317. MAX8997_PMICIRQ_MBCHGTMEXPD,
  318. MAX8997_PMICIRQ_RTC60S,
  319. MAX8997_PMICIRQ_RTCA1,
  320. MAX8997_PMICIRQ_RTCA2,
  321. MAX8997_PMICIRQ_SMPL_INT,
  322. MAX8997_PMICIRQ_RTC1S,
  323. MAX8997_PMICIRQ_WTSR,
  324. MAX8997_MUICIRQ_ADCError,
  325. MAX8997_MUICIRQ_ADCLow,
  326. MAX8997_MUICIRQ_ADC,
  327. MAX8997_MUICIRQ_VBVolt,
  328. MAX8997_MUICIRQ_DBChg,
  329. MAX8997_MUICIRQ_DCDTmr,
  330. MAX8997_MUICIRQ_ChgDetRun,
  331. MAX8997_MUICIRQ_ChgTyp,
  332. MAX8997_MUICIRQ_OVP,
  333. MAX8997_IRQ_NR,
  334. };
  335. #define MAX8997_NUM_GPIO 12
  336. struct max8997_dev {
  337. struct device *dev;
  338. struct max8997_platform_data *pdata;
  339. struct i2c_client *i2c; /* 0xcc / PMIC, Battery Control, and FLASH */
  340. struct i2c_client *rtc; /* slave addr 0x0c */
  341. struct i2c_client *haptic; /* slave addr 0x90 */
  342. struct i2c_client *muic; /* slave addr 0x4a */
  343. struct mutex iolock;
  344. unsigned long type;
  345. struct platform_device *battery; /* battery control (not fuel gauge) */
  346. int irq;
  347. int ono;
  348. struct irq_domain *irq_domain;
  349. struct mutex irqlock;
  350. int irq_masks_cur[MAX8997_IRQ_GROUP_NR];
  351. int irq_masks_cache[MAX8997_IRQ_GROUP_NR];
  352. /* For hibernation */
  353. u8 reg_dump[MAX8997_REG_PMIC_END + MAX8997_MUIC_REG_END +
  354. MAX8997_HAPTIC_REG_END];
  355. bool gpio_status[MAX8997_NUM_GPIO];
  356. };
  357. enum max8997_types {
  358. TYPE_MAX8997,
  359. TYPE_MAX8966,
  360. };
  361. extern int max8997_irq_init(struct max8997_dev *max8997);
  362. extern void max8997_irq_exit(struct max8997_dev *max8997);
  363. extern int max8997_irq_resume(struct max8997_dev *max8997);
  364. extern int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest);
  365. extern int max8997_bulk_read(struct i2c_client *i2c, u8 reg, int count,
  366. u8 *buf);
  367. extern int max8997_write_reg(struct i2c_client *i2c, u8 reg, u8 value);
  368. extern int max8997_bulk_write(struct i2c_client *i2c, u8 reg, int count,
  369. u8 *buf);
  370. extern int max8997_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask);
  371. #define MAX8997_GPIO_INT_BOTH (0x3 << 4)
  372. #define MAX8997_GPIO_INT_RISE (0x2 << 4)
  373. #define MAX8997_GPIO_INT_FALL (0x1 << 4)
  374. #define MAX8997_GPIO_INT_MASK (0x3 << 4)
  375. #define MAX8997_GPIO_DATA_MASK (0x1 << 2)
  376. #endif /* __LINUX_MFD_MAX8997_PRIV_H */