ASoC: wm8996: replace codec to component

Now we can replace Codec to Component. Let's do it.

Note:
	xxx_codec_xxx()		->	xxx_component_xxx()
	.idle_bias_off = 1	->	.idle_bias_on = 0
	.ignore_pmdown_time = 0	->	.use_pmdown_time = 1
	-			->	.endianness = 1
	-			->	.non_legacy_dai_naming = 1

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2018-01-29 03:08:15 +00:00 committed by Mark Brown
parent 7928b2cbe5
commit 5d61ef8b07
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
3 changed files with 206 additions and 211 deletions

File diff suppressed because it is too large Load Diff

View File

@ -22,9 +22,9 @@
#define WM8996_FLL_DACLRCLK1 3 #define WM8996_FLL_DACLRCLK1 3
#define WM8996_FLL_BCLK1 4 #define WM8996_FLL_BCLK1 4
typedef void (*wm8996_polarity_fn)(struct snd_soc_codec *codec, int polarity); typedef void (*wm8996_polarity_fn)(struct snd_soc_component *component, int polarity);
int wm8996_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, int wm8996_detect(struct snd_soc_component *component, struct snd_soc_jack *jack,
wm8996_polarity_fn polarity_cb); wm8996_polarity_fn polarity_cb);
/* /*

View File

@ -124,14 +124,14 @@ static int speyside_get_micbias(struct snd_soc_dapm_widget *source,
return 0; return 0;
} }
static void speyside_set_polarity(struct snd_soc_codec *codec, static void speyside_set_polarity(struct snd_soc_component *component,
int polarity) int polarity)
{ {
speyside_jack_polarity = !polarity; speyside_jack_polarity = !polarity;
gpio_direction_output(WM8996_HPSEL_GPIO, speyside_jack_polarity); gpio_direction_output(WM8996_HPSEL_GPIO, speyside_jack_polarity);
/* Re-run DAPM to make sure we're using the correct mic bias */ /* Re-run DAPM to make sure we're using the correct mic bias */
snd_soc_dapm_sync(snd_soc_codec_get_dapm(codec)); snd_soc_dapm_sync(snd_soc_component_get_dapm(component));
} }
static int speyside_wm0010_init(struct snd_soc_pcm_runtime *rtd) static int speyside_wm0010_init(struct snd_soc_pcm_runtime *rtd)
@ -149,7 +149,7 @@ static int speyside_wm0010_init(struct snd_soc_pcm_runtime *rtd)
static int speyside_wm8996_init(struct snd_soc_pcm_runtime *rtd) static int speyside_wm8996_init(struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_soc_dai *dai = rtd->codec_dai; struct snd_soc_dai *dai = rtd->codec_dai;
struct snd_soc_codec *codec = rtd->codec; struct snd_soc_component *component = dai->component;
int ret; int ret;
ret = snd_soc_dai_set_sysclk(dai, WM8996_SYSCLK_MCLK2, 32768, 0); ret = snd_soc_dai_set_sysclk(dai, WM8996_SYSCLK_MCLK2, 32768, 0);
@ -168,7 +168,7 @@ static int speyside_wm8996_init(struct snd_soc_pcm_runtime *rtd)
if (ret) if (ret)
return ret; return ret;
wm8996_detect(codec, &speyside_headset, speyside_set_polarity); wm8996_detect(component, &speyside_headset, speyside_set_polarity);
return 0; return 0;
} }
@ -232,10 +232,8 @@ static struct snd_soc_dai_link speyside_dai[] = {
static int speyside_wm9081_init(struct snd_soc_component *component) static int speyside_wm9081_init(struct snd_soc_component *component)
{ {
struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
/* At any time the WM9081 is active it will have this clock */ /* At any time the WM9081 is active it will have this clock */
return snd_soc_codec_set_sysclk(codec, WM9081_SYSCLK_MCLK, 0, return snd_soc_component_set_sysclk(component, WM9081_SYSCLK_MCLK, 0,
MCLK_AUDIO_RATE, 0); MCLK_AUDIO_RATE, 0);
} }