Переглянути джерело

Version 1.1.0_20161129-1300 released

Jenkins 9 роки тому
батько
коміт
18619d2e13

+ 1 - 1
arch/arm64/boot/dts/bq_aquaris_m10_LTE.dts

@@ -69,7 +69,7 @@ memory@00000000 {
 		compatible = "mediatek,vibrator";
 		vib_timer = <25>;
 		vib_limit = <9>;
-		vib_vol= <5>;
+		vib_vol= <6>;
 	};
  /* sensor standardization */
 	cust_accel@0 {

+ 1 - 1
arch/arm64/boot/dts/bq_aquaris_m10_LTE_bat_setting.dtsi

@@ -69,7 +69,7 @@
 	ocv_board_compesate = <0>;
 	r_fg_board_base = <1000>;
 	r_fg_board_slope = <1000>;
-	car_tune_value = <91>;
+	car_tune_value = <92>;
 	system_off_voltage = <3450>;	/* Unit: mV */
 
 	/* HW Fuel gague  */

+ 1 - 1
arch/arm64/boot/dts/g1011.dts

@@ -69,7 +69,7 @@ memory@00000000 {
 		compatible = "mediatek,vibrator";
 		vib_timer = <25>;
 		vib_limit = <9>;
-		vib_vol= <5>;
+		vib_vol= <6>;
 	};
  /* sensor standardization */
 	cust_accel@0 {

+ 2 - 2
arch/arm64/boot/dts/g1011_bat_setting.dtsi

@@ -69,7 +69,7 @@
 	ocv_board_compesate = <0>;
 	r_fg_board_base = <1000>;
 	r_fg_board_slope = <1000>;
-	car_tune_value = <100>;
+	car_tune_value = <92>;
 	system_off_voltage = <3450>;	/* Unit: mV */
 
 	/* HW Fuel gague  */
@@ -87,7 +87,7 @@
 	difference_voltage_update = <20>;
 	aging1_load_soc = <70>;
 	aging1_update_soc = <30>;
-	batterypseudo100 = <95>;
+	batterypseudo100 = <98>;
 	batterypseudo1 = <4>;
 
 	q_max_by_sys = <1>; /*Qmax varient by system drop voltage */

+ 275 - 49
drivers/misc/mediatek/aw2015/AW2015_LED_M.c

@@ -223,9 +223,56 @@ unsigned char AW2015_LED_ON(unsigned char r, unsigned char g, unsigned char b)
 
 unsigned char AW2015_LED_OFF(void)
 {
-	I2C_write_reg(0x00, 0x55);		// software reset	
+	I2C_write_reg(0x00, 0x55);		// software reset
+    I2C_write_reg(0x10, 0x00);      // Color1_R
+    I2C_write_reg(0x11, 0x00);      // Color1_G
+    I2C_write_reg(0x12, 0x00);      // Color1_B
+    I2C_write_reg(0x1C, 0x00);      // PWM1
+    I2C_write_reg(0x1D, 0x00);      // PWM2
+    I2C_write_reg(0x1E, 0x00);      // PWM3
+
 	return 0;
 }
+EXPORT_SYMBOL(AW2015_LED_OFF);
+
+static int RED_DELAY_OFF_BEFORE;
+static int RED_DELAY_ON_BEFORE;
+// set red delay off and on to 0 by xmwuwh@20161122
+unsigned char AW2015_LED_RED_ON(void)
+{
+    RED_DELAY_OFF_BEFORE = RED_DELAY_OFF;
+    RED_DELAY_ON_BEFORE = RED_DELAY_ON;
+    RED_DELAY_OFF = 0;
+    RED_DELAY_ON = 0;
+    I2C_write_reg(0x00, 0x55);      // software reset
+
+    I2C_write_reg(0x01, 0x03);      // GCR
+    I2C_write_reg(0x03, 0x01);      // IMAX
+    I2C_write_reg(0x04, 0x00);      // LCFG1
+    I2C_write_reg(0x05, 0x00);      // LCFG2
+    I2C_write_reg(0x06, 0x00);      // LCFG3
+    I2C_write_reg(0x07, 0x07);      // LEDEN
+
+    I2C_write_reg(0x10, 0xFF);		// Color1_R
+    I2C_write_reg(0x11, 0x00);		// Color1_G
+    I2C_write_reg(0x12, 0x00);		// Color1_B
+    I2C_write_reg(0x1C, 0xFF);		// PWM1
+    I2C_write_reg(0x1D, 0xFF);		// PWM2
+    I2C_write_reg(0x1E, 0xFF);		// PWM3
+    I2C_write_reg(0x09, 0x07);		// PAT_RIN
+    return 0;
+}
+EXPORT_SYMBOL(AW2015_LED_RED_ON);
+
+// set red delay off and on to before value  by xmwuwh@20161122
+unsigned char AW2015_LED_RED_OFF(void)
+{
+    RED_DELAY_OFF = RED_DELAY_OFF_BEFORE;
+    RED_DELAY_ON = RED_DELAY_ON_BEFORE;
+    return 0;
+}
+EXPORT_SYMBOL(AW2015_LED_RED_OFF);
+
 
 unsigned char AW2015_LED_Blink(unsigned char r, unsigned char g, unsigned char b, unsigned int trise_ms, unsigned int ton_ms, unsigned int tfall_ms, unsigned int toff_ms)
 {
@@ -456,6 +503,35 @@ static ssize_t AW2015_Set_White(struct device* cd, struct device_attribute *attr
                 I2C_write_reg(0x1E, 0xFF);      // PWM3
                 I2C_write_reg(0x09, 0x07);      // PAT_RIN
 
+                I2C_write_reg(0x30, 0x80);		// PAT_T1		Trise & Ton
+                I2C_write_reg(0x31, 0x00);		// PAT_T2		Tfall & Toff
+                I2C_write_reg(0x32, 0x00);		// PAT_T3		Tslot & Tdelay
+                I2C_write_reg(0x33, 0x00);		// PAT_T4 	  PAT_CTR & Color
+                I2C_write_reg(0x34, 0x00);		// PAT_T5		    Timer
+
+
+                I2C_write_reg(0x09, 0x07);		// PAT_RIN
+            }
+        }   else if(WHITE_DELAY_ON!=0 &&WHITE_DELAY_OFF!=0)
+            {
+                I2C_write_reg(0x00, 0x55);      // software reset
+
+                I2C_write_reg(0x01, 0x03);      // GCR
+                I2C_write_reg(0x03, 0x01);      // IMAX
+                I2C_write_reg(0x04, 0x01);      // LCFG1
+                I2C_write_reg(0x05, 0x01);      // LCFG2
+                I2C_write_reg(0x06, 0x01);      // LCFG3
+                I2C_write_reg(0x07, 0x07);      // LEDEN
+                I2C_write_reg(0x08, 0x08);      // LEDCTR
+
+                I2C_write_reg(0x10, 0xFF);      // Color1_R
+                I2C_write_reg(0x11, 0xFF);      // Color1_G
+                I2C_write_reg(0x12, 0xFF);      // Color1_B
+                I2C_write_reg(0x1C, 0xFF);      // PWM1
+                I2C_write_reg(0x1D, 0xFF);      // PWM2
+                I2C_write_reg(0x1E, 0xFF);      // PWM3
+                I2C_write_reg(0x09, 0x07);      // PAT_RIN
+
                 I2C_write_reg(0x30, 0x14);		// PAT_T1		Trise & Ton
                 I2C_write_reg(0x31, 0x01);		// PAT_T2		Tfall & Toff
                 I2C_write_reg(0x32, 0x31);		// PAT_T3		Tslot & Tdelay
@@ -464,9 +540,8 @@ static ssize_t AW2015_Set_White(struct device* cd, struct device_attribute *attr
 
 
                 I2C_write_reg(0x09, 0x07);		// PAT_RIN	
-            }
-                
-        }else
+        }
+        else
         {
             I2C_write_reg(0x00, 0x55);      // software reset
             
@@ -599,6 +674,35 @@ static ssize_t AW2015_Set_Gray(struct device* cd, struct device_attribute *attr,
                 I2C_write_reg(0x1E, 0xFF);      // PWM3
                 I2C_write_reg(0x09, 0x07);      // PAT_RIN
 
+                I2C_write_reg(0x30, 0x80);		// PAT_T1		Trise & Ton
+                I2C_write_reg(0x31, 0x00);		// PAT_T2		Tfall & Toff
+                I2C_write_reg(0x32, 0x00);		// PAT_T3		Tslot & Tdelay
+                I2C_write_reg(0x33, 0x00);		// PAT_T4 	  PAT_CTR & Color
+                I2C_write_reg(0x34, 0x00);		// PAT_T5		    Timer
+
+
+                I2C_write_reg(0x09, 0x07);		// PAT_RIN
+            }
+        }else if(GRAY_DELAY_ON!=0 && GRAY_DELAY_OFF!=0)
+            {
+                I2C_write_reg(0x00, 0x55);      // software reset
+
+                I2C_write_reg(0x01, 0x03);      // GCR
+                I2C_write_reg(0x03, 0x01);      // IMAX
+                I2C_write_reg(0x04, 0x01);      // LCFG1
+                I2C_write_reg(0x05, 0x01);      // LCFG2
+                I2C_write_reg(0x06, 0x01);      // LCFG3
+                I2C_write_reg(0x07, 0x07);      // LEDEN
+                I2C_write_reg(0x08, 0x08);      // LEDCTR
+
+                I2C_write_reg(0x10, 0x00);      // Color1_R
+                I2C_write_reg(0x11, 0xFF);      // Color1_G
+                I2C_write_reg(0x12, 0x80);      // Color1_B
+                I2C_write_reg(0x1C, 0xFF);      // PWM1
+                I2C_write_reg(0x1D, 0xFF);      // PWM2
+                I2C_write_reg(0x1E, 0xFF);      // PWM3
+                I2C_write_reg(0x09, 0x07);      // PAT_RIN
+
                 I2C_write_reg(0x30, 0x14);		// PAT_T1		Trise & Ton
                 I2C_write_reg(0x31, 0x01);		// PAT_T2		Tfall & Toff
                 I2C_write_reg(0x32, 0x31);		// PAT_T3		Tslot & Tdelay
@@ -607,9 +711,7 @@ static ssize_t AW2015_Set_Gray(struct device* cd, struct device_attribute *attr,
 
 
                 I2C_write_reg(0x09, 0x07);		// PAT_RIN	
-            }
-                
-        }else
+            }else
         {
             I2C_write_reg(0x00, 0x55);      // software reset
             
@@ -742,6 +844,35 @@ static ssize_t AW2015_Set_Yellow(struct device* cd, struct device_attribute *att
                 I2C_write_reg(0x1E, 0xFF);      // PWM3
                 I2C_write_reg(0x09, 0x07);      // PAT_RIN
 
+                I2C_write_reg(0x30, 0x80);		// PAT_T1		Trise & Ton
+                I2C_write_reg(0x31, 0x00);		// PAT_T2		Tfall & Toff
+                I2C_write_reg(0x32, 0x00);		// PAT_T3		Tslot & Tdelay
+                I2C_write_reg(0x33, 0x00);		// PAT_T4 	  PAT_CTR & Color
+                I2C_write_reg(0x34, 0x00);		// PAT_T5		    Timer
+
+
+                I2C_write_reg(0x09, 0x07);		// PAT_RIN
+            }
+        }else if(YELLOW_DELAY_ON!=0 && YELLOW_DELAY_OFF!=0)
+            {
+                I2C_write_reg(0x00, 0x55);      // software reset
+
+                I2C_write_reg(0x01, 0x03);      // GCR
+                I2C_write_reg(0x03, 0x01);      // IMAX
+                I2C_write_reg(0x04, 0x01);      // LCFG1
+                I2C_write_reg(0x05, 0x01);      // LCFG2
+                I2C_write_reg(0x06, 0x01);      // LCFG3
+                I2C_write_reg(0x07, 0x07);      // LEDEN
+                I2C_write_reg(0x08, 0x08);      // LEDCTR
+
+                I2C_write_reg(0x10, 0xFF);      // Color1_R
+                I2C_write_reg(0x11, 0xFF);      // Color1_G
+                I2C_write_reg(0x12, 0x00);      // Color1_B
+                I2C_write_reg(0x1C, 0xFF);      // PWM1
+                I2C_write_reg(0x1D, 0xFF);      // PWM2
+                I2C_write_reg(0x1E, 0xFF);      // PWM3
+                I2C_write_reg(0x09, 0x07);      // PAT_RIN
+
                 I2C_write_reg(0x30, 0x14);		// PAT_T1		Trise & Ton
                 I2C_write_reg(0x31, 0x01);		// PAT_T2		Tfall & Toff
                 I2C_write_reg(0x32, 0x31);		// PAT_T3		Tslot & Tdelay
@@ -750,9 +881,7 @@ static ssize_t AW2015_Set_Yellow(struct device* cd, struct device_attribute *att
 
 
                 I2C_write_reg(0x09, 0x07);		// PAT_RIN	
-            }
-                
-        }else
+            }else
         {
             I2C_write_reg(0x00, 0x55);      // software reset
             
@@ -885,6 +1014,35 @@ static ssize_t AW2015_Set_Pink(struct device* cd, struct device_attribute *attr,
                 I2C_write_reg(0x1E, 0xFF);      // PWM3
                 I2C_write_reg(0x09, 0x07);      // PAT_RIN
 
+                I2C_write_reg(0x30, 0x80);		// PAT_T1		Trise & Ton
+                I2C_write_reg(0x31, 0x00);		// PAT_T2		Tfall & Toff
+                I2C_write_reg(0x32, 0x00);		// PAT_T3		Tslot & Tdelay
+                I2C_write_reg(0x33, 0x00);		// PAT_T4 	  PAT_CTR & Color
+                I2C_write_reg(0x34, 0x00);		// PAT_T5		    Timer
+
+
+                I2C_write_reg(0x09, 0x07);		// PAT_RIN
+            }
+        }else if(PINK_DELAY_ON!=0 &&PINK_DELAY_OFF!=0)
+            {
+                I2C_write_reg(0x00, 0x55);      // software reset
+
+                I2C_write_reg(0x01, 0x03);      // GCR
+                I2C_write_reg(0x03, 0x01);      // IMAX
+                I2C_write_reg(0x04, 0x01);      // LCFG1
+                I2C_write_reg(0x05, 0x01);      // LCFG2
+                I2C_write_reg(0x06, 0x01);      // LCFG3
+                I2C_write_reg(0x07, 0x07);      // LEDEN
+                I2C_write_reg(0x08, 0x08);      // LEDCTR
+
+                I2C_write_reg(0x10, 0xFF);      // Color1_R
+                I2C_write_reg(0x11, 0x00);      // Color1_G
+                I2C_write_reg(0x12, 0xFF);      // Color1_B
+                I2C_write_reg(0x1C, 0xFF);      // PWM1
+                I2C_write_reg(0x1D, 0xFF);      // PWM2
+                I2C_write_reg(0x1E, 0xFF);      // PWM3
+                I2C_write_reg(0x09, 0x07);      // PAT_RIN
+
                 I2C_write_reg(0x30, 0x14);		// PAT_T1		Trise & Ton
                 I2C_write_reg(0x31, 0x01);		// PAT_T2		Tfall & Toff
                 I2C_write_reg(0x32, 0x31);		// PAT_T3		Tslot & Tdelay
@@ -893,9 +1051,7 @@ static ssize_t AW2015_Set_Pink(struct device* cd, struct device_attribute *attr,
 
 
                 I2C_write_reg(0x09, 0x07);		// PAT_RIN	
-            }
-                
-        }else
+            }else
         {
             I2C_write_reg(0x00, 0x55);      // software reset
             
@@ -936,14 +1092,6 @@ static ssize_t AW2015_Set_Red(struct device* cd, struct device_attribute *attr,
 {
     unsigned int databuf[16];
 	sscanf(buf,"%d",&databuf[0]);
-    I2C_write_reg(0x00, 0x55);		// software reset
-
-	I2C_write_reg(0x01, 0x03);		// GCR
-	I2C_write_reg(0x03, 0x01);		// IMAX
-	I2C_write_reg(0x04, 0x00);		// LCFG1
-	I2C_write_reg(0x05, 0x00);		// LCFG2
-	I2C_write_reg(0x06, 0x00);		// LCFG3
-	I2C_write_reg(0x07, 0x07);		// LEDEN
 
     if(databuf[0]!=0)
     {
@@ -1025,16 +1173,42 @@ static ssize_t AW2015_Set_Red(struct device* cd, struct device_attribute *attr,
                 I2C_write_reg(0x1E, 0x00);      // PWM3
                 I2C_write_reg(0x09, 0x07);      // PAT_RIN
 
-                I2C_write_reg(0x30, 0x14);		// PAT_T1		Trise & Ton
-                I2C_write_reg(0x31, 0x01);		// PAT_T2		Tfall & Toff
-                I2C_write_reg(0x32, 0x31);		// PAT_T3		Tslot & Tdelay
-                I2C_write_reg(0x33, 0x10);		// PAT_T4 	  PAT_CTR & Color
+                I2C_write_reg(0x30, 0x80);		// PAT_T1		Trise & Ton
+                I2C_write_reg(0x31, 0x00);		// PAT_T2		Tfall & Toff
+                I2C_write_reg(0x32, 0x00);		// PAT_T3		Tslot & Tdelay
+                I2C_write_reg(0x33, 0x00);		// PAT_T4 	  PAT_CTR & Color
                 I2C_write_reg(0x34, 0x00);		// PAT_T5		    Timer
 
-                I2C_write_reg(0x09, 0x07);		// PAT_RIN	
+                I2C_write_reg(0x09, 0x07);		// PAT_RIN
             }
-                
-        }else
+        }else if(RED_DELAY_ON!=0 && RED_DELAY_OFF!=0)
+            {
+                I2C_write_reg(0x00, 0x55);      // software reset
+
+                I2C_write_reg(0x01, 0x03);      // GCR
+                I2C_write_reg(0x03, 0x01);      // IMAX
+                I2C_write_reg(0x04, 0x01);      // LCFG1
+                I2C_write_reg(0x05, 0x01);      // LCFG2
+                I2C_write_reg(0x06, 0x01);      // LCFG3
+                I2C_write_reg(0x07, 0x07);      // LEDEN
+                I2C_write_reg(0x08, 0x08);      // LEDCTR
+
+                I2C_write_reg(0x10, 0xFF);      // Color1_R
+                I2C_write_reg(0x11, 0x00);      // Color1_G
+                I2C_write_reg(0x12, 0x00);      // Color1_B
+                I2C_write_reg(0x1C, 0xFF);      // PWM1
+                I2C_write_reg(0x1D, 0x00);      // PWM2
+                I2C_write_reg(0x1E, 0x00);      // PWM3
+                I2C_write_reg(0x09, 0x07);      // PAT_RIN
+
+                I2C_write_reg(0x30, 0x80);		// PAT_T1		Trise & Ton
+                I2C_write_reg(0x31, 0x00);		// PAT_T2		Tfall & Toff
+                I2C_write_reg(0x32, 0x00);		// PAT_T3		Tslot & Tdelay
+                I2C_write_reg(0x33, 0x00);		// PAT_T4 	  PAT_CTR & Color
+                I2C_write_reg(0x34, 0x00);		// PAT_T5		    Timer
+
+                I2C_write_reg(0x09, 0x07);		// PAT_RIN
+            }else
         {
             I2C_write_reg(0x00, 0x55);      // software reset
             
@@ -1044,19 +1218,27 @@ static ssize_t AW2015_Set_Red(struct device* cd, struct device_attribute *attr,
             I2C_write_reg(0x05, 0x00);      // LCFG2
             I2C_write_reg(0x06, 0x00);      // LCFG3
             I2C_write_reg(0x07, 0x07);      // LEDEN
-
+    
             I2C_write_reg(0x10, 0xFF);		// Color1_R
             I2C_write_reg(0x11, 0x00);		// Color1_G
             I2C_write_reg(0x12, 0x00);		// Color1_B
             I2C_write_reg(0x1C, 0xFF);		// PWM1
-            I2C_write_reg(0x1D, 0x00);		// PWM2
-            I2C_write_reg(0x1E, 0x00);		// PWM3
+            I2C_write_reg(0x1D, 0xFF);		// PWM2
+            I2C_write_reg(0x1E, 0xFF);		// PWM3
             I2C_write_reg(0x09, 0x07);		// PAT_RIN
         }
         
     }
     else
     {
+        I2C_write_reg(0x00, 0x55);		// software reset
+
+    	I2C_write_reg(0x01, 0x03);		// GCR
+    	I2C_write_reg(0x03, 0x01);		// IMAX
+    	I2C_write_reg(0x04, 0x00);		// LCFG1
+    	I2C_write_reg(0x05, 0x00);		// LCFG2
+    	I2C_write_reg(0x06, 0x00);		// LCFG3
+    	I2C_write_reg(0x07, 0x07);		// LEDEN
         I2C_write_reg(0x10, 0x00);		// Color1_R
         I2C_write_reg(0x11, 0x00);		// Color1_G
         I2C_write_reg(0x12, 0x00);		// Color1_B
@@ -1114,8 +1296,6 @@ static ssize_t AW2015_Set_Green(struct device* cd, struct device_attribute *attr
                 I2C_write_reg(0x33, 0x10);		// PAT_T4 	  PAT_CTR & Color
                 I2C_write_reg(0x34, 0x00);		// PAT_T5		    Timer
 
- 
-
                 I2C_write_reg(0x09, 0x07);		// PAT_RIN	
             }
             else if(GREEN_DELAY_ON == 1000)
@@ -1143,9 +1323,6 @@ static ssize_t AW2015_Set_Green(struct device* cd, struct device_attribute *attr
                 I2C_write_reg(0x33, 0x10);		// PAT_T4 	  PAT_CTR & Color
                 I2C_write_reg(0x34, 0x00);		// PAT_T5		    Timer
 
-
-
-
                 I2C_write_reg(0x09, 0x07);		// PAT_RIN	
             }
             else if(GREEN_DELAY_ON == 1499)
@@ -1167,19 +1344,42 @@ static ssize_t AW2015_Set_Green(struct device* cd, struct device_attribute *attr
                 I2C_write_reg(0x1D, 0xFF);      // PWM2
                 I2C_write_reg(0x1E, 0xFF);      // PWM3
 
-                I2C_write_reg(0x30, 0x14);		// PAT_T1		Trise & Ton
-                I2C_write_reg(0x31, 0x01);		// PAT_T2		Tfall & Toff
-                I2C_write_reg(0x32, 0x31);		// PAT_T3		Tslot & Tdelay
-                I2C_write_reg(0x33, 0x10);		// PAT_T4 	  PAT_CTR & Color
+                I2C_write_reg(0x30, 0x80);		// PAT_T1		Trise & Ton
+                I2C_write_reg(0x31, 0x00);		// PAT_T2		Tfall & Toff
+                I2C_write_reg(0x32, 0x00);		// PAT_T3		Tslot & Tdelay
+                I2C_write_reg(0x33, 0x00);		// PAT_T4 	  PAT_CTR & Color
                 I2C_write_reg(0x34, 0x00);		// PAT_T5		    Timer
 
-
-
-
-                I2C_write_reg(0x09, 0x07);		// PAT_RIN	
+                I2C_write_reg(0x09, 0x07);		// PAT_RIN
             }
-                
-        }else
+        }
+        else if (GREEN_DELAY_ON!=0 &&GREEN_DELAY_OFF!=0)
+         {
+             I2C_write_reg(0x00, 0x55);      // software reset
+
+             I2C_write_reg(0x01, 0x03);      // GCR
+             I2C_write_reg(0x03, 0x01);      // IMAX
+             I2C_write_reg(0x04, 0x01);      // LCFG1
+             I2C_write_reg(0x05, 0x01);      // LCFG2
+             I2C_write_reg(0x06, 0x01);      // LCFG3
+             I2C_write_reg(0x07, 0x07);      // LEDEN
+             I2C_write_reg(0x08, 0x08);      // LEDCTR
+
+             I2C_write_reg(0x10, 0x00);      // Color1_R
+             I2C_write_reg(0x11, 0xFF);      // Color1_G
+             I2C_write_reg(0x12, 0x00);      // Color1_B
+             I2C_write_reg(0x1C, 0xFF);      // PWM1
+             I2C_write_reg(0x1D, 0xFF);      // PWM2
+             I2C_write_reg(0x1E, 0xFF);      // PWM3
+
+             I2C_write_reg(0x30, 0x14);      // PAT_T1       Trise & Ton
+             I2C_write_reg(0x31, 0x01);      // PAT_T2       Tfall & Toff
+             I2C_write_reg(0x32, 0x31);      // PAT_T3       Tslot & Tdelay
+             I2C_write_reg(0x33, 0x10);      // PAT_T4     PAT_CTR & Color
+             I2C_write_reg(0x34, 0x00);      // PAT_T5           Timer
+
+             I2C_write_reg(0x09, 0x07);      // PAT_RIN
+         }else
         {
             I2C_write_reg(0x00, 0x55);      // software reset
             
@@ -1201,6 +1401,7 @@ static ssize_t AW2015_Set_Green(struct device* cd, struct device_attribute *attr
         }
         
     }
+ 
     else
     {
         I2C_write_reg(0x10, 0x00);		// Color1_R
@@ -1346,6 +1547,33 @@ static ssize_t AW2015_Set_Blue(struct device* cd, struct device_attribute *attr,
                 I2C_write_reg(0x1D, 0xFF);      // PWM2
                 I2C_write_reg(0x1E, 0xFF);      // PWM3
 
+                I2C_write_reg(0x30, 0x80);		// PAT_T1		Trise & Ton
+                I2C_write_reg(0x31, 0x00);		// PAT_T2		Tfall & Toff
+                I2C_write_reg(0x32, 0x00);		// PAT_T3		Tslot & Tdelay
+                I2C_write_reg(0x33, 0x00);		// PAT_T4 	  PAT_CTR & Color
+                I2C_write_reg(0x34, 0x00);		// PAT_T5		    Timer
+
+                I2C_write_reg(0x09, 0x07);		// PAT_RIN
+            }
+        }else if(BLUE_DELAY_ON!=0 &&BLUE_DELAY_OFF!=0)
+            {
+                I2C_write_reg(0x00, 0x55);      // software reset
+
+                I2C_write_reg(0x01, 0x03);      // GCR
+                I2C_write_reg(0x03, 0x01);      // IMAX
+                I2C_write_reg(0x04, 0x01);      // LCFG1
+                I2C_write_reg(0x05, 0x01);      // LCFG2
+                I2C_write_reg(0x06, 0x01);      // LCFG3
+                I2C_write_reg(0x07, 0x07);      // LEDEN
+                I2C_write_reg(0x08, 0x08);      // LEDCTR
+
+                I2C_write_reg(0x10, 0x00);      // Color1_R
+                I2C_write_reg(0x11, 0x00);      // Color1_G
+                I2C_write_reg(0x12, 0xFF);      // Color1_B
+                I2C_write_reg(0x1C, 0xFF);      // PWM1
+                I2C_write_reg(0x1D, 0xFF);      // PWM2
+                I2C_write_reg(0x1E, 0xFF);      // PWM3
+
                 I2C_write_reg(0x30, 0x14);		// PAT_T1		Trise & Ton
                 I2C_write_reg(0x31, 0x01);		// PAT_T2		Tfall & Toff
                 I2C_write_reg(0x32, 0x31);		// PAT_T3		Tslot & Tdelay
@@ -1353,9 +1581,7 @@ static ssize_t AW2015_Set_Blue(struct device* cd, struct device_attribute *attr,
                 I2C_write_reg(0x34, 0x00);		// PAT_T5		    Timer
 
                 I2C_write_reg(0x09, 0x07);		// PAT_RIN	
-            }
-                
-        }else
+            }else
         {
             I2C_write_reg(0x00, 0x55);      // software reset
             

+ 2 - 0
drivers/misc/mediatek/video/mt6735/videox/mt6753/disp_drv_platform.h

@@ -56,10 +56,12 @@
  */
 /* #define OVL_MULTIPASS_SUPPORT */
 
+#if 0  // xmsxm remove @ 2016-11-22, to fix Mantis #0059798.
 /**
  * Enable Ovl time-sharing.
  */
 #define OVL_TIME_SHARING
+#endif
 
 /**
  * Build CMDQ command in trigger stage.

+ 38 - 2
drivers/power/mediatek/battery_common_fg_20.c

@@ -76,7 +76,14 @@
 #include <mach/mt_charging.h>
 #include <mach/mt_pmic.h>
 
+// Disable LED when DTU boot and pulg OTG by xmwuwh@20161118--start
+#ifdef CONFIG_AW2015
+extern unsigned char AW2015_LED_OFF(void);
+extern unsigned char AW2015_LED_RED_ON(void);
+extern unsigned char AW2015_LED_RED_OFF(void);
 
+#endif
+// Disable LED when DTU boot and pulg OTG by xmwuwh@20161118--end
 
 #if defined(CONFIG_MTK_DUAL_INPUT_CHARGER_SUPPORT)
 #include <mach/diso.h>
@@ -378,6 +385,13 @@ kal_bool bat_is_ext_power(void)
 	return pwr_src;
 }
 #endif
+
+// Disable LED when DTU boot and pulg OTG by xmwuwh@20161118--start
+#ifdef CONFIG_AW2015
+static int LED_ON_COUNT = 1;
+#endif
+// Disable LED when DTU boot and pulg OTG by xmwuwh@20161118--end
+
 /* ///////////////////////////////////////////////////////////////////////////////////////// */
 /* // PMIC PCHR Related APIs */
 /* ///////////////////////////////////////////////////////////////////////////////////////// */
@@ -416,6 +430,17 @@ kal_bool upmu_is_chr_det(void)
 		return KAL_TRUE;
 	}
 
