Skip to content
Snippets Groups Projects
Commit ed37733f authored by Viorel Suman's avatar Viorel Suman Committed by Leonard Crestez
Browse files

ASoC: ak5558: remove redundand includes


Remove redundant includes keeping the code as close as possible
to upstream version.

Fixes commit 6d8b9d13605c ("MLK-19118-3: ASoC: AK5558: add regulators for
ak5558")
Signed-off-by: default avatarViorel Suman <viorel.suman@nxp.com>
parent 7181a966
No related branches found
No related tags found
No related merge requests found
...@@ -19,18 +19,10 @@ ...@@ -19,18 +19,10 @@
#include <sound/soc.h> #include <sound/soc.h>
#include <sound/soc-dapm.h> #include <sound/soc-dapm.h>
#include <sound/tlv.h> #include <sound/tlv.h>
#include <linux/of_gpio.h>
#include <linux/regmap.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include "ak5558.h" #include "ak5558.h"
#define AK5558_SLAVE_CKS_AUTO
/* enable debug */
/* #define AK5558_DEBUG */
#define AK5558_NUM_SUPPLIES 2 #define AK5558_NUM_SUPPLIES 2
static const char *ak5558_supply_names[AK5558_NUM_SUPPLIES] = { static const char *ak5558_supply_names[AK5558_NUM_SUPPLIES] = {
"DVDD", "DVDD",
...@@ -146,16 +138,12 @@ static int ak5558_hw_params(struct snd_pcm_substream *substream, ...@@ -146,16 +138,12 @@ static int ak5558_hw_params(struct snd_pcm_substream *substream,
u8 bits; u8 bits;
int pcm_width = max(params_physical_width(params), ak5558->slot_width); int pcm_width = max(params_physical_width(params), ak5558->slot_width);
/* set master/slave audio interface */
bits = snd_soc_component_read32(component, AK5558_02_CONTROL1);
bits &= ~AK5558_BITS;
switch (pcm_width) { switch (pcm_width) {
case 16: case 16:
bits |= AK5558_DIF_24BIT_MODE; bits = AK5558_DIF_24BIT_MODE;
break; break;
case 32: case 32:
bits |= AK5558_DIF_32BIT_MODE; bits = AK5558_DIF_32BIT_MODE;
break; break;
default: default:
return -EINVAL; return -EINVAL;
...@@ -184,18 +172,15 @@ static int ak5558_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -184,18 +172,15 @@ static int ak5558_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
} }
/* set master/slave audio interface */ /* set master/slave audio interface */
format = snd_soc_component_read32(component, AK5558_02_CONTROL1);
format &= ~AK5558_DIF;
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_I2S: case SND_SOC_DAIFMT_I2S:
format |= AK5558_DIF_I2S_MODE; format = AK5558_DIF_I2S_MODE;
break; break;
case SND_SOC_DAIFMT_LEFT_J: case SND_SOC_DAIFMT_LEFT_J:
format |= AK5558_DIF_MSB_MODE; format = AK5558_DIF_MSB_MODE;
break; break;
case SND_SOC_DAIFMT_DSP_B: case SND_SOC_DAIFMT_DSP_B:
format |= AK5558_DIF_MSB_MODE; format = AK5558_DIF_MSB_MODE;
break; break;
default: default:
return -EINVAL; return -EINVAL;
...@@ -262,7 +247,7 @@ static int ak5558_startup(struct snd_pcm_substream *substream, ...@@ -262,7 +247,7 @@ static int ak5558_startup(struct snd_pcm_substream *substream,
&ak5558_rate_constraints); &ak5558_rate_constraints);
} }
static struct snd_soc_dai_ops ak5558_dai_ops = { static const struct snd_soc_dai_ops ak5558_dai_ops = {
.startup = ak5558_startup, .startup = ak5558_startup,
.hw_params = ak5558_hw_params, .hw_params = ak5558_hw_params,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment