Commit d46c2127 authored by Sascha Hauer's avatar Sascha Hauer Committed by Mark Brown

ASoC: fsl_micfil: use clear/set bits

Instead regmap_update_bits() use the simpler variants
regmap_[set|clear]_bits() where appropriate.
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Acked-by: default avatarShengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-7-s.hauer@pengutronix.deSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 17f2142b
...@@ -168,19 +168,15 @@ static int fsl_micfil_reset(struct device *dev) ...@@ -168,19 +168,15 @@ static int fsl_micfil_reset(struct device *dev)
struct fsl_micfil *micfil = dev_get_drvdata(dev); struct fsl_micfil *micfil = dev_get_drvdata(dev);
int ret; int ret;
ret = regmap_update_bits(micfil->regmap, ret = regmap_clear_bits(micfil->regmap, REG_MICFIL_CTRL1,
REG_MICFIL_CTRL1, MICFIL_CTRL1_MDIS);
MICFIL_CTRL1_MDIS,
0);
if (ret) { if (ret) {
dev_err(dev, "failed to clear MDIS bit %d\n", ret); dev_err(dev, "failed to clear MDIS bit %d\n", ret);
return ret; return ret;
} }
ret = regmap_update_bits(micfil->regmap, ret = regmap_set_bits(micfil->regmap, REG_MICFIL_CTRL1,
REG_MICFIL_CTRL1, MICFIL_CTRL1_SRES);
MICFIL_CTRL1_SRES,
MICFIL_CTRL1_SRES);
if (ret) { if (ret) {
dev_err(dev, "failed to reset MICFIL: %d\n", ret); dev_err(dev, "failed to reset MICFIL: %d\n", ret);
return ret; return ret;
...@@ -252,9 +248,8 @@ static int fsl_micfil_trigger(struct snd_pcm_substream *substream, int cmd, ...@@ -252,9 +248,8 @@ static int fsl_micfil_trigger(struct snd_pcm_substream *substream, int cmd,
} }
/* Enable the module */ /* Enable the module */
ret = regmap_update_bits(micfil->regmap, REG_MICFIL_CTRL1, ret = regmap_set_bits(micfil->regmap, REG_MICFIL_CTRL1,
MICFIL_CTRL1_PDMIEN, MICFIL_CTRL1_PDMIEN);
MICFIL_CTRL1_PDMIEN);
if (ret) { if (ret) {
dev_err(dev, "failed to enable the module\n"); dev_err(dev, "failed to enable the module\n");
return ret; return ret;
...@@ -265,9 +260,8 @@ static int fsl_micfil_trigger(struct snd_pcm_substream *substream, int cmd, ...@@ -265,9 +260,8 @@ static int fsl_micfil_trigger(struct snd_pcm_substream *substream, int cmd,
case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH: case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
/* Disable the module */ /* Disable the module */
ret = regmap_update_bits(micfil->regmap, REG_MICFIL_CTRL1, ret = regmap_clear_bits(micfil->regmap, REG_MICFIL_CTRL1,
MICFIL_CTRL1_PDMIEN, MICFIL_CTRL1_PDMIEN);
0);
if (ret) { if (ret) {
dev_err(dev, "failed to enable the module\n"); dev_err(dev, "failed to enable the module\n");
return ret; return ret;
...@@ -332,8 +326,8 @@ static int fsl_micfil_hw_params(struct snd_pcm_substream *substream, ...@@ -332,8 +326,8 @@ static int fsl_micfil_hw_params(struct snd_pcm_substream *substream,
int ret; int ret;
/* 1. Disable the module */ /* 1. Disable the module */
ret = regmap_update_bits(micfil->regmap, REG_MICFIL_CTRL1, ret = regmap_clear_bits(micfil->regmap, REG_MICFIL_CTRL1,
MICFIL_CTRL1_PDMIEN, 0); MICFIL_CTRL1_PDMIEN);
if (ret) { if (ret) {
dev_err(dev, "failed to disable the module\n"); dev_err(dev, "failed to disable the module\n");
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment