| 1 |
// SPDX-License-Identifier: GPL-2.0-only |
| 2 |
/* |
| 3 |
* soc-acpi-amd-sdca-quirks.c - tables and support for SDCA quirks |
| 4 |
* |
| 5 |
* Copyright(c) 2025 Advanced Micro Devices, Inc. All rights reserved. |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
#include <linux/soundwire/sdw_amd.h> |
| 10 |
#include <sound/sdca.h> |
| 11 |
#include <sound/soc-acpi.h> |
| 12 |
#include "soc-acpi-amd-sdca-quirks.h" |
| 13 |
|
| 14 |
/* |
| 15 |
* Pretend machine quirk. The argument type is not the traditional |
| 16 |
* 'struct snd_soc_acpi_mach' pointer but instead the sdw_amd_ctx |
| 17 |
* which contains the peripheral information required for the |
| 18 |
* SoundWire/SDCA filter on the SMART_MIC setup and interface |
| 19 |
* revision. When the return value is false, the entry in the |
| 20 |
* 'snd_soc_acpi_mach' table needs to be skipped. |
| 21 |
*/ |
| 22 |
bool snd_soc_acpi_amd_sdca_is_device_rt712_vb(void *arg) |
| 23 |
{ |
| 24 |
struct sdw_amd_ctx *ctx = arg; |
| 25 |
int i; |
| 26 |
|
| 27 |
if (!ctx) |
| 28 |
return false; |
| 29 |
|
| 30 |
for (i = 0; i < ctx->peripherals->num_peripherals; i++) { |
| 31 |
if (sdca_device_quirk_match(ctx->peripherals->array[i], |
| 32 |
SDCA_QUIRKS_RT712_VB)) |
| 33 |
return true; |
| 34 |
} |
| 35 |
|
| 36 |
return false; |
| 37 |
} |
| 38 |
EXPORT_SYMBOL_NS(snd_soc_acpi_amd_sdca_is_device_rt712_vb, "SND_SOC_ACPI_AMD_SDCA_QUIRKS"); |
| 39 |
|
| 40 |
MODULE_DESCRIPTION("ASoC ACPI AMD SDCA quirks"); |
| 41 |
MODULE_LICENSE("GPL"); |
| 42 |
MODULE_IMPORT_NS("SND_SOC_SDCA"); |