Lines Matching refs:ctx
148 static int sst_platform_get_resources(struct intel_sst_drv *ctx) in sst_platform_get_resources() argument
151 struct platform_device *pdev = to_platform_device(ctx->dev); in sst_platform_get_resources()
156 ctx->pdata->res_info->acpi_lpe_res_index); in sst_platform_get_resources()
158 dev_err(ctx->dev, "Invalid SHIM base from IFWI\n"); in sst_platform_get_resources()
161 dev_info(ctx->dev, "LPE base: %#x size:%#x", (unsigned int) rsrc->start, in sst_platform_get_resources()
164 ctx->iram_base = rsrc->start + ctx->pdata->res_info->iram_offset; in sst_platform_get_resources()
165 ctx->iram_end = ctx->iram_base + ctx->pdata->res_info->iram_size - 1; in sst_platform_get_resources()
166 dev_info(ctx->dev, "IRAM base: %#x", ctx->iram_base); in sst_platform_get_resources()
167 ctx->iram = devm_ioremap(ctx->dev, ctx->iram_base, in sst_platform_get_resources()
168 ctx->pdata->res_info->iram_size); in sst_platform_get_resources()
169 if (!ctx->iram) { in sst_platform_get_resources()
170 dev_err(ctx->dev, "unable to map IRAM\n"); in sst_platform_get_resources()
174 ctx->dram_base = rsrc->start + ctx->pdata->res_info->dram_offset; in sst_platform_get_resources()
175 ctx->dram_end = ctx->dram_base + ctx->pdata->res_info->dram_size - 1; in sst_platform_get_resources()
176 dev_info(ctx->dev, "DRAM base: %#x", ctx->dram_base); in sst_platform_get_resources()
177 ctx->dram = devm_ioremap(ctx->dev, ctx->dram_base, in sst_platform_get_resources()
178 ctx->pdata->res_info->dram_size); in sst_platform_get_resources()
179 if (!ctx->dram) { in sst_platform_get_resources()
180 dev_err(ctx->dev, "unable to map DRAM\n"); in sst_platform_get_resources()
184 ctx->shim_phy_add = rsrc->start + ctx->pdata->res_info->shim_offset; in sst_platform_get_resources()
185 dev_info(ctx->dev, "SHIM base: %#x", ctx->shim_phy_add); in sst_platform_get_resources()
186 ctx->shim = devm_ioremap(ctx->dev, ctx->shim_phy_add, in sst_platform_get_resources()
187 ctx->pdata->res_info->shim_size); in sst_platform_get_resources()
188 if (!ctx->shim) { in sst_platform_get_resources()
189 dev_err(ctx->dev, "unable to map SHIM\n"); in sst_platform_get_resources()
194 ctx->shim_phy_add = ctx->pdata->res_info->shim_phy_addr; in sst_platform_get_resources()
197 ctx->mailbox_add = rsrc->start + ctx->pdata->res_info->mbox_offset; in sst_platform_get_resources()
198 dev_info(ctx->dev, "Mailbox base: %#x", ctx->mailbox_add); in sst_platform_get_resources()
199 ctx->mailbox = devm_ioremap(ctx->dev, ctx->mailbox_add, in sst_platform_get_resources()
200 ctx->pdata->res_info->mbox_size); in sst_platform_get_resources()
201 if (!ctx->mailbox) { in sst_platform_get_resources()
202 dev_err(ctx->dev, "unable to map mailbox\n"); in sst_platform_get_resources()
207 ctx->mailbox_add = ctx->info.mailbox_start; in sst_platform_get_resources()
210 ctx->pdata->res_info->acpi_ddr_index); in sst_platform_get_resources()
212 dev_err(ctx->dev, "Invalid DDR base from IFWI\n"); in sst_platform_get_resources()
215 ctx->ddr_base = rsrc->start; in sst_platform_get_resources()
216 ctx->ddr_end = rsrc->end; in sst_platform_get_resources()
217 dev_info(ctx->dev, "DDR base: %#x", ctx->ddr_base); in sst_platform_get_resources()
218 ctx->ddr = devm_ioremap(ctx->dev, ctx->ddr_base, in sst_platform_get_resources()
220 if (!ctx->ddr) { in sst_platform_get_resources()
221 dev_err(ctx->dev, "unable to map DDR\n"); in sst_platform_get_resources()
226 ctx->irq_num = platform_get_irq(pdev, in sst_platform_get_resources()
227 ctx->pdata->res_info->acpi_ipc_irq_index); in sst_platform_get_resources()
228 if (ctx->irq_num <= 0) in sst_platform_get_resources()
229 return ctx->irq_num < 0 ? ctx->irq_num : -EIO; in sst_platform_get_resources()
238 struct intel_sst_drv *ctx; in sst_acpi_probe() local
279 ret = sst_alloc_drv_context(&ctx, dev, dev_id); in sst_acpi_probe()
313 ctx->pdata = pdata; in sst_acpi_probe()
314 strcpy(ctx->firmware_name, mach->fw_filename); in sst_acpi_probe()
316 ret = sst_platform_get_resources(ctx); in sst_acpi_probe()
320 ret = sst_context_init(ctx); in sst_acpi_probe()
324 sst_configure_runtime_pm(ctx); in sst_acpi_probe()
325 platform_set_drvdata(pdev, ctx); in sst_acpi_probe()
339 struct intel_sst_drv *ctx; in sst_acpi_remove() local
341 ctx = platform_get_drvdata(pdev); in sst_acpi_remove()
342 sst_context_cleanup(ctx); in sst_acpi_remove()