From: Steve Lee <steve.lee.analog@gmail.com> To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ryans.lee@maximintegrated.com, Steve Lee <steve.lee.analog@gmail.com> Subject: [V2 1/2] ASoC: max98390: Add reset gpio control Date: Fri, 11 Mar 2022 22:29:05 +0900 [thread overview] Message-ID: <20220311132906.32292-1-steve.lee.analog@gmail.com> (raw) Add reset gpio control to support RESET PIN connected to gpio. Signed-off-by: Steve Lee <steve.lee.analog@gmail.com> --- sound/soc/codecs/max98390.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sound/soc/codecs/max98390.c b/sound/soc/codecs/max98390.c index b392567c2b3e..5c6162701667 100644 --- a/sound/soc/codecs/max98390.c +++ b/sound/soc/codecs/max98390.c @@ -1022,6 +1022,7 @@ static int max98390_i2c_probe(struct i2c_client *i2c, struct max98390_priv *max98390 = NULL; struct i2c_adapter *adapter = to_i2c_adapter(i2c->dev.parent); + struct gpio_desc *reset_gpio; ret = i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE @@ -1073,6 +1074,17 @@ static int max98390_i2c_probe(struct i2c_client *i2c, return ret; } + reset_gpio = devm_gpiod_get_optional(&i2c->dev, + "maxim,reset-gpios", GPIOD_OUT_LOW); + + /* Power on device */ + if (reset_gpio) { + usleep_range(1000, 2000); + /* bring out of reset */ + gpiod_set_value_cansleep(reset_gpio, 1); + usleep_range(1000, 2000); + } + /* Check Revision ID */ ret = regmap_read(max98390->regmap, MAX98390_R24FF_REV_ID, ®); -- 2.17.1
WARNING: multiple messages have this Message-ID (diff)
From: Steve Lee <steve.lee.analog@gmail.com> To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org Cc: Steve Lee <steve.lee.analog@gmail.com>, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, ryans.lee@maximintegrated.com Subject: [V2 1/2] ASoC: max98390: Add reset gpio control Date: Fri, 11 Mar 2022 22:29:05 +0900 [thread overview] Message-ID: <20220311132906.32292-1-steve.lee.analog@gmail.com> (raw) Add reset gpio control to support RESET PIN connected to gpio. Signed-off-by: Steve Lee <steve.lee.analog@gmail.com> --- sound/soc/codecs/max98390.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sound/soc/codecs/max98390.c b/sound/soc/codecs/max98390.c index b392567c2b3e..5c6162701667 100644 --- a/sound/soc/codecs/max98390.c +++ b/sound/soc/codecs/max98390.c @@ -1022,6 +1022,7 @@ static int max98390_i2c_probe(struct i2c_client *i2c, struct max98390_priv *max98390 = NULL; struct i2c_adapter *adapter = to_i2c_adapter(i2c->dev.parent); + struct gpio_desc *reset_gpio; ret = i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE @@ -1073,6 +1074,17 @@ static int max98390_i2c_probe(struct i2c_client *i2c, return ret; } + reset_gpio = devm_gpiod_get_optional(&i2c->dev, + "maxim,reset-gpios", GPIOD_OUT_LOW); + + /* Power on device */ + if (reset_gpio) { + usleep_range(1000, 2000); + /* bring out of reset */ + gpiod_set_value_cansleep(reset_gpio, 1); + usleep_range(1000, 2000); + } + /* Check Revision ID */ ret = regmap_read(max98390->regmap, MAX98390_R24FF_REV_ID, ®); -- 2.17.1
next reply other threads:[~2022-03-11 13:29 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-03-11 13:29 Steve Lee [this message] 2022-03-11 13:29 ` [V2 1/2] ASoC: max98390: Add reset gpio control Steve Lee 2022-03-11 13:29 ` [V2 2/2] ASoC: dt-bindings: max98390: add reset gpio bindings Steve Lee 2022-03-11 13:29 ` Steve Lee 2022-03-11 15:51 ` Rob Herring 2022-03-11 15:51 ` Rob Herring 2022-03-11 16:33 ` [PATCH v2 1/2] ASoC: max98390: Add reset gpio control Mark Brown 2022-03-11 16:33 ` Mark Brown 2022-03-11 22:24 ` Lee Steve 2022-03-11 22:24 ` Lee Steve 2022-04-21 17:24 ` [V2 " Mark Brown 2022-04-21 17:24 ` Mark Brown
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220311132906.32292-1-steve.lee.analog@gmail.com \ --to=steve.lee.analog@gmail.com \ --cc=alsa-devel@alsa-project.org \ --cc=broonie@kernel.org \ --cc=devicetree@vger.kernel.org \ --cc=lgirdwood@gmail.com \ --cc=linux-kernel@vger.kernel.org \ --cc=robh+dt@kernel.org \ --cc=ryans.lee@maximintegrated.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.