Merge branch 'topic/qcom' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
authorMark Brown <broonie@kernel.org>
Thu, 10 Aug 2017 15:48:25 +0000 (16:48 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 10 Aug 2017 15:48:25 +0000 (16:48 +0100)
sound/soc/codecs/msm8916-wcd-analog.c
sound/soc/codecs/msm8916-wcd-digital.c

index aec1e1626993bcc10c044ab71847b0d17c000ca7..f9a74ff2ce99a8a7820a8efaaf20be51bd109f71 100644 (file)
@@ -536,6 +536,9 @@ static int pm8916_wcd_analog_probe(struct snd_soc_codec *codec)
                snd_soc_write(codec, wcd_reg_defaults_2_0[reg].reg,
                              wcd_reg_defaults_2_0[reg].def);
 
+       snd_soc_update_bits(codec, CDC_D_CDC_RST_CTL,
+                           RST_CTL_DIG_SW_RST_N_MASK,
+                           RST_CTL_DIG_SW_RST_N_REMOVE_RESET);
        return 0;
 }
 
@@ -543,6 +546,9 @@ static int pm8916_wcd_analog_remove(struct snd_soc_codec *codec)
 {
        struct pm8916_wcd_analog_priv *priv = dev_get_drvdata(codec->dev);
 
+       snd_soc_update_bits(codec, CDC_D_CDC_RST_CTL,
+                           RST_CTL_DIG_SW_RST_N_MASK, 0);
+
        return regulator_bulk_disable(ARRAY_SIZE(priv->supplies),
                                      priv->supplies);
 }
@@ -736,28 +742,6 @@ static struct regmap *pm8916_get_regmap(struct device *dev)
        return dev_get_regmap(dev->parent, NULL);
 }
 
-static int pm8916_wcd_analog_startup(struct snd_pcm_substream *substream,
-                                     struct snd_soc_dai *dai)
-{
-       snd_soc_update_bits(dai->codec, CDC_D_CDC_RST_CTL,
-                           RST_CTL_DIG_SW_RST_N_MASK,
-                           RST_CTL_DIG_SW_RST_N_REMOVE_RESET);
-
-       return 0;
-}
-
-static void pm8916_wcd_analog_shutdown(struct snd_pcm_substream *substream,
-                                        struct snd_soc_dai *dai)
-{
-       snd_soc_update_bits(dai->codec, CDC_D_CDC_RST_CTL,
-                           RST_CTL_DIG_SW_RST_N_MASK, 0);
-}
-
-static const struct snd_soc_dai_ops pm8916_wcd_analog_dai_ops = {
-       .startup = pm8916_wcd_analog_startup,
-       .shutdown = pm8916_wcd_analog_shutdown,
-};
-
 static struct snd_soc_dai_driver pm8916_wcd_analog_dai[] = {
        [0] = {
               .name = "pm8916_wcd_analog_pdm_rx",
@@ -769,7 +753,6 @@ static struct snd_soc_dai_driver pm8916_wcd_analog_dai[] = {
                            .channels_min = 1,
                            .channels_max = 3,
                            },
-              .ops = &pm8916_wcd_analog_dai_ops,
               },
        [1] = {
               .name = "pm8916_wcd_analog_pdm_tx",
@@ -781,7 +764,6 @@ static struct snd_soc_dai_driver pm8916_wcd_analog_dai[] = {
                           .channels_min = 1,
                           .channels_max = 4,
                           },
-              .ops = &pm8916_wcd_analog_dai_ops,
               },
 };
 
index d2993e72d1e237c6f079fe69303df694bbab8fe6..858a9fc1c0574422a5d46d59803dd3482597dee2 100644 (file)
@@ -818,7 +818,7 @@ static void msm8916_wcd_digital_shutdown(struct snd_pcm_substream *substream,
                            LPASS_CDC_CLK_PDM_CTL_PDM_CLK_SEL_MASK, 0);
 }
 
-static struct snd_soc_dai_ops msm8916_wcd_digital_dai_ops = {
+static const struct snd_soc_dai_ops msm8916_wcd_digital_dai_ops = {
        .startup = msm8916_wcd_digital_startup,
        .shutdown = msm8916_wcd_digital_shutdown,
        .hw_params = msm8916_wcd_digital_hw_params,