~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/soc/mediatek/mt8186/mt8186-mt6366-common.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 //
  3 // mt8186-mt6366-common.c
  4 //      --  MT8186 MT6366 ALSA common driver
  5 //
  6 // Copyright (c) 2022 MediaTek Inc.
  7 // Author: Jiaxin Yu <jiaxin.yu@mediatek.com>
  8 //
  9 #include <sound/soc.h>
 10 
 11 #include "../../codecs/mt6358.h"
 12 #include "../common/mtk-afe-platform-driver.h"
 13 #include "mt8186-afe-common.h"
 14 #include "mt8186-mt6366-common.h"
 15 
 16 int mt8186_mt6366_init(struct snd_soc_pcm_runtime *rtd)
 17 {
 18         struct snd_soc_component *cmpnt_afe =
 19                 snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME);
 20         struct snd_soc_component *cmpnt_codec =
 21                 snd_soc_rtd_to_codec(rtd, 0)->component;
 22         struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt_afe);
 23         struct mt8186_afe_private *afe_priv = afe->platform_priv;
 24         struct snd_soc_dapm_context *dapm = &rtd->card->dapm;
 25         int ret;
 26 
 27         /* set mtkaif protocol */
 28         mt6358_set_mtkaif_protocol(cmpnt_codec,
 29                                    MT6358_MTKAIF_PROTOCOL_1);
 30         afe_priv->mtkaif_protocol = MT6358_MTKAIF_PROTOCOL_1;
 31 
 32         ret = snd_soc_dapm_sync(dapm);
 33         if (ret) {
 34                 dev_err(rtd->dev, "failed to snd_soc_dapm_sync\n");
 35                 return ret;
 36         }
 37 
 38         return 0;
 39 }
 40 EXPORT_SYMBOL_GPL(mt8186_mt6366_init);
 41 
 42 int mt8186_mt6366_card_set_be_link(struct snd_soc_card *card,
 43                                    struct snd_soc_dai_link *link,
 44                                    struct device_node *node,
 45                                    char *link_name)
 46 {
 47         int ret;
 48 
 49         if (node && strcmp(link->name, link_name) == 0) {
 50                 ret = snd_soc_of_get_dai_link_codecs(card->dev, node, link);
 51                 if (ret < 0)
 52                         return dev_err_probe(card->dev, ret, "get dai link codecs fail\n");
 53         }
 54 
 55         return 0;
 56 }
 57 EXPORT_SYMBOL_GPL(mt8186_mt6366_card_set_be_link);
 58 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php