codec->ac97_registered = 0;
}
}
+ +++++
+ +++++static void soc_unregister_ac97_dai_link(struct snd_soc_pcm_runtime *rtd)
+ +++++{
+ +++++ soc_unregister_ac97_codec(rtd->codec);
+ +++++}
#endif
--- ---static int soc_check_aux_dev(struct snd_soc_card *card, int num)
- struct snd_soc_codec *soc_find_matching_codec(struct snd_soc_card *card, int num)
+++++++static struct snd_soc_codec *soc_find_matching_codec(struct snd_soc_card *card,
+++++++ int num)
{
struct snd_soc_aux_dev *aux_dev = &card->aux_dev[num];
struct snd_soc_codec *codec;
--- --- /* find CODEC from registered CODECs*/
+++ +++ /* find CODEC from registered CODECs */
list_for_each_entry(codec, &codec_list, list) {
--- --- if (!strcmp(codec->name, aux_dev->codec_name))
--- --- return 0;
+++ +++ if (aux_dev->codec_of_node &&
+++ +++ (codec->dev->of_node != aux_dev->codec_of_node))
+++ +++ continue;
+++ +++ if (aux_dev->codec_name && strcmp(codec->name, aux_dev->codec_name))
+++ +++ continue;
+++ +++ return codec;
}
--- --- dev_err(card->dev, "ASoC: %s not registered\n", aux_dev->codec_name);
+++ +++ return NULL;
+++ +++}
+
+++ +++static int soc_check_aux_dev(struct snd_soc_card *card, int num)
+++ +++{
+++ +++ struct snd_soc_aux_dev *aux_dev = &card->aux_dev[num];
+++ +++ const char *codecname = aux_dev->codec_name;
+++ +++ struct snd_soc_codec *codec = soc_find_matching_codec(card, num);
+ + +++
+++ +++ if (codec)
+++ +++ return 0;
+++ +++ if (aux_dev->codec_of_node)
+++ +++ codecname = of_node_full_name(aux_dev->codec_of_node);
+++ +++
+++ +++ dev_err(card->dev, "ASoC: %s not registered\n", codecname);
return -EPROBE_DEFER;
}
int ret;
unsigned int val;
------- val = (snd_soc_read(codec, reg) >> shift) & mask;
+++++++ ret = snd_soc_component_read(component, reg, &val);
+++++++ if (ret < 0)
+++++++ return ret;
+ +
- - --- if (!sign_bit)
- - --- return val;
+++++++ val = (val >> shift) & mask;
+ + +++
- - if (!sign_bit)
- - return val;
+++++++ if (!sign_bit) {
+++++++ *signed_val = val;
+++++++ return 0;
+++++++ }
/* non-negative number */
------- if (!(val & BIT(sign_bit)))
------- return val;
+++++++ if (!(val & BIT(sign_bit))) {
+++++++ *signed_val = val;
+++++++ return 0;
+++++++ }
ret = val;