aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/intel/atom/sst/sst_acpi.c44
-rw-r--r--sound/soc/intel/common/sst-acpi.h2
2 files changed, 44 insertions, 2 deletions
diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c
index 3bc4b63b2f9d..82a374d885a7 100644
--- a/sound/soc/intel/atom/sst/sst_acpi.c
+++ b/sound/soc/intel/atom/sst/sst_acpi.c
@@ -28,6 +28,7 @@
28#include <linux/firmware.h> 28#include <linux/firmware.h>
29#include <linux/pm_runtime.h> 29#include <linux/pm_runtime.h>
30#include <linux/pm_qos.h> 30#include <linux/pm_qos.h>
31#include <linux/dmi.h>
31#include <linux/acpi.h> 32#include <linux/acpi.h>
32#include <asm/platform_sst_audio.h> 33#include <asm/platform_sst_audio.h>
33#include <sound/core.h> 34#include <sound/core.h>
@@ -237,6 +238,9 @@ static int sst_acpi_probe(struct platform_device *pdev)
237 dev_err(dev, "No matching machine driver found\n"); 238 dev_err(dev, "No matching machine driver found\n");
238 return -ENODEV; 239 return -ENODEV;
239 } 240 }
241 if (mach->machine_quirk)
242 mach = mach->machine_quirk(mach);
243
240 pdata = mach->pdata; 244 pdata = mach->pdata;
241 245
242 ret = kstrtouint(id->id, 16, &dev_id); 246 ret = kstrtouint(id->id, 16, &dev_id);
@@ -320,6 +324,44 @@ static int sst_acpi_remove(struct platform_device *pdev)
320 return 0; 324 return 0;
321} 325}
322 326
327static unsigned long cht_machine_id;
328
329#define CHT_SURFACE_MACH 1
330
331static int cht_surface_quirk_cb(const struct dmi_system_id *id)
332{
333 cht_machine_id = CHT_SURFACE_MACH;
334 return 1;
335}
336
337
338static const struct dmi_system_id cht_table[] = {
339 {
340 .callback = cht_surface_quirk_cb,
341 .matches = {
342 DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
343 DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
344 },
345 },
346};
347
348
349static struct sst_acpi_mach cht_surface_mach = {
350 "10EC5640", "cht-bsw-rt5645", "intel/fw_sst_22a8.bin", "cht-bsw", NULL,
351 &chv_platform_data };
352
353struct sst_acpi_mach *cht_quirk(void *arg)
354{
355 struct sst_acpi_mach *mach = arg;
356
357 dmi_check_system(cht_table);
358
359 if (cht_machine_id == CHT_SURFACE_MACH)
360 return &cht_surface_mach;
361 else
362 return mach;
363}
364
323static struct sst_acpi_mach sst_acpi_bytcr[] = { 365static struct sst_acpi_mach sst_acpi_bytcr[] = {
324 {"10EC5640", "bytcr_rt5640", "intel/fw_sst_0f28.bin", "bytcr_rt5640", NULL, 366 {"10EC5640", "bytcr_rt5640", "intel/fw_sst_0f28.bin", "bytcr_rt5640", NULL,
325 &byt_rvp_platform_data }, 367 &byt_rvp_platform_data },
@@ -343,7 +385,7 @@ static struct sst_acpi_mach sst_acpi_chv[] = {
343 {"193C9890", "cht-bsw-max98090", "intel/fw_sst_22a8.bin", "cht-bsw", NULL, 385 {"193C9890", "cht-bsw-max98090", "intel/fw_sst_22a8.bin", "cht-bsw", NULL,
344 &chv_platform_data }, 386 &chv_platform_data },
345 /* some CHT-T platforms rely on RT5640, use Baytrail machine driver */ 387 /* some CHT-T platforms rely on RT5640, use Baytrail machine driver */
346 {"10EC5640", "bytcr_rt5640", "intel/fw_sst_22a8.bin", "bytcr_rt5640", NULL, 388 {"10EC5640", "bytcr_rt5640", "intel/fw_sst_22a8.bin", "bytcr_rt5640", cht_quirk,
347 &chv_platform_data }, 389 &chv_platform_data },
348 390
349 {}, 391 {},
diff --git a/sound/soc/intel/common/sst-acpi.h b/sound/soc/intel/common/sst-acpi.h
index b02f12900b93..5d2949324d0e 100644
--- a/sound/soc/intel/common/sst-acpi.h
+++ b/sound/soc/intel/common/sst-acpi.h
@@ -40,6 +40,6 @@ struct sst_acpi_mach {
40 40
41 /* board name */ 41 /* board name */
42 const char *board; 42 const char *board;
43 void (*machine_quirk)(void); 43 struct sst_acpi_mach * (*machine_quirk)(void *arg);
44 void *pdata; 44 void *pdata;
45}; 45};