Merge "ASoC: lpass-cdc: Update clock sequence to clear Fs counter" into audio-kernel.lnx.5.10
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
8ff4c4b7e2
@@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/of_platform.h>
|
#include <linux/of_platform.h>
|
||||||
@@ -402,14 +402,15 @@ void lpass_cdc_clk_rsc_fs_gen_request(struct device *dev, bool enable)
|
|||||||
mutex_lock(&priv->fs_gen_lock);
|
mutex_lock(&priv->fs_gen_lock);
|
||||||
if (enable) {
|
if (enable) {
|
||||||
if (priv->reg_seq_en_cnt++ == 0) {
|
if (priv->reg_seq_en_cnt++ == 0) {
|
||||||
for (i = 0; i < (priv->num_fs_reg * 2); i += 2) {
|
for (i = 0; i < (priv->num_fs_reg * 3); i += 3) {
|
||||||
dev_dbg(priv->dev, "%s: Register: %d, value: %d\n",
|
dev_dbg(priv->dev, "%s: Register: %d, mask: %d, value: %d\n",
|
||||||
__func__, priv->fs_gen_seq[i],
|
__func__, priv->fs_gen_seq[i],
|
||||||
priv->fs_gen_seq[i + 1]);
|
priv->fs_gen_seq[i + 1],
|
||||||
|
priv->fs_gen_seq[i + 2]);
|
||||||
regmap_update_bits(regmap,
|
regmap_update_bits(regmap,
|
||||||
priv->fs_gen_seq[i],
|
priv->fs_gen_seq[i],
|
||||||
priv->fs_gen_seq[i + 1],
|
priv->fs_gen_seq[i + 1],
|
||||||
priv->fs_gen_seq[i + 1]);
|
priv->fs_gen_seq[i + 2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -421,8 +422,8 @@ void lpass_cdc_clk_rsc_fs_gen_request(struct device *dev, bool enable)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (--priv->reg_seq_en_cnt == 0) {
|
if (--priv->reg_seq_en_cnt == 0) {
|
||||||
for (i = ((priv->num_fs_reg - 1) * 2); i >= 0; i -= 2) {
|
for (i = ((priv->num_fs_reg - 1) * 3); i >= 0; i -= 3) {
|
||||||
dev_dbg(priv->dev, "%s: Register: %d, value: %d\n",
|
dev_dbg(priv->dev, "%s: Register: %d, mask: %d\n",
|
||||||
__func__, priv->fs_gen_seq[i],
|
__func__, priv->fs_gen_seq[i],
|
||||||
priv->fs_gen_seq[i + 1]);
|
priv->fs_gen_seq[i + 1]);
|
||||||
regmap_update_bits(regmap, priv->fs_gen_seq[i],
|
regmap_update_bits(regmap, priv->fs_gen_seq[i],
|
||||||
@@ -545,7 +546,7 @@ static int lpass_cdc_clk_rsc_probe(struct platform_device *pdev)
|
|||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
priv->num_fs_reg = fs_gen_size/(2 * sizeof(u32));
|
priv->num_fs_reg = fs_gen_size/(3 * sizeof(u32));
|
||||||
priv->fs_gen_seq = devm_kzalloc(&pdev->dev, fs_gen_size, GFP_KERNEL);
|
priv->fs_gen_seq = devm_kzalloc(&pdev->dev, fs_gen_size, GFP_KERNEL);
|
||||||
if (!priv->fs_gen_seq) {
|
if (!priv->fs_gen_seq) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
@@ -556,7 +557,7 @@ static int lpass_cdc_clk_rsc_probe(struct platform_device *pdev)
|
|||||||
ret = of_property_read_u32_array(pdev->dev.of_node,
|
ret = of_property_read_u32_array(pdev->dev.of_node,
|
||||||
"qcom,fs-gen-sequence",
|
"qcom,fs-gen-sequence",
|
||||||
priv->fs_gen_seq,
|
priv->fs_gen_seq,
|
||||||
priv->num_fs_reg * 2);
|
priv->num_fs_reg * 3);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(&pdev->dev, "%s: unable to parse fs-gen-sequence, ret = %d\n",
|
dev_err(&pdev->dev, "%s: unable to parse fs-gen-sequence, ret = %d\n",
|
||||||
__func__, ret);
|
__func__, ret);
|
||||||
|
Reference in New Issue
Block a user