summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/ak4458.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/ak4458.c')
-rw-r--r--sound/soc/codecs/ak4458.c35
1 files changed, 9 insertions, 26 deletions
diff --git a/sound/soc/codecs/ak4458.c b/sound/soc/codecs/ak4458.c
index 73cf482f104f..57cf601d3df3 100644
--- a/sound/soc/codecs/ak4458.c
+++ b/sound/soc/codecs/ak4458.c
@@ -10,7 +10,6 @@
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/of_gpio.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <linux/reset.h>
@@ -46,7 +45,6 @@ struct ak4458_priv {
const struct ak4458_drvdata *drvdata;
struct device *dev;
struct regmap *regmap;
- struct gpio_desc *reset_gpiod;
struct reset_control *reset;
struct gpio_desc *mute_gpiod;
int digfil; /* SSLOW, SD, SLOW bits */
@@ -588,13 +586,9 @@ static const struct snd_pcm_hw_constraint_list ak4458_rate_constraints = {
static int ak4458_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- int ret;
-
- ret = snd_pcm_hw_constraint_list(substream->runtime, 0,
- SNDRV_PCM_HW_PARAM_RATE,
- &ak4458_rate_constraints);
-
- return ret;
+ return snd_pcm_hw_constraint_list(substream->runtime, 0,
+ SNDRV_PCM_HW_PARAM_RATE,
+ &ak4458_rate_constraints);
}
static const struct snd_soc_dai_ops ak4458_dai_ops = {
@@ -632,10 +626,7 @@ static struct snd_soc_dai_driver ak4497_dai = {
static void ak4458_reset(struct ak4458_priv *ak4458, bool active)
{
- if (ak4458->reset_gpiod) {
- gpiod_set_value_cansleep(ak4458->reset_gpiod, active);
- usleep_range(1000, 2000);
- } else if (!IS_ERR_OR_NULL(ak4458->reset)) {
+ if (!IS_ERR_OR_NULL(ak4458->reset)) {
if (active)
reset_control_assert(ak4458->reset);
else
@@ -644,8 +635,7 @@ static void ak4458_reset(struct ak4458_priv *ak4458, bool active)
}
}
-#ifdef CONFIG_PM
-static int __maybe_unused ak4458_runtime_suspend(struct device *dev)
+static int ak4458_runtime_suspend(struct device *dev)
{
struct ak4458_priv *ak4458 = dev_get_drvdata(dev);
@@ -661,7 +651,7 @@ static int __maybe_unused ak4458_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused ak4458_runtime_resume(struct device *dev)
+static int ak4458_runtime_resume(struct device *dev)
{
struct ak4458_priv *ak4458 = dev_get_drvdata(dev);
int ret;
@@ -683,7 +673,6 @@ static int __maybe_unused ak4458_runtime_resume(struct device *dev)
return regcache_sync(ak4458->regmap);
}
-#endif /* CONFIG_PM */
static const struct snd_soc_component_driver soc_codec_dev_ak4458 = {
.controls = ak4458_snd_controls,
@@ -732,9 +721,8 @@ static const struct ak4458_drvdata ak4497_drvdata = {
};
static const struct dev_pm_ops ak4458_pm = {
- SET_RUNTIME_PM_OPS(ak4458_runtime_suspend, ak4458_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
- pm_runtime_force_resume)
+ RUNTIME_PM_OPS(ak4458_runtime_suspend, ak4458_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
};
static int ak4458_i2c_probe(struct i2c_client *i2c)
@@ -759,11 +747,6 @@ static int ak4458_i2c_probe(struct i2c_client *i2c)
if (IS_ERR(ak4458->reset))
return PTR_ERR(ak4458->reset);
- ak4458->reset_gpiod = devm_gpiod_get_optional(ak4458->dev, "reset",
- GPIOD_OUT_LOW);
- if (IS_ERR(ak4458->reset_gpiod))
- return PTR_ERR(ak4458->reset_gpiod);
-
ak4458->mute_gpiod = devm_gpiod_get_optional(ak4458->dev, "mute",
GPIOD_OUT_LOW);
if (IS_ERR(ak4458->mute_gpiod))
@@ -815,7 +798,7 @@ MODULE_DEVICE_TABLE(of, ak4458_of_match);
static struct i2c_driver ak4458_i2c_driver = {
.driver = {
.name = "ak4458",
- .pm = &ak4458_pm,
+ .pm = pm_ptr(&ak4458_pm),
.of_match_table = ak4458_of_match,
},
.probe = ak4458_i2c_probe,