Lines Matching refs:aemif
176 struct aemif_device *aemif = platform_get_drvdata(pdev); in aemif_config_abus() local
177 struct aemif_cs_data *data = &aemif->cs_data[csnum]; in aemif_config_abus()
179 unsigned long clk_rate = aemif->clk_rate; in aemif_config_abus()
183 offset = A1CR_OFFSET + (data->cs - aemif->cs_offset) * 4; in aemif_config_abus()
209 val = readl(aemif->base + offset); in aemif_config_abus()
212 writel(val, aemif->base + offset); in aemif_config_abus()
233 struct aemif_device *aemif = platform_get_drvdata(pdev); in aemif_get_hw_params() local
234 struct aemif_cs_data *data = &aemif->cs_data[csnum]; in aemif_get_hw_params()
235 unsigned long clk_rate = aemif->clk_rate; in aemif_get_hw_params()
238 offset = A1CR_OFFSET + (data->cs - aemif->cs_offset) * 4; in aemif_get_hw_params()
239 val = readl(aemif->base + offset); in aemif_get_hw_params()
264 struct aemif_device *aemif = platform_get_drvdata(pdev); in of_aemif_parse_abus_config() local
274 if (cs - aemif->cs_offset >= NUM_CS || cs < aemif->cs_offset) { in of_aemif_parse_abus_config()
279 if (aemif->num_cs >= NUM_CS) { in of_aemif_parse_abus_config()
284 data = &aemif->cs_data[aemif->num_cs]; in of_aemif_parse_abus_config()
288 aemif_get_hw_params(pdev, aemif->num_cs++); in of_aemif_parse_abus_config()
334 struct aemif_device *aemif; in aemif_probe() local
338 aemif = devm_kzalloc(dev, sizeof(*aemif), GFP_KERNEL); in aemif_probe()
339 if (!aemif) in aemif_probe()
345 platform_set_drvdata(pdev, aemif); in aemif_probe()
347 aemif->clk = devm_clk_get(dev, NULL); in aemif_probe()
348 if (IS_ERR(aemif->clk)) { in aemif_probe()
350 return PTR_ERR(aemif->clk); in aemif_probe()
353 ret = clk_prepare_enable(aemif->clk); in aemif_probe()
357 aemif->clk_rate = clk_get_rate(aemif->clk) / MSEC_PER_SEC; in aemif_probe()
360 aemif->cs_offset = 2; in aemif_probe()
362 aemif->cs_offset = pdata->cs_offset; in aemif_probe()
364 aemif->base = devm_platform_ioremap_resource(pdev, 0); in aemif_probe()
365 if (IS_ERR(aemif->base)) { in aemif_probe()
366 ret = PTR_ERR(aemif->base); in aemif_probe()
385 for (i = 0; i < pdata->num_abus_data; i++, aemif->num_cs++) { in aemif_probe()
386 aemif->cs_data[i].cs = pdata->abus_data[i].cs; in aemif_probe()
391 for (i = 0; i < aemif->num_cs; i++) { in aemif_probe()
395 aemif->cs_data[i].cs); in aemif_probe()
426 clk_disable_unprepare(aemif->clk); in aemif_probe()
432 struct aemif_device *aemif = platform_get_drvdata(pdev); in aemif_remove() local
434 clk_disable_unprepare(aemif->clk); in aemif_remove()