merge in lmp-release history after reset to 457dee533a64be33e029b3d22e8a8f224703da9f
diff --git a/audio/hal/audio_hw.c b/audio/hal/audio_hw.c
index 818e793..40c9a2f 100644
--- a/audio/hal/audio_hw.c
+++ b/audio/hal/audio_hw.c
@@ -61,7 +61,7 @@
         .avail_min = PLAYBACK_AVAILABLE_MIN,
     },
     .card = SOUND_CARD,
-    .id = 0,
+    .id = 9,
     .type = PCM_PLAYBACK,
     .devices = AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE,
 };
@@ -115,7 +115,7 @@
         .avail_min = PLAYBACK_AVAILABLE_MIN,
     },
     .card = SOUND_CARD,
-    .id = 1,
+    .id = 9,
     .type = PCM_PLAYBACK,
     .devices = AUDIO_DEVICE_OUT_SPEAKER,
 };
diff --git a/audio/hal/audio_hw.h b/audio/hal/audio_hw.h
index 4527b1a..54829b8 100644
--- a/audio/hal/audio_hw.h
+++ b/audio/hal/audio_hw.h
@@ -161,8 +161,8 @@
 #define CAPTURE_DEFAULT_SAMPLING_RATE 48000
 #define CAPTURE_START_THRESHOLD 1
 
-#define COMPRESS_CARD       2
-#define COMPRESS_DEVICE     0
+#define COMPRESS_CARD       0
+#define COMPRESS_DEVICE     5
 #define COMPRESS_OFFLOAD_FRAGMENT_SIZE (32 * 1024)
 #define COMPRESS_OFFLOAD_NUM_FRAGMENTS 4
 /* ToDo: Check and update a proper value in msec */
diff --git a/audio_policy.conf b/audio_policy.conf
index b509b90..52e2b63 100644
--- a/audio_policy.conf
+++ b/audio_policy.conf
@@ -34,6 +34,13 @@
         devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_ALL_SCO
         flags AUDIO_OUTPUT_FLAG_PRIMARY
       }
