xref: /linux/include/linux/mfd/as3711.h (revision acad189b08456722ca4a8984218d6f38f4563cbc)
1*acad189bSGuennadi Liakhovetski /*
2*acad189bSGuennadi Liakhovetski  * AS3711 PMIC MFC driver header
3*acad189bSGuennadi Liakhovetski  *
4*acad189bSGuennadi Liakhovetski  * Copyright (C) 2012 Renesas Electronics Corporation
5*acad189bSGuennadi Liakhovetski  * Author: Guennadi Liakhovetski, <g.liakhovetski@gmx.de>
6*acad189bSGuennadi Liakhovetski  *
7*acad189bSGuennadi Liakhovetski  * This program is free software; you can redistribute it and/or modify
8*acad189bSGuennadi Liakhovetski  * it under the terms of the version 2 of the GNU General Public License as
9*acad189bSGuennadi Liakhovetski  * published by the Free Software Foundation
10*acad189bSGuennadi Liakhovetski  */
11*acad189bSGuennadi Liakhovetski 
12*acad189bSGuennadi Liakhovetski #ifndef MFD_AS3711_H
13*acad189bSGuennadi Liakhovetski #define MFD_AS3711_H
14*acad189bSGuennadi Liakhovetski 
15*acad189bSGuennadi Liakhovetski /*
16*acad189bSGuennadi Liakhovetski  * Client data
17*acad189bSGuennadi Liakhovetski  */
18*acad189bSGuennadi Liakhovetski 
19*acad189bSGuennadi Liakhovetski /* Register addresses */
20*acad189bSGuennadi Liakhovetski #define AS3711_SD_1_VOLTAGE		0	/* Digital Step-Down */
21*acad189bSGuennadi Liakhovetski #define AS3711_SD_2_VOLTAGE		1
22*acad189bSGuennadi Liakhovetski #define AS3711_SD_3_VOLTAGE		2
23*acad189bSGuennadi Liakhovetski #define AS3711_SD_4_VOLTAGE		3
24*acad189bSGuennadi Liakhovetski #define AS3711_LDO_1_VOLTAGE		4	/* Analog LDO */
25*acad189bSGuennadi Liakhovetski #define AS3711_LDO_2_VOLTAGE		5
26*acad189bSGuennadi Liakhovetski #define AS3711_LDO_3_VOLTAGE		6	/* Digital LDO */
27*acad189bSGuennadi Liakhovetski #define AS3711_LDO_4_VOLTAGE		7
28*acad189bSGuennadi Liakhovetski #define AS3711_LDO_5_VOLTAGE		8
29*acad189bSGuennadi Liakhovetski #define AS3711_LDO_6_VOLTAGE		9
30*acad189bSGuennadi Liakhovetski #define AS3711_LDO_7_VOLTAGE		0xa
31*acad189bSGuennadi Liakhovetski #define AS3711_LDO_8_VOLTAGE		0xb
32*acad189bSGuennadi Liakhovetski #define AS3711_SD_CONTROL		0x10
33*acad189bSGuennadi Liakhovetski #define AS3711_GPIO_SIGNAL_OUT		0x20
34*acad189bSGuennadi Liakhovetski #define AS3711_GPIO_SIGNAL_IN		0x21
35*acad189bSGuennadi Liakhovetski #define AS3711_SD_CONTROL_1		0x30
36*acad189bSGuennadi Liakhovetski #define AS3711_SD_CONTROL_2		0x31
37*acad189bSGuennadi Liakhovetski #define AS3711_CURR_CONTROL		0x40
38*acad189bSGuennadi Liakhovetski #define AS3711_CURR1_VALUE		0x43
39*acad189bSGuennadi Liakhovetski #define AS3711_CURR2_VALUE		0x44
40*acad189bSGuennadi Liakhovetski #define AS3711_CURR3_VALUE		0x45
41*acad189bSGuennadi Liakhovetski #define AS3711_STEPUP_CONTROL_1		0x50
42*acad189bSGuennadi Liakhovetski #define AS3711_STEPUP_CONTROL_2		0x51
43*acad189bSGuennadi Liakhovetski #define AS3711_STEPUP_CONTROL_4		0x53
44*acad189bSGuennadi Liakhovetski #define AS3711_STEPUP_CONTROL_5		0x54
45*acad189bSGuennadi Liakhovetski #define AS3711_REG_STATUS		0x73
46*acad189bSGuennadi Liakhovetski #define AS3711_INTERRUPT_STATUS_1	0x77
47*acad189bSGuennadi Liakhovetski #define AS3711_INTERRUPT_STATUS_2	0x78
48*acad189bSGuennadi Liakhovetski #define AS3711_INTERRUPT_STATUS_3	0x79
49*acad189bSGuennadi Liakhovetski #define AS3711_CHARGER_STATUS_1		0x86
50*acad189bSGuennadi Liakhovetski #define AS3711_CHARGER_STATUS_2		0x87
51*acad189bSGuennadi Liakhovetski #define AS3711_ASIC_ID_1		0x90
52*acad189bSGuennadi Liakhovetski #define AS3711_ASIC_ID_2		0x91
53*acad189bSGuennadi Liakhovetski 
54*acad189bSGuennadi Liakhovetski #define AS3711_MAX_REGS			0x92
55*acad189bSGuennadi Liakhovetski 
56*acad189bSGuennadi Liakhovetski /* Regulators */
57*acad189bSGuennadi Liakhovetski enum {
58*acad189bSGuennadi Liakhovetski 	AS3711_REGULATOR_SD_1,
59*acad189bSGuennadi Liakhovetski 	AS3711_REGULATOR_SD_2,
60*acad189bSGuennadi Liakhovetski 	AS3711_REGULATOR_SD_3,
61*acad189bSGuennadi Liakhovetski 	AS3711_REGULATOR_SD_4,
62*acad189bSGuennadi Liakhovetski 	AS3711_REGULATOR_LDO_1,
63*acad189bSGuennadi Liakhovetski 	AS3711_REGULATOR_LDO_2,
64*acad189bSGuennadi Liakhovetski 	AS3711_REGULATOR_LDO_3,
65*acad189bSGuennadi Liakhovetski 	AS3711_REGULATOR_LDO_4,
66*acad189bSGuennadi Liakhovetski 	AS3711_REGULATOR_LDO_5,
67*acad189bSGuennadi Liakhovetski 	AS3711_REGULATOR_LDO_6,
68*acad189bSGuennadi Liakhovetski 	AS3711_REGULATOR_LDO_7,
69*acad189bSGuennadi Liakhovetski 	AS3711_REGULATOR_LDO_8,
70*acad189bSGuennadi Liakhovetski 
71*acad189bSGuennadi Liakhovetski 	AS3711_REGULATOR_MAX,
72*acad189bSGuennadi Liakhovetski };
73*acad189bSGuennadi Liakhovetski 
74*acad189bSGuennadi Liakhovetski struct device;
75*acad189bSGuennadi Liakhovetski struct regmap;
76*acad189bSGuennadi Liakhovetski 
77*acad189bSGuennadi Liakhovetski struct as3711 {
78*acad189bSGuennadi Liakhovetski 	struct device *dev;
79*acad189bSGuennadi Liakhovetski 	struct regmap *regmap;
80*acad189bSGuennadi Liakhovetski };
81*acad189bSGuennadi Liakhovetski 
82*acad189bSGuennadi Liakhovetski #define AS3711_MAX_STEPDOWN 4
83*acad189bSGuennadi Liakhovetski #define AS3711_MAX_STEPUP 2
84*acad189bSGuennadi Liakhovetski #define AS3711_MAX_LDO 8
85*acad189bSGuennadi Liakhovetski 
86*acad189bSGuennadi Liakhovetski enum as3711_su2_feedback {
87*acad189bSGuennadi Liakhovetski 	AS3711_SU2_VOLTAGE,
88*acad189bSGuennadi Liakhovetski 	AS3711_SU2_CURR1,
89*acad189bSGuennadi Liakhovetski 	AS3711_SU2_CURR2,
90*acad189bSGuennadi Liakhovetski 	AS3711_SU2_CURR3,
91*acad189bSGuennadi Liakhovetski 	AS3711_SU2_CURR_AUTO,
92*acad189bSGuennadi Liakhovetski };
93*acad189bSGuennadi Liakhovetski 
94*acad189bSGuennadi Liakhovetski enum as3711_su2_fbprot {
95*acad189bSGuennadi Liakhovetski 	AS3711_SU2_LX_SD4,
96*acad189bSGuennadi Liakhovetski 	AS3711_SU2_GPIO2,
97*acad189bSGuennadi Liakhovetski 	AS3711_SU2_GPIO3,
98*acad189bSGuennadi Liakhovetski 	AS3711_SU2_GPIO4,
99*acad189bSGuennadi Liakhovetski };
100*acad189bSGuennadi Liakhovetski 
101*acad189bSGuennadi Liakhovetski /*
102*acad189bSGuennadi Liakhovetski  * Platform data
103*acad189bSGuennadi Liakhovetski  */
104*acad189bSGuennadi Liakhovetski 
105*acad189bSGuennadi Liakhovetski struct as3711_regulator_pdata {
106*acad189bSGuennadi Liakhovetski 	struct regulator_init_data *init_data[AS3711_REGULATOR_MAX];
107*acad189bSGuennadi Liakhovetski };
108*acad189bSGuennadi Liakhovetski 
109*acad189bSGuennadi Liakhovetski struct as3711_bl_pdata {
110*acad189bSGuennadi Liakhovetski 	const char *su1_fb;
111*acad189bSGuennadi Liakhovetski 	int su1_max_uA;
112*acad189bSGuennadi Liakhovetski 	const char *su2_fb;
113*acad189bSGuennadi Liakhovetski 	int su2_max_uA;
114*acad189bSGuennadi Liakhovetski 	enum as3711_su2_feedback su2_feedback;
115*acad189bSGuennadi Liakhovetski 	enum as3711_su2_fbprot su2_fbprot;
116*acad189bSGuennadi Liakhovetski 	bool su2_auto_curr1;
117*acad189bSGuennadi Liakhovetski 	bool su2_auto_curr2;
118*acad189bSGuennadi Liakhovetski 	bool su2_auto_curr3;
119*acad189bSGuennadi Liakhovetski };
120*acad189bSGuennadi Liakhovetski 
121*acad189bSGuennadi Liakhovetski struct as3711_platform_data {
122*acad189bSGuennadi Liakhovetski 	struct as3711_regulator_pdata regulator;
123*acad189bSGuennadi Liakhovetski 	struct as3711_bl_pdata backlight;
124*acad189bSGuennadi Liakhovetski };
125*acad189bSGuennadi Liakhovetski 
126*acad189bSGuennadi Liakhovetski #endif
127