Lines Matching +full:designware +full:- +full:i2s

105 	adev->acp.parent = adev->dev;  in acp_sw_init()
107 adev->acp.cgs_device = in acp_sw_init()
109 if (!adev->acp.cgs_device) in acp_sw_init()
110 return -EINVAL; in acp_sw_init()
119 if (adev->acp.cgs_device) in acp_sw_fini()
120 amdgpu_cgs_destroy_device(adev->acp.cgs_device); in acp_sw_fini()
136 adev = apd->adev; in acp_poweroff()
153 adev = apd->adev; in acp_poweron()
220 * acp_hw_init - start and test ACP block
239 return -EINVAL; in acp_hw_init()
241 r = amd_acp_hw_init(adev->acp.cgs_device, in acp_hw_init()
242 ip_block->version->major, ip_block->version->minor); in acp_hw_init()
243 /* -ENODEV means board uses AZ rather than ACP */ in acp_hw_init()
244 if (r == -ENODEV) { in acp_hw_init()
251 if (adev->rmmio_size == 0 || adev->rmmio_size < 0x5289) in acp_hw_init()
252 return -EINVAL; in acp_hw_init()
254 acp_base = adev->rmmio_base; in acp_hw_init()
255 adev->acp.acp_genpd = kzalloc(sizeof(struct acp_pm_domain), GFP_KERNEL); in acp_hw_init()
256 if (!adev->acp.acp_genpd) in acp_hw_init()
257 return -ENOMEM; in acp_hw_init()
259 adev->acp.acp_genpd->gpd.name = "ACP_AUDIO"; in acp_hw_init()
260 adev->acp.acp_genpd->gpd.power_off = acp_poweroff; in acp_hw_init()
261 adev->acp.acp_genpd->gpd.power_on = acp_poweron; in acp_hw_init()
262 adev->acp.acp_genpd->adev = adev; in acp_hw_init()
264 pm_genpd_init(&adev->acp.acp_genpd->gpd, NULL, false); in acp_hw_init()
269 adev->acp.acp_cell = kcalloc(2, sizeof(struct mfd_cell), in acp_hw_init()
271 if (!adev->acp.acp_cell) { in acp_hw_init()
272 r = -ENOMEM; in acp_hw_init()
276 adev->acp.acp_res = kcalloc(3, sizeof(struct resource), GFP_KERNEL); in acp_hw_init()
277 if (!adev->acp.acp_res) { in acp_hw_init()
278 r = -ENOMEM; in acp_hw_init()
284 r = -ENOMEM; in acp_hw_init()
295 adev->acp.acp_res[0].name = "acp2x_dma"; in acp_hw_init()
296 adev->acp.acp_res[0].flags = IORESOURCE_MEM; in acp_hw_init()
297 adev->acp.acp_res[0].start = acp_base; in acp_hw_init()
298 adev->acp.acp_res[0].end = acp_base + ACP_DMA_REGS_END; in acp_hw_init()
300 adev->acp.acp_res[1].name = "acp2x_dw_i2s_play_cap"; in acp_hw_init()
301 adev->acp.acp_res[1].flags = IORESOURCE_MEM; in acp_hw_init()
302 adev->acp.acp_res[1].start = acp_base + ACP_I2S_CAP_REGS_START; in acp_hw_init()
303 adev->acp.acp_res[1].end = acp_base + ACP_I2S_CAP_REGS_END; in acp_hw_init()
305 adev->acp.acp_res[2].name = "acp2x_dma_irq"; in acp_hw_init()
306 adev->acp.acp_res[2].flags = IORESOURCE_IRQ; in acp_hw_init()
307 adev->acp.acp_res[2].start = amdgpu_irq_create_mapping(adev, 162); in acp_hw_init()
308 adev->acp.acp_res[2].end = adev->acp.acp_res[2].start; in acp_hw_init()
310 adev->acp.acp_cell[0].name = "acp_audio_dma"; in acp_hw_init()
311 adev->acp.acp_cell[0].num_resources = 3; in acp_hw_init()
312 adev->acp.acp_cell[0].resources = &adev->acp.acp_res[0]; in acp_hw_init()
313 adev->acp.acp_cell[0].platform_data = &adev->asic_type; in acp_hw_init()
314 adev->acp.acp_cell[0].pdata_size = sizeof(adev->asic_type); in acp_hw_init()
316 adev->acp.acp_cell[1].name = "designware-i2s"; in acp_hw_init()
317 adev->acp.acp_cell[1].num_resources = 1; in acp_hw_init()
318 adev->acp.acp_cell[1].resources = &adev->acp.acp_res[1]; in acp_hw_init()
319 adev->acp.acp_cell[1].platform_data = &i2s_pdata[0]; in acp_hw_init()
320 adev->acp.acp_cell[1].pdata_size = sizeof(struct i2s_platform_data); in acp_hw_init()
321 r = mfd_add_hotplug_devices(adev->acp.parent, adev->acp.acp_cell, 2); in acp_hw_init()
324 r = device_for_each_child(adev->acp.parent, &adev->acp.acp_genpd->gpd, in acp_hw_init()
331 adev->acp.acp_cell = kcalloc(ACP_DEVS, sizeof(struct mfd_cell), in acp_hw_init()
334 if (!adev->acp.acp_cell) { in acp_hw_init()
335 r = -ENOMEM; in acp_hw_init()
339 adev->acp.acp_res = kcalloc(5, sizeof(struct resource), GFP_KERNEL); in acp_hw_init()
340 if (!adev->acp.acp_res) { in acp_hw_init()
341 r = -ENOMEM; in acp_hw_init()
347 r = -ENOMEM; in acp_hw_init()
351 switch (adev->asic_type) { in acp_hw_init()
363 switch (adev->asic_type) { in acp_hw_init()
380 switch (adev->asic_type) { in acp_hw_init()
393 adev->acp.acp_res[0].name = "acp2x_dma"; in acp_hw_init()
394 adev->acp.acp_res[0].flags = IORESOURCE_MEM; in acp_hw_init()
395 adev->acp.acp_res[0].start = acp_base; in acp_hw_init()
396 adev->acp.acp_res[0].end = acp_base + ACP_DMA_REGS_END; in acp_hw_init()
398 adev->acp.acp_res[1].name = "acp2x_dw_i2s_play"; in acp_hw_init()
399 adev->acp.acp_res[1].flags = IORESOURCE_MEM; in acp_hw_init()
400 adev->acp.acp_res[1].start = acp_base + ACP_I2S_PLAY_REGS_START; in acp_hw_init()
401 adev->acp.acp_res[1].end = acp_base + ACP_I2S_PLAY_REGS_END; in acp_hw_init()
403 adev->acp.acp_res[2].name = "acp2x_dw_i2s_cap"; in acp_hw_init()
404 adev->acp.acp_res[2].flags = IORESOURCE_MEM; in acp_hw_init()
405 adev->acp.acp_res[2].start = acp_base + ACP_I2S_CAP_REGS_START; in acp_hw_init()
406 adev->acp.acp_res[2].end = acp_base + ACP_I2S_CAP_REGS_END; in acp_hw_init()
408 adev->acp.acp_res[3].name = "acp2x_dw_bt_i2s_play_cap"; in acp_hw_init()
409 adev->acp.acp_res[3].flags = IORESOURCE_MEM; in acp_hw_init()
410 adev->acp.acp_res[3].start = acp_base + ACP_BT_PLAY_REGS_START; in acp_hw_init()
411 adev->acp.acp_res[3].end = acp_base + ACP_BT_PLAY_REGS_END; in acp_hw_init()
413 adev->acp.acp_res[4].name = "acp2x_dma_irq"; in acp_hw_init()
414 adev->acp.acp_res[4].flags = IORESOURCE_IRQ; in acp_hw_init()
415 adev->acp.acp_res[4].start = amdgpu_irq_create_mapping(adev, 162); in acp_hw_init()
416 adev->acp.acp_res[4].end = adev->acp.acp_res[4].start; in acp_hw_init()
418 adev->acp.acp_cell[0].name = "acp_audio_dma"; in acp_hw_init()
419 adev->acp.acp_cell[0].num_resources = 5; in acp_hw_init()
420 adev->acp.acp_cell[0].resources = &adev->acp.acp_res[0]; in acp_hw_init()
421 adev->acp.acp_cell[0].platform_data = &adev->asic_type; in acp_hw_init()
422 adev->acp.acp_cell[0].pdata_size = sizeof(adev->asic_type); in acp_hw_init()
424 adev->acp.acp_cell[1].name = "designware-i2s"; in acp_hw_init()
425 adev->acp.acp_cell[1].num_resources = 1; in acp_hw_init()
426 adev->acp.acp_cell[1].resources = &adev->acp.acp_res[1]; in acp_hw_init()
427 adev->acp.acp_cell[1].platform_data = &i2s_pdata[0]; in acp_hw_init()
428 adev->acp.acp_cell[1].pdata_size = sizeof(struct i2s_platform_data); in acp_hw_init()
430 adev->acp.acp_cell[2].name = "designware-i2s"; in acp_hw_init()
431 adev->acp.acp_cell[2].num_resources = 1; in acp_hw_init()
432 adev->acp.acp_cell[2].resources = &adev->acp.acp_res[2]; in acp_hw_init()
433 adev->acp.acp_cell[2].platform_data = &i2s_pdata[1]; in acp_hw_init()
434 adev->acp.acp_cell[2].pdata_size = sizeof(struct i2s_platform_data); in acp_hw_init()
436 adev->acp.acp_cell[3].name = "designware-i2s"; in acp_hw_init()
437 adev->acp.acp_cell[3].num_resources = 1; in acp_hw_init()
438 adev->acp.acp_cell[3].resources = &adev->acp.acp_res[3]; in acp_hw_init()
439 adev->acp.acp_cell[3].platform_data = &i2s_pdata[2]; in acp_hw_init()
440 adev->acp.acp_cell[3].pdata_size = sizeof(struct i2s_platform_data); in acp_hw_init()
442 r = mfd_add_hotplug_devices(adev->acp.parent, adev->acp.acp_cell, ACP_DEVS); in acp_hw_init()
446 r = device_for_each_child(adev->acp.parent, &adev->acp.acp_genpd->gpd, in acp_hw_init()
453 val = cgs_read_register(adev->acp.cgs_device, mmACP_SOFT_RESET); in acp_hw_init()
456 cgs_write_register(adev->acp.cgs_device, mmACP_SOFT_RESET, val); in acp_hw_init()
460 val = cgs_read_register(adev->acp.cgs_device, mmACP_SOFT_RESET); in acp_hw_init()
464 if (--count == 0) { in acp_hw_init()
465 dev_err(&adev->pdev->dev, "Failed to reset ACP\n"); in acp_hw_init()
466 r = -ETIMEDOUT; in acp_hw_init()
472 val = cgs_read_register(adev->acp.cgs_device, mmACP_CONTROL); in acp_hw_init()
474 cgs_write_register(adev->acp.cgs_device, mmACP_CONTROL, val); in acp_hw_init()
479 val = cgs_read_register(adev->acp.cgs_device, mmACP_STATUS); in acp_hw_init()
482 if (--count == 0) { in acp_hw_init()
483 dev_err(&adev->pdev->dev, "Failed to reset ACP\n"); in acp_hw_init()
484 r = -ETIMEDOUT; in acp_hw_init()
490 val = cgs_read_register(adev->acp.cgs_device, mmACP_SOFT_RESET); in acp_hw_init()
492 cgs_write_register(adev->acp.cgs_device, mmACP_SOFT_RESET, val); in acp_hw_init()
497 kfree(adev->acp.acp_res); in acp_hw_init()
498 kfree(adev->acp.acp_cell); in acp_hw_init()
499 kfree(adev->acp.acp_genpd); in acp_hw_init()
504 * acp_hw_fini - stop the hardware block
516 if (!adev->acp.acp_genpd) { in acp_hw_fini()
522 val = cgs_read_register(adev->acp.cgs_device, mmACP_SOFT_RESET); in acp_hw_fini()
525 cgs_write_register(adev->acp.cgs_device, mmACP_SOFT_RESET, val); in acp_hw_fini()
529 val = cgs_read_register(adev->acp.cgs_device, mmACP_SOFT_RESET); in acp_hw_fini()
533 if (--count == 0) { in acp_hw_fini()
534 dev_err(&adev->pdev->dev, "Failed to reset ACP\n"); in acp_hw_fini()
535 return -ETIMEDOUT; in acp_hw_fini()
540 val = cgs_read_register(adev->acp.cgs_device, mmACP_CONTROL); in acp_hw_fini()
542 cgs_write_register(adev->acp.cgs_device, mmACP_CONTROL, val); in acp_hw_fini()
547 val = cgs_read_register(adev->acp.cgs_device, mmACP_STATUS); in acp_hw_fini()
550 if (--count == 0) { in acp_hw_fini()
551 dev_err(&adev->pdev->dev, "Failed to reset ACP\n"); in acp_hw_fini()
552 return -ETIMEDOUT; in acp_hw_fini()
557 device_for_each_child(adev->acp.parent, NULL, in acp_hw_fini()
560 mfd_remove_devices(adev->acp.parent); in acp_hw_fini()
561 kfree(adev->acp.acp_res); in acp_hw_fini()
562 kfree(adev->acp.acp_genpd); in acp_hw_fini()
563 kfree(adev->acp.acp_cell); in acp_hw_fini()
573 if (!adev->acp.acp_cell) in acp_suspend()
583 if (!adev->acp.acp_cell) in acp_resume()