summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/imx-wm8958.c
diff options
context:
space:
mode:
authorDong Aisheng <aisheng.dong@nxp.com>2019-04-22 16:24:29 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:50:47 +0800
commit69bef1118914e35146baf72149070908c13cc482 (patch)
tree05103d12b00accfd142b8ae4ed271a4630272b91 /sound/soc/fsl/imx-wm8958.c
parentc71bd2df2f11a8ff2ba70f8dfbd4595e41a9ee2d (diff)
ASoC: fsl: imx-wm8958: fix build for 5.1 RC kernel
../sound/soc/fsl/imx-wm8958.c: In function 'hpjack_status_check': ../sound/soc/fsl/imx-wm8958.c:88:3: error: implicit declaration of function 'snd_soc_codec_get_dapm' [-Werror=implicit-function-declaration] snd_soc_dapm_disable_pin(snd_soc_codec_get_dapm(priv->codec), "Ext Spk"); ^ ../sound/soc/fsl/imx-wm8958.c:88:3: warning: passing argument 1 of 'snd_soc_dapm_disable_pin' makes pointer from integer without a cast In file included from ../include/sound/soc.h:413:0, from ../sound/soc/fsl/imx-wm8958.c:19: ../include/sound/soc-dapm.h:449:5: note: expected 'struct snd_soc_dapm_context *' but argument is of type 'int' int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, ^ ../sound/soc/fsl/imx-wm8958.c:92:3: warning: passing argument 1 of 'snd_soc_dapm_enable_pin' makes pointer from integer without a cast snd_soc_dapm_enable_pin(snd_soc_codec_get_dapm(priv->codec), "Ext Spk"); ^ In file included from ../include/sound/soc.h:413:0, from ../sound/soc/fsl/imx-wm8958.c:19: ../include/sound/soc-dapm.h:445:5: note: expected 'struct snd_soc_dapm_context *' but argument is of type 'int' int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, ^ ../sound/soc/fsl/imx-wm8958.c: In function 'imx_hifi_hw_params': ../sound/soc/fsl/imx-wm8958.c:126:41: error: 'struct snd_soc_dai' has no member named 'codec' struct snd_soc_codec *codec = codec_dai->codec; ^ ../sound/soc/fsl/imx-wm8958.c:210:2: error: implicit declaration of function 'snd_soc_update_bits' [-Werror=implicit-function-declaration] snd_soc_update_bits(codec, WM8994_GPIO_1, 0x1f, 0x2); ^ ../sound/soc/fsl/imx-wm8958.c: In function 'imx_wm8958_gpio_init': ../sound/soc/fsl/imx-wm8958.c:292:41: error: 'struct snd_soc_dai' has no member named 'codec' struct snd_soc_codec *codec = codec_dai->codec; Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Diffstat (limited to 'sound/soc/fsl/imx-wm8958.c')
-rw-r--r--sound/soc/fsl/imx-wm8958.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sound/soc/fsl/imx-wm8958.c b/sound/soc/fsl/imx-wm8958.c
index 210f6662eb09..13035790ac68 100644
--- a/sound/soc/fsl/imx-wm8958.c
+++ b/sound/soc/fsl/imx-wm8958.c
@@ -44,7 +44,7 @@ struct imx_wm8958_data {
struct imx_priv {
int hp_gpio;
int hp_active_low;
- struct snd_soc_codec *codec;
+ struct snd_soc_component *component;
struct platform_device *pdev;
};
@@ -85,11 +85,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;
}
@@ -123,7 +123,6 @@ static int imx_hifi_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *codec_dai = rtd->codec_dai;
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
- struct snd_soc_codec *codec = codec_dai->codec;
struct snd_soc_card *card = rtd->card;
struct device *dev = card->dev;
struct imx_wm8958_data *data = snd_soc_card_get_drvdata(card);
@@ -207,13 +206,13 @@ static int imx_hifi_hw_params(struct snd_pcm_substream *substream,
* Set GPIO1 pin function to reserve, so that DAC1 and ADC1 using shared
* LRCLK from DACLRCK1.
*/
- snd_soc_update_bits(codec, WM8994_GPIO_1, 0x1f, 0x2);
+ snd_soc_component_update_bits(codec_dai->component, WM8994_GPIO_1, 0x1f, 0x2);
/*
* Clear ADC_OSR128 bit to support slower SYSCLK, and support ADC sample
* rate 8K, 11.025K and 12K.
*/
- snd_soc_update_bits(codec, WM8994_OVERSAMPLING, 1<<1, 0);
+ snd_soc_component_update_bits(codec_dai->component, WM8994_OVERSAMPLING, 1<<1, 0);
return 0;
}
@@ -289,10 +288,10 @@ static int imx_wm8958_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 imx_priv *priv = &card_priv;
int ret;
- priv->codec = codec;
+
+ priv->component = codec_dai->component;
if (gpio_is_valid(priv->hp_gpio)) {
imx_hp_jack_gpio.gpio = priv->hp_gpio;