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

Commit 1ae0e8cb authored by Pushkar Joshi's avatar Pushkar Joshi Committed by Gerrit - the friendly Code Review server
Browse files

clk: qcom: clock-rpm: Add interface to vote for BIMC clock



On some targets, Linux needs to make an explicit vote for the BIMC clock
before registering all the rpm controlled clocks. Add an interface to do
the same.

Change-Id: Ic207575eea09da1e2236182f81999adcff5fa424
Signed-off-by: default avatarPushkar Joshi <pushkarj@codeaurora.org>
parent 50866b7b
Loading
Loading
Loading
Loading
+23 −1
Original line number Diff line number Diff line
/* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2010-2015, 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
@@ -299,6 +299,28 @@ int enable_rpm_scaling(void)
	return 0;
}

int vote_bimc(struct rpm_clk *r, uint32_t value)
{
	int rc;

	struct msm_rpm_kvp kvp = {
		.key = r->rpm_key,
		.data = (void *)&value,
		.length = sizeof(value),
	};

	rc = msm_rpm_send_message_noirq(MSM_RPM_CTX_ACTIVE_SET,
			r->rpm_res_type, r->rpmrs_data->ctx_active_id,
			&kvp, 1);
	if (rc < 0) {
		if (rc != -EPROBE_DEFER)
			WARN(1, "BIMC vote not sent!\n");
		return rc;
	}

	return rc;
}

struct clk_ops clk_ops_rpm = {
	.prepare = rpm_clk_prepare,
	.unprepare = rpm_clk_unprepare,
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2010-2015, 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
@@ -54,6 +54,8 @@ static inline struct rpm_clk *to_rpm_clk(struct clk *clk)
 */
int enable_rpm_scaling(void);

int vote_bimc(struct rpm_clk *r, uint32_t value);

extern struct clk_rpmrs_data clk_rpmrs_data_smd;

#define __DEFINE_CLK_RPM(name, active, type, r_id, stat_id, dep, key, \