msm: ipa3: vote turbo when tethering on

Change the modem vote for pm_client as
the highest when usb-tethering is on and vote
back to low power mode when usb-tethering off.

Change-Id: I3e51dc34cea5c97a7f901d9981f908e35b8b0fb2
Signed-off-by: Arnav Sharma <arnav_s@codeaurora.org>
This commit is contained in:
Skylar Chang 2019-06-10 18:06:04 -07:00 committed by Arnav Sharma
parent ca68ccb325
commit e9ddca7066
2 changed files with 25 additions and 13 deletions

View File

@ -2105,13 +2105,30 @@ static int rmnet_ipa_send_coalesce_notification(uint8_t qmap_id,
int ipa3_wwan_set_modem_state(struct wan_ioctl_notify_wan_state *state)
{
uint32_t bw_mbps = 0;
int ret = 0;
if (!state)
return -EINVAL;
if (state->up)
return ipa_pm_activate_sync(rmnet_ipa3_ctx->q6_teth_pm_hdl);
else
return ipa_pm_deactivate_sync(rmnet_ipa3_ctx->q6_teth_pm_hdl);
if (state->up) {
bw_mbps = 5200;
ret = ipa3_vote_for_bus_bw(&bw_mbps);
if (ret) {
IPAERR("Failed to vote for bus BW (%u)\n", bw_mbps);
return ret;
}
ret = ipa_pm_activate_sync(rmnet_ipa3_ctx->q6_teth_pm_hdl);
} else {
bw_mbps = 0;
ret = ipa3_vote_for_bus_bw(&bw_mbps);
if (ret) {
IPAERR("Failed to vote for bus BW (%u)\n", bw_mbps);
return ret;
}
ret = ipa_pm_deactivate_sync(rmnet_ipa3_ctx->q6_teth_pm_hdl);
}
return ret;
}
/**
@ -2159,16 +2176,8 @@ static void ipa3_q6_deregister_pm(void)
int ipa3_wwan_set_modem_perf_profile(int throughput)
{
int ret;
int tether_bridge_handle = 0;
IPAWANDBG("throughput: %d\n", throughput);
/* query rmnet-tethering handle */
tether_bridge_handle = ipa3_teth_bridge_get_pm_hdl();
if (tether_bridge_handle > 0) {
/* only update with valid handle*/
ret = ipa_pm_set_throughput(tether_bridge_handle,
throughput);
}
/* for TETH MODEM on softap/rndis */
ret = ipa_pm_set_throughput(rmnet_ipa3_ctx->q6_teth_pm_hdl,
throughput);

View File

@ -178,8 +178,11 @@ int ipa3_teth_bridge_connect(struct teth_bridge_connect_params *connect_params)
TETH_ERR("fail to register with PM %d\n", res);
return res;
}
/* vote for turbo */
res = ipa_pm_set_throughput(ipa3_teth_ctx->modem_pm_hdl,
5200);
res = ipa_pm_activate_sync(ipa3_teth_ctx->modem_pm_hdl);
TETH_DBG_FUNC_EXIT();
return res;
}