From d40e90674b0d3ac4b3eda74cab9468cb8e12e40f Mon Sep 17 00:00:00 2001
From: Vipul Kumar <vipul_kumar@mentor.com>
Date: Wed, 5 Dec 2018 16:46:33 +0530
Subject: [PATCH] ASoC: wm8962: replace codec to component

Now we can replace Codec to Component.

xxx_codec_xxx()         ->      xxx_component_xxx()

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
---
 sound/soc/fsl/imx-wm8962.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/sound/soc/fsl/imx-wm8962.c b/sound/soc/fsl/imx-wm8962.c
index 26c053ddee7127..8732fa83e97a6a 100644
--- a/sound/soc/fsl/imx-wm8962.c
+++ b/sound/soc/fsl/imx-wm8962.c
@@ -52,7 +52,7 @@ struct imx_priv {
 	int mic_active_low;
 	bool amic_mono;
 	bool dmic_mono;
-	struct snd_soc_codec *codec;
+	struct snd_soc_component *component;
 	struct platform_device *pdev;
 	struct snd_pcm_substream *first_stream;
 	struct snd_pcm_substream *second_stream;
@@ -115,11 +115,11 @@ static int hpjack_status_check(void *data)
 
 	if (hp_status != priv->hp_active_low) {
 		snprintf(buf, 32, "STATE=%d", 2);
-		snd_soc_dapm_disable_pin(snd_soc_codec_get_dapm(priv->codec), "Ext Spk");
+		snd_soc_dapm_disable_pin(snd_soc_component_get_dapm(priv->component), "Ext Spk");
 		ret = imx_hp_jack_gpio.report;
 	} else {
 		snprintf(buf, 32, "STATE=%d", 0);
-		snd_soc_dapm_enable_pin(snd_soc_codec_get_dapm(priv->codec), "Ext Spk");
+		snd_soc_dapm_enable_pin(snd_soc_component_get_dapm(priv->component), "Ext Spk");
 		ret = 0;
 	}
 
@@ -146,10 +146,10 @@ static int micjack_status_check(void *data)
 
 	if ((mic_status != priv->mic_active_low && priv->amic_mono)
 		|| (mic_status == priv->mic_active_low && priv->dmic_mono))
-		snd_soc_update_bits(priv->codec, WM8962_THREED1,
+		snd_soc_component_update_bits(priv->component, WM8962_THREED1,
 				WM8962_ADC_MONOMIX_MASK, WM8962_ADC_MONOMIX);
 	else
-		snd_soc_update_bits(priv->codec, WM8962_THREED1,
+		snd_soc_component_update_bits(priv->component, WM8962_THREED1,
 				WM8962_ADC_MONOMIX_MASK, 0);
 
 	buf = kmalloc(32, GFP_ATOMIC);
@@ -160,11 +160,11 @@ static int micjack_status_check(void *data)
 
 	if (mic_status != priv->mic_active_low) {
 		snprintf(buf, 32, "STATE=%d", 2);
-		snd_soc_dapm_disable_pin(snd_soc_codec_get_dapm(priv->codec), "DMIC");
+		snd_soc_dapm_disable_pin(snd_soc_component_get_dapm(priv->component), "DMIC");
 		ret = imx_mic_jack_gpio.report;
 	} else {
 		snprintf(buf, 32, "STATE=%d", 0);
-		snd_soc_dapm_enable_pin(snd_soc_codec_get_dapm(priv->codec), "DMIC");
+		snd_soc_dapm_enable_pin(snd_soc_component_get_dapm(priv->component), "DMIC");
 		ret = 0;
 	}
 
@@ -442,10 +442,10 @@ static int imx_wm8962_gpio_init(struct snd_soc_card *card)
 	struct snd_soc_pcm_runtime *rtd = list_first_entry(
 		&card->rtd_list, struct snd_soc_pcm_runtime, list);
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
-	struct snd_soc_codec *codec = codec_dai->codec;
+	struct snd_soc_component *component = codec_dai->component;
 	struct imx_priv *priv = &card_priv;
 
-	priv->codec = codec;
+	priv->component = component;
 
 	if (gpio_is_valid(priv->hp_gpio)) {
 		imx_hp_jack_gpio.gpio = priv->hp_gpio;
@@ -472,7 +472,7 @@ static int imx_wm8962_gpio_init(struct snd_soc_card *card)
 		 * Permanent set monomix bit if only one microphone
 		 * is present on the board while it needs monomix.
 		 */
-		snd_soc_update_bits(priv->codec, WM8962_THREED1,
+		snd_soc_component_update_bits(priv->component, WM8962_THREED1,
 				WM8962_ADC_MONOMIX_MASK, WM8962_ADC_MONOMIX);
 	}
 
@@ -658,7 +658,7 @@ audmux_bypass:
 		goto fail;
 	}
 	codec_dev = of_find_i2c_device_by_node(codec_np);
-	if (!codec_dev || !codec_dev->driver) {
+	if (!codec_dev || !codec_dev->dev.driver) {
 		dev_err(&pdev->dev, "failed to find codec platform device\n");
 		return -EINVAL;
 	}
-- 
GitLab