1 #include <linux/xlog.h>
2 #include <mach/mt_typedefs.h>
4 #ifdef CONFIG_MTK_FAN5405_SUPPORT
8 #ifdef CONFIG_MTK_BQ24158_SUPPORT
12 #ifdef CONFIG_MTK_BQ24196_SUPPORT
16 #ifdef CONFIG_MTK_BQ24297_SUPPORT
20 #ifdef CONFIG_MTK_BQ24296_SUPPORT
24 #ifdef CONFIG_MTK_NCP1851_SUPPORT
28 #ifdef CONFIG_MTK_NCP1854_SUPPORT
31 /************* ATTENTATION ***************/
32 /* IF ANY NEW CHARGER IC SUPPORT IN THIS FILE, */
33 /* REMEMBER TO NOTIFY USB OWNER TO MODIFY OTG RELATED FILES!! */
35 #ifdef CONFIG_USB_MTK_HDRC_HCD
36 void tbl_charger_otg_vbus(int mode
)
38 xlog_printk(ANDROID_LOG_INFO
, "Power/Battery", "[tbl_charger_otg_vbus] mode = %d\n", mode
);
42 #ifdef CONFIG_MTK_FAN5405_SUPPORT
43 fan5405_set_opa_mode(1);
44 fan5405_set_otg_pl(1);
45 fan5405_set_otg_en(1);
49 #ifdef CONFIG_MTK_BQ24158_SUPPORT
50 bq24158_set_opa_mode(1);
51 bq24158_set_otg_pl(1);
52 bq24158_set_otg_en(1);
56 #ifdef CONFIG_MTK_BQ24196_SUPPORT
57 bq24196_set_chg_config(0x3); //OTG
58 bq24196_set_boost_lim(0x1); //1.3A on VBUS
59 bq24196_set_en_hiz(0x0);
62 #ifdef CONFIG_MTK_BQ24297_SUPPORT
63 bq24297_set_otg_config(0x1); //OTG
64 bq24297_set_boost_lim(0x1); //1.5A on VBUS
65 bq24297_set_en_hiz(0x0);
68 #ifdef CONFIG_MTK_BQ24296_SUPPORT
69 bq24296_set_chg_config(0x0); //disable charge
70 bq24296_set_otg_config(0x1); //OTG
71 bq24296_set_boostv(0x7); //boost voltage 4.998V
72 bq24296_set_boost_lim(0x1); //1.5A on VBUS
73 bq24296_set_en_hiz(0x0);
76 #ifdef CONFIG_MTK_NCP1851_SUPPORT
77 ncp1851_set_chg_en(0x0); //charger disable
78 ncp1851_set_otg_en(0x1); //otg enable
81 #ifdef CONFIG_MTK_NCP1854_SUPPORT
82 ncp1854_set_chg_en(0x0); //charger disable
83 ncp1854_set_otg_en(0x1); //otg enable
88 #ifdef CONFIG_MTK_FAN5405_SUPPORT
89 fan5405_reg_config_interface(0x01,0x30);
90 fan5405_reg_config_interface(0x02,0x8e);
93 #ifdef CONFIG_MTK_BQ24158_SUPPORT
94 bq24158_config_interface_liao(0x01,0x30);
95 bq24158_config_interface_liao(0x02,0x8e);
99 #ifdef CONFIG_MTK_BQ24196_SUPPORT
100 bq24196_set_chg_config(0x0); //OTG & Charge disabled
103 #ifdef CONFIG_MTK_BQ24297_SUPPORT
104 bq24297_set_otg_config(0x0); //OTG & Charge disabled
107 #ifdef CONFIG_MTK_BQ24296_SUPPORT
108 bq24296_set_otg_config(0x0); //OTG disabled
109 bq24296_set_chg_config(0x0); //Charge disabled
112 #ifdef CONFIG_MTK_NCP1851_SUPPORT
113 ncp1851_set_otg_en(0x0);
116 #ifdef CONFIG_MTK_NCP1854_SUPPORT
117 ncp1854_set_otg_en(0x0);