summaryrefslogtreecommitdiff
path: root/arch/arm/boot/dts/rt5033.dtsi
blob: 584183ba942b02d87c4ac123d35dd10bdf7605f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
/* example for RT5033
 * Copyright (C) 2013 Richtek Technology Corp.
 * Author: Patrick Chang <patrick_chang@richtek.com>
 */

/{
	sec-battery {
		status = "okay";
		compatible = "samsung,sec-battery";
		battery,vendor = "SDI SDI";
		battery,charger_name = "sec-charger";
		battery,fuelgauge_name = "sec-fuelgauge";
		battery,technology = <2>; /* POWER_SUPPLY_TECHNOLOGY_LION */
		battery,bat_irq_attr = <3>; /* IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING */
		/* battery,ta_int = <&d_gpio_gpio 62 0x1>;
		battery,ta_irq_attr = <0x3>; */

		battery,chip_vendor = "QCOM";
		battery,temp_adc_type = <1>; /* SEC_BATTERY_ADC_TYPE_AP */

		battery,polling_time = <10 30 30 30 3600>;

		battery,adc_check_count = <5>;

		battery,cable_check_type = <5>; /* SEC_BATTERY_CABLE_CHECK_PSY */
		battery,cable_source_type = <3>; /* SEC_BATTERY_CABLE_SOURCE_EXTERNAL */
		battery,event_check;
		battery,event_waiting_time = <600>;
		battery,polling_type = <1>; /* SEC_BATTERY_MONITOR_ALARM */
		battery,monitor_initial_count = <3>;

		battery,battery_check_type = <0>; /* SEC_BATTERY_CHECK_NONE */
		battery,check_count = <0>;
		battery,check_adc_max = <1440>;
		battery,check_adc_min = <0>;

		battery,ovp_uvlo_check_type = <3>; /* SEC_BATTERY_OVP_UVLO_CHGPOLLING */

		battery,thermal_source = <2>; /* SEC_BATTERY_THERMAL_SOURCE_ADC */

		battery,temp_table_adc = <27281 27669 28178 28724 29342 30101 30912 31807 32823 33858 34950 36049 37054
			38025 38219 38448 38626 38795 38989 39229 39540 39687 39822 40523 41123 41619>;
		battery,temp_table_data = <700 650 600 550 500 450 400 350 300 250 200 150 100
			50 40 30 20 10 0 (-10) (-30) (-40) (-50) (-100) (-150) (-200)>;
		battery,temp_check_type = <0>; /* SEC_BATTERY_TEMP_CHECK_NONE */
		battery,temp_check_count = <1>;
		battery,temp_high_threshold_event = <600>;
		battery,temp_high_recovery_event = <450>;
		battery,temp_low_threshold_event = <(-50)>;
		battery,temp_low_recovery_event = <0>;
		battery,temp_high_threshold_normal = <600>;
		battery,temp_high_recovery_normal = <450>;
		battery,temp_low_threshold_normal = <(-50)>;
		battery,temp_low_recovery_normal = <0>;
		battery,temp_high_threshold_lpm = <600>;
		battery,temp_high_recovery_lpm = <450>;
		battery,temp_low_threshold_lpm = <(-50)>;
		battery,temp_low_recovery_lpm = <0>;
		battery,full_check_type = <7>; /* SEC_BATTERY_FULLCHARGED_CHGPSY */
		battery,full_check_type_2nd = <3>; /* SEC_BATTERY_FULLCHARGED_TIME */
		battery,full_check_count = <1>;
		battery,chg_gpio_full_check = <0>;
		battery,chg_polarity_full_check = <1>;

		/* SEC_BATTERY_FULL_CONDITION_SOC |
		   SEC_BATTERY_FULL_CONDITION_NOTIMEFULL |
		   SEC_BATTERY_FULL_CONDITION_VCELL */
		battery,full_condition_type = <13>;
		battery,full_condition_soc = <95>;
		battery,full_condition_vcell = <4300>;

		battery,recharge_check_count = <1>;
		battery,recharge_condition_type = <2>; /* SEC_BATTERY_RECHARGE_CONDITION_VCELL */
		battery,recharge_condition_soc = <98>;
		battery,recharge_condition_vcell = <4300>;

		battery,charging_total_time = <36000>;
		battery,recharging_total_time = <5400>;
		battery,charging_reset_time = <0>;

		charger{
			status = "disable";
			/* Charger */
			battery,charger_name = "sec-charger";
			#battery,vbus_ctrl_gpio = <&d_gpio_gpio 64 0x00>;
			battery,chg_gpio_en = <0>;
			battery,chg_polarity_en = <0>;
			battery,chg_gpio_status = <0>;
			battery,chg_polarity_status = <0>;
			battery,chg_float_voltage = <4350>;
			battery,ovp_uvlo_check_type = <3>; /* SEC_BATTERY_OVP_UVLO_CHGPOLLING */
			battery,full_check_type = <2>; /* SEC_BATTERY_FULLCHARGED_FG_CURRENT */

			battery,input_current_limit = <1800 460 460 1800 460 900 1000 460 460 1000 650 1800 1800 460 1300 300 700 1300 300 1000 1800 460 460>;
			battery,fast_charging_current = <2100 0 460 2100 460 1200 1000 460 0 1200 750 2100 2100 (-1) 1300 300 700 1300 300 1000 2100 0 0>;
			battery,full_check_current_1st = <300 0 300 300 300 300 300 300 0 300 300 300 300 0 300 300 300 300 300 300 300 0 0>;
			battery,full_check_current_2nd = <2400 0 2400 2400 2400 2400 2400 2400 0 2400 2400 2400 2400 0 2400 2400 2400 2400 2400 2400 2400 0 0>;
		};
	};

	i2c_gpio6: i2c_gpio@0 {
		compatible = "i2c-gpio";
		gpios = <&d_gpio_gpio 66 0 /* sda */
		&d_gpio_gpio 65 0 >;   /* scl */
		/*i2c-gpio,sda-open-drain;*/
		/*i2c-gpio,scl-open-drain;*/
		i2c-gpio,delay-us = <10>;    /* ~100 kHz */
		i2c-gpio,timeout-ms = <0>;
		#address-cells = <1>;
		#size-cells = <0>;
		sec-fuelgauge@35 {
			compatible = "samsung,sec-fuelgauge";
			fuelgauge,fuelgauge_name = "sec-fuelgauge";
			reg = <0x35>;
			interrupt-parent = <&d_gpio_gpio>;	
			fuelgauge,irqf = "IRQF_TRIGGER_FALLING + IRQF_ONESHOT + IRQF_NO_SUSPEND";
			fuelgauge,fuel_int = <&d_gpio_gpio 153 0x1>;
			fuelgauge,capacity_max = <1000>;
			fuelgauge,capacity_max_margin = <30>;
			fuelgauge,capacity_min = <0>;
			fuelgauge,capacity_calculation_type = <0x17>; /* not easy to understand ... */
			fuelgauge,fuel_alert_soc = <1>;

			battery_params {
				battery,id = <0>; /* -1 means auto, detected by F/G */
				battery0,battery_type = <4350>; /* 4200 4350 4400 */
				battery0,vg_comp_interpolation_order = <2 2>; /* necessary */
				battery0,vg_comp_idle_size = <1 4>; /* necessary */
				battery0,vg_comp_idle_data = <3300 (-200) 0x32 0x32 0x32 0x32
								3300 50 0x32 0x32 0x32 0x32
								3300 250 0x32 0x32 0x32 0x32
								3300 450 0x32 0x32 0x32 0x32>;
				battery0,vg_comp_normal_size = <1 4>; /* necessary */
				battery0,vg_comp_normal_data = <3300 (-200) 0x32 0x32 0x32 0x32
								3300 50 0x32 0x32 0x32 0x32
								3300 250 0x32 0x32 0x32 0x32
								3300 450 0x32 0x32 0x32 0x32>; 
				battery0,special_case = <0>;
				battery0,offset_interpolation_order = <2 2>; /* necessary */
				battery0,offset_charging_size = <0 0>; /* m x n, m: volt or soc, n : temp */
				battery0,offset_charging_data = <0 0 0>;
				battery0,offset_discharging_size = <0 0>;
				battery0,offset_discharging_data = <0 0 0>;
				battery0,offset_special_size = <0 0>;
				battery0,offset_special_data = <0 0 0>;	
				battery0,offset_low_power_size = <3 1>;
				battery0,offset_low_power_data = <0 300 (-12)
								100 300 0
								1000 300 0>;
				battery0,crate_idle_thres = <256>;
				};
		};
	};
        i2c_gpio8: i2c_gpio@1 {
		compatible = "i2c-gpio";
		gpios = <&d_gpio_gpio 159 0 /* sda */
			&d_gpio_gpio 160 0 >;  /* scl */
		/*i2c-gpio,sda-open-drain;*/
		/*i2c-gpio,scl-open-drain;*/
		i2c-gpio,delay-us = <3>;    /* ~100 kHz */
		i2c-gpio,timeout-ms = <100>;
		#address-cells = <1>;
		#size-cells = <0>;

		rt5033-mfd@34{
			compatible = "richtek,rt5033mfd";
			reg = <0x34>;
			interrupt-parent = <&d_gpio_gpio>;
			rt5033,irq-gpio = <&d_gpio_gpio 161 0x00>;
			rt5033,mrstb-gpio = <&d_gpio_gpio 78 0x00>; //?for what?
			
			rt5033_charger {
				compatible = "richtek,rt5033-charger";
				/* is_750kHz_switching = "yes"; optional, exist = enabled */
				/* is_fixed_switching = "yes"; optional, exist = enabled */
			};
			rt5033_fled {
				compatible = "richtek,rt5033-fled";
				enable = <1 1>;
				mid_track_alive = <0>;
				mid_auto_track_en = <0>;
				timeout_current_level = <50>;
				strobe_current = <500>;
				strobe_timeout = <544>;
				torch_current = <38>;
				lv_protection = <3300>;
				mid_level = <4400>;
			};

			rt5033_safe_ldo {
				compatible = "richtek,rt5033-safeldo";
				regulator-name = "RT5033SafeLDO"; /* constraints->name, change name by yourself*/
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <4950000>; /* if max == min then apply_uV = 1 */
				/* regulator-microvolt-offset = <0>; optional*/
				/* regulator-boot-on = "yes"; optional, exist = enabled */
				regulator-always-on = "yes";
				/* regulator-ramp-delay = <100>; optional*/
			};

			rt5033_ldo1 {
				compatible = "richtek,rt5033-ldo1";
				regulator-name = "RT5033LDO1"; /* change name by yourself */
				regulator-min-microvolt = <1200000>;
				regulator-max-microvolt = <3000000>; /* max == min then apply_uV = 1 */
				/* regulator-microvolt-offset = < >; optional*/
				/* regulator-boot-on = "yes"; optional, exist = enabled */
				/* regulator-always-on = "yes"; optional, exist = enabled */
				/* regulator-ramp-delay = <100>; optional*/

			};


			rt5033_buck1 {
				compatible = "richtek,rt5033-dcdc1";
				regulator-name = "RT5033BUCK"; /* change name by yourself */
				regulator-min-microvolt = <1200000>;
				regulator-max-microvolt = <3300000>; /* max == min then apply_uV = 1 */
				/* regulator-microvolt-offset = < >; optional*/
				/* regulator-boot-on = "yes"; optional, exist = enabled */
				/* regulator-always-on = "yes"; optional, exist = enabled */
				/* regulator-ramp-delay = <100>; optional*/
			};
		};
	};
};