saif 149 drivers/clk/mxs/clk-imx23.c clks[saif] = mxs_clk_gate("saif", "saif_div", SAIF, 31); saif 51 sound/soc/mxs/mxs-saif.c struct mxs_saif *saif = snd_soc_dai_get_drvdata(cpu_dai); saif 55 sound/soc/mxs/mxs-saif.c saif->mclk = freq; saif 69 sound/soc/mxs/mxs-saif.c static inline struct mxs_saif *mxs_saif_get_master(struct mxs_saif * saif) saif 71 sound/soc/mxs/mxs-saif.c return mxs_saif[saif->master_id]; saif 77 sound/soc/mxs/mxs-saif.c static int mxs_saif_set_clk(struct mxs_saif *saif, saif 85 sound/soc/mxs/mxs-saif.c dev_dbg(saif->dev, "mclk %d rate %d\n", mclk, rate); saif 88 sound/soc/mxs/mxs-saif.c master_saif = mxs_saif_get_master(saif); saif 92 sound/soc/mxs/mxs-saif.c dev_dbg(saif->dev, "master saif%d\n", master_saif->id); saif 96 sound/soc/mxs/mxs-saif.c dev_err(saif->dev, saif 207 sound/soc/mxs/mxs-saif.c struct mxs_saif *saif = mxs_saif[saif_id]; saif 210 sound/soc/mxs/mxs-saif.c if (!saif) saif 213 sound/soc/mxs/mxs-saif.c stat = __raw_readl(saif->base + SAIF_STAT); saif 215 sound/soc/mxs/mxs-saif.c dev_err(saif->dev, "error: busy\n"); saif 219 sound/soc/mxs/mxs-saif.c clk_disable_unprepare(saif->clk); saif 223 sound/soc/mxs/mxs-saif.c saif->base + SAIF_CTRL + MXS_SET_ADDR); saif 225 sound/soc/mxs/mxs-saif.c saif->base + SAIF_CTRL + MXS_CLR_ADDR); saif 227 sound/soc/mxs/mxs-saif.c saif->mclk_in_use = 0; saif 241 sound/soc/mxs/mxs-saif.c struct mxs_saif *saif = mxs_saif[saif_id]; saif 246 sound/soc/mxs/mxs-saif.c if (!saif) saif 251 sound/soc/mxs/mxs-saif.c saif->base + SAIF_CTRL + MXS_CLR_ADDR); saif 255 sound/soc/mxs/mxs-saif.c saif->base + SAIF_CTRL + MXS_CLR_ADDR); saif 257 sound/soc/mxs/mxs-saif.c master_saif = mxs_saif_get_master(saif); saif 258 sound/soc/mxs/mxs-saif.c if (saif != master_saif) { saif 259 sound/soc/mxs/mxs-saif.c dev_err(saif->dev, "can not get mclk from a non-master saif\n"); saif 263 sound/soc/mxs/mxs-saif.c stat = __raw_readl(saif->base + SAIF_STAT); saif 265 sound/soc/mxs/mxs-saif.c dev_err(saif->dev, "error: busy\n"); saif 269 sound/soc/mxs/mxs-saif.c saif->mclk_in_use = 1; saif 270 sound/soc/mxs/mxs-saif.c ret = mxs_saif_set_clk(saif, mclk, rate); saif 274 sound/soc/mxs/mxs-saif.c ret = clk_prepare_enable(saif->clk); saif 280 sound/soc/mxs/mxs-saif.c saif->base + SAIF_CTRL + MXS_SET_ADDR); saif 294 sound/soc/mxs/mxs-saif.c struct mxs_saif *saif = snd_soc_dai_get_drvdata(cpu_dai); saif 296 sound/soc/mxs/mxs-saif.c stat = __raw_readl(saif->base + SAIF_STAT); saif 305 sound/soc/mxs/mxs-saif.c if (saif->id != saif->master_id) { saif 307 sound/soc/mxs/mxs-saif.c saif->base + SAIF_CTRL + MXS_CLR_ADDR); saif 309 sound/soc/mxs/mxs-saif.c saif->base + SAIF_CTRL + MXS_CLR_ADDR); saif 312 sound/soc/mxs/mxs-saif.c scr0 = __raw_readl(saif->base + SAIF_CTRL); saif 363 sound/soc/mxs/mxs-saif.c if (saif->id == saif->master_id) saif 368 sound/soc/mxs/mxs-saif.c __raw_writel(scr | scr0, saif->base + SAIF_CTRL); saif 380 sound/soc/mxs/mxs-saif.c struct mxs_saif *saif = snd_soc_dai_get_drvdata(cpu_dai); saif 384 sound/soc/mxs/mxs-saif.c saif->fifo_underrun = 0; saif 385 sound/soc/mxs/mxs-saif.c saif->fifo_overrun = 0; saif 389 sound/soc/mxs/mxs-saif.c saif->base + SAIF_CTRL + MXS_CLR_ADDR); saif 393 sound/soc/mxs/mxs-saif.c saif->base + SAIF_CTRL + MXS_CLR_ADDR); saif 395 sound/soc/mxs/mxs-saif.c ret = clk_prepare(saif->clk); saif 405 sound/soc/mxs/mxs-saif.c struct mxs_saif *saif = snd_soc_dai_get_drvdata(cpu_dai); saif 407 sound/soc/mxs/mxs-saif.c clk_unprepare(saif->clk); saif 418 sound/soc/mxs/mxs-saif.c struct mxs_saif *saif = snd_soc_dai_get_drvdata(cpu_dai); saif 423 sound/soc/mxs/mxs-saif.c master_saif = mxs_saif_get_master(saif); saif 428 sound/soc/mxs/mxs-saif.c if (!saif->mclk && saif->mclk_in_use) { saif 433 sound/soc/mxs/mxs-saif.c stat = __raw_readl(saif->base + SAIF_STAT); saif 434 sound/soc/mxs/mxs-saif.c if (!saif->mclk_in_use && (stat & BM_SAIF_STAT_BUSY)) { saif 444 sound/soc/mxs/mxs-saif.c ret = mxs_saif_set_clk(saif, saif->mclk, params_rate(params)); saif 450 sound/soc/mxs/mxs-saif.c if (saif != master_saif) { saif 458 sound/soc/mxs/mxs-saif.c clk_enable(saif->clk); saif 459 sound/soc/mxs/mxs-saif.c ret = clk_set_rate(saif->clk, 24000000); saif 460 sound/soc/mxs/mxs-saif.c clk_disable(saif->clk); saif 469 sound/soc/mxs/mxs-saif.c scr = __raw_readl(saif->base + SAIF_CTRL); saif 498 sound/soc/mxs/mxs-saif.c __raw_writel(scr, saif->base + SAIF_CTRL); saif 505 sound/soc/mxs/mxs-saif.c struct mxs_saif *saif = snd_soc_dai_get_drvdata(cpu_dai); saif 509 sound/soc/mxs/mxs-saif.c saif->base + SAIF_CTRL + MXS_SET_ADDR); saif 517 sound/soc/mxs/mxs-saif.c struct mxs_saif *saif = snd_soc_dai_get_drvdata(cpu_dai); saif 522 sound/soc/mxs/mxs-saif.c master_saif = mxs_saif_get_master(saif); saif 530 sound/soc/mxs/mxs-saif.c if (saif->state == MXS_SAIF_STATE_RUNNING) saif 537 sound/soc/mxs/mxs-saif.c dev_err(saif->dev, "Failed to enable master clock\n"); saif 545 sound/soc/mxs/mxs-saif.c if (saif != master_saif) { saif 546 sound/soc/mxs/mxs-saif.c ret = clk_enable(saif->clk); saif 548 sound/soc/mxs/mxs-saif.c dev_err(saif->dev, "Failed to enable master clock\n"); saif 554 sound/soc/mxs/mxs-saif.c saif->base + SAIF_CTRL + MXS_SET_ADDR); saif 569 sound/soc/mxs/mxs-saif.c __raw_writel(0, saif->base + SAIF_DATA); saif 570 sound/soc/mxs/mxs-saif.c __raw_writel(0, saif->base + SAIF_DATA); saif 579 sound/soc/mxs/mxs-saif.c __raw_readl(saif->base + SAIF_DATA); saif 580 sound/soc/mxs/mxs-saif.c __raw_readl(saif->base + SAIF_DATA); saif 584 sound/soc/mxs/mxs-saif.c saif->state = MXS_SAIF_STATE_RUNNING; saif 586 sound/soc/mxs/mxs-saif.c dev_dbg(saif->dev, "CTRL 0x%x STAT 0x%x\n", saif 587 sound/soc/mxs/mxs-saif.c __raw_readl(saif->base + SAIF_CTRL), saif 588 sound/soc/mxs/mxs-saif.c __raw_readl(saif->base + SAIF_STAT)); saif 597 sound/soc/mxs/mxs-saif.c if (saif->state == MXS_SAIF_STATE_STOPPED) saif 612 sound/soc/mxs/mxs-saif.c if (saif != master_saif) { saif 614 sound/soc/mxs/mxs-saif.c saif->base + SAIF_CTRL + MXS_CLR_ADDR); saif 616 sound/soc/mxs/mxs-saif.c clk_disable(saif->clk); saif 620 sound/soc/mxs/mxs-saif.c saif->state = MXS_SAIF_STATE_STOPPED; saif 647 sound/soc/mxs/mxs-saif.c struct mxs_saif *saif = dev_get_drvdata(dai->dev); saif 649 sound/soc/mxs/mxs-saif.c snd_soc_dai_set_drvdata(dai, saif); saif 678 sound/soc/mxs/mxs-saif.c struct mxs_saif *saif = dev_id; saif 681 sound/soc/mxs/mxs-saif.c stat = __raw_readl(saif->base + SAIF_STAT); saif 687 sound/soc/mxs/mxs-saif.c dev_dbg(saif->dev, "underrun!!! %d\n", ++saif->fifo_underrun); saif 689 sound/soc/mxs/mxs-saif.c saif->base + SAIF_STAT + MXS_CLR_ADDR); saif 693 sound/soc/mxs/mxs-saif.c dev_dbg(saif->dev, "overrun!!! %d\n", ++saif->fifo_overrun); saif 695 sound/soc/mxs/mxs-saif.c saif->base + SAIF_STAT + MXS_CLR_ADDR); saif 698 sound/soc/mxs/mxs-saif.c dev_dbg(saif->dev, "SAIF_CTRL %x SAIF_STAT %x\n", saif 699 sound/soc/mxs/mxs-saif.c __raw_readl(saif->base + SAIF_CTRL), saif 700 sound/soc/mxs/mxs-saif.c __raw_readl(saif->base + SAIF_STAT)); saif 707 sound/soc/mxs/mxs-saif.c struct mxs_saif *saif = platform_get_drvdata(pdev); saif 713 sound/soc/mxs/mxs-saif.c __clk_get_name(saif->clk), 0, saif 714 sound/soc/mxs/mxs-saif.c saif->base + SAIF_CTRL, saif 735 sound/soc/mxs/mxs-saif.c struct mxs_saif *saif; saif 742 sound/soc/mxs/mxs-saif.c saif = devm_kzalloc(&pdev->dev, sizeof(*saif), GFP_KERNEL); saif 743 sound/soc/mxs/mxs-saif.c if (!saif) saif 750 sound/soc/mxs/mxs-saif.c saif->id = ret; saif 752 sound/soc/mxs/mxs-saif.c if (saif->id >= ARRAY_SIZE(mxs_saif)) { saif 764 sound/soc/mxs/mxs-saif.c saif->master_id = saif->id; saif 770 sound/soc/mxs/mxs-saif.c saif->master_id = ret; saif 772 sound/soc/mxs/mxs-saif.c if (saif->master_id >= ARRAY_SIZE(mxs_saif)) { saif 778 sound/soc/mxs/mxs-saif.c mxs_saif[saif->id] = saif; saif 780 sound/soc/mxs/mxs-saif.c saif->clk = devm_clk_get(&pdev->dev, NULL); saif 781 sound/soc/mxs/mxs-saif.c if (IS_ERR(saif->clk)) { saif 782 sound/soc/mxs/mxs-saif.c ret = PTR_ERR(saif->clk); saif 788 sound/soc/mxs/mxs-saif.c saif->base = devm_platform_ioremap_resource(pdev, 0); saif 789 sound/soc/mxs/mxs-saif.c if (IS_ERR(saif->base)) saif 790 sound/soc/mxs/mxs-saif.c return PTR_ERR(saif->base); saif 796 sound/soc/mxs/mxs-saif.c saif->dev = &pdev->dev; saif 798 sound/soc/mxs/mxs-saif.c dev_name(&pdev->dev), saif); saif 804 sound/soc/mxs/mxs-saif.c platform_set_drvdata(pdev, saif); saif 807 sound/soc/mxs/mxs-saif.c if (saif->id == 0) {