From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: <broonie@kernel.org>
Cc: pierre-louis.bossart@linux.intel.com,
alsa-devel@alsa-project.org, patches@opensource.cirrus.com,
lgirdwood@gmail.com, james.schulman@cirrus.com,
david.rhodes@cirrus.com
Subject: [PATCH 06/10] ASoC: cs35l35: Correct errata handling
Date: Mon, 10 May 2021 14:13:53 +0100 [thread overview]
Message-ID: <20210510131357.17170-7-ckeepax@opensource.cirrus.com> (raw)
In-Reply-To: <20210510131357.17170-1-ckeepax@opensource.cirrus.com>
Currently the check of errata_chk will always evaluate to false since
the values tested don't come under the mask used. A shift of the field
is missing, add this. Also there is an error in the values tested, they
don't match the comment and the value 0x3 is not a valid value for the
field in question. Update the value to match the comment.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
sound/soc/codecs/cs35l35.c | 4 ++--
sound/soc/codecs/cs35l35.h | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/cs35l35.c b/sound/soc/codecs/cs35l35.c
index 554b32f388d9a..a4309312e84f3 100644
--- a/sound/soc/codecs/cs35l35.c
+++ b/sound/soc/codecs/cs35l35.c
@@ -496,10 +496,10 @@ static int cs35l35_hw_params(struct snd_pcm_substream *substream,
* the Class H algorithm does not enable weak-drive operation for
* nonzero values of CH_WKFET_DELAY if SP_RATE = 01 or 10
*/
- errata_chk = clk_ctl & CS35L35_SP_RATE_MASK;
+ errata_chk = (clk_ctl & CS35L35_SP_RATE_MASK) >> CS35L35_SP_RATE_SHIFT;
if (classh->classh_wk_fet_disable == 0x00 &&
- (errata_chk == 0x01 || errata_chk == 0x03)) {
+ (errata_chk == 0x01 || errata_chk == 0x02)) {
ret = regmap_update_bits(cs35l35->regmap,
CS35L35_CLASS_H_FET_DRIVE_CTL,
CS35L35_CH_WKFET_DEL_MASK,
diff --git a/sound/soc/codecs/cs35l35.h b/sound/soc/codecs/cs35l35.h
index ffb154cd962c2..2117dcb08c467 100644
--- a/sound/soc/codecs/cs35l35.h
+++ b/sound/soc/codecs/cs35l35.h
@@ -168,6 +168,7 @@
#define CS35L35_SP_SCLKS_48FS 0x0B
#define CS35L35_SP_SCLKS_64FS 0x0F
#define CS35L35_SP_RATE_MASK 0xC0
+#define CS35L35_SP_RATE_SHIFT 6
#define CS35L35_PDN_BST_MASK 0x06
#define CS35L35_PDN_BST_FETON_SHIFT 1
--
2.11.0
next prev parent reply other threads:[~2021-05-10 13:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-10 13:13 [PATCH 00/10] Tidy up device ID reading on legacy Cirrus parts Charles Keepax
2021-05-10 13:13 ` [PATCH 01/10] ASoC: cirrus: Add helper function for reading the device ID Charles Keepax
2021-05-10 13:13 ` [PATCH 02/10] ASoC: cs35l32: Minor error paths fixups Charles Keepax
2021-05-10 13:13 ` [PATCH 03/10] ASoC: cs35l33: " Charles Keepax
2021-05-10 13:13 ` [PATCH 04/10] ASoC: cs35l34: " Charles Keepax
2021-05-10 13:13 ` [PATCH 05/10] ASoC: cs35l35: " Charles Keepax
2021-05-10 13:13 ` Charles Keepax [this message]
2021-05-10 13:13 ` [PATCH 07/10] ASoC: cs42l42: " Charles Keepax
2021-05-10 13:13 ` [PATCH 08/10] ASoC: cs42l73: " Charles Keepax
2021-05-10 13:13 ` [PATCH 09/10] ASoC: cs43130: " Charles Keepax
2021-05-10 13:13 ` [PATCH 10/10] ASoC: cs53l30: " Charles Keepax
2021-05-10 14:59 ` [PATCH 00/10] Tidy up device ID reading on legacy Cirrus parts Pierre-Louis Bossart
2021-05-11 9:12 ` Charles Keepax
2021-05-11 8:26 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210510131357.17170-7-ckeepax@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=david.rhodes@cirrus.com \
--cc=james.schulman@cirrus.com \
--cc=lgirdwood@gmail.com \
--cc=patches@opensource.cirrus.com \
--cc=pierre-louis.bossart@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.