Merge "ARM: dts: msm: Enable camera on MSM8937 MTP"
diff --git a/Documentation/devicetree/bindings/input/touchscreen/focaltech_ts.txt b/Documentation/devicetree/bindings/input/touchscreen/focaltech_ts.txt
index 4a1b751..0174e3d 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/focaltech_ts.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/focaltech_ts.txt
@@ -30,6 +30,7 @@
  - focaltech,keys 			: array of key code.
  - focaltech,key-y-coord 	: y coordinate for the keys.
  - focaltech,key-x-coords	: array of x coordinates for the keys.
+ - focaltech,wakeup-gestures-en	: enable wakeup gestures.
 
 Example:
 	i2c@f9923000{
diff --git a/arch/arm/boot/dts/qcom/sdxpoorwills.dtsi b/arch/arm/boot/dts/qcom/sdxpoorwills.dtsi
index b125e08..bb3f4a9 100644
--- a/arch/arm/boot/dts/qcom/sdxpoorwills.dtsi
+++ b/arch/arm/boot/dts/qcom/sdxpoorwills.dtsi
@@ -43,6 +43,16 @@
 			label = "sbl_mem";
 		};
 
+		flex_sec_apps_mem: flex_sec_apps_regions@8fcfd000 {
+			no-map;
+			reg = <0x8fcfd000 0x3000>;
+		};
+
+		access_control_mem: access_control_mem@8fc80000 {
+			no-map;
+			reg = <0x8fc80000 0x40000>;
+		};
+
 		hyp_region: hyp_region@8fc00000 {
 			no-map;
 			reg = <0x8fc00000 0x80000>;
diff --git a/arch/arm/configs/msm8953-perf_defconfig b/arch/arm/configs/msm8953-perf_defconfig
index 45ce824..c2ce38b 100644
--- a/arch/arm/configs/msm8953-perf_defconfig
+++ b/arch/arm/configs/msm8953-perf_defconfig
@@ -292,6 +292,7 @@
 # CONFIG_SERIO_SERPORT is not set
 # CONFIG_VT is not set
 # CONFIG_LEGACY_PTYS is not set
+# CONFIG_DEVKMEM is not set
 CONFIG_SERIAL_MSM_HS=y
 CONFIG_SERIAL_MSM_SMD=y
 CONFIG_DIAG_CHAR=y
diff --git a/arch/arm/configs/sdxpoorwills-perf_defconfig b/arch/arm/configs/sdxpoorwills-perf_defconfig
index 3cd1419..c91c183 100644
--- a/arch/arm/configs/sdxpoorwills-perf_defconfig
+++ b/arch/arm/configs/sdxpoorwills-perf_defconfig
@@ -322,6 +322,7 @@
 CONFIG_ION_MSM=y
 CONFIG_GSI=y
 CONFIG_IPA3=y
+CONFIG_IPA_WDI_UNIFIED_API=y
 CONFIG_RMNET_IPA3=y
 CONFIG_ECM_IPA=y
 CONFIG_RNDIS_IPA=y
diff --git a/arch/arm/configs/sdxpoorwills_defconfig b/arch/arm/configs/sdxpoorwills_defconfig
index b081cdd..784bb56 100644
--- a/arch/arm/configs/sdxpoorwills_defconfig
+++ b/arch/arm/configs/sdxpoorwills_defconfig
@@ -327,6 +327,7 @@
 CONFIG_ION_MSM=y
 CONFIG_GSI=y
 CONFIG_IPA3=y
+CONFIG_IPA_WDI_UNIFIED_API=y
 CONFIG_RMNET_IPA3=y
 CONFIG_ECM_IPA=y
 CONFIG_RNDIS_IPA=y
diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index cc75e7f..a92f511 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -165,6 +165,15 @@
 	  This enables support for the MSM8937 chipset. If you do not
 	  wish to build a kernel that runs on this chipset, say 'N' here.
 
+config ARCH_MSM8917
+	bool "Enable Support for Qualcomm Technologies Inc. MSM8917"
+	depends on ARCH_QCOM
+	select CPU_FREQ_QCOM
+	select COMMON_CLK_MSM
+	help
+	  This enables support for the MSM8917 chipset. If you do not
+	  wish to build a kernel that runs on this chipset, say 'N' here.
+
 config ARCH_SDM450
 	bool "Enable Support for Qualcomm Technologies Inc. SDM450"
 	depends on ARCH_QCOM
diff --git a/arch/arm64/boot/dts/qcom/msm8937.dtsi b/arch/arm64/boot/dts/qcom/msm8937.dtsi
index 928bb5d..055ad09 100644
--- a/arch/arm64/boot/dts/qcom/msm8937.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8937.dtsi
@@ -991,6 +991,7 @@
 		qcom,ipi-ping;
 		qcom,wakeup-enable;
 		status = "okay";
+		qcom,scandump-size = <0x40000>;
 	};
 
 	spmi_bus: qcom,spmi@200f000 {
diff --git a/arch/arm64/boot/dts/qcom/qcs605-cdp-overlay.dts b/arch/arm64/boot/dts/qcom/qcs605-cdp-overlay.dts
index 1429880..a479175 100644
--- a/arch/arm64/boot/dts/qcom/qcs605-cdp-overlay.dts
+++ b/arch/arm64/boot/dts/qcom/qcs605-cdp-overlay.dts
@@ -46,7 +46,7 @@
 		eeprom-src = <&eeprom_rear_aux>;
 		cam_vio-supply = <&camera_vio_ldo>;
 		cam_vana-supply = <&camera_vana_ldo>;
-		cam_vdig-supply = <&camera_ldo>;
+		cam_vdig-supply = <&camera_rear_ldo>;
 		cam_clk-supply = <&titan_top_gdsc>;
 		regulator-names = "cam_vdig", "cam_vio", "cam_vana",
 			"cam_clk";
diff --git a/arch/arm64/boot/dts/qcom/qcs605-cdp.dts b/arch/arm64/boot/dts/qcom/qcs605-cdp.dts
index 6c6012e..92453d4 100644
--- a/arch/arm64/boot/dts/qcom/qcs605-cdp.dts
+++ b/arch/arm64/boot/dts/qcom/qcs605-cdp.dts
@@ -40,7 +40,7 @@
 		eeprom-src = <&eeprom_rear_aux>;
 		cam_vio-supply = <&camera_vio_ldo>;
 		cam_vana-supply = <&camera_vana_ldo>;
-		cam_vdig-supply = <&camera_ldo>;
+		cam_vdig-supply = <&camera_rear_ldo>;
 		cam_clk-supply = <&titan_top_gdsc>;
 		regulator-names = "cam_vdig", "cam_vio", "cam_vana",
 			"cam_clk";
diff --git a/arch/arm64/boot/dts/qcom/qcs605-lc.dtsi b/arch/arm64/boot/dts/qcom/qcs605-lc.dtsi
index ba068f9..8279587 100644
--- a/arch/arm64/boot/dts/qcom/qcs605-lc.dtsi
+++ b/arch/arm64/boot/dts/qcom/qcs605-lc.dtsi
@@ -209,12 +209,12 @@
 
 &clock_gfx {
 	/delete-property/ vdd_gfx-supply;
-	vdd_gfx-supply = <&pm8005_s2>;
+	vdd_gfx-supply = <&pm8005_s3_level>;
 };
 
 &gpu_gx_gdsc {
 	/delete-property/ parent-supply;
-	parent-supply = <&pm8005_s2>;
+	parent-supply = <&pm8005_s3_level>;
 };
 
 &mdss_mdp {
diff --git a/arch/arm64/boot/dts/qcom/sdm439-audio.dtsi b/arch/arm64/boot/dts/qcom/sdm439-audio.dtsi
index fae43ba..f6751d2 100644
--- a/arch/arm64/boot/dts/qcom/sdm439-audio.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm439-audio.dtsi
@@ -13,6 +13,7 @@
 
 &soc {
 	int_codec: sound {
+		qcom,model = "sdm439-snd-card-mtp";
 		qcom,msm-hs-micbias-type = "internal";
 
 		asoc-codec = <&stub_codec>, <&msm_digital_codec>,
diff --git a/arch/arm64/configs/msm8953-perf_defconfig b/arch/arm64/configs/msm8953-perf_defconfig
index f5410c1..33cb7a2 100644
--- a/arch/arm64/configs/msm8953-perf_defconfig
+++ b/arch/arm64/configs/msm8953-perf_defconfig
@@ -53,6 +53,7 @@
 CONFIG_ARCH_QCOM=y
 CONFIG_ARCH_MSM8953=y
 CONFIG_ARCH_MSM8937=y
+CONFIG_ARCH_MSM8917=y
 CONFIG_ARCH_SDM450=y
 CONFIG_ARCH_SDM632=y
 CONFIG_ARCH_SDM429=y
@@ -293,6 +294,7 @@
 # CONFIG_SERIO_SERPORT is not set
 # CONFIG_VT is not set
 # CONFIG_LEGACY_PTYS is not set
+# CONFIG_DEVKMEM is not set
 CONFIG_SERIAL_MSM_HS=y
 CONFIG_SERIAL_MSM_SMD=y
 CONFIG_DIAG_CHAR=y
diff --git a/arch/arm64/configs/msm8953_defconfig b/arch/arm64/configs/msm8953_defconfig
index b9f4d9d..c47fb7e 100644
--- a/arch/arm64/configs/msm8953_defconfig
+++ b/arch/arm64/configs/msm8953_defconfig
@@ -57,6 +57,7 @@
 CONFIG_ARCH_QCOM=y
 CONFIG_ARCH_MSM8953=y
 CONFIG_ARCH_MSM8937=y
+CONFIG_ARCH_MSM8917=y
 CONFIG_ARCH_SDM450=y
 CONFIG_ARCH_SDM632=y
 CONFIG_ARCH_SDM429=y
diff --git a/drivers/gpu/msm/kgsl_sharedmem.c b/drivers/gpu/msm/kgsl_sharedmem.c
index a9c2252..3702893 100644
--- a/drivers/gpu/msm/kgsl_sharedmem.c
+++ b/drivers/gpu/msm/kgsl_sharedmem.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2002,2007-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2002,2007-2018, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -716,6 +716,18 @@
 
 	align = (memdesc->flags & KGSL_MEMALIGN_MASK) >> KGSL_MEMALIGN_SHIFT;
 
+	/*
+	 * As 1MB is the max supported page size, use the alignment
+	 * corresponding to 1MB page to make sure higher order pages
+	 * are used if possible for a given memory size. Also, we
+	 * don't need to update alignment in memdesc flags in case
+	 * higher order page is used, as memdesc flags represent the
+	 * virtual alignment specified by the user which is anyways
+	 * getting satisfied.
+	 */
+	if (align < ilog2(SZ_1M))
+		align = ilog2(SZ_1M);
+
 	page_size = kgsl_get_page_size(size, align);
 
 	/*
diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_config.h b/drivers/input/touchscreen/focaltech_touch/focaltech_config.h
index 157f0df..5ab6bda 100644
--- a/drivers/input/touchscreen/focaltech_touch/focaltech_config.h
+++ b/drivers/input/touchscreen/focaltech_touch/focaltech_config.h
@@ -121,7 +121,7 @@
  * Gesture function enable
  * default: disable
  */
-#define FTS_GESTURE_EN                          0
+#define FTS_GESTURE_EN                          1
 
 /*
  * ESD check & protection
diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_core.c b/drivers/input/touchscreen/focaltech_touch/focaltech_core.c
index 27bb390..b3d7322 100644
--- a/drivers/input/touchscreen/focaltech_touch/focaltech_core.c
+++ b/drivers/input/touchscreen/focaltech_touch/focaltech_core.c
@@ -648,7 +648,7 @@
 #if FTS_GESTURE_EN
 	u8 state;
 
-	if (data->suspended) {
+	if (data->suspended && data->pdata->wakeup_gestures_en) {
 		fts_i2c_read_reg(data->client, FTS_REG_GESTURE_EN, &state);
 		if (state == 1) {
 			fts_gesture_readdata(data->client);
@@ -989,6 +989,8 @@
 		pdata->max_touch_number = FTS_MAX_POINTS;
 	}
 
+	pdata->wakeup_gestures_en = of_property_read_bool(np,
+			"focaltech,wakeup-gestures-en");
 
 	FTS_FUNC_EXIT();
 	return 0;
@@ -1310,15 +1312,17 @@
 #endif
 
 #if FTS_GESTURE_EN
-	retval = fts_gesture_suspend(data->client);
-	if (retval == 0) {
-		/* Enter into gesture mode(suspend) */
-		retval = enable_irq_wake(fts_wq_data->client->irq);
-		if (retval)
-			FTS_ERROR("%s: set_irq_wake failed", __func__);
-		data->suspended = true;
-		FTS_FUNC_EXIT();
-		return 0;
+	if (data->pdata->wakeup_gestures_en) {
+		retval = fts_gesture_suspend(data->client);
+		if (retval == 0) {
+			/* Enter into gesture mode(suspend) */
+			retval = enable_irq_wake(fts_wq_data->client->irq);
+			if (retval)
+				FTS_ERROR("%s: set_irq_wake failed", __func__);
+			data->suspended = true;
+			FTS_FUNC_EXIT();
+			return 0;
+		}
 	}
 #endif
 
@@ -1376,15 +1380,18 @@
 #endif
 
 #if FTS_GESTURE_EN
-	if (fts_gesture_resume(data->client) == 0) {
-		int err;
+	if (data->pdata->wakeup_gestures_en) {
+		if (fts_gesture_resume(data->client) == 0) {
+			int err;
 
-		err = disable_irq_wake(data->client->irq);
-		if (err)
-			FTS_ERROR("%s: disable_irq_wake failed", __func__);
-		data->suspended = false;
-		FTS_FUNC_EXIT();
-		return 0;
+			err = disable_irq_wake(data->client->irq);
+			if (err)
+				FTS_ERROR("%s: disable_irq_wake failed",
+						__func__);
+			data->suspended = false;
+			FTS_FUNC_EXIT();
+			return 0;
+		}
 	}
 #endif
 
diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_core.h b/drivers/input/touchscreen/focaltech_touch/focaltech_core.h
index 52b4ffe..13ffc3e 100644
--- a/drivers/input/touchscreen/focaltech_touch/focaltech_core.h
+++ b/drivers/input/touchscreen/focaltech_touch/focaltech_core.h
@@ -122,6 +122,7 @@
 	u32 x_min;
 	u32 y_min;
 	u32 max_touch_number;
+	bool wakeup_gestures_en;
 };
 
 struct ts_event {
diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_gesture.c b/drivers/input/touchscreen/focaltech_touch/focaltech_gesture.c
index b3bb39e..d24cd8a 100644
--- a/drivers/input/touchscreen/focaltech_touch/focaltech_gesture.c
+++ b/drivers/input/touchscreen/focaltech_touch/focaltech_gesture.c
@@ -69,6 +69,9 @@
 #define FTS_GESTRUE_POINTS                      255
 #define FTS_GESTRUE_POINTS_HEADER               8
 
+#define GESTURE_SMALL_AREA      0x25    /* TP Coverage < 50% */
+#define GESTURE_LARGE_AREA      0x26    /* TP Coverage > 50% */
+
 /*****************************************************************************
  * Private enumerations, structures and unions using typedef
  *****************************************************************************/
@@ -423,11 +426,21 @@
 		return ret;
 	}
 
-	/* FW recognize gesture */
-	if (fts_gesture_fw()) {
-		memcpy(fts_gesture_data.header, buf, FTS_GESTRUE_POINTS_HEADER);
-		gestrue_id = buf[0];
-		pointnum = buf[1];
+	memcpy(fts_gesture_data.header, buf, FTS_GESTRUE_POINTS_HEADER);
+	gestrue_id = buf[0];
+	pointnum = buf[1];
+
+	if (gestrue_id == GESTURE_SMALL_AREA) {
+		FTS_INFO("[GESTURE] Wakeup gesture.");
+		input_report_key(fts_input_dev, KEY_POWER, 1);
+		input_sync(fts_input_dev);
+		input_report_key(fts_input_dev, KEY_POWER, 0);
+		input_sync(fts_input_dev);
+
+	} else if (gestrue_id == GESTURE_LARGE_AREA) {
+		FTS_INFO("[GESTURE] Large object detected.");
+	} else if (fts_gesture_fw()) {
+		/* FW recognize gesture */
 		read_bytes = ((int)pointnum) * 4 + 2;
 		buf[0] = FTS_REG_GESTURE_OUTPUT_ADDRESS;
 		FTS_DEBUG("[GESTURE]PointNum=%d", pointnum);
@@ -448,12 +461,13 @@
 				| (((s16) buf[3 + (4 * i + 2)]) & 0xFF);
 		}
 
-		FTS_FUNC_EXIT();
-		return 0;
+
+	} else {
+		FTS_ERROR("[GESTURE]IC 0x%x need lib to support gestures.",
+							chip_types.chip_idh);
 	}
 
-	FTS_ERROR("[GESTURE]IC 0x%x need gesture lib to support gestures.",
-				chip_types.chip_idh);
+	FTS_FUNC_EXIT();
 
 	return 0;
 }
diff --git a/drivers/platform/msm/Kconfig b/drivers/platform/msm/Kconfig
index 782ce62..6575b38 100644
--- a/drivers/platform/msm/Kconfig
+++ b/drivers/platform/msm/Kconfig
@@ -47,6 +47,16 @@
 	  Kernel and user-space processes can call the IPA driver
 	  to configure IPA core.
 
+config IPA_WDI_UNIFIED_API
+	bool "IPA WDI unified API support"
+	depends on IPA3
+	help
+	  This driver supports IPA WDI unified API.
+	  WDI is the interface between IPA micro controller and WLAN chipset.
+	  It is designed to support IPA HW accelerating path for WLAN use case.
+	  The IPA WDI unified API supports all WDI versions through a unified
+	  interface.
+
 config RMNET_IPA3
 	tristate "IPA3 RMNET WWAN Network Device"
 	depends on IPA3 && MSM_QMI_INTERFACE
diff --git a/net/wireless/db.txt b/net/wireless/db.txt
index 7fe91b1..eb4cc00 100644
--- a/net/wireless/db.txt
+++ b/net/wireless/db.txt
@@ -1202,9 +1202,12 @@
 	# 60 gHz band channels 1-3, FCC
 	(57240 - 63720 @ 2160), (40)
 
-country QA:
+country QA: DFS-ETSI
 	(2402 - 2482 @ 40), (20)
-	(5735 - 5835 @ 80), (30)
+	(5170 - 5250 @ 80), (23), AUTO-BW
+	(5250 - 5330 @ 80), (23), DFS, AUTO-BW
+	(5490 - 5730 @ 80), (20), DFS
+	(5735 - 5875 @ 80), (20)
 
 country RE: DFS-ETSI
 	(2402 - 2482 @ 40), (20)