if (pcm->device >= adma_isomgr->max_pcm_device) {
dev_err(dev, "%s: PCM device number %d is greater than %d\n", __func__,
pcm->device, adma_isomgr->max_pcm_device); return -EINVAL;
}
/* * No action if stream is running and bandwidth is already set or * stream is not running and bandwidth is already reset
*/ if ((adma_isomgr->bw_per_dev[type][pcm->device] && is_running) ||
(!adma_isomgr->bw_per_dev[type][pcm->device] && !is_running)) return 0;
if (is_running) {
sample_bytes = snd_pcm_format_width(runtime->format) / 8; if (sample_bytes < 0) return sample_bytes;
/* KB/s kilo bytes per sec */
bandwidth = runtime->channels * (runtime->rate / 1000) *
sample_bytes;
}
mutex_lock(&adma_isomgr->mutex);
if (is_running) { if (bandwidth + adma_isomgr->current_bandwidth > adma_isomgr->max_bw)
bandwidth = adma_isomgr->max_bw - adma_isomgr->current_bandwidth;
int tegra_isomgr_adma_register(struct device *dev)
{ struct tegra_admaif *admaif = dev_get_drvdata(dev); struct tegra_adma_isomgr *adma_isomgr; int i;
adma_isomgr = devm_kzalloc(dev, sizeof(struct tegra_adma_isomgr), GFP_KERNEL); if (!adma_isomgr) return -ENOMEM;
adma_isomgr->icc_path_handle = devm_of_icc_get(dev, "write"); if (IS_ERR(adma_isomgr->icc_path_handle)) return dev_err_probe(dev, PTR_ERR(adma_isomgr->icc_path_handle), "failed to acquire interconnect path\n");
/* Either INTERCONNECT config OR interconnect property is not defined */ if (!adma_isomgr->icc_path_handle) {
devm_kfree(dev, adma_isomgr); return 0;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.