Lines Matching refs:sdw

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