Lines Matching refs:sdw
194 struct sdw_intel *sdw = s_file->private; in intel_reg_show() local
195 void __iomem *s = sdw->res->shim; in intel_reg_show()
196 void __iomem *a = sdw->res->alh; in intel_reg_show()
260 static void intel_debugfs_init(struct sdw_intel *sdw) in intel_debugfs_init() argument
262 struct dentry *root = sdw->cdns.bus.debugfs; in intel_debugfs_init()
267 sdw->debugfs = debugfs_create_dir("intel-sdw", root); in intel_debugfs_init()
269 debugfs_create_file("intel-registers", 0400, sdw->debugfs, sdw, in intel_debugfs_init()
272 sdw_cdns_debugfs_init(&sdw->cdns, sdw->debugfs); in intel_debugfs_init()
275 static void intel_debugfs_exit(struct sdw_intel *sdw) in intel_debugfs_exit() argument
277 debugfs_remove_recursive(sdw->debugfs); in intel_debugfs_exit()
280 static void intel_debugfs_init(struct sdw_intel *sdw) {} in intel_debugfs_init() argument
281 static void intel_debugfs_exit(struct sdw_intel *sdw) {} in intel_debugfs_exit() argument
288 static int intel_link_power_up(struct sdw_intel *sdw) in intel_link_power_up() argument
290 unsigned int link_id = sdw->instance; in intel_link_power_up()
291 void __iomem *shim = sdw->res->shim; in intel_link_power_up()
305 sdw->cdns.link_up = true; in intel_link_power_up()
309 static int intel_shim_init(struct sdw_intel *sdw) in intel_shim_init() argument
311 void __iomem *shim = sdw->res->shim; in intel_shim_init()
312 unsigned int link_id = sdw->instance; in intel_shim_init()
361 dev_err(sdw->cdns.dev, "Failed to set sync period: %d\n", ret); in intel_shim_init()
369 static void intel_pdi_init(struct sdw_intel *sdw, in intel_pdi_init() argument
372 void __iomem *shim = sdw->res->shim; in intel_pdi_init()
373 unsigned int link_id = sdw->instance; in intel_pdi_init()
386 dev_dbg(sdw->cdns.dev, "PCM cap bd:%d in:%d out:%d\n", in intel_pdi_init()
399 dev_dbg(sdw->cdns.dev, "PDM cap bd:%d in:%d out:%d\n", in intel_pdi_init()
404 intel_pdi_get_ch_cap(struct sdw_intel *sdw, unsigned int pdi_num, bool pcm) in intel_pdi_get_ch_cap() argument
406 void __iomem *shim = sdw->res->shim; in intel_pdi_get_ch_cap()
407 unsigned int link_id = sdw->instance; in intel_pdi_get_ch_cap()
434 static int intel_pdi_get_ch_update(struct sdw_intel *sdw, in intel_pdi_get_ch_update() argument
442 pdi->ch_count = intel_pdi_get_ch_cap(sdw, pdi->num, pcm); in intel_pdi_get_ch_update()
451 static int intel_pdi_stream_ch_update(struct sdw_intel *sdw, in intel_pdi_stream_ch_update() argument
454 intel_pdi_get_ch_update(sdw, stream->bd, stream->num_bd, in intel_pdi_stream_ch_update()
457 intel_pdi_get_ch_update(sdw, stream->in, stream->num_in, in intel_pdi_stream_ch_update()
460 intel_pdi_get_ch_update(sdw, stream->out, stream->num_out, in intel_pdi_stream_ch_update()
466 static int intel_pdi_ch_update(struct sdw_intel *sdw) in intel_pdi_ch_update() argument
469 intel_pdi_stream_ch_update(sdw, &sdw->cdns.pcm, true); in intel_pdi_ch_update()
470 intel_pdi_stream_ch_update(sdw, &sdw->cdns.pdm, false); in intel_pdi_ch_update()
476 intel_pdi_shim_configure(struct sdw_intel *sdw, struct sdw_cdns_pdi *pdi) in intel_pdi_shim_configure() argument
478 void __iomem *shim = sdw->res->shim; in intel_pdi_shim_configure()
479 unsigned int link_id = sdw->instance; in intel_pdi_shim_configure()
505 intel_pdi_alh_configure(struct sdw_intel *sdw, struct sdw_cdns_pdi *pdi) in intel_pdi_alh_configure() argument
507 void __iomem *alh = sdw->res->alh; in intel_pdi_alh_configure()
508 unsigned int link_id = sdw->instance; in intel_pdi_alh_configure()
525 static int intel_config_stream(struct sdw_intel *sdw, in intel_config_stream() argument
530 struct sdw_intel_link_res *res = sdw->res; in intel_config_stream()
546 struct sdw_intel *sdw = cdns_to_intel(cdns); in intel_pre_bank_switch() local
547 void __iomem *shim = sdw->res->shim; in intel_pre_bank_switch()
556 sync_reg |= SDW_SHIM_SYNC_CMDSYNC << sdw->instance; in intel_pre_bank_switch()
565 struct sdw_intel *sdw = cdns_to_intel(cdns); in intel_post_bank_switch() local
566 void __iomem *shim = sdw->res->shim; in intel_post_bank_switch()
597 dev_err(sdw->cdns.dev, "Post bank switch failed: %d\n", ret); in intel_post_bank_switch()
606 static struct sdw_cdns_port *intel_alloc_port(struct sdw_intel *sdw, in intel_alloc_port() argument
609 struct sdw_cdns *cdns = &sdw->cdns; in intel_alloc_port()
634 intel_pdi_shim_configure(sdw, port->pdi); in intel_alloc_port()
637 intel_pdi_alh_configure(sdw, port->pdi); in intel_alloc_port()
671 struct sdw_intel *sdw = cdns_to_intel(cdns); in intel_hw_params() local
706 dma->port[i] = intel_alloc_port(sdw, ch, dir, pcm); in intel_hw_params()
715 ret = intel_config_stream(sdw, substream, dai, params, in intel_hw_params()
886 static int intel_register_dai(struct sdw_intel *sdw) in intel_register_dai() argument
888 struct sdw_cdns *cdns = &sdw->cdns; in intel_register_dai()
1002 struct sdw_intel *sdw; in intel_probe() local
1005 sdw = devm_kzalloc(&pdev->dev, sizeof(*sdw), GFP_KERNEL); in intel_probe()
1006 if (!sdw) in intel_probe()
1009 sdw->instance = pdev->id; in intel_probe()
1010 sdw->res = dev_get_platdata(&pdev->dev); in intel_probe()
1011 sdw->cdns.dev = &pdev->dev; in intel_probe()
1012 sdw->cdns.registers = sdw->res->registers; in intel_probe()
1013 sdw->cdns.instance = sdw->instance; in intel_probe()
1014 sdw->cdns.msg_count = 0; in intel_probe()
1015 sdw->cdns.bus.dev = &pdev->dev; in intel_probe()
1016 sdw->cdns.bus.link_id = pdev->id; in intel_probe()
1018 sdw_cdns_probe(&sdw->cdns); in intel_probe()
1022 sdw->cdns.bus.ops = &sdw_intel_ops; in intel_probe()
1024 platform_set_drvdata(pdev, sdw); in intel_probe()
1026 ret = sdw_add_bus_master(&sdw->cdns.bus); in intel_probe()
1032 if (sdw->cdns.bus.prop.hw_disabled) { in intel_probe()
1034 sdw->cdns.bus.link_id); in intel_probe()
1039 intel_link_power_up(sdw); in intel_probe()
1040 intel_shim_init(sdw); in intel_probe()
1042 ret = sdw_cdns_init(&sdw->cdns); in intel_probe()
1046 ret = sdw_cdns_enable_interrupt(&sdw->cdns); in intel_probe()
1049 intel_pdi_init(sdw, &config); in intel_probe()
1050 ret = sdw_cdns_pdi_init(&sdw->cdns, config); in intel_probe()
1054 intel_pdi_ch_update(sdw); in intel_probe()
1057 ret = request_threaded_irq(sdw->res->irq, sdw_cdns_irq, sdw_cdns_thread, in intel_probe()
1058 IRQF_SHARED, KBUILD_MODNAME, &sdw->cdns); in intel_probe()
1060 dev_err(sdw->cdns.dev, "unable to grab IRQ %d, disabling device\n", in intel_probe()
1061 sdw->res->irq); in intel_probe()
1066 ret = intel_register_dai(sdw); in intel_probe()
1068 dev_err(sdw->cdns.dev, "DAI registration failed: %d\n", ret); in intel_probe()
1069 snd_soc_unregister_component(sdw->cdns.dev); in intel_probe()
1073 intel_debugfs_init(sdw); in intel_probe()
1078 free_irq(sdw->res->irq, sdw); in intel_probe()
1080 sdw_delete_bus_master(&sdw->cdns.bus); in intel_probe()
1087 struct sdw_intel *sdw; in intel_remove() local
1089 sdw = platform_get_drvdata(pdev); in intel_remove()
1091 if (!sdw->cdns.bus.prop.hw_disabled) { in intel_remove()
1092 intel_debugfs_exit(sdw); in intel_remove()
1093 free_irq(sdw->res->irq, sdw); in intel_remove()
1094 snd_soc_unregister_component(sdw->cdns.dev); in intel_remove()
1096 sdw_delete_bus_master(&sdw->cdns.bus); in intel_remove()