Merge tag 'lsk-android-14.04' into develop-3.10
[firefly-linux-kernel-4.4.55.git] / include / linux / regulator / rockchip_io_vol_domain.h
1 /*
2  *
3  * Copyright (C) 2014 ROCKCHIP, Inc.
4  *
5  * This software is licensed under the terms of the GNU General Public
6  * License version 2, as published by the Free Software Foundation, and
7  * may be copied, distributed, and modified under those terms.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  */
15
16 #include <linux/device.h>
17
18 #if 0
19 #define IO_DOMAIN_DBG(fmt, args...) printk( "IO_DOMAIN_DBG:\t"fmt, ##args)
20 #else
21 #define IO_DOMAIN_DBG(fmt, args...) {while(0);}
22 #endif
23
24 #define io_domain_regulator_get(dev,id) regulator_get((dev),(id))
25 #define io_domain_regulator_put(regu) regulator_put((regu))
26 #define io_domain_regulator_get_voltage(regu) regulator_get_voltage((regu))
27
28 int io_domain_regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV);
29
30 #define IO_VOL_DOMAIN_3V3 2800000
31 #define IO_VOL_DOMAIN_1V8 1500000
32
33 struct vd_node {
34         const char              *name;
35         const char              *regulator_name;
36         struct regulator        *regulator;
37         struct list_head        node;
38 };
39 struct io_domain_port {
40         struct pinctrl          *pctl;
41         struct pinctrl_state    *pins_default;
42         struct pinctrl_state    *pins_1v8;
43         struct pinctrl_state    *pins_3v3;
44 };
45
46 struct io_domain_device{
47         struct device *dev;
48         struct device_node *of_node;
49         
50 };
51