Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f5b592e authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa3: vote turbo when tethering on"

parents a58a70c7 4cadc271
Loading
Loading
Loading
Loading
+21 −12
Original line number Diff line number Diff line
@@ -2169,16 +2169,33 @@ 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 (!ipa_pm_is_used())
		return 0;

	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;
}

/**
@@ -2227,18 +2244,10 @@ int ipa3_wwan_set_modem_perf_profile(int throughput)
{
	struct ipa_rm_perf_profile profile;
	int ret;
	int tether_bridge_handle = 0;

	IPAWANDBG("throughput: %d\n", throughput);

	if (ipa3_ctx->use_ipa_pm) {
		/* 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);
+4 −2
Original line number Diff line number Diff line
/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2019, 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
@@ -191,7 +191,9 @@ 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);
		goto bail;
	}