summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/boards/bytcr_rt5640.c
diff options
context:
space:
mode:
authorPierre-Louis Bossart2019-05-30 13:50:11 +0200
committerMark Brown2019-05-30 17:33:26 +0200
commit536cfd2f375d36f4316c0b93bb9e0eaf78e0ef6c (patch)
tree2990c0ffb102ef23ac6316329c71ce9083d8d0ee /sound/soc/intel/boards/bytcr_rt5640.c
parentASoC: rt5677: Add missing voice activation register definitions (diff)
downloadkernel-qcow2-linux-536cfd2f375d36f4316c0b93bb9e0eaf78e0ef6c.tar.gz
kernel-qcow2-linux-536cfd2f375d36f4316c0b93bb9e0eaf78e0ef6c.tar.xz
kernel-qcow2-linux-536cfd2f375d36f4316c0b93bb9e0eaf78e0ef6c.zip
ASoC: Intel: use common helpers to detect CPUs
We have duplicated code in multiple locations (atom, machine drivers, SOF) to detect Baytrail, Cherrytrail and other SOCs. This is not very elegant, and introduces dependencies on CONFIG_X86 that prevent COMPILE_TEST from working. Add common helpers to provide same functionality in a cleaner way. This will also help support the DMI-based quirks being introduced to handle SOF/SST autodetection. Reviewed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/boards/bytcr_rt5640.c')
-rw-r--r--sound/soc/intel/boards/bytcr_rt5640.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c
index dc22df9a99fb..7aae7b78efba 100644
--- a/sound/soc/intel/boards/bytcr_rt5640.c
+++ b/sound/soc/intel/boards/bytcr_rt5640.c
@@ -28,7 +28,6 @@
#include <linux/dmi.h>
#include <linux/input.h>
#include <linux/slab.h>
-#include <asm/cpu_device_id.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
@@ -38,6 +37,7 @@
#include "../../codecs/rt5640.h"
#include "../atom/sst-atom-controls.h"
#include "../common/sst-dsp.h"
+#include "../common/soc-intel-quirks.h"
enum {
BYT_RT5640_DMIC1_MAP,
@@ -1130,18 +1130,6 @@ static struct snd_soc_card byt_rt5640_card = {
.resume_post = byt_rt5640_resume,
};
-static bool is_valleyview(void)
-{
- static const struct x86_cpu_id cpu_ids[] = {
- { X86_VENDOR_INTEL, 6, 55 }, /* Valleyview, Bay Trail */
- {}
- };
-
- if (!x86_match_cpu(cpu_ids))
- return false;
- return true;
-}
-
struct acpi_chan_package { /* ACPICA seems to require 64 bit integers */
u64 aif_value; /* 1: AIF1, 2: AIF2 */
u64 mclock_value; /* usually 25MHz (0x17d7940), ignored */
@@ -1190,7 +1178,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
* swap SSP0 if bytcr is detected
* (will be overridden if DMI quirk is detected)
*/
- if (is_valleyview()) {
+ if (soc_intel_is_byt()) {
if (mach->mach_params.acpi_ipc_irq_index == 0)
is_bytcr = true;
}