Lines Matching refs:sdw

16 #include <linux/soundwire/sdw.h>
73 struct sdw_intel *sdw = s_file->private;
74 void __iomem *s = sdw->link_res->shim;
75 void __iomem *a = sdw->link_res->alh;
140 struct sdw_intel *sdw = data;
141 struct sdw_bus *bus = &sdw->cdns.bus;
158 struct sdw_intel *sdw = data;
159 struct sdw_bus *bus = &sdw->cdns.bus;
174 static void intel_debugfs_init(struct sdw_intel *sdw)
176 struct dentry *root = sdw->cdns.bus.debugfs;
181 sdw->debugfs = debugfs_create_dir("intel-sdw", root);
183 debugfs_create_file("intel-registers", 0400, sdw->debugfs, sdw,
186 debugfs_create_file("intel-m-datamode", 0200, sdw->debugfs, sdw,
189 debugfs_create_file("intel-s-datamode", 0200, sdw->debugfs, sdw,
192 sdw_cdns_debugfs_init(&sdw->cdns, sdw->debugfs);
195 static void intel_debugfs_exit(struct sdw_intel *sdw)
197 debugfs_remove_recursive(sdw->debugfs);
200 static void intel_debugfs_init(struct sdw_intel *sdw) {}
201 static void intel_debugfs_exit(struct sdw_intel *sdw) {}
208 static void intel_shim_glue_to_master_ip(struct sdw_intel *sdw)
210 void __iomem *shim = sdw->link_res->shim;
211 unsigned int link_id = sdw->instance;
238 static void intel_shim_master_ip_to_glue(struct sdw_intel *sdw)
240 unsigned int link_id = sdw->instance;
241 void __iomem *shim = sdw->link_res->shim;
259 static void intel_shim_init(struct sdw_intel *sdw)
261 void __iomem *shim = sdw->link_res->shim;
262 unsigned int link_id = sdw->instance;
282 intel_shim_glue_to_master_ip(sdw);
292 static int intel_shim_check_wake(struct sdw_intel *sdw)
297 shim = sdw->link_res->shim;
300 return wake_sts & BIT(sdw->instance);
303 static void intel_shim_wake(struct sdw_intel *sdw, bool wake_enable)
305 void __iomem *shim = sdw->link_res->shim;
306 unsigned int link_id = sdw->instance;
309 mutex_lock(sdw->link_res->shim_lock);
326 mutex_unlock(sdw->link_res->shim_lock);
329 static bool intel_check_cmdsync_unlocked(struct sdw_intel *sdw)
331 void __iomem *shim = sdw->link_res->shim;
338 static int intel_link_power_up(struct sdw_intel *sdw)
340 unsigned int link_id = sdw->instance;
341 void __iomem *shim = sdw->link_res->shim;
342 u32 *shim_mask = sdw->link_res->shim_mask;
343 struct sdw_bus *bus = &sdw->cdns.bus;
351 mutex_lock(sdw->link_res->shim_lock);
369 dev_dbg(sdw->cdns.dev, "powering up all links\n");
372 dev_dbg(sdw->cdns.dev,
387 spa_mask = FIELD_PREP(SDW_SHIM_LCTL_SPA_MASK, sdw->link_res->link_mask);
388 cpa_mask = FIELD_PREP(SDW_SHIM_LCTL_CPA_MASK, sdw->link_res->link_mask);
394 dev_err(sdw->cdns.dev, "Failed to power up link: %d\n", ret);
402 dev_err(sdw->cdns.dev,
410 sdw->cdns.link_up = true;
412 intel_shim_init(sdw);
415 mutex_unlock(sdw->link_res->shim_lock);
420 static int intel_link_power_down(struct sdw_intel *sdw)
423 unsigned int link_id = sdw->instance;
424 void __iomem *shim = sdw->link_res->shim;
425 u32 *shim_mask = sdw->link_res->shim_mask;
428 mutex_lock(sdw->link_res->shim_lock);
431 dev_err(sdw->cdns.dev,
434 sdw->cdns.link_up = false;
436 intel_shim_master_ip_to_glue(sdw);
442 dev_dbg(sdw->cdns.dev, "powering down all links\n");
448 spa_mask = FIELD_PREP(SDW_SHIM_LCTL_SPA_MASK, ~sdw->link_res->link_mask);
449 cpa_mask = FIELD_PREP(SDW_SHIM_LCTL_CPA_MASK, sdw->link_res->link_mask);
455 dev_err(sdw->cdns.dev, "%s: could not power down link\n", __func__);
458 * we leave the sdw->cdns.link_up flag as false since we've disabled
464 mutex_unlock(sdw->link_res->shim_lock);
469 static void intel_shim_sync_arm(struct sdw_intel *sdw)
471 void __iomem *shim = sdw->link_res->shim;
474 mutex_lock(sdw->link_res->shim_lock);
478 sync_reg |= (SDW_SHIM_SYNC_CMDSYNC << sdw->instance);
481 mutex_unlock(sdw->link_res->shim_lock);
484 static int intel_shim_sync_go_unlocked(struct sdw_intel *sdw)
486 void __iomem *shim = sdw->link_res->shim;
504 static int intel_shim_sync_go(struct sdw_intel *sdw)
508 mutex_lock(sdw->link_res->shim_lock);
510 ret = intel_shim_sync_go_unlocked(sdw);
512 mutex_unlock(sdw->link_res->shim_lock);
520 static void intel_pdi_init(struct sdw_intel *sdw,
523 void __iomem *shim = sdw->link_res->shim;
524 unsigned int link_id = sdw->instance;
534 dev_dbg(sdw->cdns.dev, "PCM cap bd:%d in:%d out:%d\n",
539 intel_pdi_get_ch_cap(struct sdw_intel *sdw, unsigned int pdi_num)
541 void __iomem *shim = sdw->link_res->shim;
542 unsigned int link_id = sdw->instance;
562 static int intel_pdi_get_ch_update(struct sdw_intel *sdw,
570 pdi->ch_count = intel_pdi_get_ch_cap(sdw, pdi->num);
579 static int intel_pdi_stream_ch_update(struct sdw_intel *sdw,
582 intel_pdi_get_ch_update(sdw, stream->bd, stream->num_bd,
585 intel_pdi_get_ch_update(sdw, stream->in, stream->num_in,
588 intel_pdi_get_ch_update(sdw, stream->out, stream->num_out,
595 intel_pdi_shim_configure(struct sdw_intel *sdw, struct sdw_cdns_pdi *pdi)
597 void __iomem *shim = sdw->link_res->shim;
598 unsigned int link_id = sdw->instance;
626 intel_pdi_alh_configure(struct sdw_intel *sdw, struct sdw_cdns_pdi *pdi)
628 void __iomem *alh = sdw->link_res->alh;
629 unsigned int link_id = sdw->instance;
646 static int intel_params_stream(struct sdw_intel *sdw,
652 struct sdw_intel_link_res *res = sdw->link_res;
676 struct sdw_intel *sdw = cdns_to_intel(cdns);
702 intel_pdi_shim_configure(sdw, pdi);
703 intel_pdi_alh_configure(sdw, pdi);
712 ret = intel_params_stream(sdw, substream, dai, params,
713 sdw->instance,
749 struct sdw_intel *sdw = cdns_to_intel(cdns);
784 intel_pdi_shim_configure(sdw, dai_runtime->pdi);
785 intel_pdi_alh_configure(sdw, dai_runtime->pdi);
789 ret = intel_params_stream(sdw, substream, dai,
791 sdw->instance,
810 * The sdw stream state will transition to RELEASED when stream->
982 static int intel_register_dai(struct sdw_intel *sdw)
986 struct sdw_cdns *cdns = &sdw->cdns;
992 intel_pdi_init(sdw, &config);
997 intel_pdi_stream_ch_update(sdw, &sdw->cdns.pcm);