diff options
Diffstat (limited to 'sound/soc/intel/common')
-rw-r--r-- | sound/soc/intel/common/sst-acpi.h | 3 | ||||
-rw-r--r-- | sound/soc/intel/common/sst-dsp-priv.h | 1 | ||||
-rw-r--r-- | sound/soc/intel/common/sst-match-acpi.c | 45 |
3 files changed, 44 insertions, 5 deletions
diff --git a/sound/soc/intel/common/sst-acpi.h b/sound/soc/intel/common/sst-acpi.h index 3ee3b7ab5d03..4dcfb7e5ed70 100644 --- a/sound/soc/intel/common/sst-acpi.h +++ b/sound/soc/intel/common/sst-acpi.h @@ -14,6 +14,9 @@ #include <linux/acpi.h> +/* translation fron HID to I2C name, needed for DAI codec_name */ +const char *sst_acpi_find_name_from_hid(const u8 hid[ACPI_ID_LEN]); + /* acpi match */ struct sst_acpi_mach *sst_acpi_find_machine(struct sst_acpi_mach *machines); diff --git a/sound/soc/intel/common/sst-dsp-priv.h b/sound/soc/intel/common/sst-dsp-priv.h index 81aa1ed64201..97dc1ae05e69 100644 --- a/sound/soc/intel/common/sst-dsp-priv.h +++ b/sound/soc/intel/common/sst-dsp-priv.h @@ -317,6 +317,7 @@ struct sst_dsp { struct skl_cl_dev cl_dev; u32 intr_status; const struct firmware *fw; + struct snd_dma_buffer dmab; }; /* Size optimised DRAM/IRAM memcpy */ diff --git a/sound/soc/intel/common/sst-match-acpi.c b/sound/soc/intel/common/sst-match-acpi.c index 3b4539d21492..789843307a49 100644 --- a/sound/soc/intel/common/sst-match-acpi.c +++ b/sound/soc/intel/common/sst-match-acpi.c @@ -13,17 +13,53 @@ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. */ -#include <linux/acpi.h> -#include <linux/device.h> -#include <linux/module.h> -#include <linux/platform_device.h> #include "sst-acpi.h" +static acpi_status sst_acpi_find_name(acpi_handle handle, u32 level, + void *context, void **ret) +{ + struct acpi_device *adev; + const char *name = NULL; + + if (acpi_bus_get_device(handle, &adev)) + return AE_OK; + + if (adev->status.present && adev->status.functional) { + name = acpi_dev_name(adev); + *(const char **)ret = name; + return AE_CTRL_TERMINATE; + } + + return AE_OK; +} + +const char *sst_acpi_find_name_from_hid(const u8 hid[ACPI_ID_LEN]) +{ + const char *name = NULL; + acpi_status status; + + status = acpi_get_devices(hid, sst_acpi_find_name, NULL, + (void **)&name); + + if (ACPI_FAILURE(status) || name[0] == '\0') + return NULL; + + return name; +} +EXPORT_SYMBOL_GPL(sst_acpi_find_name_from_hid); + static acpi_status sst_acpi_mach_match(acpi_handle handle, u32 level, void *context, void **ret) { + unsigned long long sta; + acpi_status status; + *(bool *)context = true; + status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); + if (ACPI_FAILURE(status) || !(sta & ACPI_STA_DEVICE_PRESENT)) + *(bool *)context = false; + return AE_OK; } @@ -37,7 +73,6 @@ struct sst_acpi_mach *sst_acpi_find_machine(struct sst_acpi_mach *machines) sst_acpi_mach_match, &found, NULL)) && found) return mach; - return NULL; } EXPORT_SYMBOL_GPL(sst_acpi_find_machine); |