aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-11-05 00:22:47 -0800
committerLinux Build Service Account <lnxbuild@localhost>2018-11-05 00:22:47 -0800
commit54db012f5f19365723d4cf9b5fb6fa2674ff2b4a (patch)
treeb55217a0ac42490081f84e5cf767a0fddc5f32b0
parent0b6cfba2db6800f0bb8b5e2fda854f12f92dec33 (diff)
parent7b3c529efcfb1bc51e3620629a6e8dd18416e14c (diff)
Merge 7b3c529efcfb1bc51e3620629a6e8dd18416e14c on remote branchLA.UM.6.6.2.r1-06300-89xx.0
Change-Id: I299860a678aa8e3c8ac08dd2f9ca8caf979df132
-rw-r--r--Documentation/devicetree/bindings/regulator/qpnp-lcdb-regulator.txt8
-rw-r--r--arch/arm64/boot/dts/qcom/pmi632.dtsi1
-rw-r--r--arch/arm64/boot/dts/qcom/sdm439-regulator.dtsi34
-rw-r--r--arch/arm64/boot/dts/qcom/sdm439.dtsi2
-rw-r--r--drivers/char/diag/diag_memorydevice.c2
-rw-r--r--drivers/char/diag/diagfwd_peripheral.c20
-rw-r--r--drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c14
-rw-r--r--drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c6
-rw-r--r--drivers/media/platform/msm/vidc/venus_hfi.c19
-rw-r--r--drivers/media/platform/msm/vidc_3x/venus_hfi.c7
-rw-r--r--drivers/mmc/core/core.c6
-rw-r--r--drivers/platform/msm/ipa/ipa_v2/ipa_debugfs.c1
-rw-r--r--drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c1
-rw-r--r--drivers/platform/msm/ipa/ipa_v3/ipa_rt.c22
-rw-r--r--drivers/regulator/qpnp-lcdb-regulator.c120
-rw-r--r--include/uapi/linux/msm_ipa.h8
-rw-r--r--sound/soc/soc-ops.c4
17 files changed, 218 insertions, 57 deletions
diff --git a/Documentation/devicetree/bindings/regulator/qpnp-lcdb-regulator.txt b/Documentation/devicetree/bindings/regulator/qpnp-lcdb-regulator.txt
index 9798ac60b493..f6eacbb53cb7 100644
--- a/Documentation/devicetree/bindings/regulator/qpnp-lcdb-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/qpnp-lcdb-regulator.txt
@@ -31,6 +31,14 @@ First Level Node - LCDB module
Value type: <phandle>
Definition: Phandle to the PMIC's revid node
+- qcom,voltage-step-ramp
+ Usage: optional
+ Value type: <bool>
+ Definition: Required only if the voltage needs to be set in the
+ steps of 500 mV starting from the 4500 mV. This needs
+ to be enabled only on platforms where voltage needs to
+ be ramped up with multiple steps.
+
Touch-to-wake (TTW) properties:
TTW supports 2 modes of operation - HW and SW. In the HW mode the enable/disable
diff --git a/arch/arm64/boot/dts/qcom/pmi632.dtsi b/arch/arm64/boot/dts/qcom/pmi632.dtsi
index 90780f6f7bc1..24535ac0d836 100644
--- a/arch/arm64/boot/dts/qcom/pmi632.dtsi
+++ b/arch/arm64/boot/dts/qcom/pmi632.dtsi
@@ -625,6 +625,7 @@
interrupt-names = "sc-irq";
qcom,pmic-revid = <&pmi632_revid>;
+ qcom,voltage-step-ramp;
lcdb_ldo_vreg: ldo {
label = "ldo";
diff --git a/arch/arm64/boot/dts/qcom/sdm439-regulator.dtsi b/arch/arm64/boot/dts/qcom/sdm439-regulator.dtsi
index 42c3e83c0118..750cedbe0261 100644
--- a/arch/arm64/boot/dts/qcom/sdm439-regulator.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm439-regulator.dtsi
@@ -378,12 +378,12 @@
reg = <0x2000 0x100>;
regulator-name = "pm8953_s5";
regulator-min-microvolt = <490000>;
- regulator-max-microvolt = <960000>;
+ regulator-max-microvolt = <980000>;
pm8953_s5_limit: avs-limit-regulator {
regulator-name = "pm8953_s5_avs_limit";
regulator-min-microvolt = <490000>;
- regulator-max-microvolt = <960000>;
+ regulator-max-microvolt = <980000>;
};
};
};
@@ -418,14 +418,14 @@
interrupts = <0 15 0>;
regulator-name = "apc_corner";
regulator-min-microvolt = <1>;
- regulator-max-microvolt = <5>;
+ regulator-max-microvolt = <6>;
qcom,cpr-fuse-corners = <3>;
- qcom,cpr-voltage-ceiling = <810000 845000 960000>;
+ qcom,cpr-voltage-ceiling = <810000 845000 980000>;
qcom,cpr-voltage-floor = <700000 700000 790000>;
vdd-apc-supply = <&pm8953_s5>;
mem-acc-supply = <&apc_mem_acc_vreg>;
- qcom,mem-acc-corner-map = <1 1 1 1 2>;
+ qcom,mem-acc-corner-map = <1 1 1 1 2 2>;
qcom,cpr-ref-clk = <19200>;
qcom,cpr-timer-delay = <5000>;
@@ -455,15 +455,19 @@
<70 54 7 0>;
qcom,cpr-fuse-quot-offset-scale = <5 5 5>;
qcom,cpr-init-voltage-step = <10000>;
- qcom,cpr-corner-map = <1 2 3 3 3>;
+ qcom,cpr-corner-map = <1 2 3 3 3 3>;
qcom,cpr-corner-frequency-map =
<1 1305600000>,
<2 1497600000>,
<3 1708800000>,
<4 1804800000>,
- <5 1958400000>;
+ <5 1958400000>,
+ <6 2016000000>;
qcom,speed-bin-fuse-sel = <37 34 3 0>;
- qcom,cpr-speed-bin-max-corners = <(-1) (-1) 1 2 5>;
+ qcom,cpr-speed-bin-max-corners =
+ <0 (-1) 1 2 5>,
+ <1 (-1) 1 2 5>,
+ <4 (-1) 1 2 6>;
qcom,cpr-fuse-revision = <69 39 3 0>;
qcom,cpr-quot-adjust-scaling-factor-max = <0 1400 1400>;
qcom,cpr-voltage-scaling-factor-max = <0 2000 2000>;
@@ -481,17 +485,17 @@
<0 0 0>;
qcom,cpr-floor-to-ceiling-max-range =
- <50000 50000 65000 65000 65000>,
- <50000 50000 65000 65000 65000>,
- <50000 50000 65000 65000 65000>;
+ <50000 50000 65000 65000 65000 65000>,
+ <50000 50000 65000 65000 65000 65000>,
+ <50000 50000 65000 65000 65000 65000>;
qcom,cpr-voltage-ceiling-override =
- <(-1) (-1) 810000 845000 885000 960000 960000>;
+ <(-1) (-1) 810000 845000 885000 980000 980000 980000>;
qcom,cpr-virtual-corner-quotient-adjustment =
- <0 0 0 0 0>,
- <0 0 (-22) 0 0>, /* NOMP: -10 mV */
- <0 0 0 0 0>;
+ <0 0 0 0 0 0>,
+ <0 0 (-22) 0 0 0>, /* NOMP: -10 mV */
+ <0 0 0 0 0 0>;
qcom,cpr-enable;
};
diff --git a/arch/arm64/boot/dts/qcom/sdm439.dtsi b/arch/arm64/boot/dts/qcom/sdm439.dtsi
index ef22440ca923..4e7aa5c7fc6a 100644
--- a/arch/arm64/boot/dts/qcom/sdm439.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm439.dtsi
@@ -663,5 +663,5 @@
};
&usb_otg {
- qcom,hsusb-otg-phy-init-seq = <0x06 0x82 0xffffffff>;
+ qcom,hsusb-otg-phy-init-seq = <0x43 0x80 0x06 0x82 0xffffffff>;
};
diff --git a/drivers/char/diag/diag_memorydevice.c b/drivers/char/diag/diag_memorydevice.c
index ce0c7bb2fbef..46de6a67a0a4 100644
--- a/drivers/char/diag/diag_memorydevice.c
+++ b/drivers/char/diag/diag_memorydevice.c
@@ -194,6 +194,7 @@ int diag_md_write(int id, unsigned char *buf, int len, int ctx)
}
found = 0;
+ mutex_lock(&driver->diagchar_mutex);
for (i = 0; i < driver->num_clients && !found; i++) {
if ((driver->client_map[i].pid != pid) ||
(driver->client_map[i].pid == 0))
@@ -207,6 +208,7 @@ int diag_md_write(int id, unsigned char *buf, int len, int ctx)
pr_debug("diag: wake up logging process\n");
wake_up_interruptible(&driver->wait_q);
}
+ mutex_unlock(&driver->diagchar_mutex);
if (!found)
return -EINVAL;
diff --git a/drivers/char/diag/diagfwd_peripheral.c b/drivers/char/diag/diagfwd_peripheral.c
index 2022e7be73b5..23524bb094c2 100644
--- a/drivers/char/diag/diagfwd_peripheral.c
+++ b/drivers/char/diag/diagfwd_peripheral.c
@@ -385,6 +385,8 @@ static void diagfwd_data_process_done(struct diagfwd_info *fwd_info,
goto end;
}
}
+ mutex_unlock(&fwd_info->data_mutex);
+ mutex_unlock(&driver->hdlc_disable_mutex);
if (write_len > 0) {
err = diag_mux_write(DIAG_LOCAL_PROC, write_buf, write_len,
@@ -392,18 +394,18 @@ static void diagfwd_data_process_done(struct diagfwd_info *fwd_info,
if (err) {
pr_err_ratelimited("diag: In %s, unable to write to mux error: %d\n",
__func__, err);
- goto end;
+ goto end_write;
}
}
- mutex_unlock(&fwd_info->data_mutex);
- mutex_unlock(&driver->hdlc_disable_mutex);
+
diagfwd_queue_read(fwd_info);
return;
end:
- diag_ws_release();
mutex_unlock(&fwd_info->data_mutex);
mutex_unlock(&driver->hdlc_disable_mutex);
+end_write:
+ diag_ws_release();
if (buf) {
DIAG_LOG(DIAG_DEBUG_PERIPHERALS,
"Marking buffer as free p: %d, t: %d, buf_num: %d\n",
@@ -690,24 +692,26 @@ static void diagfwd_data_read_done(struct diagfwd_info *fwd_info,
}
}
+ mutex_unlock(&fwd_info->data_mutex);
+ mutex_unlock(&driver->hdlc_disable_mutex);
+
if (write_len > 0) {
err = diag_mux_write(DIAG_LOCAL_PROC, write_buf, write_len,
temp_buf->ctxt);
if (err) {
pr_err_ratelimited("diag: In %s, unable to write to mux error: %d\n",
__func__, err);
- goto end;
+ goto end_write;
}
}
- mutex_unlock(&fwd_info->data_mutex);
- mutex_unlock(&driver->hdlc_disable_mutex);
diagfwd_queue_read(fwd_info);
return;
end:
- diag_ws_release();
mutex_unlock(&fwd_info->data_mutex);
mutex_unlock(&driver->hdlc_disable_mutex);
+end_write:
+ diag_ws_release();
if (temp_buf) {
DIAG_LOG(DIAG_DEBUG_PERIPHERALS,
"Marking buffer as free p: %d, t: %d, buf_num: %d\n",
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c
index 99962d094455..f393dea9b7fc 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c
@@ -3875,7 +3875,7 @@ static int msm_isp_stream_axi_cfg_update(struct vfe_device *vfe_dev,
int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg)
{
- int rc = 0, i;
+ int rc = 0, i, j, k;
struct msm_vfe_axi_stream *stream_info;
struct msm_vfe_axi_stream_update_cmd *update_cmd = arg;
struct msm_vfe_axi_stream_cfg_update_info *update_info = NULL;
@@ -4154,8 +4154,16 @@ int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg)
}
vfe_idx = msm_isp_get_vfe_idx_for_stream(
vfe_dev, stream_info);
- msm_isp_stream_axi_cfg_update(vfe_dev, stream_info,
- update_info);
+ for (j = 0; j < stream_info->num_planes; j++) {
+ stream_info->plane_cfg[vfe_idx][j] =
+ update_info->plane_cfg[j];
+ for (k = 0; k < stream_info->num_isp; k++) {
+ vfe_dev = stream_info->vfe_dev[k];
+ vfe_dev->hw_info->vfe_ops.axi_ops.
+ cfg_wm_reg(vfe_dev,
+ stream_info, j);
+ }
+ }
}
break;
}
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
index b589afa634e4..e67112267a2e 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
@@ -410,8 +410,12 @@ static int msm_isp_start_fetch_engine_multi_pass(struct vfe_device *vfe_dev,
pr_err("%s: Fetch engine config failed\n", __func__);
return -EINVAL;
}
- for (i = 0; i < stream_info->num_planes; i++)
+ for (i = 0; i < stream_info->num_planes; i++) {
+ vfe_dev->hw_info->vfe_ops.axi_ops.enable_wm(
+ vfe_dev->vfe_base,
+ stream_info->wm[vfe_idx][i], 1);
wm_reload_mask |= (1 << stream_info->wm[vfe_idx][i]);
+ }
vfe_dev->hw_info->vfe_ops.core_ops.reg_update(vfe_dev,
VFE_SRC_MAX);
vfe_dev->hw_info->vfe_ops.axi_ops.reload_wm(vfe_dev,
diff --git a/drivers/media/platform/msm/vidc/venus_hfi.c b/drivers/media/platform/msm/vidc/venus_hfi.c
index 7e7ed4713485..54b7e2cfe116 100644
--- a/drivers/media/platform/msm/vidc/venus_hfi.c
+++ b/drivers/media/platform/msm/vidc/venus_hfi.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-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
@@ -1170,7 +1170,7 @@ static int __iface_cmdq_write_relaxed(struct venus_hfi_device *device,
__strict_check(device);
if (!__core_in_valid_state(device)) {
- dprintk(VIDC_DBG, "%s - fw not in init state\n", __func__);
+ dprintk(VIDC_ERR, "%s - fw not in init state\n", __func__);
result = -EINVAL;
goto err_q_null;
}
@@ -2854,8 +2854,6 @@ static void __process_sys_error(struct venus_hfi_device *device)
{
struct hfi_sfr_struct *vsfr = NULL;
- __set_state(device, VENUS_STATE_DEINIT);
-
vsfr = (struct hfi_sfr_struct *)device->sfr.align_virtual_addr;
if (vsfr) {
void *p = memchr(vsfr->rg_data, '\0', vsfr->bufSize);
@@ -3110,6 +3108,10 @@ static int __response_handler(struct venus_hfi_device *device)
"Too many packets in message queue to handle at once, deferring read\n");
break;
}
+
+ /* do not read packets after sys error packet */
+ if (info->response_type == HAL_SYS_ERROR)
+ break;
}
if (requeue_pm_work && device->res->sw_power_collapsible) {
@@ -3172,8 +3174,13 @@ err_no_work:
for (i = 0; !IS_ERR_OR_NULL(device->response_pkt) &&
i < num_responses; ++i) {
struct msm_vidc_cb_info *r = &device->response_pkt[i];
- dprintk(VIDC_DBG, "Processing response %d of %d, type %d\n",
- (i + 1), num_responses, r->response_type);
+
+ if (!__core_in_valid_state(device)) {
+ dprintk(VIDC_ERR,
+ "Ignore responses from %d to %d as device is in invalid state",
+ (i + 1), num_responses);
+ break;
+ }
device->callback(r->response_type, &r->response);
}
diff --git a/drivers/media/platform/msm/vidc_3x/venus_hfi.c b/drivers/media/platform/msm/vidc_3x/venus_hfi.c
index 743f5cd12a7c..1bd6ae8959cf 100644
--- a/drivers/media/platform/msm/vidc_3x/venus_hfi.c
+++ b/drivers/media/platform/msm/vidc_3x/venus_hfi.c
@@ -1587,7 +1587,7 @@ static int __iface_cmdq_write_relaxed(struct venus_hfi_device *device,
__strict_check(device);
if (!__core_in_valid_state(device)) {
- dprintk(VIDC_DBG, "%s - fw not in init state\n", __func__);
+ dprintk(VIDC_ERR, "%s - fw not in init state\n", __func__);
result = -EINVAL;
goto err_q_null;
}
@@ -3337,8 +3337,6 @@ static void __process_sys_error(struct venus_hfi_device *device)
{
struct hfi_sfr_struct *vsfr = NULL;
- __set_state(device, VENUS_STATE_DEINIT);
-
/* Once SYS_ERROR received from HW, it is safe to halt the AXI.
* With SYS_ERROR, Venus FW may have crashed and HW might be
* active and causing unnecessary transactions. Hence it is
@@ -3581,6 +3579,9 @@ static int __response_handler(struct venus_hfi_device *device)
"Too many packets in message queue to handle at once, deferring read\n");
break;
}
+ /* do not read packets after sys error packet */
+ if (info->response_type == HAL_SYS_ERROR)
+ break;
}
if (requeue_pm_work && device->res->sw_power_collapsible) {
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index a3bca9cdbe26..9a14cb2ad06e 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -470,7 +470,7 @@ int mmc_recovery_fallback_lower_speed(struct mmc_host *host)
mmc_host_clear_sdr104(host);
err = mmc_hw_reset(host);
host->card->sdr104_blocked = true;
- } else {
+ } else if (mmc_card_sd(host->card)) {
/* If sdr104_wa is not present, just return status */
err = host->bus_ops->alive(host);
}
@@ -4593,7 +4593,9 @@ int mmc_power_save_host(struct mmc_host *host)
mmc_bus_put(host);
+ mmc_claim_host(host);
mmc_power_off(host);
+ mmc_release_host(host);
return ret;
}
@@ -4614,8 +4616,8 @@ int mmc_power_restore_host(struct mmc_host *host)
return -EINVAL;
}
- mmc_power_up(host, host->card->ocr);
mmc_claim_host(host);
+ mmc_power_up(host, host->card->ocr);
ret = host->bus_ops->power_restore(host);
mmc_release_host(host);
diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_debugfs.c b/drivers/platform/msm/ipa/ipa_v2/ipa_debugfs.c
index 953469aef7a9..791acf58fed6 100644
--- a/drivers/platform/msm/ipa/ipa_v2/ipa_debugfs.c
+++ b/drivers/platform/msm/ipa/ipa_v2/ipa_debugfs.c
@@ -89,6 +89,7 @@ const char *ipa_event_name[] = {
__stringify(DEL_L2TP_VLAN_MAPPING),
__stringify(IPA_PER_CLIENT_STATS_CONNECT_EVENT),
__stringify(IPA_PER_CLIENT_STATS_DISCONNECT_EVENT),
+ __stringify(WLAN_FWR_SSR_BEFORE_SHUTDOWN),
};
const char *ipa_hdr_l2_type_name[] = {
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c b/drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c
index 8d832ff99b36..5272bb53a2d1 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c
@@ -73,6 +73,7 @@ const char *ipa3_event_name[] = {
__stringify(DEL_L2TP_VLAN_MAPPING),
__stringify(IPA_PER_CLIENT_STATS_CONNECT_EVENT),
__stringify(IPA_PER_CLIENT_STATS_DISCONNECT_EVENT),
+ __stringify(WLAN_FWR_SSR_BEFORE_SHUTDOWN),
};
const char *ipa3_hdr_l2_type_name[] = {
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_rt.c b/drivers/platform/msm/ipa/ipa_v3/ipa_rt.c
index a0f1f54ff919..671320b1181d 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_rt.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_rt.c
@@ -1030,13 +1030,12 @@ static int __ipa_add_rt_rule(enum ipa_ip_type ip, const char *name,
goto error;
}
/*
- * do not allow any rules to be added at end of the "default" routing
- * tables
+ * do not allow any rule to be added at "default" routing
+ * table
*/
if (!strcmp(tbl->name, IPA_DFLT_RT_TBL_NAME) &&
- (tbl->rule_cnt > 0) && (at_rear != 0)) {
- IPAERR_RL("cannot add rule at end of tbl rule_cnt=%d at_rear=%d"
- , tbl->rule_cnt, at_rear);
+ (tbl->rule_cnt > 0)) {
+ IPAERR_RL("cannot add rules to default rt table\n");
goto error;
}
@@ -1242,13 +1241,12 @@ int ipa3_add_rt_rule_after(struct ipa_ioc_add_rt_rule_after *rules)
}
/*
- * do not allow any rules to be added at end of the "default" routing
- * tables
+ * do not allow any rule to be added at "default" routing
+ * table
*/
if (!strcmp(tbl->name, IPA_DFLT_RT_TBL_NAME) &&
- (&entry->link == tbl->head_rt_rule_list.prev)) {
- IPAERR_RL("cannot add rule at end of tbl rule_cnt=%d\n",
- tbl->rule_cnt);
+ (tbl->rule_cnt > 0)) {
+ IPAERR_RL("cannot add rules to default rt table\n");
ret = -EINVAL;
goto bail;
}
@@ -1681,6 +1679,10 @@ static int __ipa_mdfy_rt_rule(struct ipa_rt_rule_mdfy *rtrule)
goto error;
}
+ if (!strcmp(entry->tbl->name, IPA_DFLT_RT_TBL_NAME)) {
+ IPAERR_RL("Default tbl rule cannot be modified\n");
+ return -EINVAL;
+ }
/* Adding check to confirm still
* header entry present in header table or not
*/
diff --git a/drivers/regulator/qpnp-lcdb-regulator.c b/drivers/regulator/qpnp-lcdb-regulator.c
index c4adad97fd91..ef1e5bea84f9 100644
--- a/drivers/regulator/qpnp-lcdb-regulator.c
+++ b/drivers/regulator/qpnp-lcdb-regulator.c
@@ -181,6 +181,7 @@ struct ldo_regulator {
int soft_start_us;
int vreg_ok_dbc_us;
int voltage_mv;
+ int prev_voltage_mv;
};
struct ncp_regulator {
@@ -195,6 +196,7 @@ struct ncp_regulator {
int soft_start_us;
int vreg_ok_dbc_us;
int voltage_mv;
+ int prev_voltage_mv;
};
struct bst_params {
@@ -228,6 +230,7 @@ struct qpnp_lcdb {
bool lcdb_enabled;
bool settings_saved;
bool lcdb_sc_disable;
+ bool voltage_step_ramp;
int sc_count;
ktime_t sc_module_enable_time;
@@ -249,6 +252,7 @@ enum lcdb_module {
LDO,
NCP,
BST,
+ LDO_NCP,
};
enum pfm_hysteresis {
@@ -316,6 +320,12 @@ static u32 ncp_ilim_ma[] = {
.valid = _valid \
} \
+static int qpnp_lcdb_set_voltage_step(struct qpnp_lcdb *lcdb,
+ int voltage_start_mv, u8 type);
+
+static int qpnp_lcdb_set_voltage(struct qpnp_lcdb *lcdb,
+ int voltage_mv, u8 type);
+
static bool is_between(int value, int min, int max)
{
if (value < min || value > max)
@@ -781,9 +791,13 @@ static int qpnp_lcdb_enable_wa(struct qpnp_lcdb *lcdb)
return 0;
}
+#define VOLTAGE_START_MV 4500
+#define VOLTAGE_STEP_MV 500
+
static int qpnp_lcdb_enable(struct qpnp_lcdb *lcdb)
{
int rc = 0, timeout, delay;
+ int voltage_mv = VOLTAGE_START_MV;
u8 val = 0;
if (lcdb->lcdb_enabled || lcdb->lcdb_sc_disable) {
@@ -806,6 +820,22 @@ static int qpnp_lcdb_enable(struct qpnp_lcdb *lcdb)
return rc;
}
+ if (lcdb->voltage_step_ramp) {
+ if (lcdb->ldo.voltage_mv < VOLTAGE_START_MV)
+ voltage_mv = lcdb->ldo.voltage_mv;
+
+ rc = qpnp_lcdb_set_voltage(lcdb, voltage_mv, LDO);
+ if (rc < 0)
+ return rc;
+
+ if (lcdb->ncp.voltage_mv < VOLTAGE_START_MV)
+ voltage_mv = lcdb->ncp.voltage_mv;
+
+ rc = qpnp_lcdb_set_voltage(lcdb, voltage_mv, NCP);
+ if (rc < 0)
+ return rc;
+ }
+
val = MODULE_EN_BIT;
rc = qpnp_lcdb_write(lcdb, lcdb->base + LCDB_ENABLE_CTL1_REG,
&val, 1);
@@ -842,6 +872,17 @@ static int qpnp_lcdb_enable(struct qpnp_lcdb *lcdb)
}
lcdb->lcdb_enabled = true;
+ if (lcdb->voltage_step_ramp) {
+ usleep_range(10000, 11000);
+ rc = qpnp_lcdb_set_voltage_step(lcdb,
+ voltage_mv + VOLTAGE_STEP_MV,
+ LDO_NCP);
+ if (rc < 0) {
+ pr_err("Failed to set LCDB voltage rc=%d\n", rc);
+ return rc;
+ }
+ }
+
pr_debug("lcdb enabled successfully!\n");
return 0;
@@ -1121,6 +1162,56 @@ static int qpnp_lcdb_set_voltage(struct qpnp_lcdb *lcdb,
return rc;
}
+static int qpnp_lcdb_set_voltage_step(struct qpnp_lcdb *lcdb,
+ int voltage_start_mv, u8 type)
+{
+ int i, ldo_voltage, ncp_voltage, voltage, rc = 0;
+
+ for (i = voltage_start_mv; i <= (MAX_VOLTAGE_MV + VOLTAGE_STEP_MV);
+ i += VOLTAGE_STEP_MV) {
+
+ ldo_voltage = (lcdb->ldo.voltage_mv < i) ?
+ lcdb->ldo.voltage_mv : i;
+
+ ncp_voltage = (lcdb->ncp.voltage_mv < i) ?
+ lcdb->ncp.voltage_mv : i;
+ if (type == LDO_NCP) {
+ rc = qpnp_lcdb_set_voltage(lcdb, ldo_voltage, LDO);
+ if (rc < 0)
+ return rc;
+
+ rc = qpnp_lcdb_set_voltage(lcdb, ncp_voltage, NCP);
+ if (rc < 0)
+ return rc;
+
+ pr_debug(" LDO voltage step %d NCP voltage step %d\n",
+ ldo_voltage, ncp_voltage);
+
+ if ((i >= lcdb->ncp.voltage_mv) &&
+ (i >= lcdb->ldo.voltage_mv))
+ break;
+ } else {
+ voltage = (type == LDO) ? ldo_voltage : ncp_voltage;
+ rc = qpnp_lcdb_set_voltage(lcdb, voltage, type);
+ if (rc < 0)
+ return rc;
+
+ pr_debug("%s voltage step %d\n",
+ (type == LDO) ? "LDO" : "NCP", voltage);
+ if ((type == LDO) && (i >= lcdb->ldo.voltage_mv))
+ break;
+
+ if ((type == NCP) && (i >= lcdb->ncp.voltage_mv))
+ break;
+
+ }
+
+ usleep_range(1000, 1100);
+ }
+
+ return rc;
+}
+
static int qpnp_lcdb_get_voltage(struct qpnp_lcdb *lcdb,
u32 *voltage_mv, u8 type)
{
@@ -1229,11 +1320,17 @@ static int qpnp_lcdb_ldo_regulator_set_voltage(struct regulator_dev *rdev,
int rc = 0;
struct qpnp_lcdb *lcdb = rdev_get_drvdata(rdev);
- rc = qpnp_lcdb_set_voltage(lcdb, min_uV / 1000, LDO);
+ lcdb->ldo.voltage_mv = min_uV / 1000;
+ if (lcdb->voltage_step_ramp)
+ rc = qpnp_lcdb_set_voltage_step(lcdb,
+ lcdb->ldo.prev_voltage_mv + VOLTAGE_STEP_MV, LDO);
+ else
+ rc = qpnp_lcdb_set_voltage(lcdb, lcdb->ldo.voltage_mv, LDO);
+
if (rc < 0)
pr_err("Failed to set LDO voltage rc=%c\n", rc);
else
- lcdb->ldo.voltage_mv = min_uV / 1000;
+ lcdb->ldo.prev_voltage_mv = lcdb->ldo.voltage_mv;
return rc;
}
@@ -1302,11 +1399,17 @@ static int qpnp_lcdb_ncp_regulator_set_voltage(struct regulator_dev *rdev,
int rc = 0;
struct qpnp_lcdb *lcdb = rdev_get_drvdata(rdev);
- rc = qpnp_lcdb_set_voltage(lcdb, min_uV / 1000, NCP);
+ lcdb->ncp.voltage_mv = min_uV / 1000;
+ if (lcdb->voltage_step_ramp)
+ rc = qpnp_lcdb_set_voltage_step(lcdb,
+ lcdb->ncp.prev_voltage_mv + VOLTAGE_STEP_MV, NCP);
+ else
+ rc = qpnp_lcdb_set_voltage(lcdb, lcdb->ncp.voltage_mv, NCP);
+
if (rc < 0)
- pr_err("Failed to set LDO voltage rc=%c\n", rc);
+ pr_err("Failed to set NCP voltage rc=%c\n", rc);
else
- lcdb->ncp.voltage_mv = min_uV / 1000;
+ lcdb->ncp.prev_voltage_mv = lcdb->ncp.voltage_mv;
return rc;
}
@@ -1668,6 +1771,8 @@ static int qpnp_lcdb_init_ldo(struct qpnp_lcdb *lcdb)
return rc;
}
+ lcdb->ldo.prev_voltage_mv = lcdb->ldo.voltage_mv;
+
rc = qpnp_lcdb_read(lcdb, lcdb->base +
LCDB_LDO_VREG_OK_CTL_REG, &val, 1);
if (rc < 0) {
@@ -1773,6 +1878,8 @@ static int qpnp_lcdb_init_ncp(struct qpnp_lcdb *lcdb)
return rc;
}
+ lcdb->ncp.prev_voltage_mv = lcdb->ncp.voltage_mv;
+
rc = qpnp_lcdb_read(lcdb, lcdb->base +
LCDB_NCP_VREG_OK_CTL_REG, &val, 1);
if (rc < 0) {
@@ -2027,6 +2134,9 @@ static int qpnp_lcdb_parse_dt(struct qpnp_lcdb *lcdb)
if (lcdb->sc_irq < 0)
pr_debug("sc irq is not defined\n");
+ lcdb->voltage_step_ramp =
+ of_property_read_bool(node, "qcom,voltage-step-ramp");
+
return rc;
}
diff --git a/include/uapi/linux/msm_ipa.h b/include/uapi/linux/msm_ipa.h
index de3f890fd47d..69b4d65658a1 100644
--- a/include/uapi/linux/msm_ipa.h
+++ b/include/uapi/linux/msm_ipa.h
@@ -509,7 +509,13 @@ enum ipa_per_client_stats_event {
IPA_PER_CLIENT_STATS_EVENT_MAX
};
-#define IPA_EVENT_MAX_NUM (IPA_PER_CLIENT_STATS_EVENT_MAX)
+enum ipa_wlan_fw_ssr_event {
+ WLAN_FWR_SSR_BEFORE_SHUTDOWN = IPA_PER_CLIENT_STATS_EVENT_MAX,
+ IPA_WLAN_FW_SSR_EVENT_MAX
+#define IPA_WLAN_FW_SSR_EVENT_MAX IPA_WLAN_FW_SSR_EVENT_MAX
+};
+
+#define IPA_EVENT_MAX_NUM (IPA_WLAN_FW_SSR_EVENT_MAX)
#define IPA_EVENT_MAX ((int)IPA_EVENT_MAX_NUM)
/**
diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c
index fc9c9b0ad5f6..63e40b5275a0 100644
--- a/sound/soc/soc-ops.c
+++ b/sound/soc/soc-ops.c
@@ -379,7 +379,7 @@ int snd_soc_get_volsw_sx(struct snd_kcontrol *kcontrol,
unsigned int rshift = mc->rshift;
int max = mc->max;
int min = mc->min;
- unsigned int mask = (1 << (fls(min + max) - 1)) - 1;
+ unsigned int mask = (1U << (fls(min + max) - 1)) - 1;
unsigned int val;
int ret;
@@ -424,7 +424,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
unsigned int rshift = mc->rshift;
int max = mc->max;
int min = mc->min;
- unsigned int mask = (1 << (fls(min + max) - 1)) - 1;
+ unsigned int mask = (1U << (fls(min + max) - 1)) - 1;
int err = 0;
unsigned int val, val_mask, val2 = 0;