+      compress_offload {
+        sampling_rates 44100|48000
+        channel_masks AUDIO_CHANNEL_OUT_STEREO
+        formats AUDIO_FORMAT_MP3|AUDIO_FORMAT_AAC_LC
+        devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE
+        flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING
+      }
     }
     inputs {
       primary {
diff --git a/init.flounder.rc b/init.flounder.rc
index 9e3912d..0ef6a98 100644
--- a/init.flounder.rc
+++ b/init.flounder.rc
@@ -19,6 +19,7 @@
 
 on post-fs
     write /sys/module/input_cfboost/parameters/gpu_wakeup 1
+    write /sys/devices/platform/spi-tegra114.2/spi_master/spi2/spi2.0/input/input0/doreflash 1
 
 on post-fs-data
     mkdir /data/media 0770 media_rw media_rw
diff --git a/mixer_paths_0.xml b/mixer_paths_0.xml
index 29c1243..a6c3def 100644
--- a/mixer_paths_0.xml
+++ b/mixer_paths_0.xml
@@ -11,16 +11,20 @@
   <!-- TODO other defaults -->
 
   <path name="speaker">
+    <ctl name="SPK VMixer SPK Switch" value="1"/>
   </path>
 
   <path name="speaker-reverse">
   </path>
 
   <path name="headphones">
-    <ctl name="Headphone Jack Switch" value="1"/>
+    <ctl name="Codec VMixer Codec Switch" value="1"/>
+    <ctl name="Headphone Jak Switch" value="1"/>
   </path>
 
   <path name="speaker-and-headphones">
+    <ctl name="SPK VMixer SPK Switch" value="1"/>
+    <ctl name="Codec VMixer Codec Switch" value="1"/>
     <ctl name="Headphone Jack Switch" value="1"/>
   </path>
 
diff --git a/overlay/frameworks/base/core/res/res/xml/power_profile.xml b/overlay/frameworks/base/core/res/res/xml/power_profile.xml
index f10f3f0..f6c3e01 100644
--- a/overlay/frameworks/base/core/res/res/xml/power_profile.xml
+++ b/overlay/frameworks/base/core/res/res/xml/power_profile.xml
@@ -22,42 +22,6 @@
   <item name="screen.on">121</item>
   <item name="screen.full">521</item>
 
-  <array name="screen.brightness">
-    <value>dark</value>
-    <value>dim</value>
-    <value>medium</value>
-    <value>light</value>
-    <value>bright</value>
-  </array>
-  <!-- Screen Power consumption at different brightness -->
-  <array name="screen.brightness_bin">
-      <value>121</value>
-      <value>183</value>
-      <value>259</value>
-      <value>390</value>
-      <value>521</value>
-  </array>
-
-  <array name="gpu.speeds">
-      <value>247000</value>
-      <value>304000</value>
-      <value>352000</value>
-      <value>400000</value>
-      <value>437000</value>
-      <value>484000</value>
-      <value>520000</value>
-  </array>
-    <!-- GPU Power consumption at different speeds -->
-  <array name="gpu.active">
-      <value>54.36</value>
-      <value>198</value>
-      <value>303.84</value>
-      <value>459.36</value>
-      <value>612.72</value>
-      <value>741.96</value>
-      <value>836.28</value>
-  </array>
-
   <item name="bluetooth.active">35.4</item> <!-- In call -->
   <item name="bluetooth.on">1.8</item>
   <!-- CPU wakelock held for 830ms on bluetooth headset at command. 43mA * 830 -->
@@ -67,7 +31,6 @@
   <item name="wifi.scan">54</item>
   <item name="dsp.audio">10.8</item>
   <item name="dsp.video">39.6</item>
-  <item name="radio.talk">96.12</item>
   <item name="radio.active">191.16</item>
   <item name="gps.on">50.4</item>
   <item name="battery.capacity">6700</item>
@@ -127,61 +90,58 @@
     <value>2499000</value>
   </array>
   <!-- CPU Power consumption in suspend -->
-  <item name="cpu.idle">5.8</item>
-  <!-- Wakelock power consumption -->
-  <item name="cpu.awake">59.51</item>
+  <item name="cpu.idle">6.95</item>
   <!-- CPU Power consumption at different speeds -->
   <array name="cpu.active">
-    <value>10</value>
-    <value>20</value>
-    <value>30</value>
-    <value>40</value>
-    <value>50</value>
-    <value>60</value>
-    <value>70</value>
-    <value>80</value>
-    <value>90</value>
-    <value>100</value>
-    <value>100</value>
-    <value>120</value>
-    <value>130</value>
-    <value>140</value>
-    <value>150</value>
-    <value>160</value>
-    <value>170</value>
-    <value>180</value>
-    <value>190</value>
-    <value>200</value>
-    <value>210</value>
-    <value>220</value>
-    <value>230</value>
-    <value>240</value>
-    <value>250</value>
-    <value>260</value>
-    <value>270</value>
-    <value>280</value>
-    <value>290</value>
-    <value>300</value>
-    <value>310</value>
-    <value>320</value>
-    <value>330</value>
-    <value>340</value>
-    <value>350</value>
-    <value>360</value>
-    <value>370</value>
-    <value>380</value>
-    <value>390</value>
-    <value>400</value>
-    <value>410</value>
-    <value>420</value>
-    <value>430</value>
-    <value>440</value>
-    <value>450</value>
-    <value>460</value>
-    <value>470</value>
-    <value>480</value>
+    <value>92.06</value>
+    <value>103.56</value>
+    <value>115.07</value>
+    <value>126.58</value>
+    <value>138.08</value>
+    <value>149.59</value>
+    <value>161.10</value>
+    <value>172.60</value>
+    <value>184.11</value>
+    <value>195.62</value>
+    <value>207.12</value>
+    <value>218.63</value>
+    <value>230.14</value>
+    <value>241.64</value>
+    <value>253.15</value>
+    <value>264.66</value>
+    <value>276.17</value>
+    <value>287.67</value>
+    <value>299.18</value>
+    <value>310.69</value>
+    <value>322.19</value>
+    <value>333.70</value>
+    <value>345.21</value>
+    <value>356.71</value>
+    <value>377.36</value>
+    <value>389.15</value>
+    <value>400.95</value>
+    <value>412.74</value>
+    <value>441.64</value>
+    <value>453.91</value>
+    <value>466.18</value>
+    <value>478.44</value>
+    <value>511.52</value>
+    <value>587.62</value>
+    <value>670.62</value>
+    <value>761.25</value>
+    <value>860.27</value>
+    <value>968.51</value>
+    <value>1086.83</value>
+    <value>1215.57</value>
+    <value>1356.86</value>
+    <value>1511.20</value>
+    <value>1570.85</value>
+    <value>1769.65</value>
+    <value>1961.67</value>
+    <value>2170.95</value>
+    <value>2398.88</value>
+    <value>2646.91</value>
   </array>
-
   <array name="wifi.batchedscan"> <!-- mA -->
       <value>0.0002</value> <!-- 1-8/hr -->
       <value>0.002</value>  <!-- 9-64/hr -->
diff --git a/sensor_hub/libsensors/CwMcuSensor.cpp b/sensor_hub/libsensors/CwMcuSensor.cpp
index 71fd9d1..009b2b2 100644
--- a/sensor_hub/libsensors/CwMcuSensor.cpp
+++ b/sensor_hub/libsensors/CwMcuSensor.cpp
@@ -338,10 +338,6 @@
     mPendingEvents[CW_STEP_COUNTER].sensor = ID_CW_STEP_COUNTER;
     mPendingEvents[CW_STEP_COUNTER].type = SENSOR_TYPE_STEP_COUNTER;
 
-    mPendingEvents[HTC_WAKE_UP_GESTURE].version = sizeof(sensors_event_t);
-    mPendingEvents[HTC_WAKE_UP_GESTURE].sensor = ID_WAKE_UP_GESTURE;
-    mPendingEvents[HTC_WAKE_UP_GESTURE].type = SENSOR_TYPE_WAKE_GESTURE;
-
     mPendingEventsFlush.version = META_DATA_VERSION;
     mPendingEventsFlush.sensor = 0;
     mPendingEventsFlush.type = SENSOR_TYPE_META_DATA;
@@ -510,8 +506,6 @@
         return ID_CW_STEP_DETECTOR;
     case CW_STEP_COUNTER:
         return ID_CW_STEP_COUNTER;
-    case HTC_WAKE_UP_GESTURE:
-        return ID_WAKE_UP_GESTURE;
     default:
         return 0xFF;
     }
@@ -568,9 +562,6 @@
     case ID_L:
         what = CW_LIGHT;
         break;
-    case ID_WAKE_UP_GESTURE:
-        what = HTC_WAKE_UP_GESTURE;
-        break;
     }
     return what;
 }
