diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-04-02 20:51:39 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-04-02 20:51:39 +0300 |
commit | 903d271a3f83826ef810a4b5dbbd9842cf0465d6 (patch) | |
tree | 07fd60b1d7ad07ba36c82b2e83ece7c7eb6e6ce9 /sound/soc/codecs/ak4613.c | |
parent | bc334cb61b9ee6e85b9bb01519989a3ae8fe03f6 (diff) | |
parent | 445bb423f6a3c50788529a33b82e45148001e855 (diff) | |
download | linux-903d271a3f83826ef810a4b5dbbd9842cf0465d6.tar.xz |
Merge tag 'asoc-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v4.17
This is a *very* big release for ASoC. Not much change in the core but
there s the transition of all the individual drivers over to components
which is intended to support further core work. The goal is to make it
easier to do further core work by removing the need to special case all
the different driver classes in the core, many of the devices end up
being used in multiple roles in modern systems.
We also have quite a lot of new drivers added this month of all kinds,
quite a few for simple devices but also some more advanced ones with
more substantial code.
- The biggest thing is the huge series from Morimoto-san which
converted everything over to components. This is a huge change by
code volume but was fairly mechanical
- Many fixes for some of the Realtek based Baytrail systems covering
both the CODECs and the CPUs, contributed by Hans de Goode.
- Lots of cleanups for Samsung based Odroid systems from Sylwester
Nawrocki.
- The Freescale SSI driver also got a lot of cleanups from Nicolin
Chen.
- The Blackfin drivers have been removed as part of the removal of the
architecture.
- New drivers for AKM AK4458 and AK5558, several AMD based machines,
several Intel based machines, Maxim MAX9759, Motorola CPCAP,
Socionext Uniphier SoCs, and TI PCM1789 and TDA7419
Diffstat (limited to 'sound/soc/codecs/ak4613.c')
-rw-r--r-- | sound/soc/codecs/ak4613.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c index 3d1cf4784e87..8523ff9351cf 100644 --- a/sound/soc/codecs/ak4613.c +++ b/sound/soc/codecs/ak4613.c @@ -243,9 +243,9 @@ static const struct snd_soc_dapm_route ak4613_intercon[] = { static void ak4613_dai_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct snd_soc_codec *codec = dai->codec; - struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec); - struct device *dev = codec->dev; + struct snd_soc_component *component = dai->component; + struct ak4613_priv *priv = snd_soc_component_get_drvdata(component); + struct device *dev = component->dev; mutex_lock(&priv->lock); priv->cnt--; @@ -305,8 +305,8 @@ static void ak4613_hw_constraints(struct ak4613_priv *priv, static int ak4613_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct snd_soc_codec *codec = dai->codec; - struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct ak4613_priv *priv = snd_soc_component_get_drvdata(component); priv->cnt++; @@ -318,8 +318,8 @@ static int ak4613_dai_startup(struct snd_pcm_substream *substream, static int ak4613_dai_set_sysclk(struct snd_soc_dai *codec_dai, int clk_id, unsigned int freq, int dir) { - struct snd_soc_codec *codec = codec_dai->codec; - struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = codec_dai->component; + struct ak4613_priv *priv = snd_soc_component_get_drvdata(component); priv->sysclk = freq; @@ -328,8 +328,8 @@ static int ak4613_dai_set_sysclk(struct snd_soc_dai *codec_dai, static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) { - struct snd_soc_codec *codec = dai->codec; - struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct ak4613_priv *priv = snd_soc_component_get_drvdata(component); fmt &= SND_SOC_DAIFMT_FORMAT_MASK; @@ -366,10 +366,10 @@ static int ak4613_dai_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { - struct snd_soc_codec *codec = dai->codec; - struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct ak4613_priv *priv = snd_soc_component_get_drvdata(component); const struct ak4613_interface *iface; - struct device *dev = codec->dev; + struct device *dev = component->dev; unsigned int width = params_width(params); unsigned int fmt = priv->fmt; unsigned int rate; @@ -434,11 +434,11 @@ static int ak4613_dai_hw_params(struct snd_pcm_substream *substream, fmt_ctrl = AUDIO_IFACE_TO_VAL(iface); - snd_soc_update_bits(codec, CTRL1, FMT_MASK, fmt_ctrl); - snd_soc_update_bits(codec, CTRL2, DFS_MASK, ctrl2); + snd_soc_component_update_bits(component, CTRL1, FMT_MASK, fmt_ctrl); + snd_soc_component_update_bits(component, CTRL2, DFS_MASK, ctrl2); - snd_soc_update_bits(codec, ICTRL, ICTRL_MASK, priv->ic); - snd_soc_update_bits(codec, OCTRL, OCTRL_MASK, priv->oc); + snd_soc_component_update_bits(component, ICTRL, ICTRL_MASK, priv->ic); + snd_soc_component_update_bits(component, OCTRL, OCTRL_MASK, priv->oc); hw_params_end: if (ret < 0) @@ -447,7 +447,7 @@ hw_params_end: return ret; } -static int ak4613_set_bias_level(struct snd_soc_codec *codec, +static int ak4613_set_bias_level(struct snd_soc_component *component, enum snd_soc_bias_level level) { u8 mgmt1 = 0; @@ -467,7 +467,7 @@ static int ak4613_set_bias_level(struct snd_soc_codec *codec, break; } - snd_soc_write(codec, PW_MGMT1, mgmt1); + snd_soc_component_write(component, PW_MGMT1, mgmt1); return 0; } @@ -504,8 +504,8 @@ static void ak4613_dummy_write(struct work_struct *work) static int ak4613_dai_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { - struct snd_soc_codec *codec = dai->codec; - struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct ak4613_priv *priv = snd_soc_component_get_drvdata(component); /* * FIXME @@ -537,7 +537,7 @@ static int ak4613_dai_trigger(struct snd_pcm_substream *substream, int cmd, if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) return 0; - priv->component = &codec->component; + priv->component = component; schedule_work(&priv->dummy_write_work); return 0; @@ -582,35 +582,36 @@ static struct snd_soc_dai_driver ak4613_dai = { .symmetric_rates = 1, }; -static int ak4613_suspend(struct snd_soc_codec *codec) +static int ak4613_suspend(struct snd_soc_component *component) { - struct regmap *regmap = dev_get_regmap(codec->dev, NULL); + struct regmap *regmap = dev_get_regmap(component->dev, NULL); regcache_cache_only(regmap, true); regcache_mark_dirty(regmap); return 0; } -static int ak4613_resume(struct snd_soc_codec *codec) +static int ak4613_resume(struct snd_soc_component *component) { - struct regmap *regmap = dev_get_regmap(codec->dev, NULL); + struct regmap *regmap = dev_get_regmap(component->dev, NULL); regcache_cache_only(regmap, false); return regcache_sync(regmap); } -static const struct snd_soc_codec_driver soc_codec_dev_ak4613 = { +static const struct snd_soc_component_driver soc_component_dev_ak4613 = { .suspend = ak4613_suspend, .resume = ak4613_resume, .set_bias_level = ak4613_set_bias_level, - .component_driver = { - .controls = ak4613_snd_controls, - .num_controls = ARRAY_SIZE(ak4613_snd_controls), - .dapm_widgets = ak4613_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(ak4613_dapm_widgets), - .dapm_routes = ak4613_intercon, - .num_dapm_routes = ARRAY_SIZE(ak4613_intercon), - }, + .controls = ak4613_snd_controls, + .num_controls = ARRAY_SIZE(ak4613_snd_controls), + .dapm_widgets = ak4613_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(ak4613_dapm_widgets), + .dapm_routes = ak4613_intercon, + .num_dapm_routes = ARRAY_SIZE(ak4613_intercon), + .idle_bias_on = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static void ak4613_parse_of(struct ak4613_priv *priv, @@ -677,13 +678,12 @@ static int ak4613_i2c_probe(struct i2c_client *i2c, if (IS_ERR(regmap)) return PTR_ERR(regmap); - return snd_soc_register_codec(dev, &soc_codec_dev_ak4613, + return devm_snd_soc_register_component(dev, &soc_component_dev_ak4613, &ak4613_dai, 1); } static int ak4613_i2c_remove(struct i2c_client *client) { - snd_soc_unregister_codec(&client->dev); return 0; } |