static int __init omap1_mcbsp_init(void) { if (!cpu_class_is_omap1()) return -ENODEV; if (cpu_is_omap7xx()) { omap_mcbsp_count = OMAP7XX_MCBSP_PDATA_SZ; omap_mcbsp_cache_size = OMAP7XX_MCBSP_REG_NUM * sizeof(u16); } else if (cpu_is_omap15xx()) { omap_mcbsp_count = OMAP15XX_MCBSP_PDATA_SZ; omap_mcbsp_cache_size = OMAP15XX_MCBSP_REG_NUM * sizeof(u16); } else if (cpu_is_omap16xx()) { omap_mcbsp_count = OMAP16XX_MCBSP_PDATA_SZ; omap_mcbsp_cache_size = OMAP16XX_MCBSP_REG_NUM * sizeof(u16); } mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), GFP_KERNEL); if (!mcbsp_ptr) return -ENOMEM; if (cpu_is_omap7xx()) omap_mcbsp_register_board_cfg(omap7xx_mcbsp_pdata, OMAP7XX_MCBSP_PDATA_SZ); if (cpu_is_omap15xx()) omap_mcbsp_register_board_cfg(omap15xx_mcbsp_pdata, OMAP15XX_MCBSP_PDATA_SZ); if (cpu_is_omap16xx()) omap_mcbsp_register_board_cfg(omap16xx_mcbsp_pdata, OMAP16XX_MCBSP_PDATA_SZ); return omap_mcbsp_init(); }
int __init omap1_mcbsp_init(void) { int i; for (i = 0; i < omap_mcbsp_clks_size; i++) { if (cpu_is_omap15xx() || cpu_is_omap16xx()) { omap_mcbsp_clk_init(&omap_mcbsp_clks[i]); clk_register(&omap_mcbsp_clks[i].clk); } } if (cpu_is_omap730()) omap_mcbsp_register_board_cfg(omap730_mcbsp_pdata, OMAP730_MCBSP_PDATA_SZ); if (cpu_is_omap15xx()) omap_mcbsp_register_board_cfg(omap15xx_mcbsp_pdata, OMAP15XX_MCBSP_PDATA_SZ); if (cpu_is_omap16xx()) omap_mcbsp_register_board_cfg(omap16xx_mcbsp_pdata, OMAP16XX_MCBSP_PDATA_SZ); return omap_mcbsp_init(); }
static int __init omap2_mcbsp_init(void) { if (cpu_is_omap2420()) omap_mcbsp_count = OMAP2420_MCBSP_PDATA_SZ; if (cpu_is_omap2430()) omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ; if (cpu_is_omap34xx()) omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ; mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), GFP_KERNEL); if (!mcbsp_ptr) return -ENOMEM; if (cpu_is_omap2420()) omap_mcbsp_register_board_cfg(omap2420_mcbsp_pdata, OMAP2420_MCBSP_PDATA_SZ); if (cpu_is_omap2430()) omap_mcbsp_register_board_cfg(omap2430_mcbsp_pdata, OMAP2430_MCBSP_PDATA_SZ); if (cpu_is_omap34xx()) omap_mcbsp_register_board_cfg(omap34xx_mcbsp_pdata, OMAP34XX_MCBSP_PDATA_SZ); return omap_mcbsp_init(); }
int __init omap1_mcbsp_init(void) { if (cpu_is_omap730()) omap_mcbsp_count = OMAP730_MCBSP_PDATA_SZ; if (cpu_is_omap15xx()) omap_mcbsp_count = OMAP15XX_MCBSP_PDATA_SZ; if (cpu_is_omap16xx()) omap_mcbsp_count = OMAP16XX_MCBSP_PDATA_SZ; mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), GFP_KERNEL); if (!mcbsp_ptr) return -ENOMEM; if (cpu_is_omap730()) omap_mcbsp_register_board_cfg(omap730_mcbsp_pdata, OMAP730_MCBSP_PDATA_SZ); if (cpu_is_omap15xx()) omap_mcbsp_register_board_cfg(omap15xx_mcbsp_pdata, OMAP15XX_MCBSP_PDATA_SZ); if (cpu_is_omap16xx()) omap_mcbsp_register_board_cfg(omap16xx_mcbsp_pdata, OMAP16XX_MCBSP_PDATA_SZ); return omap_mcbsp_init(); }
static __devinit int asoc_mcbsp_probe(struct platform_device *pdev) { struct omap_mcbsp_platform_data *pdata = dev_get_platdata(&pdev->dev); struct omap_mcbsp *mcbsp; int ret; if (!pdata) { dev_err(&pdev->dev, "missing platform data.\n"); return -EINVAL; } mcbsp = devm_kzalloc(&pdev->dev, sizeof(struct omap_mcbsp), GFP_KERNEL); if (!mcbsp) return -ENOMEM; mcbsp->id = pdev->id; mcbsp->pdata = pdata; mcbsp->dev = &pdev->dev; platform_set_drvdata(pdev, mcbsp); /* McBSP must be active during suspend in voice calls */ if (pdata->disable_idle_on_suspend) pdata->disable_idle_on_suspend(pdev); ret = omap_mcbsp_init(pdev); if (!ret) return snd_soc_register_dai(&pdev->dev, &omap_mcbsp_dai); return ret; }
static int asoc_mcbsp_probe(struct platform_device *pdev) { struct omap_mcbsp_platform_data *pdata = dev_get_platdata(&pdev->dev); struct omap_mcbsp *mcbsp; const struct of_device_id *match; int ret; match = of_match_device(omap_mcbsp_of_match, &pdev->dev); if (match) { struct device_node *node = pdev->dev.of_node; struct omap_mcbsp_platform_data *pdata_quirk = pdata; int buffer_size; pdata = devm_kzalloc(&pdev->dev, sizeof(struct omap_mcbsp_platform_data), GFP_KERNEL); if (!pdata) return -ENOMEM; memcpy(pdata, match->data, sizeof(*pdata)); if (!of_property_read_u32(node, "ti,buffer-size", &buffer_size)) pdata->buffer_size = buffer_size; if (pdata_quirk) pdata->force_ick_on = pdata_quirk->force_ick_on; } else if (!pdata) { dev_err(&pdev->dev, "missing platform data.\n"); return -EINVAL; } mcbsp = devm_kzalloc(&pdev->dev, sizeof(struct omap_mcbsp), GFP_KERNEL); if (!mcbsp) return -ENOMEM; mcbsp->id = pdev->id; mcbsp->pdata = pdata; mcbsp->dev = &pdev->dev; platform_set_drvdata(pdev, mcbsp); ret = omap_mcbsp_init(pdev); if (ret) return ret; ret = devm_snd_soc_register_component(&pdev->dev, &omap_mcbsp_component, &omap_mcbsp_dai, 1); if (ret) return ret; return omap_pcm_platform_register(&pdev->dev); }
static int __init omap2_mcbsp_init(void) { omap_hwmod_for_each_by_class("mcbsp_sidetone", omap_mcbsp_st, NULL); omap_hwmod_for_each_by_class("mcbsp", omap_init_mcbsp, NULL); mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), GFP_KERNEL); if (!mcbsp_ptr) { pr_err("%s: No memory for mcbsp\n", __func__); return -ENOMEM; } return omap_mcbsp_init(); }
static int __init omap1_mcbsp_init(void) { if (!cpu_class_is_omap1()) return -ENODEV; if (cpu_is_omap7xx()) omap_mcbsp_count = OMAP7XX_MCBSP_COUNT; else if (cpu_is_omap15xx()) omap_mcbsp_count = OMAP15XX_MCBSP_COUNT; else if (cpu_is_omap16xx()) omap_mcbsp_count = OMAP16XX_MCBSP_COUNT; mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), GFP_KERNEL); if (!mcbsp_ptr) return -ENOMEM; if (cpu_is_omap7xx()) omap_mcbsp_register_board_cfg(omap7xx_mcbsp_res_0, OMAP7XX_MCBSP_RES_SZ, omap7xx_mcbsp_pdata, OMAP7XX_MCBSP_COUNT); if (cpu_is_omap15xx()) omap_mcbsp_register_board_cfg(omap15xx_mcbsp_res_0, OMAP15XX_MCBSP_RES_SZ, omap15xx_mcbsp_pdata, OMAP15XX_MCBSP_COUNT); if (cpu_is_omap16xx()) omap_mcbsp_register_board_cfg(omap16xx_mcbsp_res_0, OMAP16XX_MCBSP_RES_SZ, omap16xx_mcbsp_pdata, OMAP16XX_MCBSP_COUNT); return omap_mcbsp_init(); }
int __init omap1_mcbsp_init(void) { int i; for (i = 0; i < omap_mcbsp_clks_size; i++) { if (cpu_is_omap15xx() || cpu_is_omap16xx()) { omap_mcbsp_clk_init(&omap_mcbsp_clks[i]); clk_register(&omap_mcbsp_clks[i].clk); } } if (cpu_is_omap730()) omap_mcbsp_count = OMAP730_MCBSP_PDATA_SZ; if (cpu_is_omap15xx()) omap_mcbsp_count = OMAP15XX_MCBSP_PDATA_SZ; if (cpu_is_omap16xx()) omap_mcbsp_count = OMAP16XX_MCBSP_PDATA_SZ; mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), GFP_KERNEL); if (!mcbsp_ptr) return -ENOMEM; if (cpu_is_omap730()) omap_mcbsp_register_board_cfg(omap730_mcbsp_pdata, OMAP730_MCBSP_PDATA_SZ); if (cpu_is_omap15xx()) omap_mcbsp_register_board_cfg(omap15xx_mcbsp_pdata, OMAP15XX_MCBSP_PDATA_SZ); if (cpu_is_omap16xx()) omap_mcbsp_register_board_cfg(omap16xx_mcbsp_pdata, OMAP16XX_MCBSP_PDATA_SZ); return omap_mcbsp_init(); }