blob: f0b6585cd874cd0ecb917e8dccb130460bedbb40 [file] [log] [blame]
Chanwoo Choi83871c02012-05-14 22:50:39 +02001/*
2 * max77693.h - Driver for the Maxim 77693
3 *
4 * Copyright (C) 2012 Samsung Electrnoics
5 * SangYoung Son <hello.son@samsung.com>
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 * This driver is based on max8997.h
24 *
25 * MAX77693 has PMIC, Charger, Flash LED, Haptic, MUIC devices.
26 * The devices share the same I2C bus and included in
27 * this mfd driver.
28 */
29
30#ifndef __LINUX_MFD_MAX77693_H
31#define __LINUX_MFD_MAX77693_H
32
Jonghwa Lee80b022e2013-06-25 10:08:38 +090033/* MAX77686 regulator IDs */
34enum max77693_regulators {
35 MAX77693_ESAFEOUT1 = 0,
36 MAX77693_ESAFEOUT2,
37 MAX77693_CHARGER,
38 MAX77693_REG_MAX,
39};
40
41struct max77693_regulator_data {
42 int id;
43 struct regulator_init_data *initdata;
44 struct device_node *of_node;
45};
46
Chanwoo Choif8457d52012-10-08 14:41:49 +090047struct max77693_reg_data {
48 u8 addr;
49 u8 data;
50};
51
52struct max77693_muic_platform_data {
53 struct max77693_reg_data *init_data;
54 int num_init_data;
Chanwoo Choi297620f2012-12-26 13:10:11 +090055
56 int detcable_delay_ms;
Chanwoo Choi2b757992012-12-06 21:27:56 +090057
58 /*
59 * Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
60 * h/w path of COMP2/COMN1 on CONTROL1 register.
61 */
62 int path_usb;
63 int path_uart;
Chanwoo Choif8457d52012-10-08 14:41:49 +090064};
65
Jacek Anaszewskia0bc60722014-08-22 11:06:18 +020066/* MAX77693 led flash */
67
68/* triggers */
69enum max77693_led_trigger {
70 MAX77693_LED_TRIG_OFF,
71 MAX77693_LED_TRIG_FLASH,
72 MAX77693_LED_TRIG_TORCH,
73 MAX77693_LED_TRIG_EXT,
74 MAX77693_LED_TRIG_SOFT,
75};
76
77/* trigger types */
78enum max77693_led_trigger_type {
79 MAX77693_LED_TRIG_TYPE_EDGE,
80 MAX77693_LED_TRIG_TYPE_LEVEL,
81};
82
83/* boost modes */
84enum max77693_led_boost_mode {
85 MAX77693_LED_BOOST_NONE,
86 MAX77693_LED_BOOST_ADAPTIVE,
87 MAX77693_LED_BOOST_FIXED,
88};
89
90struct max77693_led_platform_data {
91 u32 fleds[2];
92 u32 iout_torch[2];
93 u32 iout_flash[2];
94 u32 trigger[2];
95 u32 trigger_type[2];
96 u32 num_leds;
97 u32 boost_mode;
98 u32 flash_timeout;
99 u32 boost_vout;
100 u32 low_vsys;
101};
102
103/* MAX77693 */
104
Chanwoo Choi83871c02012-05-14 22:50:39 +0200105struct max77693_platform_data {
Jonghwa Lee80b022e2013-06-25 10:08:38 +0900106 /* regulator data */
107 struct max77693_regulator_data *regulators;
108 int num_regulators;
109
Chanwoo Choif8457d52012-10-08 14:41:49 +0900110 /* muic data */
111 struct max77693_muic_platform_data *muic_data;
Jacek Anaszewskia0bc60722014-08-22 11:06:18 +0200112 struct max77693_led_platform_data *led_data;
Chanwoo Choi83871c02012-05-14 22:50:39 +0200113};
114#endif /* __LINUX_MFD_MAX77693_H */