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

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

Merge "msm: ipa4: Add IPA clock-gated case in IPA PM"

parents f6017fde 2e4aa5cc
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3659,6 +3659,9 @@ void ipa3_disable_clks(void)

	ipa3_ctx->ctrl->ipa3_disable_clks();

	if (ipa3_ctx->use_ipa_pm)
		ipa_pm_set_clock_index(0);

	if (msm_bus_scale_client_update_request(ipa3_ctx->ipa_bus_hdl, 0))
		WARN(1, "bus scaling failed");
	atomic_set(&ipa3_ctx->ipa_clk_vote, 0);
+14 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 */

#include <linux/debugfs.h>
@@ -345,6 +345,11 @@ static int do_clk_scaling(void)
	int new_th_idx = 1;
	struct clk_scaling_db *clk_scaling;

	if (atomic_read(&ipa3_ctx->ipa_clk_vote) == 0) {
		IPA_PM_DBG("IPA clock is gated\n");
		return 0;
	}

	clk_scaling = &ipa_pm_ctx->clk_scaling;

	mutex_lock(&ipa_pm_ctx->client_mutex);
@@ -1271,6 +1276,14 @@ int ipa_pm_set_throughput(u32 hdl, int throughput)
	return 0;
}

void ipa_pm_set_clock_index(int index)
{
	if (ipa_pm_ctx && index >= 0)
		ipa_pm_ctx->clk_scaling.cur_vote = index;

	IPA_PM_DBG("Setting pm clock vote to %d\n", index);
}

/**
 * ipa_pm_stat() - print PM stat
 * @buf: [in] The user buff used to print
+2 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 */

#ifndef _IPA_PM_H_
@@ -100,6 +100,7 @@ int ipa_pm_handle_suspend(u32 pipe_bitmask);
int ipa_pm_deactivate_all_deferred(void);
int ipa_pm_stat(char *buf, int size);
int ipa_pm_exceptions_stat(char *buf, int size);
void ipa_pm_set_clock_index(int index);

#else