+// Disable LED when DTU boot and pulg OTG by xmwuwh@20161118--start
+#ifdef CONFIG_AW2015
+    if(LED_ON_COUNT)
+    {
+        //pr_err("xmwuwh close LED\n");
+        AW2015_LED_OFF();
+        LED_ON_COUNT--;
+    }
+#endif
+// Disable LED when DTU boot and pulg OTG by xmwuwh@20161118--end
+
 	battery_log(BAT_LOG_CRTI, "[upmu_is_chr_det] Charger exist but USB is host\n");
 
 	return KAL_FALSE;
@@ -2677,7 +2702,12 @@ void do_chrdet_int_task(void)
 #endif
 			battery_log(BAT_LOG_CRTI, "[do_chrdet_int_task] charger exist!\n");
 			BMT_status.charger_exist = KAL_TRUE;
-
+            #ifdef CONFIG_AW2015
+                if (BMT_status.UI_SOC2 <= 90)
+                {
+                    AW2015_LED_RED_ON();
+                }
+            #endif
 			wake_lock(&battery_suspend_lock);
 
 #if defined(CONFIG_POWER_EXT)
@@ -2695,6 +2725,12 @@ void do_chrdet_int_task(void)
 		} else {
 			battery_log(BAT_LOG_CRTI, "[do_chrdet_int_task] charger NOT exist!\n");
 			BMT_status.charger_exist = KAL_FALSE;
+        #ifdef CONFIG_AW2015
+                if (BMT_status.UI_SOC2 <= 90)
+                {
+                    AW2015_LED_RED_OFF();
+                }
+        #endif
 
 #if defined(CONFIG_MTK_DUAL_INPUT_CHARGER_SUPPORT)
 			battery_log(BAT_LOG_CRTI,
@@ -4562,4 +4598,4 @@ module_exit(battery_exit);
 
 MODULE_AUTHOR("Oscar Liu");
 MODULE_DESCRIPTION("Battery Device Driver");
-MODULE_LICENSE("GPL");
+MODULE_LICENSE("GPL");

+ 3 - 1
drivers/usb/gadget/android.c

@@ -191,7 +191,9 @@ static struct usb_device_descriptor device_desc = {
 	.bDeviceClass         = USB_CLASS_PER_INTERFACE,
 	.idVendor             = __constant_cpu_to_le16(VENDOR_ID),
 	.idProduct            = __constant_cpu_to_le16(PRODUCT_ID),
-	.bcdDevice            = __constant_cpu_to_le16(0xffff),
+	/* initialize the value for REV/bcdDevice, modify by xmtjx*/
+//	.bcdDevice			  = __constant_cpu_to_le16(0xffff),
+	.bcdDevice			  = __constant_cpu_to_le16(0x0200),
 	.bNumConfigurations   = 1,
 };
 

+ 2 - 2
sound/soc/mediatek/mt_soc_audio_v3/mt_soc_codec_63xx.c

@@ -2810,8 +2810,8 @@ void SetMicPGAGain(void)
 static bool GetAdcStatus(void)
 {
 	int i = 0;
-
-	for (i = AUDIO_ANALOG_DEVICE_IN_ADC1; i < AUDIO_ANALOG_DEVICE_MAX; i++) {
+	//fix for record issue (bug 0059482) xmysx 20161116
+	for (i = AUDIO_ANALOG_DEVICE_IN_ADC1; i <= AUDIO_ANALOG_DEVICE_RECEIVER_SPEAKER_SWITCH; i++) {
 		if ((mCodec_data->mAudio_Ana_DevicePower[i] == true)
 		    && (i != AUDIO_ANALOG_DEVICE_RECEIVER_SPEAKER_SWITCH)) {
 			return true;