Lines Matching refs:afe

148 	struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component);  in mt8183_memif_fs()  local
151 return mt8183_rate_transform(afe->dev, rate, id); in mt8183_memif_fs()
159 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); in mt8183_irq_fs() local
161 return mt8183_general_rate_transform(afe->dev, rate); in mt8183_irq_fs()
929 struct mtk_base_afe *afe = dev; in mt8183_afe_irq_handler() local
939 regmap_read(afe->regmap, AFE_IRQ_MCU_EN, &mcu_en); in mt8183_afe_irq_handler()
941 ret = regmap_read(afe->regmap, AFE_IRQ_MCU_STATUS, &status); in mt8183_afe_irq_handler()
946 dev_err(afe->dev, "%s(), irq status err, ret %d, status 0x%x, mcu_en 0x%x\n", in mt8183_afe_irq_handler()
954 struct mtk_base_afe_memif *memif = &afe->memif[i]; in mt8183_afe_irq_handler()
962 irq = &afe->irqs[memif->irq_usage]; in mt8183_afe_irq_handler()
970 regmap_write(afe->regmap, in mt8183_afe_irq_handler()
979 struct mtk_base_afe *afe = dev_get_drvdata(dev); in mt8183_afe_runtime_suspend() local
980 struct mt8183_afe_private *afe_priv = afe->platform_priv; in mt8183_afe_runtime_suspend()
984 if (!afe->regmap || afe_priv->pm_runtime_bypass_reg_ctl) in mt8183_afe_runtime_suspend()
988 regmap_update_bits(afe->regmap, AFE_DAC_CON0, AFE_ON_MASK_SFT, 0x0); in mt8183_afe_runtime_suspend()
990 ret = regmap_read_poll_timeout(afe->regmap, in mt8183_afe_runtime_suspend()
997 dev_warn(afe->dev, "%s(), ret %d\n", __func__, ret); in mt8183_afe_runtime_suspend()
1000 regmap_update_bits(afe->regmap, AFE_IRQ_MCU_CLR, 0xffff, 0xffff); in mt8183_afe_runtime_suspend()
1001 regmap_update_bits(afe->regmap, AFE_IRQ_MCU_CLR, 0xffff, 0xffff); in mt8183_afe_runtime_suspend()
1004 regcache_cache_only(afe->regmap, true); in mt8183_afe_runtime_suspend()
1005 regcache_mark_dirty(afe->regmap); in mt8183_afe_runtime_suspend()
1008 return mt8183_afe_disable_clock(afe); in mt8183_afe_runtime_suspend()
1013 struct mtk_base_afe *afe = dev_get_drvdata(dev); in mt8183_afe_runtime_resume() local
1014 struct mt8183_afe_private *afe_priv = afe->platform_priv; in mt8183_afe_runtime_resume()
1017 ret = mt8183_afe_enable_clock(afe); in mt8183_afe_runtime_resume()
1021 if (!afe->regmap || afe_priv->pm_runtime_bypass_reg_ctl) in mt8183_afe_runtime_resume()
1024 regcache_cache_only(afe->regmap, false); in mt8183_afe_runtime_resume()
1025 regcache_sync(afe->regmap); in mt8183_afe_runtime_resume()
1028 regmap_update_bits(afe->regmap, AUDIO_TOP_CON0, 0x1 << 29, 0x1 << 29); in mt8183_afe_runtime_resume()
1031 regmap_update_bits(afe->regmap, AFE_MEMIF_MSB, in mt8183_afe_runtime_resume()
1035 regmap_write(afe->regmap, AFE_CONN_24BIT, 0xffffffff); in mt8183_afe_runtime_resume()
1036 regmap_write(afe->regmap, AFE_CONN_24BIT_1, 0xffffffff); in mt8183_afe_runtime_resume()
1039 regmap_update_bits(afe->regmap, AFE_DAC_CON0, 0x1, 0x1); in mt8183_afe_runtime_resume()
1057 static int mt8183_dai_memif_register(struct mtk_base_afe *afe) in mt8183_dai_memif_register() argument
1061 dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL); in mt8183_dai_memif_register()
1065 list_add(&dai->list, &afe->sub_dais); in mt8183_dai_memif_register()
1089 struct mtk_base_afe *afe; in mt8183_afe_pcm_dev_probe() local
1095 afe = devm_kzalloc(&pdev->dev, sizeof(*afe), GFP_KERNEL); in mt8183_afe_pcm_dev_probe()
1096 if (!afe) in mt8183_afe_pcm_dev_probe()
1098 platform_set_drvdata(pdev, afe); in mt8183_afe_pcm_dev_probe()
1100 afe->platform_priv = devm_kzalloc(&pdev->dev, sizeof(*afe_priv), in mt8183_afe_pcm_dev_probe()
1102 if (!afe->platform_priv) in mt8183_afe_pcm_dev_probe()
1105 afe_priv = afe->platform_priv; in mt8183_afe_pcm_dev_probe()
1106 afe->dev = &pdev->dev; in mt8183_afe_pcm_dev_probe()
1107 dev = afe->dev; in mt8183_afe_pcm_dev_probe()
1110 ret = mt8183_init_clock(afe); in mt8183_afe_pcm_dev_probe()
1119 afe->regmap = syscon_node_to_regmap(dev->parent->of_node); in mt8183_afe_pcm_dev_probe()
1120 if (IS_ERR(afe->regmap)) { in mt8183_afe_pcm_dev_probe()
1122 ret = PTR_ERR(afe->regmap); in mt8183_afe_pcm_dev_probe()
1125 ret = regmap_attach_dev(dev, afe->regmap, &mt8183_afe_regmap_config); in mt8183_afe_pcm_dev_probe()
1148 ret = regmap_reinit_cache(afe->regmap, &mt8183_afe_regmap_config); in mt8183_afe_pcm_dev_probe()
1157 regcache_cache_only(afe->regmap, true); in mt8183_afe_pcm_dev_probe()
1158 regcache_mark_dirty(afe->regmap); in mt8183_afe_pcm_dev_probe()
1161 afe->memif_size = MT8183_MEMIF_NUM; in mt8183_afe_pcm_dev_probe()
1162 afe->memif = devm_kcalloc(dev, afe->memif_size, sizeof(*afe->memif), in mt8183_afe_pcm_dev_probe()
1164 if (!afe->memif) { in mt8183_afe_pcm_dev_probe()
1169 for (i = 0; i < afe->memif_size; i++) { in mt8183_afe_pcm_dev_probe()
1170 afe->memif[i].data = &memif_data[i]; in mt8183_afe_pcm_dev_probe()
1171 afe->memif[i].irq_usage = -1; in mt8183_afe_pcm_dev_probe()
1174 afe->memif[MT8183_MEMIF_HDMI].irq_usage = MT8183_IRQ_8; in mt8183_afe_pcm_dev_probe()
1175 afe->memif[MT8183_MEMIF_HDMI].const_irq = 1; in mt8183_afe_pcm_dev_probe()
1177 mutex_init(&afe->irq_alloc_lock); in mt8183_afe_pcm_dev_probe()
1181 afe->irqs_size = MT8183_IRQ_NUM; in mt8183_afe_pcm_dev_probe()
1182 afe->irqs = devm_kcalloc(dev, afe->irqs_size, sizeof(*afe->irqs), in mt8183_afe_pcm_dev_probe()
1184 if (!afe->irqs) { in mt8183_afe_pcm_dev_probe()
1189 for (i = 0; i < afe->irqs_size; i++) in mt8183_afe_pcm_dev_probe()
1190 afe->irqs[i].irq_data = &irq_data[i]; in mt8183_afe_pcm_dev_probe()
1200 IRQF_TRIGGER_NONE, "asys-isr", (void *)afe); in mt8183_afe_pcm_dev_probe()
1207 INIT_LIST_HEAD(&afe->sub_dais); in mt8183_afe_pcm_dev_probe()
1210 ret = dai_register_cbs[i](afe); in mt8183_afe_pcm_dev_probe()
1212 dev_warn(afe->dev, "dai register i %d fail, ret %d\n", in mt8183_afe_pcm_dev_probe()
1219 ret = mtk_afe_combine_sub_dai(afe); in mt8183_afe_pcm_dev_probe()
1221 dev_warn(afe->dev, "mtk_afe_combine_sub_dai fail, ret %d\n", in mt8183_afe_pcm_dev_probe()
1226 afe->mtk_afe_hardware = &mt8183_afe_hardware; in mt8183_afe_pcm_dev_probe()
1227 afe->memif_fs = mt8183_memif_fs; in mt8183_afe_pcm_dev_probe()
1228 afe->irq_fs = mt8183_irq_fs; in mt8183_afe_pcm_dev_probe()
1230 afe->runtime_resume = mt8183_afe_runtime_resume; in mt8183_afe_pcm_dev_probe()
1231 afe->runtime_suspend = mt8183_afe_runtime_suspend; in mt8183_afe_pcm_dev_probe()
1242 ret = devm_snd_soc_register_component(afe->dev, in mt8183_afe_pcm_dev_probe()
1244 afe->dai_drivers, in mt8183_afe_pcm_dev_probe()
1245 afe->num_dai_drivers); in mt8183_afe_pcm_dev_probe()