summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2015-07-31 17:48:53 +0800
committerNitin Garg <nitin.garg@freescale.com>2015-09-17 09:24:09 -0500
commitf61884cdf4b1440766de2fa9424cbbf1f77e3f3c (patch)
treea0f65744da845c6ad078538aa24f25538562a767 /sound
parent11d22bdb6ba70988a3078c7128805169b0c48777 (diff)
MLK-11301: ASoC: cs42xx8: can't set volume 255 in idle mode
Volume 255 corresponding to register value 0, the value 0 is default value. In regcache_sync(), when the cache value is equal to default value, this register will be skipped. So volume 255 isn't set to register successfully. The correct fix is to add software reset in runtime_resume, but cs42xx8 has no software reset, the hardware reset gpio pin is used by all the perpherial device in ARD base board. So need to use another method. In order to fix it, need to cherry-pick two patch from master branch. Which will sync all the registers include the register which cache value equal the default value, And remove regcache_mark_dirty(). Add update value of one register to make the cache_dirty if user press the hardware reset pin on the board, then need to regcache_sync. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/cs42xx8.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/soc/codecs/cs42xx8.c b/sound/soc/codecs/cs42xx8.c
index a2d1772e4702..3707034187ed 100644
--- a/sound/soc/codecs/cs42xx8.c
+++ b/sound/soc/codecs/cs42xx8.c
@@ -377,7 +377,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 */
@@ -619,9 +618,14 @@ static int cs42xx8_runtime_resume(struct device *dev)
goto err_clk;
}
+ regmap_update_bits(cs42xx8->regmap, CS42XX8_PWRCTL,
+ CS42XX8_PWRCTL_PDN_MASK, 1);
/* Make sure hardware reset done */
msleep(5);
+ regmap_update_bits(cs42xx8->regmap, CS42XX8_PWRCTL,
+ CS42XX8_PWRCTL_PDN_MASK, 0);
+
regcache_cache_only(cs42xx8->regmap, false);
ret = regcache_sync(cs42xx8->regmap);
@@ -645,7 +649,6 @@ static int cs42xx8_runtime_suspend(struct device *dev)
{
struct cs42xx8_priv *cs42xx8 = dev_get_drvdata(dev);
- regcache_mark_dirty(cs42xx8->regmap);
regcache_cache_only(cs42xx8->regmap, true);
regulator_bulk_disable(ARRAY_SIZE(cs42xx8->supplies),