Lines Matching +full:aux +full:- +full:devs
1 // SPDX-License-Identifier: GPL-2.0
10 #include "meson-card.h"
29 if (ret && ret != -ENOTSUPP) in meson_card_i2s_set_sysclk()
35 if (ret && ret != -ENOTSUPP) in meson_card_i2s_set_sysclk()
49 links = krealloc(priv->card.dai_link, in meson_card_reallocate_links()
50 num_links * sizeof(*priv->card.dai_link), in meson_card_reallocate_links()
55 ldata = krealloc(priv->link_data, in meson_card_reallocate_links()
56 num_links * sizeof(*priv->link_data), in meson_card_reallocate_links()
61 priv->card.dai_link = links; in meson_card_reallocate_links()
62 priv->link_data = ldata; in meson_card_reallocate_links()
63 priv->card.num_links = num_links; in meson_card_reallocate_links()
69 dev_err(priv->card.dev, "failed to allocate links\n"); in meson_card_reallocate_links()
70 return -ENOMEM; in meson_card_reallocate_links()
82 return -EINVAL; in meson_card_parse_dai()
86 return dev_err_probe(card->dev, ret, "can't parse dai\n"); in meson_card_parse_dai()
97 char *name = devm_kasprintf(card->dev, GFP_KERNEL, "%s.%s", in meson_card_set_link_name()
98 prefix, node->full_name); in meson_card_set_link_name()
100 return -ENOMEM; in meson_card_set_link_name()
102 link->name = name; in meson_card_set_link_name()
103 link->stream_name = name; in meson_card_set_link_name()
145 dev_err(card->dev, "be link %s has no codec\n", in meson_card_set_be_link()
146 node->full_name); in meson_card_set_be_link()
147 return -EINVAL; in meson_card_set_be_link()
150 codec = devm_kcalloc(card->dev, num_codecs, sizeof(*codec), GFP_KERNEL); in meson_card_set_be_link()
152 return -ENOMEM; in meson_card_set_be_link()
154 link->codecs = codec; in meson_card_set_be_link()
155 link->num_codecs = num_codecs; in meson_card_set_be_link()
169 dev_err(card->dev, "error setting %pOFn link name\n", np); in meson_card_set_be_link()
180 link->codecs = &snd_soc_dummy_dlc; in meson_card_set_fe_link()
181 link->num_codecs = 1; in meson_card_set_fe_link()
183 link->dynamic = 1; in meson_card_set_fe_link()
184 link->dpcm_merged_format = 1; in meson_card_set_fe_link()
185 link->dpcm_merged_chan = 1; in meson_card_set_fe_link()
186 link->dpcm_merged_rate = 1; in meson_card_set_fe_link()
189 link->playback_only = 1; in meson_card_set_fe_link()
191 link->capture_only = 1; in meson_card_set_fe_link()
200 struct device_node *node = card->dev->of_node; in meson_card_add_links()
206 dev_err(card->dev, "card has no links\n"); in meson_card_add_links()
207 return -EINVAL; in meson_card_add_links()
216 ret = priv->match_data->add_link(card, np, &i); in meson_card_add_links()
234 if (!of_property_read_bool(card->dev->of_node, propname)) in meson_card_parse_of_optional()
243 struct snd_soc_card *card = &priv->card; in meson_card_clean_references()
246 struct snd_soc_aux_dev *aux; in meson_card_clean_references() local
249 if (card->dai_link) { in meson_card_clean_references()
251 if (link->cpus) in meson_card_clean_references()
252 of_node_put(link->cpus->of_node); in meson_card_clean_references()
254 of_node_put(codec->of_node); in meson_card_clean_references()
258 if (card->aux_dev) { in meson_card_clean_references()
259 for_each_card_pre_auxs(card, i, aux) in meson_card_clean_references()
260 of_node_put(aux->dlc.of_node); in meson_card_clean_references()
263 kfree(card->dai_link); in meson_card_clean_references()
264 kfree(priv->link_data); in meson_card_clean_references()
270 struct device *dev = &pdev->dev; in meson_card_probe()
277 return -ENODEV; in meson_card_probe()
282 return -ENOMEM; in meson_card_probe()
285 snd_soc_card_set_drvdata(&priv->card, priv); in meson_card_probe()
287 priv->card.owner = THIS_MODULE; in meson_card_probe()
288 priv->card.dev = dev; in meson_card_probe()
289 priv->card.driver_name = dev->driver->name; in meson_card_probe()
290 priv->match_data = data; in meson_card_probe()
292 ret = snd_soc_of_parse_card_name(&priv->card, "model"); in meson_card_probe()
296 ret = meson_card_parse_of_optional(&priv->card, "audio-routing", in meson_card_probe()
303 ret = meson_card_parse_of_optional(&priv->card, "audio-widgets", in meson_card_probe()
310 ret = meson_card_add_links(&priv->card); in meson_card_probe()
314 ret = snd_soc_of_parse_aux_devs(&priv->card, "audio-aux-devs"); in meson_card_probe()
318 ret = devm_snd_soc_register_card(dev, &priv->card); in meson_card_probe()