Lines Matching full:mca

3 // Apple SoCs MCA driver
7 // The MCA peripheral is made up of a number of identical units called clusters.
182 struct mca_data *mca = snd_soc_dai_get_drvdata(dai); in mca_dai_to_cluster() local
187 int cluster_no = dai->id % mca->nclusters; in mca_dai_to_cluster()
189 return &mca->clusters[cluster_no]; in mca_dai_to_cluster()
253 struct mca_data *mca = cl->host; in mca_fe_enable_clocks() local
258 dev_err(mca->dev, in mca_fe_enable_clocks()
269 cl->pd_link = device_link_add(mca->dev, cl->pd_dev, in mca_fe_enable_clocks()
273 dev_err(mca->dev, in mca_fe_enable_clocks()
298 struct mca_data *mca = cl->host; in mca_fe_clocks_in_use() local
302 mutex_lock(&mca->port_mutex); in mca_fe_clocks_in_use()
303 for (i = 0; i < mca->nclusters; i++) { in mca_fe_clocks_in_use()
304 be_cl = &mca->clusters[i]; in mca_fe_clocks_in_use()
311 mutex_unlock(&mca->port_mutex); in mca_fe_clocks_in_use()
316 mutex_unlock(&mca->port_mutex); in mca_fe_clocks_in_use()
324 struct mca_data *mca = cl->host; in mca_be_prepare() local
331 fe_cl = &mca->clusters[cl->port_driver]; in mca_be_prepare()
354 struct mca_data *mca = cl->host; in mca_be_hw_free() local
365 fe_cl = &mca->clusters[cl->port_driver]; in mca_be_hw_free()
475 struct mca_data *mca = cl->host; in mca_fe_set_fmt() local
526 dev_err(mca->dev, "unsupported DAI format (0x%x) requested\n", fmt); in mca_fe_set_fmt()
562 struct mca_data *mca = cl->host; in mca_fe_hw_params() local
563 struct device *dev = mca->dev; in mca_fe_hw_params()
642 writel_relaxed(regval, mca->switch_base + REG_DMA_ADAPTER_A(cl->no)); in mca_fe_hw_params()
646 mca->switch_base + REG_DMA_ADAPTER_A(cl->no)); in mca_fe_hw_params()
649 mca->switch_base + REG_DMA_ADAPTER_B(cl->no)); in mca_fe_hw_params()
665 dev_err(mca->dev, "cluster %d: unable to set clock parent: %d\n", in mca_fe_hw_params()
699 struct mca_data *mca = cl->host; in mca_be_startup() local
706 dev_err(mca->dev, "many FE per one BE unsupported\n"); in mca_be_startup()
737 mutex_lock(&mca->port_mutex); in mca_be_startup()
739 mutex_unlock(&mca->port_mutex); in mca_be_startup()
749 struct mca_data *mca = cl->host; in mca_be_shutdown() local
760 mutex_lock(&mca->port_mutex); in mca_be_shutdown()
762 mutex_unlock(&mca->port_mutex); in mca_be_shutdown()
961 .name = "apple-mca",
971 static void apple_mca_release(struct mca_data *mca) in apple_mca_release() argument
975 for (i = 0; i < mca->nclusters; i++) { in apple_mca_release()
976 struct mca_cluster *cl = &mca->clusters[i]; in apple_mca_release()
985 if (mca->pd_link) in apple_mca_release()
986 device_link_del(mca->pd_link); in apple_mca_release()
988 if (!IS_ERR_OR_NULL(mca->pd_dev)) in apple_mca_release()
989 dev_pm_domain_detach(mca->pd_dev, true); in apple_mca_release()
991 reset_control_rearm(mca->rstc); in apple_mca_release()
996 struct mca_data *mca; in apple_mca_probe() local
1012 mca = devm_kzalloc(&pdev->dev, struct_size(mca, clusters, nclusters), in apple_mca_probe()
1014 if (!mca) in apple_mca_probe()
1016 mca->dev = &pdev->dev; in apple_mca_probe()
1017 mca->nclusters = nclusters; in apple_mca_probe()
1018 mutex_init(&mca->port_mutex); in apple_mca_probe()
1019 platform_set_drvdata(pdev, mca); in apple_mca_probe()
1020 clusters = mca->clusters; in apple_mca_probe()
1022 mca->switch_base = in apple_mca_probe()
1024 if (IS_ERR(mca->switch_base)) in apple_mca_probe()
1025 return PTR_ERR(mca->switch_base); in apple_mca_probe()
1027 mca->rstc = devm_reset_control_get_optional_shared(&pdev->dev, NULL); in apple_mca_probe()
1028 if (IS_ERR(mca->rstc)) in apple_mca_probe()
1029 return PTR_ERR(mca->rstc); in apple_mca_probe()
1036 mca->pd_dev = dev_pm_domain_attach_by_id(&pdev->dev, 0); in apple_mca_probe()
1037 if (IS_ERR(mca->pd_dev)) in apple_mca_probe()
1040 mca->pd_link = device_link_add(&pdev->dev, mca->pd_dev, in apple_mca_probe()
1043 if (!mca->pd_link) { in apple_mca_probe()
1046 mca->rstc = NULL; in apple_mca_probe()
1050 reset_control_reset(mca->rstc); in apple_mca_probe()
1055 &dai_drivers[mca->nclusters + i]; in apple_mca_probe()
1058 cl->host = mca; in apple_mca_probe()
1080 devm_kasprintf(&pdev->dev, GFP_KERNEL, "mca-pcm-%d", i); in apple_mca_probe()
1107 be->name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "mca-i2s-%d", i); in apple_mca_probe()
1143 apple_mca_release(mca); in apple_mca_probe()
1149 struct mca_data *mca = platform_get_drvdata(pdev); in apple_mca_remove() local
1152 apple_mca_release(mca); in apple_mca_remove()
1157 { .compatible = "apple,mca", },
1164 .name = "apple-mca",
1173 MODULE_DESCRIPTION("ASoC Apple MCA driver");