ASoC: ak5558: remove redundand includes
authorViorel Suman <viorel.suman@nxp.com>
Thu, 4 Apr 2019 12:51:31 +0000 (15:51 +0300)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
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: Viorel Suman <viorel.suman@nxp.com>
sound/soc/codecs/ak5558.c

index 2e2738a..5f5a7d4 100644 (file)
 #include <sound/soc.h>
 #include <sound/soc-dapm.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 "ak5558.h"
 
-#define AK5558_SLAVE_CKS_AUTO
-
-/* enable debug */
-/* #define AK5558_DEBUG */
-
 #define AK5558_NUM_SUPPLIES 2
 static const char *ak5558_supply_names[AK5558_NUM_SUPPLIES] = {
        "DVDD",
@@ -146,16 +138,12 @@ static int ak5558_hw_params(struct snd_pcm_substream *substream,
        u8 bits;
        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) {
        case 16:
-               bits |= AK5558_DIF_24BIT_MODE;
+               bits = AK5558_DIF_24BIT_MODE;
                break;
        case 32:
-               bits |= AK5558_DIF_32BIT_MODE;
+               bits = AK5558_DIF_32BIT_MODE;
                break;
        default:
                return -EINVAL;
@@ -184,18 +172,15 @@ static int ak5558_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
        }
 
        /* set master/slave audio interface */
-       format = snd_soc_component_read32(component, AK5558_02_CONTROL1);
-       format &= ~AK5558_DIF;
-
        switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
        case SND_SOC_DAIFMT_I2S:
-               format |= AK5558_DIF_I2S_MODE;
+               format = AK5558_DIF_I2S_MODE;
                break;
        case SND_SOC_DAIFMT_LEFT_J:
-               format |= AK5558_DIF_MSB_MODE;
+               format = AK5558_DIF_MSB_MODE;
                break;
        case SND_SOC_DAIFMT_DSP_B:
-               format |= AK5558_DIF_MSB_MODE;
+               format = AK5558_DIF_MSB_MODE;
                break;
        default:
                return -EINVAL;
@@ -262,7 +247,7 @@ static int ak5558_startup(struct snd_pcm_substream *substream,
                                          &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,
        .hw_params      = ak5558_hw_params,