Lines Matching defs:sdw

11 #include <linux/soundwire/sdw.h>
23 static void intel_shim_vs_init(struct sdw_intel *sdw)
25 void __iomem *shim_vs = sdw->link_res->shim_vs;
36 static int intel_shim_check_wake(struct sdw_intel *sdw)
41 shim_vs = sdw->link_res->shim_vs;
47 static void intel_shim_wake(struct sdw_intel *sdw, bool wake_enable)
49 void __iomem *shim_vs = sdw->link_res->shim_vs;
71 static int intel_link_power_up(struct sdw_intel *sdw)
73 struct sdw_bus *bus = &sdw->cdns.bus;
75 u32 *shim_mask = sdw->link_res->shim_mask;
76 unsigned int link_id = sdw->instance;
80 mutex_lock(sdw->link_res->shim_lock);
84 dev_dbg(sdw->cdns.dev, "first link up, programming SYNCPRD\n");
91 ret = hdac_bus_eml_sdw_set_syncprd_unlocked(sdw->link_res->hbus, syncprd);
93 dev_err(sdw->cdns.dev, "%s: hdac_bus_eml_sdw_set_syncprd failed: %d\n",
99 ret = hdac_bus_eml_sdw_power_up_unlocked(sdw->link_res->hbus, link_id);
101 dev_err(sdw->cdns.dev, "%s: hdac_bus_eml_sdw_power_up failed: %d\n",
108 ret = hdac_bus_eml_sdw_wait_syncpu_unlocked(sdw->link_res->hbus);
110 dev_err(sdw->cdns.dev, "%s: hdac_bus_eml_sdw_wait_syncpu failed: %d\n",
118 sdw->cdns.link_up = true;
120 intel_shim_vs_init(sdw);
123 mutex_unlock(sdw->link_res->shim_lock);
128 static int intel_link_power_down(struct sdw_intel *sdw)
130 u32 *shim_mask = sdw->link_res->shim_mask;
131 unsigned int link_id = sdw->instance;
134 mutex_lock(sdw->link_res->shim_lock);
136 sdw->cdns.link_up = false;
140 ret = hdac_bus_eml_sdw_power_down_unlocked(sdw->link_res->hbus, link_id);
142 dev_err(sdw->cdns.dev, "%s: hdac_bus_eml_sdw_power_down failed: %d\n",
146 * we leave the sdw->cdns.link_up flag as false since we've disabled
151 mutex_unlock(sdw->link_res->shim_lock);
156 static void intel_sync_arm(struct sdw_intel *sdw)
158 unsigned int link_id = sdw->instance;
160 mutex_lock(sdw->link_res->shim_lock);
162 hdac_bus_eml_sdw_sync_arm_unlocked(sdw->link_res->hbus, link_id);
164 mutex_unlock(sdw->link_res->shim_lock);
167 static int intel_sync_go_unlocked(struct sdw_intel *sdw)
171 ret = hdac_bus_eml_sdw_sync_go_unlocked(sdw->link_res->hbus);
173 dev_err(sdw->cdns.dev, "%s: SyncGO clear failed: %d\n", __func__, ret);
178 static int intel_sync_go(struct sdw_intel *sdw)
182 mutex_lock(sdw->link_res->shim_lock);
184 ret = intel_sync_go_unlocked(sdw);
186 mutex_unlock(sdw->link_res->shim_lock);
191 static bool intel_check_cmdsync_unlocked(struct sdw_intel *sdw)
193 return hdac_bus_eml_sdw_check_cmdsync_unlocked(sdw->link_res->hbus);
197 static int intel_params_stream(struct sdw_intel *sdw,
203 struct sdw_intel_link_res *res = sdw->link_res;
218 static int intel_free_stream(struct sdw_intel *sdw,
224 struct sdw_intel_link_res *res = sdw->link_res;
246 struct sdw_intel *sdw = cdns_to_intel(cdns);
281 ret = intel_params_stream(sdw, substream, dai, params,
282 sdw->instance,
318 struct sdw_intel *sdw = cdns_to_intel(cdns);
358 ret = intel_params_stream(sdw, substream, dai,
360 sdw->instance,
371 struct sdw_intel *sdw = cdns_to_intel(cdns);
380 * The sdw stream state will transition to RELEASED when stream->
392 ret = intel_free_stream(sdw, substream, dai, sdw->instance);
425 struct sdw_intel *sdw = cdns_to_intel(cdns);
426 struct sdw_intel_link_res *res = sdw->link_res;
491 static void intel_pdi_init(struct sdw_intel *sdw,
494 void __iomem *shim = sdw->link_res->shim;
504 dev_dbg(sdw->cdns.dev, "PCM cap bd:%d in:%d out:%d\n",
509 intel_pdi_get_ch_cap(struct sdw_intel *sdw, unsigned int pdi_num)
511 void __iomem *shim = sdw->link_res->shim;
517 static void intel_pdi_get_ch_update(struct sdw_intel *sdw,
526 pdi->ch_count = intel_pdi_get_ch_cap(sdw, pdi->num);
534 static void intel_pdi_stream_ch_update(struct sdw_intel *sdw,
537 intel_pdi_get_ch_update(sdw, stream->bd, stream->num_bd,
540 intel_pdi_get_ch_update(sdw, stream->in, stream->num_in,
543 intel_pdi_get_ch_update(sdw, stream->out, stream->num_out,
580 static int intel_register_dai(struct sdw_intel *sdw)
584 struct sdw_cdns *cdns = &sdw->cdns;
592 intel_pdi_init(sdw, &config);
597 intel_pdi_stream_ch_update(sdw, &sdw->cdns.pcm);
637 static void intel_program_sdi(struct sdw_intel *sdw, int dev_num)
641 ret = hdac_bus_eml_sdw_set_lsdiid(sdw->link_res->hbus, sdw->instance, dev_num);
643 dev_err(sdw->cdns.dev, "%s: could not set lsdiid for link %d %d\n",
644 __func__, sdw->instance, dev_num);