diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-06-01 10:43:24 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-06-11 20:11:39 +0300 |
commit | 469a7306f1717b9017006708f0815bd5294324dd (patch) | |
tree | 73ce4ae1121f3f4a1edb2907aba1f197be530531 /drivers/staging/media/atomisp/include | |
parent | 77bdacaa9f553449fe2807bfb5a88f10dba4d2b4 (diff) | |
download | linux-469a7306f1717b9017006708f0815bd5294324dd.tar.xz |
media: atomisp: change the detection of ISP2401 at runtime
Instead of having a static var to detect it, let's use the
already-existing arch-specific bytes, as this is how other
parts of the code also checks when it needs to do something
different, depending on an specific chipset version.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/atomisp/include')
-rw-r--r-- | drivers/staging/media/atomisp/include/linux/atomisp.h | 3 | ||||
-rw-r--r-- | drivers/staging/media/atomisp/include/linux/atomisp_platform.h | 11 |
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/staging/media/atomisp/include/linux/atomisp.h b/drivers/staging/media/atomisp/include/linux/atomisp.h index 0913d8b25097..22c4103b0385 100644 --- a/drivers/staging/media/atomisp/include/linux/atomisp.h +++ b/drivers/staging/media/atomisp/include/linux/atomisp.h @@ -70,9 +70,6 @@ #define V4L2_MBUS_FMT_CUSTOM_M10MO_RAW 0x800b #endif -/* FIXME: for now, let's use a boolean to identify the type of atomisp chipset */ -extern bool atomisp_hw_is_isp2401; - /* Configuration used by Bayer noise reduction and YCC noise reduction */ struct atomisp_nr_config { /* [gain] Strength of noise reduction for Bayer NR (Used by Bayer NR) */ diff --git a/drivers/staging/media/atomisp/include/linux/atomisp_platform.h b/drivers/staging/media/atomisp/include/linux/atomisp_platform.h index 395d7c022ad1..873344a02ccf 100644 --- a/drivers/staging/media/atomisp/include/linux/atomisp_platform.h +++ b/drivers/staging/media/atomisp/include/linux/atomisp_platform.h @@ -19,6 +19,7 @@ #define ATOMISP_PLATFORM_H_ #include <asm/intel-family.h> +#include <asm/processor.h> #include <linux/i2c.h> #include <linux/sfi.h> @@ -240,11 +241,19 @@ const struct atomisp_camera_caps *atomisp_get_default_camera_caps(void); /* API from old platform_camera.h, new CPUID implementation */ #define __IS_SOC(x) (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && \ boot_cpu_data.x86 == 6 && \ - boot_cpu_data.x86_model == x) + boot_cpu_data.x86_model == (x)) +#define __IS_SOCS(x,y) (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && \ + boot_cpu_data.x86 == 6 && \ + (boot_cpu_data.x86_model == (x) || \ + boot_cpu_data.x86_model == (y))) #define IS_MFLD __IS_SOC(INTEL_FAM6_ATOM_SALTWELL_MID) #define IS_BYT __IS_SOC(INTEL_FAM6_ATOM_SILVERMONT) #define IS_CHT __IS_SOC(INTEL_FAM6_ATOM_AIRMONT) #define IS_MOFD __IS_SOC(INTEL_FAM6_ATOM_AIRMONT_MID) +/* Both CHT and MOFD come with ISP2401 */ +#define IS_ISP2401 __IS_SOCS(INTEL_FAM6_ATOM_AIRMONT, \ + INTEL_FAM6_ATOM_AIRMONT_MID) + #endif /* ATOMISP_PLATFORM_H_ */ |