提交 dc43f46a 编写于 作者: C Charles Keepax 提交者: Mark Brown

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: NCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: NPaul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 2ea659a9
...@@ -162,6 +162,14 @@ static bool cs35l35_precious_register(struct device *dev, unsigned int reg) ...@@ -162,6 +162,14 @@ static bool cs35l35_precious_register(struct device *dev, unsigned int reg)
} }
} }
static void cs35l35_reset(struct cs35l35_private *cs35l35)
{
gpiod_set_value_cansleep(cs35l35->reset_gpio, 0);
usleep_range(2000, 2100);
gpiod_set_value_cansleep(cs35l35->reset_gpio, 1);
usleep_range(1000, 1100);
}
static int cs35l35_wait_for_pdn(struct cs35l35_private *cs35l35) static int cs35l35_wait_for_pdn(struct cs35l35_private *cs35l35)
{ {
int ret; int ret;
...@@ -1454,7 +1462,7 @@ static int cs35l35_i2c_probe(struct i2c_client *i2c_client, ...@@ -1454,7 +1462,7 @@ static int cs35l35_i2c_probe(struct i2c_client *i2c_client,
} }
} }
gpiod_set_value_cansleep(cs35l35->reset_gpio, 1); cs35l35_reset(cs35l35);
init_completion(&cs35l35->pdn_done); init_completion(&cs35l35->pdn_done);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册