Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
core.h
Go to the documentation of this file.
1 /*
2  * core.h
3  *
4  * copyright (c) 2011 Samsung Electronics Co., Ltd
5  * http://www.samsung.com
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the
9  * Free Software Foundation; either version 2 of the License, or (at your
10  * option) any later version.
11  *
12  */
13 
14 #ifndef __LINUX_MFD_SEC_CORE_H
15 #define __LINUX_MFD_SEC_CORE_H
16 
17 #define NUM_IRQ_REGS 4
18 
24 };
25 
40 struct sec_pmic_dev {
41  struct device *dev;
42  struct regmap *regmap;
43  struct i2c_client *i2c;
44  struct i2c_client *rtc;
45  struct mutex iolock;
46  struct mutex irqlock;
47 
49  int irq_base;
50  int irq;
52 
53  int ono;
56  int type;
57  bool wakeup;
58 };
59 
60 int sec_irq_init(struct sec_pmic_dev *sec_pmic);
61 void sec_irq_exit(struct sec_pmic_dev *sec_pmic);
62 int sec_irq_resume(struct sec_pmic_dev *sec_pmic);
63 
64 extern int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest);
65 extern int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf);
66 extern int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value);
67 extern int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf);
68 extern int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask);
69 
75 
76  int irq_base;
78 
79  int ono;
80  bool wakeup;
82 
83  int buck_gpios[3];
84  int buck_ds[3];
85  int buck2_voltage[8];
87  int buck3_voltage[8];
89  int buck4_voltage[8];
91 
92  int buck_set1;
93  int buck_set2;
94  int buck_set3;
102 
104 
111 
116 
120 };
121 
128  int id;
130 };
131 
132 /*
133  * sec_opmode_data - regulator operation mode data
134  * @id: regulator id
135  * @mode: regulator operation mode
136  */
138  int id;
139  int mode;
140 };
141 
142 /*
143  * samsung regulator operation mode
144  * SEC_OPMODE_OFF Regulator always OFF
145  * SEC_OPMODE_ON Regulator always ON
146  * SEC_OPMODE_LOWPOWER Regulator is on in low-power mode
147  * SEC_OPMODE_SUSPEND Regulator is changed by PWREN pin
148  * If PWREN is high, regulator is on
149  * If PWREN is low, regulator is off
150  */
151 
157 };
158 
159 #endif /* __LINUX_MFD_SEC_CORE_H */