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

Commit 3c39a263 authored by Vivek Aknurwar's avatar Vivek Aknurwar
Browse files

clk: qcom: clk-rcg2: Fix QUPV3 DFSR M and N register mode overwrite



Move reading of MN counter mode register earlier to source sel
to fix overwrite of MN counter mode variable.

Change-Id: I5a318112e85c4af83fdbf9bba8770f4ec1b84326
Signed-off-by: default avatarVivek Aknurwar <viveka@codeaurora.org>
parent 377e49df
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2013, 2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013, 2018-2019, The Linux Foundation. All rights reserved.
 */

#include <linux/kernel.h>
@@ -1324,6 +1324,9 @@ static int clk_rcg2_dfs_populate_freq(struct clk_hw *hw, unsigned int l,
	if (cfg & mask)
		f->pre_div = cfg & mask;

	mode = cfg & CFG_MODE_MASK;
	mode >>= CFG_MODE_SHIFT;

	cfg &= CFG_SRC_SEL_MASK;
	cfg >>= CFG_SRC_SEL_SHIFT;

@@ -1338,8 +1341,6 @@ static int clk_rcg2_dfs_populate_freq(struct clk_hw *hw, unsigned int l,
		}
	}

	mode = cfg & CFG_MODE_MASK;
	mode >>= CFG_MODE_SHIFT;
	if (mode) {
		mask = BIT(rcg->mnd_width) - 1;
		regmap_read(rcg->clkr.regmap, rcg->cmd_rcgr + SE_PERF_M_DFSR(l),