All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: broonie@kernel.org
Cc: brian.austin@cirrus.com, alsa-devel@alsa-project.org,
	lgirdwood@gmail.com, Paul.Handrigan@cirrus.com,
	patches@opensource.wolfsonmicro.com
Subject: [PATCH 1/6] ASoC: cs42xx8: Mark chip ID as volatile and remove cache bypass
Date: Mon, 24 Oct 2016 10:55:44 +0100	[thread overview]
Message-ID: <1477302949-28049-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)

Rather than manually enabling cache bypass when reading the ID registers
simply mark them as volatile. The old code worked this is simply the
more standard way to implement this. There is a comment included in the
code that claims the chip ID register also contains the right input
volume, however this is clearly not the case from the rest of the
driver. Further investigation reveals exactly the same comment in the
wm8962 driver, where this is the case, so this is almost certainly a
copy and paste error from when the driver was created.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
 sound/soc/codecs/cs42xx8.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/sound/soc/codecs/cs42xx8.c b/sound/soc/codecs/cs42xx8.c
index b4d8737..1d50748 100644
--- a/sound/soc/codecs/cs42xx8.c
+++ b/sound/soc/codecs/cs42xx8.c
@@ -321,7 +321,6 @@ static struct snd_soc_dai_driver cs42xx8_dai = {
 };
 
 static const struct reg_default cs42xx8_reg[] = {
-	{ 0x01, 0x01 },   /* Chip I.D. and Revision Register */
 	{ 0x02, 0x00 },   /* Power Control */
 	{ 0x03, 0xF0 },   /* Functional Mode */
 	{ 0x04, 0x46 },   /* Interface Formats */
@@ -352,6 +351,7 @@ static const struct reg_default cs42xx8_reg[] = {
 static bool cs42xx8_volatile_register(struct device *dev, unsigned int reg)
 {
 	switch (reg) {
+	case CS42XX8_CHIPID:
 	case CS42XX8_STATUS:
 		return true;
 	default:
@@ -498,13 +498,6 @@ int cs42xx8_probe(struct device *dev, struct regmap *regmap)
 	/* Make sure hardware reset done */
 	msleep(5);
 
-	/*
-	 * We haven't marked the chip revision as volatile due to
-	 * sharing a register with the right input volume; explicitly
-	 * bypass the cache to read it.
-	 */
-	regcache_cache_bypass(cs42xx8->regmap, true);
-
 	/* Validate the chip ID */
 	ret = regmap_read(cs42xx8->regmap, CS42XX8_CHIPID, &val);
 	if (ret < 0) {
@@ -523,8 +516,6 @@ int cs42xx8_probe(struct device *dev, struct regmap *regmap)
 	dev_info(dev, "found device, revision %X\n",
 			val & CS42XX8_CHIPID_REV_ID_MASK);
 
-	regcache_cache_bypass(cs42xx8->regmap, false);
-
 	cs42xx8_dai.name = cs42xx8->drvdata->name;
 
 	/* Each adc supports stereo input */
-- 
2.1.4

             reply	other threads:[~2016-10-24  9:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24  9:55 Charles Keepax [this message]
2016-10-24  9:55 ` [PATCH 2/6] ASoC: cs42l73: Make ID registers volatile and remove cache bypass Charles Keepax
2016-10-24  9:55 ` [PATCH 3/6] ASoC: cs42l56: " Charles Keepax
2016-10-24  9:55 ` [PATCH 4/6] ASoC: cs4265: Mark chip ID register as volatile Charles Keepax
2016-10-24  9:55 ` [PATCH 5/6] ASoC: cs42l52: " Charles Keepax
2016-10-24  9:55 ` [PATCH 6/6] ASoC: cs53l30: Mark chip ID registers " Charles Keepax
2016-10-24 12:55 ` [PATCH 1/6] ASoC: cs42xx8: Mark chip ID as volatile and remove cache bypass Brian Austin
2016-10-24 15:33 ` Mark Brown
2016-10-25 15:16   ` Charles Keepax

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=1477302949-28049-1-git-send-email-ckeepax@opensource.wolfsonmicro.com \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=Paul.Handrigan@cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=brian.austin@cirrus.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=patches@opensource.wolfsonmicro.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.