diff options
Diffstat (limited to 'sound/soc/codecs/adau17x1.c')
| -rw-r--r-- | sound/soc/codecs/adau17x1.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/sound/soc/codecs/adau17x1.c b/sound/soc/codecs/adau17x1.c index 634d4dbca5ec..26d7eb437ad1 100644 --- a/sound/soc/codecs/adau17x1.c +++ b/sound/soc/codecs/adau17x1.c @@ -19,7 +19,7 @@ #include <linux/i2c.h> #include <linux/spi/spi.h> #include <linux/regmap.h> -#include <asm/unaligned.h> +#include <linux/unaligned.h> #include "sigmadsp.h" #include "adau17x1.h" @@ -185,8 +185,8 @@ static const struct snd_soc_dapm_route adau17x1_dapm_pll_route = { static int adau17x1_dsp_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); struct adau *adau = snd_soc_component_get_drvdata(component); struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; struct snd_soc_dapm_update update = {}; @@ -230,7 +230,7 @@ static int adau17x1_dsp_mux_enum_put(struct snd_kcontrol *kcontrol, static int adau17x1_dsp_mux_enum_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); + struct snd_soc_component *component = snd_soc_dapm_kcontrol_to_component(kcontrol); struct adau *adau = snd_soc_component_get_drvdata(component); struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; unsigned int stream = e->shift_l; @@ -255,7 +255,7 @@ static int adau17x1_dsp_mux_enum_get(struct snd_kcontrol *kcontrol, #define DECLARE_ADAU17X1_DSP_MUX_CTRL(_name, _label, _stream, _text) \ const struct snd_kcontrol_new _name = \ - SOC_DAPM_ENUM_EXT(_label, (const struct soc_enum)\ + SOC_ENUM_EXT(_label, (const struct soc_enum)\ SOC_ENUM_SINGLE(SND_SOC_NOPM, _stream, \ ARRAY_SIZE(_text), _text), \ adau17x1_dsp_mux_enum_get, adau17x1_dsp_mux_enum_put) @@ -383,7 +383,7 @@ static int adau17x1_set_dai_pll(struct snd_soc_dai *dai, int pll_id, static int adau17x1_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int freq, int dir) { - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(dai->component); + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(dai->component); struct adau *adau = snd_soc_component_get_drvdata(dai->component); bool is_pll; bool was_pll; @@ -881,7 +881,7 @@ static int adau17x1_setup_firmware(struct snd_soc_component *component, int ret; int dspsr, dsp_run; struct adau *adau = snd_soc_component_get_drvdata(component); - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); /* Check if sample rate is the same as before. If it is there is no * point in performing the below steps as the call to @@ -922,7 +922,7 @@ err: int adau17x1_add_widgets(struct snd_soc_component *component) { - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); struct adau *adau = snd_soc_component_get_drvdata(component); int ret; @@ -958,7 +958,7 @@ EXPORT_SYMBOL_GPL(adau17x1_add_widgets); int adau17x1_add_routes(struct snd_soc_component *component) { - struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); struct adau *adau = snd_soc_component_get_drvdata(component); int ret; @@ -1059,13 +1059,12 @@ int adau17x1_probe(struct device *dev, struct regmap *regmap, if (!adau) return -ENOMEM; - adau->mclk = devm_clk_get(dev, "mclk"); - if (IS_ERR(adau->mclk)) { - if (PTR_ERR(adau->mclk) != -ENOENT) - return PTR_ERR(adau->mclk); - /* Clock is optional (for the driver) */ - adau->mclk = NULL; - } else if (adau->mclk) { + /* Clock is optional (for the driver) */ + adau->mclk = devm_clk_get_optional(dev, "mclk"); + if (IS_ERR(adau->mclk)) + return PTR_ERR(adau->mclk); + + if (adau->mclk) { adau->clk_src = ADAU17X1_CLK_SRC_PLL_AUTO; /* |
