3bd975f3ae
SM8450 machine driver code can be reused across multiple Qualcomm SoCs, At least another 2 of them for now (SM8450 and SC8250XP). Move some of the common SoundWire stream specific code to common file so that other drivers can use it instead of duplication. This patch is to prepare the common driver to be able to add new SoCs support with less dupication. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20220916132427.1845-5-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
47 lines
1.4 KiB
C
47 lines
1.4 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
// Copyright (c) 2018, The Linux Foundation. All rights reserved.
|
|
|
|
#ifndef __QCOM_SND_COMMON_H__
|
|
#define __QCOM_SND_COMMON_H__
|
|
|
|
#include <sound/soc.h>
|
|
#include <linux/soundwire/sdw.h>
|
|
|
|
int qcom_snd_parse_of(struct snd_soc_card *card);
|
|
int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,
|
|
struct snd_soc_jack *jack, bool *jack_setup);
|
|
|
|
#if IS_ENABLED(CONFIG_SOUNDWIRE)
|
|
int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream,
|
|
struct sdw_stream_runtime *runtime,
|
|
bool *stream_prepared);
|
|
int qcom_snd_sdw_hw_params(struct snd_pcm_substream *substream,
|
|
struct snd_pcm_hw_params *params,
|
|
struct sdw_stream_runtime **psruntime);
|
|
int qcom_snd_sdw_hw_free(struct snd_pcm_substream *substream,
|
|
struct sdw_stream_runtime *sruntime,
|
|
bool *stream_prepared);
|
|
#else
|
|
static inline int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream,
|
|
struct sdw_stream_runtime *runtime,
|
|
bool *stream_prepared)
|
|
{
|
|
return -ENOTSUPP;
|
|
}
|
|
|
|
static inline int qcom_snd_sdw_hw_params(struct snd_pcm_substream *substream,
|
|
struct snd_pcm_hw_params *params,
|
|
struct sdw_stream_runtime **psruntime)
|
|
{
|
|
return -ENOTSUPP;
|
|
}
|
|
|
|
static inline int qcom_snd_sdw_hw_free(struct snd_pcm_substream *substream,
|
|
struct sdw_stream_runtime *sruntime,
|
|
bool *stream_prepared)
|
|
{
|
|
return -ENOTSUPP;
|
|
}
|
|
#endif
|
|
#endif
|