aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2017-05-31 11:51:13 -0400
committerMark Brown <broonie@kernel.org>2017-06-06 14:54:18 -0400
commitdc43f46a9b6988a40d4e11d05b8107d4546c61b9 (patch)
treeb57f3f0344d5e1b62f4ac2fb6e78f7d6cedc9c6d
parent2ea659a9ef488125eb46da6eb571de5eae5c43f6 (diff)
ASoC: cs35l35: Add additional delay for reset
Very fast systems may violate the minimum constraints for time the reset line needs to remain low, or communicate with the device too soon after releasing the reset. Fix this by adding some delays in to allow the chip to properly reset, also factor out the reset into a function as it is likely it will be re-used in later additions to the driver. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/cs35l35.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sound/soc/codecs/cs35l35.c b/sound/soc/codecs/cs35l35.c
index f8aef5869b03..5ff12e4116e5 100644
--- a/sound/soc/codecs/cs35l35.c
+++ b/sound/soc/codecs/cs35l35.c
@@ -162,6 +162,14 @@ static bool cs35l35_precious_register(struct device *dev, unsigned int reg)
162 } 162 }
163} 163}
164 164
165static void cs35l35_reset(struct cs35l35_private *cs35l35)
166{
167 gpiod_set_value_cansleep(cs35l35->reset_gpio, 0);
168 usleep_range(2000, 2100);
169 gpiod_set_value_cansleep(cs35l35->reset_gpio, 1);
170 usleep_range(1000, 1100);
171}
172
165static int cs35l35_wait_for_pdn(struct cs35l35_private *cs35l35) 173static int cs35l35_wait_for_pdn(struct cs35l35_private *cs35l35)
166{ 174{
167 int ret; 175 int ret;
@@ -1454,7 +1462,7 @@ static int cs35l35_i2c_probe(struct i2c_client *i2c_client,
1454 } 1462 }
1455 } 1463 }
1456 1464
1457 gpiod_set_value_cansleep(cs35l35->reset_gpio, 1); 1465 cs35l35_reset(cs35l35);
1458 1466
1459 init_completion(&cs35l35->pdn_done); 1467 init_completion(&cs35l35->pdn_done);
1460 1468