mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-30 03:57:32 +00:00

Add interconnect framework support to set required audio bandwidth based on PCM device usage. The maximum bandwidth is determined by the number of APE PCM devices and maximum audio format supported. If interconnect property is not defined or INTERCONNECT config is not enabled then the audio usecase will still function. Validate bandwidth updates by reading the interconnect summary sysfs node during PCM device open and close operations. Signed-off-by: Sheetal <sheetal@nvidia.com> Link: https://patch.msgid.link/20250203105304.4155542-1-sheetal@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
32 lines
815 B
C
32 lines
815 B
C
/* SPDX-License-Identifier: GPL-2.0-only
|
|
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES.
|
|
* All rights reserved.
|
|
*
|
|
* tegra_isomgr_bw.h - Definitions for ADMA bandwidth calculation
|
|
*
|
|
*/
|
|
|
|
#ifndef __TEGRA_ISOMGR_BW_H__
|
|
#define __TEGRA_ISOMGR_BW_H__
|
|
|
|
/* Playback and Capture streams */
|
|
#define STREAM_TYPE 2
|
|
|
|
struct tegra_adma_isomgr {
|
|
/* Protect pcm devices bandwidth */
|
|
struct mutex mutex;
|
|
/* interconnect path handle */
|
|
struct icc_path *icc_path_handle;
|
|
u32 *bw_per_dev[STREAM_TYPE];
|
|
u32 current_bandwidth;
|
|
u32 max_pcm_device;
|
|
u32 max_bw;
|
|
};
|
|
|
|
int tegra_isomgr_adma_register(struct device *dev);
|
|
void tegra_isomgr_adma_unregister(struct device *dev);
|
|
int tegra_isomgr_adma_setbw(struct snd_pcm_substream *substream,
|
|
struct snd_soc_dai *dai, bool is_running);
|
|
|
|
#endif
|