Lines Matching +full:mt8365 +full:- +full:mt6357
1 // SPDX-License-Identifier: GPL-2.0
3 * MediaTek MT8365 Sound Card driver
13 #include "mt8365-afe-common.h"
15 #include "../common/mtk-soc-card.h"
16 #include "../common/mtk-soundcard-driver.h"
66 struct snd_soc_pcm_runtime *rtd = substream->private_data; in mt8365_mt6357_int_adda_startup()
67 struct mt8365_mt6357_priv *priv = snd_soc_card_get_drvdata(rtd->card); in mt8365_mt6357_int_adda_startup()
70 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in mt8365_mt6357_int_adda_startup()
71 if (IS_ERR(priv->pin_states[PIN_STATE_MOSI_ON])) in mt8365_mt6357_int_adda_startup()
74 ret = pinctrl_select_state(priv->pinctrl, in mt8365_mt6357_int_adda_startup()
75 priv->pin_states[PIN_STATE_MOSI_ON]); in mt8365_mt6357_int_adda_startup()
77 dev_err(rtd->card->dev, "%s failed to select state %d\n", in mt8365_mt6357_int_adda_startup()
81 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { in mt8365_mt6357_int_adda_startup()
82 if (IS_ERR(priv->pin_states[PIN_STATE_MISO_ON])) in mt8365_mt6357_int_adda_startup()
85 ret = pinctrl_select_state(priv->pinctrl, in mt8365_mt6357_int_adda_startup()
86 priv->pin_states[PIN_STATE_MISO_ON]); in mt8365_mt6357_int_adda_startup()
88 dev_err(rtd->card->dev, "%s failed to select state %d\n", in mt8365_mt6357_int_adda_startup()
97 struct snd_soc_pcm_runtime *rtd = substream->private_data; in mt8365_mt6357_int_adda_shutdown()
98 struct mt8365_mt6357_priv *priv = snd_soc_card_get_drvdata(rtd->card); in mt8365_mt6357_int_adda_shutdown()
101 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in mt8365_mt6357_int_adda_shutdown()
102 if (IS_ERR(priv->pin_states[PIN_STATE_MOSI_OFF])) in mt8365_mt6357_int_adda_shutdown()
105 ret = pinctrl_select_state(priv->pinctrl, in mt8365_mt6357_int_adda_shutdown()
106 priv->pin_states[PIN_STATE_MOSI_OFF]); in mt8365_mt6357_int_adda_shutdown()
108 dev_err(rtd->card->dev, "%s failed to select state %d\n", in mt8365_mt6357_int_adda_shutdown()
112 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { in mt8365_mt6357_int_adda_shutdown()
113 if (IS_ERR(priv->pin_states[PIN_STATE_MISO_OFF])) in mt8365_mt6357_int_adda_shutdown()
116 ret = pinctrl_select_state(priv->pinctrl, in mt8365_mt6357_int_adda_shutdown()
117 priv->pin_states[PIN_STATE_MISO_OFF]); in mt8365_mt6357_int_adda_shutdown()
119 dev_err(rtd->card->dev, "%s failed to select state %d\n", in mt8365_mt6357_int_adda_shutdown()
156 DAILINK_COMP_ARRAY(COMP_CODEC("mt6357-sound", "mt6357-snd-codec-aif1")),
159 /* Digital audio interface glue - connects codec <---> CPU */
249 priv->pinctrl = devm_pinctrl_get(card->dev); in mt8365_mt6357_gpio_probe()
250 if (IS_ERR(priv->pinctrl)) { in mt8365_mt6357_gpio_probe()
251 ret = PTR_ERR(priv->pinctrl); in mt8365_mt6357_gpio_probe()
252 return dev_err_probe(card->dev, ret, in mt8365_mt6357_gpio_probe()
257 priv->pin_states[i] = pinctrl_lookup_state(priv->pinctrl, in mt8365_mt6357_gpio_probe()
259 if (IS_ERR(priv->pin_states[i])) { in mt8365_mt6357_gpio_probe()
260 dev_info(card->dev, "No pin state for %s\n", in mt8365_mt6357_gpio_probe()
263 ret = pinctrl_select_state(priv->pinctrl, in mt8365_mt6357_gpio_probe()
264 priv->pin_states[i]); in mt8365_mt6357_gpio_probe()
266 dev_err_probe(card->dev, ret, in mt8365_mt6357_gpio_probe()
277 .name = "mt8365-evk",
289 struct mtk_platform_card_data *card_data = soc_card_data->card_data; in mt8365_mt6357_dev_probe()
290 struct snd_soc_card *card = card_data->card; in mt8365_mt6357_dev_probe()
291 struct device *dev = card->dev; in mt8365_mt6357_dev_probe()
295 card->dev = dev; in mt8365_mt6357_dev_probe()
303 return -ENOMEM; in mt8365_mt6357_dev_probe()
304 soc_card_data->mach_priv = mach_priv; in mt8365_mt6357_dev_probe()
315 .card_name = "mt8365-mt6357",
323 { .compatible = "mediatek,mt8365-mt6357", .data = &mt8365_mt6357_card },
340 MODULE_DESCRIPTION("MT8365 EVK SoC machine driver");