alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] ASoC: cs42xx8: Mark chip ID as volatile and remove cache bypass
@ 2016-10-25 15:42 Charles Keepax
  2016-10-25 15:42 ` [PATCH v2 2/3] ASoC: cs42l56: Make ID registers " Charles Keepax
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Charles Keepax @ 2016-10-25 15:42 UTC (permalink / raw)
  To: broonie; +Cc: brian.austin, alsa-devel, lgirdwood, Paul.Handrigan, patches

Rather than manually enabling cache bypass when reading the ID registers
simply remove the default which will cause the first read to go to the
hardware. 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>
Acked-by: Brian Austin <brian.austin@cirrus.com>
---

Changes since v1:
 - Don't mark the ID register as volatile.

Thanks,
Charles

 sound/soc/codecs/cs42xx8.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/sound/soc/codecs/cs42xx8.c b/sound/soc/codecs/cs42xx8.c
index b4d8737..c1785bd 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 */
@@ -498,13 +497,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 +515,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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-10-25 19:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-25 15:42 [PATCH v2 1/3] ASoC: cs42xx8: Mark chip ID as volatile and remove cache bypass Charles Keepax
2016-10-25 15:42 ` [PATCH v2 2/3] ASoC: cs42l56: Make ID registers " Charles Keepax
2016-10-25 19:23   ` Applied "ASoC: cs42l56: Make ID registers volatile and remove cache bypass" to the asoc tree Mark Brown
2016-10-25 15:42 ` [PATCH v2 3/3] ASoC: cs42l73: Remove cache bypass for read of ID registers Charles Keepax
2016-10-25 19:23   ` Applied "ASoC: cs42l73: Remove cache bypass for read of ID registers" to the asoc tree Mark Brown
2016-10-25 19:23 ` Applied "ASoC: cs42xx8: Mark chip ID as volatile and remove cache bypass" " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).