@@ -610,7 +601,7 @@
     what = find_sensor(handle);
 
     ALOGD("CwMcuSensor::setEnable: "
-          "[v05-Fix init trigger iio device fails], handle = %d, en = %d, what = %d\n",
+          "[v06-Remove SENSOR_TYPE_WAKE_GESTURE], handle = %d, en = %d, what = %d\n",
           handle, en, what);
 
     if (uint32_t(what) >= numSensors) {
@@ -952,8 +943,6 @@
             if (mEnabled & (1<<id)) {
                 if (id == CW_SIGNIFICANT_MOTION) {
                     setEnable(ID_CW_SIGNIFICANT_MOTION, 0);
-                } else if (id == HTC_WAKE_UP_GESTURE) {
-                    setEnable(ID_WAKE_UP_GESTURE, 0);
                 }
                 calculate_rv_4th_element(id);
                 *data++ = mPendingEvents[id];
@@ -1049,11 +1038,6 @@
         mPendingMask |= 1<<(sensorsid);
         mPendingEvents[CW_STEP_COUNTER].u64.step_counter = *(uint32_t *)&data[0]; // We use 4 bytes in SensorHUB
         break;
-    case HTC_WAKE_UP_GESTURE:
-        mPendingMask |= 1<<(sensorsid);
-        mPendingEvents[HTC_WAKE_UP_GESTURE].data[0] = 1;
-        ALOGV("HTC_WAKE_UP_GESTURE occurs\n");
-        break;
     case CW_META_DATA:
         mPendingEventsFlush.meta_data.what = META_DATA_FLUSH_COMPLETE;
         mPendingEventsFlush.meta_data.sensor = find_handle(data[0]);
diff --git a/sensor_hub/libsensors/CwMcuSensor.h b/sensor_hub/libsensors/CwMcuSensor.h
index 0f8d1b4..2521864 100644
--- a/sensor_hub/libsensors/CwMcuSensor.h
+++ b/sensor_hub/libsensors/CwMcuSensor.h
@@ -39,7 +39,6 @@
     CW_ROTATIONVECTOR              = 7,
     CW_LINEARACCELERATION          = 8,
     CW_GRAVITY                     = 9,
-    HTC_WAKE_UP_GESTURE            = 10,
     CW_MAGNETIC_UNCALIBRATED       = 16,
     CW_GYROSCOPE_UNCALIBRATED      = 17,
     CW_GAME_ROTATION_VECTOR        = 18,
diff --git a/sensor_hub/libsensors/sensors.cpp b/sensor_hub/libsensors/sensors.cpp
index 449b5d7..6dda45a 100644
--- a/sensor_hub/libsensors/sensors.cpp
+++ b/sensor_hub/libsensors/sensors.cpp
@@ -313,23 +313,6 @@
          .flags = SENSOR_FLAG_ON_CHANGE_MODE,
          .reserved =          {}
         },
-        {.name =       "HTC Wake Gesture",
-         .vendor =     "hTC Corp",
-         .version =    1,
-         .handle =     ID_WAKE_UP_GESTURE,
-         .type =       SENSOR_TYPE_WAKE_GESTURE,
-         .maxRange =   10240.0f,
-         .resolution = 1.0f,
-         .power =      0.17f,
-         .minDelay =   -1,
-         .fifoReservedEventCount = 0,
-         .fifoMaxEventCount =      0,
-         .stringType =         NULL,
-         .requiredPermission = NULL,
-         .maxDelay =           0,
-         .flags = SENSOR_FLAG_ONE_SHOT_MODE | SENSOR_FLAG_WAKE_UP,
-         .reserved =          {}
-        },
 };
 
 static int open_sensors(const struct hw_module_t* module, const char* id,
@@ -403,7 +386,6 @@
                 case ID_CW_SIGNIFICANT_MOTION:
                 case ID_CW_STEP_DETECTOR:
                 case ID_CW_STEP_COUNTER:
-                case ID_WAKE_UP_GESTURE:
                         return cwmcu;
         }
         return -EINVAL;
diff --git a/sensor_hub/libsensors/sensors.h b/sensor_hub/libsensors/sensors.h
index 82f53f4..cb6cc67 100644
--- a/sensor_hub/libsensors/sensors.h
+++ b/sensor_hub/libsensors/sensors.h
@@ -50,7 +50,6 @@
 #define ID_CW_SIGNIFICANT_MOTION                   13//CW_SIGNIFICANT_MOTION
 #define ID_CW_STEP_DETECTOR                        14//CW_STEP_DETECTOR
 #define ID_CW_STEP_COUNTER                         15//CW_STEP_COUNTER
-#define ID_WAKE_UP_GESTURE                         16//HTC_WAKE_UP_GESTURE
 
 /*****************************************************************************/