mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-12-26 12:21:01 +01:00
First of all, we don't use intel-family.h directly. On the other hand we actively use boolean type, that is defined in the types.h (we take top-level header for that) and x86_cpu_id, that is provided in the mod_devicetable.h. Secondly, we don't need to spread SOC_INTEL_IS_CPU() macro to the users. Hence, undefine it when it's appropriate. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230206145238.19460-1-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
71 lines
1.3 KiB
C
71 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Helpers for Intel SoC model detection
|
|
*
|
|
* Copyright (c) 2019, Intel Corporation.
|
|
*/
|
|
|
|
#ifndef __PLATFORM_DATA_X86_SOC_H
|
|
#define __PLATFORM_DATA_X86_SOC_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
#if IS_ENABLED(CONFIG_X86)
|
|
|
|
#include <linux/mod_devicetable.h>
|
|
|
|
#include <asm/cpu_device_id.h>
|
|
|
|
#define SOC_INTEL_IS_CPU(soc, type) \
|
|
static inline bool soc_intel_is_##soc(void) \
|
|
{ \
|
|
static const struct x86_cpu_id soc##_cpu_ids[] = { \
|
|
X86_MATCH_INTEL_FAM6_MODEL(type, NULL), \
|
|
{} \
|
|
}; \
|
|
const struct x86_cpu_id *id; \
|
|
\
|
|
id = x86_match_cpu(soc##_cpu_ids); \
|
|
if (id) \
|
|
return true; \
|
|
return false; \
|
|
}
|
|
|
|
SOC_INTEL_IS_CPU(byt, ATOM_SILVERMONT);
|
|
SOC_INTEL_IS_CPU(cht, ATOM_AIRMONT);
|
|
SOC_INTEL_IS_CPU(apl, ATOM_GOLDMONT);
|
|
SOC_INTEL_IS_CPU(glk, ATOM_GOLDMONT_PLUS);
|
|
SOC_INTEL_IS_CPU(cml, KABYLAKE_L);
|
|
|
|
#undef SOC_INTEL_IS_CPU
|
|
|
|
#else /* IS_ENABLED(CONFIG_X86) */
|
|
|
|
static inline bool soc_intel_is_byt(void)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline bool soc_intel_is_cht(void)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline bool soc_intel_is_apl(void)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline bool soc_intel_is_glk(void)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline bool soc_intel_is_cml(void)
|
|
{
|
|
return false;
|
|
}
|
|
#endif /* IS_ENABLED(CONFIG_X86) */
|
|
|
|
#endif /* __PLATFORM_DATA_X86_SOC_H */
|