cps4038_charger.dtsi 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. #include <dt-bindings/battery/sec-battery.h>
  2. &smd {
  3. sb_tx: sb-tx {
  4. aov {
  5. high_freq = <144>;
  6. };
  7. };
  8. };
  9. &tlmm {
  10. cps_irq_default: cps_irq_default {
  11. GPIO_CONFIG_PUD_DRV(AP,tlmm,84, FUNC_INPUT_WAKEUP, PULL_NONE, DRV_LV1);
  12. };
  13. };
  14. &pm8550_gpios {
  15. cps_det_default: cps_det_default {
  16. GPIO_CONFIG_PUD(PM,pm8550_gpios,9, FUNC_INPUT_WAKEUP, PULL_NONE);
  17. };
  18. };
  19. &tlmm {
  20. cps_en_default: cps_en_default {
  21. GPIO_CONFIG_PUD(AP,tlmm,82, FUNC_OUTPUT_LOW, PULL_NONE);
  22. };
  23. };
  24. #if 1
  25. &pm8550ve_gpios {
  26. cps_pdrc_default: cps_pdrc_default {
  27. GPIO_CONFIG_PUD(PM,pm8550ve_gpios,6, FUNC_INPUT_WAKEUP, PULL_NONE);
  28. };
  29. };
  30. #endif
  31. #if 1
  32. &tlmm {
  33. cps_ping_nen_default: cps_ping_nen_default {
  34. GPIO_CONFIG_PUD(AP,tlmm,180, FUNC_OUTPUT_HIGH, PULL_NONE);
  35. };
  36. };
  37. #endif
  38. #if 1
  39. &tlmm {
  40. cps_pdet_b_default: cps_pdet_b_default {
  41. GPIO_CONFIG_PUD(AP,tlmm,55, FUNC_INPUT_WAKEUP, PULL_NONE);
  42. };
  43. };
  44. #endif
  45. #if 1
  46. &pm8550vs_g_gpios {
  47. cps_mag_det_default: cps_mag_det_default {
  48. GPIO_CONFIG_PUD(PM,pm8550vs_g_gpios,5, FUNC_OUTPUT_HIGH, PULL_NONE);
  49. };
  50. };
  51. #endif
  52. &qupv3_hub_i2c7 {
  53. #address-cells = <1>;
  54. #size-cells = <0>;
  55. status = "okay";
  56. clock-frequency = <100000>;
  57. cps4038_charger: cps4038-charger@38 {
  58. compatible = "cps,cps4038-charger";
  59. reg = <0x38>;
  60. status = "okay";
  61. pinctrl-names = "default";
  62. pinctrl-0 = <&cps_irq_default &cps_det_default &cps_en_default &cps_pdrc_default
  63. #if 1
  64. &cps_ping_nen_default
  65. #endif
  66. #if 1
  67. &cps_pdet_b_default
  68. #endif
  69. #if 1
  70. &cps_mag_det_default
  71. #endif
  72. >;
  73. battery,wpc_int = <SEC_GPIO_REF(AP,tlmm,84) 1>; /* MFC_AP_INT */
  74. battery,wpc_det = <SEC_GPIO_REF(PM,pm8550_gpios,9) 0>; /* WPC_DET */
  75. #if 0
  76. battery,mst_pwr_en = <SEC_GPIO_REF(${cps_pwr_en_gpio}) 0>; /* MST_PWR_EN */
  77. #endif
  78. #if 1
  79. battery,wpc_ping_nen = <SEC_GPIO_REF(AP,tlmm,180) 1>; /* PING_NEN */
  80. #endif
  81. #if 1
  82. battery,wpc_pdet_b = <SEC_GPIO_REF(AP,tlmm,55) 1>; /* PDET_B */
  83. #endif
  84. battery,wpc_en = <SEC_GPIO_REF(AP,tlmm,82) 0>; /* WPC_EN */
  85. #if 1
  86. battery,wpc_pdrc = <SEC_GPIO_REF(PM,pm8550ve_gpios,6) 1>; /* VRECT_INT */
  87. #endif
  88. #if 1
  89. battery,wpc_mag_det = <SEC_GPIO_REF(PM,pm8550vs_g_gpios,5) 0>; /* MAG_DET */
  90. #endif
  91. battery,charger_name = "max77775-charger";
  92. battery,fuelgauge_name = "max77775-fuelgauge";
  93. battery,wireless_charger_name = "cps4038-charger";
  94. battery,wc_cover_rpp = <0x44>;
  95. battery,phone_fod_threshold = <0x3b>;
  96. battery,wireless20_vout_list = <WIRELESS_VOUT_9V /* 0xA0 */
  97. WIRELESS_VOUT_12V /* 0xA1 */
  98. WIRELESS_VOUT_12V /* 0xA2 */
  99. WIRELESS_VOUT_12V /* 0xA3 */
  100. WIRELESS_VOUT_12V /* 0xA4 */
  101. WIRELESS_VOUT_12V>; /* 0xA5 */
  102. battery,wireless20_vrect_list = <MFC_AFC_CONF_12V_TX
  103. MFC_AFC_CONF_12_5V_TX
  104. MFC_AFC_CONF_12_5V_TX
  105. MFC_AFC_CONF_12_5V_TX
  106. MFC_AFC_CONF_12_5V_TX
  107. MFC_AFC_CONF_12_5V_TX>;
  108. battery,wireless20_max_power_list = <SEC_WIRELESS_RX_POWER_12W
  109. SEC_WIRELESS_RX_POWER_15W
  110. SEC_WIRELESS_RX_POWER_15W
  111. SEC_WIRELESS_RX_POWER_15W
  112. SEC_WIRELESS_RX_POWER_15W
  113. SEC_WIRELESS_RX_POWER_15W>;
  114. battery,buds_fod_ta_thresh = <0x0898>; /* 2200mW */
  115. battery,wpc_vout_ctrl_full = <WIRELESS_VOUT_5V_STEP>;
  116. battery,mis_align_guide;
  117. battery,mis_align_target_vout = <5000>;
  118. battery,mpp_epp_vout = <WIRELESS_VOUT_12V>;
  119. fod_list {
  120. count = <1>;
  121. pad_0x00 { /* DEFAULT PAD */
  122. bpp { /* DEFAULT OP MODE */
  123. flag = <(SET_FOD_CC(ADD) | SET_FOD_CV(USE_CC) | SET_FOD_FULL(ADD))>;
  124. cc = <0x4E 0x0F 0x4E 0x10 0x4E 0x0C 0x4E 0x0C 0x4E 0x0C 0x4E 0x0C 0x4E 0x0D 0x4E 0x0D 0x4E 0x0D 0x4E 0x0D>;
  125. full = <0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F
  126. 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F>;
  127. };
  128. ppde {
  129. flag = <(SET_FOD_CC(USE_DEF_OP) | SET_FOD_CV(USE_DEF_OP) | SET_FOD_FULL(USE_DEF_OP))>;
  130. };
  131. epp {
  132. flag = <(SET_FOD_CC(USE_DEF_OP) | SET_FOD_CV(USE_DEF_OP) | SET_FOD_FULL(USE_DEF_OP))>;
  133. };
  134. mpp {
  135. flag = <(SET_FOD_CC(USE_DEF_OP) | SET_FOD_CV(USE_DEF_OP) | SET_FOD_FULL(USE_DEF_OP))>;
  136. };
  137. };
  138. };
  139. };
  140. };
  141. /* /home/dpi/qb5_8814/workspace/P4_1716/android/kernel_platform/kmodule/battery/stable/eureka/wireless/cps4038/cps4038_charger.e1q.dtsi */
  142. #include <dt-bindings/battery/sec-battery.h>
  143. &cps_pdrc_default {
  144. power-source = <1>; /* need to set default MV gpio to LV */
  145. };
  146. &cps_det_default {
  147. power-source = <1>; /* need to set default MV gpio to LV */
  148. };
  149. #if 1
  150. &cps_mag_det_default {
  151. power-source = <1>; /* need to set default MV gpio to LV */
  152. };
  153. #endif
  154. &cps4038_charger {
  155. battery,unknown_cmb_ctrl;
  156. battery,default_clamp_volt;
  157. battery,tx_max_op_freq = <1450>;
  158. battery,tx_min_op_freq = <1120>;
  159. battery,wireless20_iec_ploss_fod_enable = <0x1>;
  160. battery,tx_fod_gain = <0x74>;
  161. battery,buds_fod_thresh1 = <0x0DAC>;
  162. battery,buds_fod_ta_thresh = <0x0DAC>;
  163. battery,cep_timeout_xac = <900>;
  164. fod_list {
  165. epp_ref_qf = <0x24>;
  166. epp_ref_rf = <0x69>;
  167. count = <3>;
  168. pad_0x00 { /* DEFAULT */
  169. bpp { /* DEFAULT OP MODE */
  170. flag = <(SET_FOD_CC(ADD) | SET_FOD_CV(ADD) | SET_FOD_FULL(ADD))>;
  171. cc = <0x52 0x0E 0x52 0x0E 0x52 0x0A 0x52 0x0A 0x52 0x0A 0x52 0x0A 0x52 0x0B 0x52 0x0B 0x52 0x0B 0x52 0x0B>;
  172. cv = <0x52 0x16 0x52 0x16 0x52 0x12 0x52 0x12 0x52 0x12 0x52 0x12 0x52 0x13 0x52 0x13 0x52 0x13 0x52 0x13>;
  173. full = <0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F>;
  174. };
  175. epp {
  176. flag = <(SET_FOD_CC(ADD) | SET_FOD_CV(ADD) | SET_FOD_FULL(ADD))>;
  177. cc = <0x65 0x1B 0x65 0x1B 0x65 0x16 0x65 0x16 0x65 0x19 0x65 0x19 0x62 0x1D 0x62 0x1D 0x62 0x1D 0x0E 0x03>;
  178. cv = <0x65 0x23 0x65 0x23 0x65 0x1E 0x65 0x1E 0x65 0x21 0x65 0x21 0x62 0x25 0x62 0x25 0x62 0x25 0x0E 0x03>;
  179. full = <0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0x0E 0x03>;
  180. };
  181. ppde {
  182. flag = <(SET_FOD_CC(ADD) | SET_FOD_CV(ADD) | SET_FOD_FULL(USE_DEF_OP))>;
  183. cc = <0xA0 0x4F 0xA0 0x4F 0xA0 0x3B 0xA0 0x3D 0xA0 0x3E 0xA0 0x3E 0xA0 0x3E 0xA0 0x3B 0xA0 0x39 0xA0 0x39>;
  184. cv = <0xA0 0x57 0xA0 0x57 0xA0 0x43 0xA0 0x45 0xA0 0x46 0xA0 0x46 0xA0 0x46 0xA0 0x43 0xA0 0x41 0xA0 0x41>;
  185. };
  186. };
  187. pad_0xA3 { /* p2400 */
  188. epp {
  189. flag = <(SET_FOD_CC(ADD) | SET_FOD_CV(ADD) | SET_FOD_FULL(ADD))>;
  190. cc = <0x65 0x41 0x65 0x41 0x65 0x3C 0x65 0x3C 0x65 0x3E 0x65 0x3E 0x62 0x43 0x62 0x43 0x62 0x43 0x0E 0x0A>;
  191. cv = <0x65 0x49 0x65 0x49 0x65 0x44 0x65 0x44 0x65 0x46 0x65 0x46 0x62 0x4B 0x62 0x4B 0x62 0x4B 0x62 0x4B>;
  192. full = <0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F>;
  193. };
  194. };
  195. pad_0x18 { /* p2400 */
  196. epp {
  197. flag = <(SET_FOD_CC(ADD) | SET_FOD_CV(ADD) | SET_FOD_FULL(ADD))>;
  198. cc = <0x65 0x41 0x65 0x41 0x65 0x3C 0x65 0x3C 0x65 0x3E 0x65 0x3E 0x62 0x43 0x62 0x43 0x62 0x43 0x0E 0x0A>;
  199. cv = <0x65 0x49 0x65 0x49 0x65 0x44 0x65 0x44 0x65 0x46 0x65 0x46 0x62 0x4B 0x62 0x4B 0x62 0x4B 0x62 0x4B>;
  200. full = <0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F 0xFF 0x7F>;
  201. };
  202. };
  203. };
  204. };