diff options
author | Steve Lee <steve.lee.analog@gmail.com> | 2022-04-20 07:48:59 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-04-21 17:52:56 +0300 |
commit | 397ff024960634962af93e9e2775fc0e4fe7de92 (patch) | |
tree | c4ca50d3852a435e7947434d7128733361971510 /sound/soc/codecs/max98390.c | |
parent | b3598fe6d009b2f2144115dfc381615c8b534aec (diff) | |
download | linux-397ff024960634962af93e9e2775fc0e4fe7de92.tar.xz |
ASoC: max98390: Add reset gpio control
Add reset gpio control to support RESET PIN connected to gpio.
Signed-off-by: Steve Lee <steve.lee.analog@gmail.com>
Acked-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20220420044900.2989-1-steve.lee.analog@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/max98390.c')
-rw-r--r-- | sound/soc/codecs/max98390.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/soc/codecs/max98390.c b/sound/soc/codecs/max98390.c index d1fed8e2bded..2a6b1648c884 100644 --- a/sound/soc/codecs/max98390.c +++ b/sound/soc/codecs/max98390.c @@ -1021,6 +1021,7 @@ static int max98390_i2c_probe(struct i2c_client *i2c) struct max98390_priv *max98390 = NULL; struct i2c_adapter *adapter = i2c->adapter; + struct gpio_desc *reset_gpio; ret = i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE @@ -1072,6 +1073,17 @@ static int max98390_i2c_probe(struct i2c_client *i2c) return ret; } + reset_gpio = devm_gpiod_get_optional(&i2c->dev, + "reset", GPIOD_OUT_HIGH); + + /* Power on device */ + if (reset_gpio) { + usleep_range(1000, 2000); + /* bring out of reset */ + gpiod_set_value_cansleep(reset_gpio, 0); + usleep_range(1000, 2000); + } + /* Check Revision ID */ ret = regmap_read(max98390->regmap, MAX98390_R24FF_REV_ID, ®); |