mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 06:31:49 +00:00
ASoC: SOF: Introduce function sof_of_machine_select
From current design in sof_machine_check and snd_sof_new_platform_drv, the SOF can only support ACPI type machine. 1. In sof_machine_check if there is no ACPI machine exist, the function will return -ENODEV directly, that's we don't expected if we do not base on ACPI machine. 2. In snd_sof_new_platform_drv the component driver need a driver name to do ignore_machine, currently the driver name is obtained from machine->drv_name, and the type of machine is snd_soc_acpi_mach. So we add a new function named sof_of_machine_select that we can pass sof_machine_check and obtain info required by snd_sof_new_platform_drv. Signed-off-by: Chunxu Li <chunxu.li@mediatek.com> Link: https://lore.kernel.org/r/20220805070449.6611-2-chunxu.li@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
94f0727483
commit
6ace85b983
@ -89,6 +89,7 @@ struct snd_sof_pdata {
|
|||||||
/* machine */
|
/* machine */
|
||||||
struct platform_device *pdev_mach;
|
struct platform_device *pdev_mach;
|
||||||
const struct snd_soc_acpi_mach *machine;
|
const struct snd_soc_acpi_mach *machine;
|
||||||
|
const struct snd_sof_of_mach *of_machine;
|
||||||
|
|
||||||
void *hw_pdata;
|
void *hw_pdata;
|
||||||
|
|
||||||
@ -102,6 +103,7 @@ struct snd_sof_pdata {
|
|||||||
struct sof_dev_desc {
|
struct sof_dev_desc {
|
||||||
/* list of machines using this configuration */
|
/* list of machines using this configuration */
|
||||||
struct snd_soc_acpi_mach *machines;
|
struct snd_soc_acpi_mach *machines;
|
||||||
|
struct snd_sof_of_mach *of_machines;
|
||||||
|
|
||||||
/* alternate list of machines using this configuration */
|
/* alternate list of machines using this configuration */
|
||||||
struct snd_soc_acpi_mach *alt_machines;
|
struct snd_soc_acpi_mach *alt_machines;
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include <linux/pm_runtime.h>
|
#include <linux/pm_runtime.h>
|
||||||
#include <sound/pcm_params.h>
|
#include <sound/pcm_params.h>
|
||||||
#include <sound/sof.h>
|
#include <sound/sof.h>
|
||||||
|
#include "sof-of-dev.h"
|
||||||
#include "sof-priv.h"
|
#include "sof-priv.h"
|
||||||
#include "sof-audio.h"
|
#include "sof-audio.h"
|
||||||
#include "sof-utils.h"
|
#include "sof-utils.h"
|
||||||
@ -655,7 +656,12 @@ void snd_sof_new_platform_drv(struct snd_sof_dev *sdev)
|
|||||||
struct snd_sof_pdata *plat_data = sdev->pdata;
|
struct snd_sof_pdata *plat_data = sdev->pdata;
|
||||||
const char *drv_name;
|
const char *drv_name;
|
||||||
|
|
||||||
drv_name = plat_data->machine->drv_name;
|
if (plat_data->machine)
|
||||||
|
drv_name = plat_data->machine->drv_name;
|
||||||
|
else if (plat_data->of_machine)
|
||||||
|
drv_name = plat_data->of_machine->drv_name;
|
||||||
|
else
|
||||||
|
drv_name = NULL;
|
||||||
|
|
||||||
pd->name = "sof-audio-component";
|
pd->name = "sof-audio-component";
|
||||||
pd->probe = sof_pcm_probe;
|
pd->probe = sof_pcm_probe;
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include <linux/bitfield.h>
|
#include <linux/bitfield.h>
|
||||||
#include "sof-audio.h"
|
#include "sof-audio.h"
|
||||||
|
#include "sof-of-dev.h"
|
||||||
#include "ops.h"
|
#include "ops.h"
|
||||||
|
|
||||||
static void sof_reset_route_setup_status(struct snd_sof_dev *sdev, struct snd_sof_widget *widget)
|
static void sof_reset_route_setup_status(struct snd_sof_dev *sdev, struct snd_sof_widget *widget)
|
||||||
|
@ -9,6 +9,13 @@
|
|||||||
#ifndef __SOUND_SOC_SOF_OF_H
|
#ifndef __SOUND_SOC_SOF_OF_H
|
||||||
#define __SOUND_SOC_SOF_OF_H
|
#define __SOUND_SOC_SOF_OF_H
|
||||||
|
|
||||||
|
struct snd_sof_of_mach {
|
||||||
|
const char *compatible;
|
||||||
|
const char *drv_name;
|
||||||
|
const char *fw_filename;
|
||||||
|
const char *sof_tplg_filename;
|
||||||
|
};
|
||||||
|
|
||||||
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…
Reference in New Issue
Block a user