• Home
  • Raw
  • Download

Lines Matching +full:system +full:- +full:clock +full:- +full:direction +full:- +full:out

1 // SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
2 // Copyright(c) 2015-17 Intel Corporation.
31 * flags reused in each byte, with master0 using the ls-byte, etc.
70 #define SDW_SHIM_SYNC_SYNCPRD_VAL_24 (24000 / SDW_CADENCE_GSYNC_KHZ - 1)
71 #define SDW_SHIM_SYNC_SYNCPRD_VAL_38_4 (38400 / SDW_CADENCE_GSYNC_KHZ - 1)
158 timeout--; in intel_wait_bit()
162 return -EAGAIN; in intel_wait_bit()
194 return scnprintf(buf + pos, RD_BUF - pos, "%4x\t%4x\n", reg, value); in intel_sprintf()
199 struct sdw_intel *sdw = s_file->private; in intel_reg_show()
200 void __iomem *s = sdw->link_res->shim; in intel_reg_show()
201 void __iomem *a = sdw->link_res->alh; in intel_reg_show()
209 return -ENOMEM; in intel_reg_show()
214 ret += scnprintf(buf + ret, RD_BUF - ret, "\nShim\n"); in intel_reg_show()
222 ret += scnprintf(buf + ret, RD_BUF - ret, "\nLink%d\n", i); in intel_reg_show()
230 ret += scnprintf(buf + ret, RD_BUF - ret, "\n PCMSyCH registers\n"); in intel_reg_show()
234 * cleanup to remove hard-coded Intel configurations in intel_reg_show()
243 ret += scnprintf(buf + ret, RD_BUF - ret, "\n PDMSCAP, IOCTL, CTMCTL\n"); in intel_reg_show()
250 ret += scnprintf(buf + ret, RD_BUF - ret, "\nWake registers\n"); in intel_reg_show()
254 ret += scnprintf(buf + ret, RD_BUF - ret, "\nALH STRMzCFG\n"); in intel_reg_show()
268 struct sdw_bus *bus = &sdw->cdns.bus; in intel_set_m_datamode()
271 return -EINVAL; in intel_set_m_datamode()
276 bus->params.m_data_mode = value; in intel_set_m_datamode()
286 struct sdw_bus *bus = &sdw->cdns.bus; in intel_set_s_datamode()
289 return -EINVAL; in intel_set_s_datamode()
294 bus->params.s_data_mode = value; in intel_set_s_datamode()
303 struct dentry *root = sdw->cdns.bus.debugfs; in intel_debugfs_init()
308 sdw->debugfs = debugfs_create_dir("intel-sdw", root); in intel_debugfs_init()
310 debugfs_create_file("intel-registers", 0400, sdw->debugfs, sdw, in intel_debugfs_init()
313 debugfs_create_file("intel-m-datamode", 0200, sdw->debugfs, sdw, in intel_debugfs_init()
316 debugfs_create_file("intel-s-datamode", 0200, sdw->debugfs, sdw, in intel_debugfs_init()
319 sdw_cdns_debugfs_init(&sdw->cdns, sdw->debugfs); in intel_debugfs_init()
324 debugfs_remove_recursive(sdw->debugfs); in intel_debugfs_exit()
337 unsigned int link_id = sdw->instance; in intel_link_power_up()
338 void __iomem *shim = sdw->link_res->shim; in intel_link_power_up()
339 u32 *shim_mask = sdw->link_res->shim_mask; in intel_link_power_up()
340 struct sdw_bus *bus = &sdw->cdns.bus; in intel_link_power_up()
341 struct sdw_master_prop *prop = &bus->prop; in intel_link_power_up()
348 mutex_lock(sdw->link_res->shim_lock); in intel_link_power_up()
352 * to generate the SoundWire SSP - which defines a 'safe' in intel_link_power_up()
355 * is only dependent on the oscillator clock provided to in intel_link_power_up()
360 if (prop->mclk_freq % 6000000) in intel_link_power_up()
366 dev_dbg(sdw->cdns.dev, "%s: powering up all links\n", __func__); in intel_link_power_up()
369 dev_dbg(sdw->cdns.dev, in intel_link_power_up()
383 /* only power-up enabled links */ in intel_link_power_up()
384 spa_mask = FIELD_PREP(SDW_SHIM_LCTL_SPA_MASK, sdw->link_res->link_mask); in intel_link_power_up()
385 cpa_mask = FIELD_PREP(SDW_SHIM_LCTL_CPA_MASK, sdw->link_res->link_mask); in intel_link_power_up()
391 dev_err(sdw->cdns.dev, "Failed to power up link: %d\n", ret); in intel_link_power_up()
392 goto out; in intel_link_power_up()
399 dev_err(sdw->cdns.dev, in intel_link_power_up()
401 goto out; in intel_link_power_up()
407 sdw->cdns.link_up = true; in intel_link_power_up()
408 out: in intel_link_power_up()
409 mutex_unlock(sdw->link_res->shim_lock); in intel_link_power_up()
417 void __iomem *shim = sdw->link_res->shim; in intel_shim_glue_to_master_ip()
418 unsigned int link_id = sdw->instance; in intel_shim_glue_to_master_ip()
447 unsigned int link_id = sdw->instance; in intel_shim_master_ip_to_glue()
448 void __iomem *shim = sdw->link_res->shim; in intel_shim_master_ip_to_glue()
467 void __iomem *shim = sdw->link_res->shim; in intel_shim_init()
468 unsigned int link_id = sdw->instance; in intel_shim_init()
472 mutex_lock(sdw->link_res->shim_lock); in intel_shim_init()
499 mutex_unlock(sdw->link_res->shim_lock); in intel_shim_init()
506 void __iomem *shim = sdw->link_res->shim; in intel_shim_wake()
507 unsigned int link_id = sdw->instance; in intel_shim_wake()
510 mutex_lock(sdw->link_res->shim_lock); in intel_shim_wake()
527 mutex_unlock(sdw->link_res->shim_lock); in intel_shim_wake()
533 unsigned int link_id = sdw->instance; in intel_link_power_down()
534 void __iomem *shim = sdw->link_res->shim; in intel_link_power_down()
535 u32 *shim_mask = sdw->link_res->shim_mask; in intel_link_power_down()
538 mutex_lock(sdw->link_res->shim_lock); in intel_link_power_down()
541 dev_err(sdw->cdns.dev, in intel_link_power_down()
542 "%s: Unbalanced power-up/down calls\n", __func__); in intel_link_power_down()
544 sdw->cdns.link_up = false; in intel_link_power_down()
552 dev_dbg(sdw->cdns.dev, "%s: powering down all links\n", __func__); in intel_link_power_down()
557 /* only power-down enabled links */ in intel_link_power_down()
558 spa_mask = FIELD_PREP(SDW_SHIM_LCTL_SPA_MASK, ~sdw->link_res->link_mask); in intel_link_power_down()
559 cpa_mask = FIELD_PREP(SDW_SHIM_LCTL_CPA_MASK, sdw->link_res->link_mask); in intel_link_power_down()
565 dev_err(sdw->cdns.dev, "%s: could not power down link\n", __func__); in intel_link_power_down()
568 * we leave the sdw->cdns.link_up flag as false since we've disabled in intel_link_power_down()
576 mutex_unlock(sdw->link_res->shim_lock); in intel_link_power_down()
583 void __iomem *shim = sdw->link_res->shim; in intel_shim_sync_arm()
586 mutex_lock(sdw->link_res->shim_lock); in intel_shim_sync_arm()
590 sync_reg |= (SDW_SHIM_SYNC_CMDSYNC << sdw->instance); in intel_shim_sync_arm()
593 mutex_unlock(sdw->link_res->shim_lock); in intel_shim_sync_arm()
598 void __iomem *shim = sdw->link_res->shim; in intel_shim_sync_go_unlocked()
616 dev_err(sdw->cdns.dev, "SyncGO clear failed: %d\n", ret); in intel_shim_sync_go_unlocked()
625 mutex_lock(sdw->link_res->shim_lock); in intel_shim_sync_go()
629 mutex_unlock(sdw->link_res->shim_lock); in intel_shim_sync_go()
640 void __iomem *shim = sdw->link_res->shim; in intel_pdi_init()
641 unsigned int link_id = sdw->instance; in intel_pdi_init()
647 config->pcm_bd = FIELD_GET(SDW_SHIM_PCMSCAP_BSS, pcm_cap); in intel_pdi_init()
648 config->pcm_in = FIELD_GET(SDW_SHIM_PCMSCAP_ISS, pcm_cap); in intel_pdi_init()
649 config->pcm_out = FIELD_GET(SDW_SHIM_PCMSCAP_OSS, pcm_cap); in intel_pdi_init()
651 dev_dbg(sdw->cdns.dev, "PCM cap bd:%d in:%d out:%d\n", in intel_pdi_init()
652 config->pcm_bd, config->pcm_in, config->pcm_out); in intel_pdi_init()
657 config->pdm_bd = FIELD_GET(SDW_SHIM_PDMSCAP_BSS, pdm_cap); in intel_pdi_init()
658 config->pdm_in = FIELD_GET(SDW_SHIM_PDMSCAP_ISS, pdm_cap); in intel_pdi_init()
659 config->pdm_out = FIELD_GET(SDW_SHIM_PDMSCAP_OSS, pdm_cap); in intel_pdi_init()
661 dev_dbg(sdw->cdns.dev, "PDM cap bd:%d in:%d out:%d\n", in intel_pdi_init()
662 config->pdm_bd, config->pdm_in, config->pdm_out); in intel_pdi_init()
668 void __iomem *shim = sdw->link_res->shim; in intel_pdi_get_ch_cap()
669 unsigned int link_id = sdw->instance; in intel_pdi_get_ch_cap()
703 pdi->ch_count = intel_pdi_get_ch_cap(sdw, pdi->num, pcm); in intel_pdi_get_ch_update()
704 ch_count += pdi->ch_count; in intel_pdi_get_ch_update()
715 intel_pdi_get_ch_update(sdw, stream->bd, stream->num_bd, in intel_pdi_stream_ch_update()
716 &stream->num_ch_bd, pcm); in intel_pdi_stream_ch_update()
718 intel_pdi_get_ch_update(sdw, stream->in, stream->num_in, in intel_pdi_stream_ch_update()
719 &stream->num_ch_in, pcm); in intel_pdi_stream_ch_update()
721 intel_pdi_get_ch_update(sdw, stream->out, stream->num_out, in intel_pdi_stream_ch_update()
722 &stream->num_ch_out, pcm); in intel_pdi_stream_ch_update()
730 intel_pdi_stream_ch_update(sdw, &sdw->cdns.pcm, true); in intel_pdi_ch_update()
731 intel_pdi_stream_ch_update(sdw, &sdw->cdns.pdm, false); in intel_pdi_ch_update()
739 void __iomem *shim = sdw->link_res->shim; in intel_pdi_shim_configure()
740 unsigned int link_id = sdw->instance; in intel_pdi_shim_configure()
744 pdi->intel_alh_id = (link_id * 16) + pdi->num + 3; in intel_pdi_shim_configure()
745 if (pdi->num >= 2) in intel_pdi_shim_configure()
746 pdi->intel_alh_id += 2; in intel_pdi_shim_configure()
752 if (pdi->type != SDW_STREAM_PCM) in intel_pdi_shim_configure()
755 if (pdi->dir == SDW_DATA_DIR_RX) in intel_pdi_shim_configure()
760 u32p_replace_bits(&pdi_conf, pdi->intel_alh_id, SDW_SHIM_PCMSYCM_STREAM); in intel_pdi_shim_configure()
761 u32p_replace_bits(&pdi_conf, pdi->l_ch_num, SDW_SHIM_PCMSYCM_LCHN); in intel_pdi_shim_configure()
762 u32p_replace_bits(&pdi_conf, pdi->h_ch_num, SDW_SHIM_PCMSYCM_HCHN); in intel_pdi_shim_configure()
764 intel_writew(shim, SDW_SHIM_PCMSYCHM(link_id, pdi->num), pdi_conf); in intel_pdi_shim_configure()
770 void __iomem *alh = sdw->link_res->alh; in intel_pdi_alh_configure()
771 unsigned int link_id = sdw->instance; in intel_pdi_alh_configure()
775 pdi->intel_alh_id = (link_id * 16) + pdi->num + 3; in intel_pdi_alh_configure()
776 if (pdi->num >= 2) in intel_pdi_alh_configure()
777 pdi->intel_alh_id += 2; in intel_pdi_alh_configure()
780 conf = intel_readl(alh, SDW_ALH_STRMZCFG(pdi->intel_alh_id)); in intel_pdi_alh_configure()
783 u32p_replace_bits(&conf, pdi->ch_count - 1, SDW_ALH_STRMZCFG_CHN); in intel_pdi_alh_configure()
785 intel_writel(alh, SDW_ALH_STRMZCFG(pdi->intel_alh_id), conf); in intel_pdi_alh_configure()
794 struct sdw_intel_link_res *res = sdw->link_res; in intel_params_stream()
803 if (res->ops && res->ops->params_stream && res->dev) in intel_params_stream()
804 return res->ops->params_stream(res->dev, in intel_params_stream()
806 return -EIO; in intel_params_stream()
814 struct sdw_intel_link_res *res = sdw->link_res; in intel_free_stream()
821 if (res->ops && res->ops->free_stream && res->dev) in intel_free_stream()
822 return res->ops->free_stream(res->dev, in intel_free_stream()
837 /* Write to register only for multi-link */ in intel_pre_bank_switch()
838 if (!bus->multi_link) in intel_pre_bank_switch()
850 void __iomem *shim = sdw->link_res->shim; in intel_post_bank_switch()
853 /* Write to register only for multi-link */ in intel_post_bank_switch()
854 if (!bus->multi_link) in intel_post_bank_switch()
857 mutex_lock(sdw->link_res->shim_lock); in intel_post_bank_switch()
877 mutex_unlock(sdw->link_res->shim_lock); in intel_post_bank_switch()
880 dev_err(sdw->cdns.dev, "Post bank switch failed: %d\n", ret); in intel_post_bank_switch()
895 ret = pm_runtime_get_sync(cdns->dev); in intel_startup()
896 if (ret < 0 && ret != -EACCES) { in intel_startup()
897 dev_err_ratelimited(cdns->dev, in intel_startup()
900 pm_runtime_put_noidle(cdns->dev); in intel_startup()
922 return -EIO; in intel_hw_params()
925 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) in intel_hw_params()
930 if (dma->stream_type == SDW_STREAM_PDM) in intel_hw_params()
934 pdi = sdw_cdns_alloc_pdi(cdns, &cdns->pcm, ch, dir, dai->id); in intel_hw_params()
936 pdi = sdw_cdns_alloc_pdi(cdns, &cdns->pdm, ch, dir, dai->id); in intel_hw_params()
939 ret = -EINVAL; in intel_hw_params()
943 /* do run-time configurations for SHIM, ALH and PDI/PORT */ in intel_hw_params()
949 dma->suspended = false; in intel_hw_params()
950 dma->pdi = pdi; in intel_hw_params()
951 dma->hw_params = params; in intel_hw_params()
955 sdw->instance, in intel_hw_params()
956 pdi->intel_alh_id); in intel_hw_params()
960 sconfig.direction = dir; in intel_hw_params()
963 sconfig.type = dma->stream_type; in intel_hw_params()
965 if (dma->stream_type == SDW_STREAM_PDM) { in intel_hw_params()
975 ret = -ENOMEM; in intel_hw_params()
979 pconfig->num = pdi->num; in intel_hw_params()
980 pconfig->ch_mask = (1 << ch) - 1; in intel_hw_params()
982 ret = sdw_stream_add_master(&cdns->bus, &sconfig, in intel_hw_params()
983 pconfig, 1, dma->stream); in intel_hw_params()
985 dev_err(cdns->dev, "add master to stream failed:%d\n", ret); in intel_hw_params()
1003 dev_err(dai->dev, "failed to get dma data in %s", in intel_prepare()
1005 return -EIO; in intel_prepare()
1008 if (dma->suspended) { in intel_prepare()
1009 dma->suspended = false; in intel_prepare()
1012 * .prepare() is called after system resume, where we in intel_prepare()
1020 ch = params_channels(dma->hw_params); in intel_prepare()
1021 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) in intel_prepare()
1026 intel_pdi_shim_configure(sdw, dma->pdi); in intel_prepare()
1027 intel_pdi_alh_configure(sdw, dma->pdi); in intel_prepare()
1028 sdw_cdns_config_stream(cdns, ch, dir, dma->pdi); in intel_prepare()
1032 dma->hw_params, in intel_prepare()
1033 sdw->instance, in intel_prepare()
1034 dma->pdi->intel_alh_id); in intel_prepare()
1050 return -EIO; in intel_hw_free()
1053 * The sdw stream state will transition to RELEASED when stream-> in intel_hw_free()
1055 * DEPREPARED for the first cpu-dai and to RELEASED for the last in intel_hw_free()
1056 * cpu-dai. in intel_hw_free()
1058 ret = sdw_stream_remove_master(&cdns->bus, dma->stream); in intel_hw_free()
1060 dev_err(dai->dev, "remove master from stream %s failed: %d\n", in intel_hw_free()
1061 dma->stream->name, ret); in intel_hw_free()
1065 ret = intel_free_stream(sdw, substream, dai, sdw->instance); in intel_hw_free()
1067 dev_err(dai->dev, "intel_free_stream: failed %d", ret); in intel_hw_free()
1071 dma->hw_params = NULL; in intel_hw_free()
1072 dma->pdi = NULL; in intel_hw_free()
1082 pm_runtime_mark_last_busy(cdns->dev); in intel_shutdown()
1083 pm_runtime_put_autosuspend(cdns->dev); in intel_shutdown()
1097 dma = dai->playback_dma_data; in intel_component_dais_suspend()
1099 dma->suspended = true; in intel_component_dais_suspend()
1101 dma = dai->capture_dma_data; in intel_component_dais_suspend()
1103 dma->suspended = true; in intel_component_dais_suspend()
1110 void *stream, int direction) in intel_pcm_set_sdw_stream() argument
1112 return cdns_set_sdw_stream(dai, stream, true, direction); in intel_pcm_set_sdw_stream()
1116 void *stream, int direction) in intel_pdm_set_sdw_stream() argument
1118 return cdns_set_sdw_stream(dai, stream, false, direction); in intel_pdm_set_sdw_stream()
1122 int direction) in intel_get_sdw_stream() argument
1126 if (direction == SNDRV_PCM_STREAM_PLAYBACK) in intel_get_sdw_stream()
1127 dma = dai->playback_dma_data; in intel_get_sdw_stream()
1129 dma = dai->capture_dma_data; in intel_get_sdw_stream()
1132 return ERR_PTR(-EINVAL); in intel_get_sdw_stream()
1134 return dma->stream; in intel_get_sdw_stream()
1174 dais[i].name = devm_kasprintf(cdns->dev, GFP_KERNEL, in intel_create_dai()
1176 cdns->instance, i); in intel_create_dai()
1178 return -ENOMEM; in intel_create_dai()
1205 struct sdw_cdns *cdns = &sdw->cdns; in intel_register_dai()
1211 num_dai = cdns->pcm.num_pdi + cdns->pdm.num_pdi; in intel_register_dai()
1213 dais = devm_kcalloc(cdns->dev, num_dai, sizeof(*dais), GFP_KERNEL); in intel_register_dai()
1215 return -ENOMEM; in intel_register_dai()
1218 stream = &cdns->pcm; in intel_register_dai()
1220 ret = intel_create_dai(cdns, dais, INTEL_PDI_IN, cdns->pcm.num_in, in intel_register_dai()
1221 off, stream->num_ch_in, true); in intel_register_dai()
1225 off += cdns->pcm.num_in; in intel_register_dai()
1226 ret = intel_create_dai(cdns, dais, INTEL_PDI_OUT, cdns->pcm.num_out, in intel_register_dai()
1227 off, stream->num_ch_out, true); in intel_register_dai()
1231 off += cdns->pcm.num_out; in intel_register_dai()
1232 ret = intel_create_dai(cdns, dais, INTEL_PDI_BD, cdns->pcm.num_bd, in intel_register_dai()
1233 off, stream->num_ch_bd, true); in intel_register_dai()
1238 stream = &cdns->pdm; in intel_register_dai()
1239 off += cdns->pcm.num_bd; in intel_register_dai()
1240 ret = intel_create_dai(cdns, dais, INTEL_PDI_IN, cdns->pdm.num_in, in intel_register_dai()
1241 off, stream->num_ch_in, false); in intel_register_dai()
1245 off += cdns->pdm.num_in; in intel_register_dai()
1246 ret = intel_create_dai(cdns, dais, INTEL_PDI_OUT, cdns->pdm.num_out, in intel_register_dai()
1247 off, stream->num_ch_out, false); in intel_register_dai()
1251 off += cdns->pdm.num_out; in intel_register_dai()
1252 ret = intel_create_dai(cdns, dais, INTEL_PDI_BD, cdns->pdm.num_bd, in intel_register_dai()
1253 off, stream->num_ch_bd, false); in intel_register_dai()
1257 return snd_soc_register_component(cdns->dev, &dai_component, in intel_register_dai()
1263 struct sdw_master_prop *prop = &bus->prop; in sdw_master_read_intel_prop()
1270 "mipi-sdw-link-%d-subproperties", bus->link_id); in sdw_master_read_intel_prop()
1272 link = device_get_named_child_node(bus->dev, name); in sdw_master_read_intel_prop()
1274 dev_err(bus->dev, "Master node %s not found\n", name); in sdw_master_read_intel_prop()
1275 return -EIO; in sdw_master_read_intel_prop()
1279 "intel-sdw-ip-clock", in sdw_master_read_intel_prop()
1280 &prop->mclk_freq); in sdw_master_read_intel_prop()
1282 /* the values reported by BIOS are the 2x clock, not the bus clock */ in sdw_master_read_intel_prop()
1283 prop->mclk_freq /= 2; in sdw_master_read_intel_prop()
1286 "intel-quirk-mask", in sdw_master_read_intel_prop()
1290 prop->hw_disabled = true; in sdw_master_read_intel_prop()
1300 /* read Intel-specific properties */ in intel_prop_read()
1323 clock_stop = sdw_cdns_is_clock_stop(&sdw->cdns); in intel_init()
1335 struct device *dev = &pdev->dev; in intel_master_probe()
1343 return -ENOMEM; in intel_master_probe()
1345 cdns = &sdw->cdns; in intel_master_probe()
1346 bus = &cdns->bus; in intel_master_probe()
1348 sdw->instance = pdev->id; in intel_master_probe()
1349 sdw->link_res = dev_get_platdata(dev); in intel_master_probe()
1350 cdns->dev = dev; in intel_master_probe()
1351 cdns->registers = sdw->link_res->registers; in intel_master_probe()
1352 cdns->instance = sdw->instance; in intel_master_probe()
1353 cdns->msg_count = 0; in intel_master_probe()
1355 bus->link_id = pdev->id; in intel_master_probe()
1361 bus->ops = &sdw_intel_ops; in intel_master_probe()
1367 sdw->cdns.bus.compute_params = sdw_compute_params; in intel_master_probe()
1369 ret = sdw_bus_master_add(bus, dev, dev->fwnode); in intel_master_probe()
1375 if (bus->prop.hw_disabled) in intel_master_probe()
1378 bus->link_id); in intel_master_probe()
1383 bus->prop.err_threshold = 0; in intel_master_probe()
1391 struct device *dev = &pdev->dev; in intel_master_startup()
1394 struct sdw_bus *bus = &cdns->bus; in intel_master_startup()
1400 if (bus->prop.hw_disabled) { in intel_master_startup()
1403 sdw->instance); in intel_master_startup()
1407 link_flags = md_flags >> (bus->link_id * 8); in intel_master_startup()
1410 dev_dbg(dev, "Multi-link is disabled\n"); in intel_master_startup()
1411 bus->multi_link = false; in intel_master_startup()
1414 * hardware-based synchronization is required regardless in intel_master_startup()
1415 * of the number of segments used by a stream: SSP-based in intel_master_startup()
1416 * synchronization is gated by gsync when the multi-master in intel_master_startup()
1419 bus->multi_link = true; in intel_master_startup()
1420 bus->hw_sync_min_links = 1; in intel_master_startup()
1490 clock_stop_quirks = sdw->link_res->clock_stop_quirks; in intel_master_startup()
1493 * To keep the clock running we need to prevent in intel_master_startup()
1507 * there are no Slave devices populated or if the power-on is in intel_master_startup()
1511 * Conditionally force the pm_runtime core to re-evaluate the in intel_master_startup()
1530 struct device *dev = &pdev->dev; in intel_master_remove()
1533 struct sdw_bus *bus = &cdns->bus; in intel_master_remove()
1540 if (!bus->prop.hw_disabled) { in intel_master_remove()
1552 struct device *dev = &pdev->dev; in intel_master_process_wakeen_event()
1559 bus = &sdw->cdns.bus; in intel_master_process_wakeen_event()
1561 if (bus->prop.hw_disabled) { in intel_master_process_wakeen_event()
1562 dev_dbg(dev, "SoundWire master %d is disabled, ignoring\n", bus->link_id); in intel_master_process_wakeen_event()
1566 shim = sdw->link_res->shim; in intel_master_process_wakeen_event()
1569 if (!(wake_sts & BIT(sdw->instance))) in intel_master_process_wakeen_event()
1577 * Slaves re-attaching and be re-enumerated. The SoundWire physical in intel_master_process_wakeen_event()
1597 struct sdw_bus *bus = &cdns->bus; in intel_suspend()
1601 if (bus->prop.hw_disabled) { in intel_suspend()
1603 bus->link_id); in intel_suspend()
1610 clock_stop_quirks = sdw->link_res->clock_stop_quirks; in intel_suspend()
1614 !pm_runtime_suspended(dev->parent)) { in intel_suspend()
1617 * if we've enabled clock stop, and the parent in intel_suspend()
1651 struct sdw_bus *bus = &cdns->bus; in intel_suspend_runtime()
1655 if (bus->prop.hw_disabled) { in intel_suspend_runtime()
1657 bus->link_id); in intel_suspend_runtime()
1661 clock_stop_quirks = sdw->link_res->clock_stop_quirks; in intel_suspend_runtime()
1683 dev_err(dev, "cannot enable clock stop on suspend\n"); in intel_suspend_runtime()
1703 ret = -EINVAL; in intel_suspend_runtime()
1713 struct sdw_bus *bus = &cdns->bus; in intel_resume()
1718 if (bus->prop.hw_disabled) { in intel_resume()
1720 bus->link_id); in intel_resume()
1724 link_flags = md_flags >> (bus->link_id * 8); in intel_resume()
1736 link_flags = md_flags >> (bus->link_id * 8); in intel_resume()
1767 ret = sdw_cdns_init(&sdw->cdns); in intel_resume()
1788 * after system resume, the pm_runtime suspend() may kick in in intel_resume()
1806 struct sdw_bus *bus = &cdns->bus; in intel_resume_runtime()
1814 if (bus->prop.hw_disabled) { in intel_resume_runtime()
1816 bus->link_id); in intel_resume_runtime()
1820 link_flags = md_flags >> (bus->link_id * 8); in intel_resume_runtime()
1823 clock_stop_quirks = sdw->link_res->clock_stop_quirks; in intel_resume_runtime()
1851 ret = sdw_cdns_init(&sdw->cdns); in intel_resume_runtime()
1881 * domain. Master can preserve its context for clock stop0, so in intel_resume_runtime()
1884 clock_stop0 = sdw_cdns_is_clock_stop(&sdw->cdns); in intel_resume_runtime()
1910 * Re-initialize the IP since it was powered-off in intel_resume_runtime()
1912 sdw_cdns_init(&sdw->cdns); in intel_resume_runtime()
1924 dev_err(dev, "unable to restart clock during resume\n"); in intel_resume_runtime()
1938 dev_err(sdw->cdns.dev, "sync go failed during resume\n"); in intel_resume_runtime()
1945 clock_stop0 = sdw_cdns_is_clock_stop(&sdw->cdns); in intel_resume_runtime()
1947 dev_err(dev, "%s invalid configuration, clock was not stopped", __func__); in intel_resume_runtime()
1969 ret = -EINVAL; in intel_resume_runtime()
1986 .name = "intel-sdw",
1994 MODULE_ALIAS("platform:intel-sdw");