mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
ASoC: SOF: Move sof_of_machine_select() to sof-of-dev.c from sof-audio.c
Move the sof_of_machine_select() function to sof-of-dev.c file and provide an inline stub in case of non OF builds. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20231129125327.23708-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
8c91ca76f4
commit
014fdeb0d7
3 changed files with 32 additions and 22 deletions
|
@ -990,28 +990,6 @@ int sof_dai_get_bclk(struct snd_soc_pcm_runtime *rtd)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(sof_dai_get_bclk);
|
EXPORT_SYMBOL(sof_dai_get_bclk);
|
||||||
|
|
||||||
static struct snd_sof_of_mach *sof_of_machine_select(struct snd_sof_dev *sdev)
|
|
||||||
{
|
|
||||||
struct snd_sof_pdata *sof_pdata = sdev->pdata;
|
|
||||||
const struct sof_dev_desc *desc = sof_pdata->desc;
|
|
||||||
struct snd_sof_of_mach *mach = desc->of_machines;
|
|
||||||
|
|
||||||
if (!mach)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
for (; mach->compatible; mach++) {
|
|
||||||
if (of_machine_is_compatible(mach->compatible)) {
|
|
||||||
sof_pdata->tplg_filename = mach->sof_tplg_filename;
|
|
||||||
if (mach->fw_filename)
|
|
||||||
sof_pdata->fw_filename = mach->fw_filename;
|
|
||||||
|
|
||||||
return mach;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SOF Driver enumeration.
|
* SOF Driver enumeration.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -41,6 +41,29 @@ static void sof_of_probe_complete(struct device *dev)
|
||||||
pm_runtime_enable(dev);
|
pm_runtime_enable(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct snd_sof_of_mach *sof_of_machine_select(struct snd_sof_dev *sdev)
|
||||||
|
{
|
||||||
|
struct snd_sof_pdata *sof_pdata = sdev->pdata;
|
||||||
|
const struct sof_dev_desc *desc = sof_pdata->desc;
|
||||||
|
struct snd_sof_of_mach *mach = desc->of_machines;
|
||||||
|
|
||||||
|
if (!mach)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
for (; mach->compatible; mach++) {
|
||||||
|
if (of_machine_is_compatible(mach->compatible)) {
|
||||||
|
sof_pdata->tplg_filename = mach->sof_tplg_filename;
|
||||||
|
if (mach->fw_filename)
|
||||||
|
sof_pdata->fw_filename = mach->fw_filename;
|
||||||
|
|
||||||
|
return mach;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(sof_of_machine_select);
|
||||||
|
|
||||||
int sof_of_probe(struct platform_device *pdev)
|
int sof_of_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
|
|
|
@ -16,6 +16,15 @@ struct snd_sof_of_mach {
|
||||||
const char *sof_tplg_filename;
|
const char *sof_tplg_filename;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_SND_SOC_SOF_OF_DEV)
|
||||||
|
struct snd_sof_of_mach *sof_of_machine_select(struct snd_sof_dev *sdev);
|
||||||
|
#else
|
||||||
|
static inline struct snd_sof_of_mach *sof_of_machine_select(struct snd_sof_dev *sdev)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
extern const struct dev_pm_ops sof_of_pm;
|
extern const struct dev_pm_ops sof_of_pm;
|
||||||
|
|
||||||
int sof_of_probe(struct platform_device *pdev);
|
int sof_of_probe(struct platform_device *pdev);
|
||||||
|
|
Loading…
Add table
Reference in a new issue