Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb1cd608 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown
Browse files

ASoC: rt5640: Replace w->codec snd_soc_dapm_to_codec(w->dapm)



The codec field of the snd_soc_widget struct is eventually going to be
removed, use snd_soc_dapm_to_codec(w->dapm) instead.

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 4389eb29
Loading
Loading
Loading
Loading
+6 −5
Original line number Original line Diff line number Diff line
@@ -458,7 +458,7 @@ static const struct snd_kcontrol_new rt5640_specific_snd_controls[] = {
static int set_dmic_clk(struct snd_soc_dapm_widget *w,
static int set_dmic_clk(struct snd_soc_dapm_widget *w,
	struct snd_kcontrol *kcontrol, int event)
	struct snd_kcontrol *kcontrol, int event)
{
{
	struct snd_soc_codec *codec = w->codec;
	struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
	struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec);
	struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec);
	int idx = -EINVAL;
	int idx = -EINVAL;


@@ -475,9 +475,10 @@ static int set_dmic_clk(struct snd_soc_dapm_widget *w,
static int is_sys_clk_from_pll(struct snd_soc_dapm_widget *source,
static int is_sys_clk_from_pll(struct snd_soc_dapm_widget *source,
			 struct snd_soc_dapm_widget *sink)
			 struct snd_soc_dapm_widget *sink)
{
{
	struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm);
	unsigned int val;
	unsigned int val;


	val = snd_soc_read(source->codec, RT5640_GLB_CLK);
	val = snd_soc_read(codec, RT5640_GLB_CLK);
	val &= RT5640_SCLK_SRC_MASK;
	val &= RT5640_SCLK_SRC_MASK;
	if (val == RT5640_SCLK_SRC_PLL1)
	if (val == RT5640_SCLK_SRC_PLL1)
		return 1;
		return 1;
@@ -963,7 +964,7 @@ static void rt5640_pmu_depop(struct snd_soc_codec *codec)
static int rt5640_hp_event(struct snd_soc_dapm_widget *w,
static int rt5640_hp_event(struct snd_soc_dapm_widget *w,
			   struct snd_kcontrol *kcontrol, int event)
			   struct snd_kcontrol *kcontrol, int event)
{
{
	struct snd_soc_codec *codec = w->codec;
	struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
	struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec);
	struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec);


	switch (event) {
	switch (event) {
@@ -987,7 +988,7 @@ static int rt5640_hp_event(struct snd_soc_dapm_widget *w,
static int rt5640_hp_power_event(struct snd_soc_dapm_widget *w,
static int rt5640_hp_power_event(struct snd_soc_dapm_widget *w,
			   struct snd_kcontrol *kcontrol, int event)
			   struct snd_kcontrol *kcontrol, int event)
{
{
	struct snd_soc_codec *codec = w->codec;
	struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);


	switch (event) {
	switch (event) {
	case SND_SOC_DAPM_POST_PMU:
	case SND_SOC_DAPM_POST_PMU:
@@ -1003,7 +1004,7 @@ static int rt5640_hp_power_event(struct snd_soc_dapm_widget *w,
static int rt5640_hp_post_event(struct snd_soc_dapm_widget *w,
static int rt5640_hp_post_event(struct snd_soc_dapm_widget *w,
			   struct snd_kcontrol *kcontrol, int event)
			   struct snd_kcontrol *kcontrol, int event)
{
{
	struct snd_soc_codec *codec = w->codec;
	struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
	struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec);
	struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec);


	switch (event) {
	switch (event) {