diff options
| author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2020-11-12 16:38:15 -0600 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-06-16 13:32:10 +0200 |
| commit | ece8098579e10bf2cdd1b9cd75cb5e4a2814cf21 (patch) | |
| tree | de116a4587ca3c25fe6771c9ff2f6f34de3c516f /include/sound | |
| parent | 04bc4d1090c343025d69149ca669a27c5b9c34a7 (diff) | |
| download | linux-ece8098579e10bf2cdd1b9cd75cb5e4a2814cf21.tar.gz linux-ece8098579e10bf2cdd1b9cd75cb5e4a2814cf21.tar.bz2 linux-ece8098579e10bf2cdd1b9cd75cb5e4a2814cf21.zip | |
ASoC: soc-acpi: add helper to identify parent driver.
[ Upstream commit 644eebdbbf1154c995d6319c133d7d5b898c5ed2 ]
Intel machine drivers are used by parent platform drivers based on
closed-source firmware (Atom/SST and catpt) and SOF-based ones.
In some cases for ACPI-based platforms, the behavior of machine
drivers needs to be modified depending on the parent type, typically
for card names and power management.
An initial solution based on passing a boolean flag as a platform
device parameter was tested earlier. Since it looked overkill, this
patch suggests instead a simple string comparison to identify an SOF
parent device/driver.
Suggested-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 0cb3b7fd530b ("ASoC: Intel: Disable route checks for Skylake boards")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/sound')
| -rw-r--r-- | include/sound/soc-acpi.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h index b16a844d16ef..9a43c44dcbbb 100644 --- a/include/sound/soc-acpi.h +++ b/include/sound/soc-acpi.h @@ -171,4 +171,10 @@ struct snd_soc_acpi_codecs { u8 codecs[SND_SOC_ACPI_MAX_CODECS][ACPI_ID_LEN]; }; +static inline bool snd_soc_acpi_sof_parent(struct device *dev) +{ + return dev->parent && dev->parent->driver && dev->parent->driver->name && + !strcmp(dev->parent->driver->name, "sof-audio-acpi"); +} + #endif |
