Skip to contentSkip to conversation

media: atomisp: Switch to new Intel CPU model defines

PATCH RESEND Applied Tony Luck 4 participants 6 messages Jun 11, 2024 – Jun 13, 2024

Subsystems (4)

v6 of 8 Applied Latest is v8 →

lore
Share & tools
lore

Tony Luck

author
#0 lore raw

PATCH RESEND v6 5/49 media: atomisp: Switch to new Intel CPU model defines

New CPU #defines encode vendor and family as well as model.

---

Mauro, Hans, Greg: Which one of you owns this one. Can you take a look please. Let me know if changes are needed.

 .../atomisp/include/linux/atomisp_platform.h  | 27 ++++++++-----------
 1 file changed, 11 insertions(+), 16 deletions(-)
drivers/staging/media/atomisp/include/linux/atomisp_platform.h +11 -16
index 0e3f6fb78483..fdeb247036b0 100644
@@ -18,7 +18,7 @@
 #ifndef ATOMISP_PLATFORM_H_
 #define ATOMISP_PLATFORM_H_
 
-#include <asm/intel-family.h>
+#include <asm/cpu_device_id.h>
 #include <asm/processor.h>
 
 #include <linux/i2c.h>
@@ -178,22 +178,17 @@ void atomisp_unregister_subdev(struct v4l2_subdev *subdev);
 int v4l2_get_acpi_sensor_info(struct device *dev, char **module_id_str);
 
 /* 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))
-#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_MRFD	__IS_SOC(INTEL_FAM6_ATOM_SILVERMONT_MID)
-#define IS_MOFD	__IS_SOC(INTEL_FAM6_ATOM_AIRMONT_MID)
+#define __IS_SOC(x) (boot_cpu_data.x86_vfm == x)
+#define __IS_SOCS(x, y) (boot_cpu_data.x86_vfm == x || boot_cpu_data.x86_vfm == y)
+
+#define IS_MFLD	__IS_SOC(INTEL_ATOM_SALTWELL_MID)
+#define IS_BYT	__IS_SOC(INTEL_ATOM_SILVERMONT)
+#define IS_CHT	__IS_SOC(INTEL_ATOM_AIRMONT)
+#define IS_MRFD	__IS_SOC(INTEL_ATOM_SILVERMONT_MID)
+#define IS_MOFD	__IS_SOC(INTEL_ATOM_AIRMONT_MID)
 
 /* Both CHT and MOFD come with ISP2401 */
-#define IS_ISP2401 __IS_SOCS(INTEL_FAM6_ATOM_AIRMONT, \
-			     INTEL_FAM6_ATOM_AIRMONT_MID)
+#define IS_ISP2401 __IS_SOCS(INTEL_ATOM_AIRMONT, \
+			     INTEL_ATOM_AIRMONT_MID)
 
 #endif /* ATOMISP_PLATFORM_H_ */
Signature · 1 line
2.45.0
#1 lore raw
Quoted 5 lines · Tony Luck

New CPU #defines encode vendor and family as well as model.

Quoted 7 lines

---

Mauro, Hans, Greg: Which one of you owns this one. Can you take a look please. Let me know if changes are needed.

 .../atomisp/include/linux/atomisp_platform.h  | 27 ++++++++-----------
 1 file changed, 11 insertions(+), 16 deletions(-)

Not me! :)

#2 lore raw
In reply to Tony Luck

Hi Tony,

Quoted 9 lines · Tony Luck

New CPU #defines encode vendor and family as well as model.

---

Mauro, Hans, Greg: Which one of you owns this one. Can you take a look please. Let me know if changes are needed.

I'll pick this one up. But atomisp support is a side project, so I only work on this every few weeks.

My intent is to get this send to Mauro (media-next) in time for the 6.11 merge window.

Regards,

Hans

Quoted 50 lines
 .../atomisp/include/linux/atomisp_platform.h  | 27 ++++++++-----------
 1 file changed, 11 insertions(+), 16 deletions(-)
drivers/staging/media/atomisp/include/linux/atomisp_platform.h +11 -16
index 0e3f6fb78483..fdeb247036b0 100644
@@ -18,7 +18,7 @@
 #ifndef ATOMISP_PLATFORM_H_
 #define ATOMISP_PLATFORM_H_
 
-#include <asm/intel-family.h>
+#include <asm/cpu_device_id.h>
 #include <asm/processor.h>
 
 #include <linux/i2c.h>
@@ -178,22 +178,17 @@ void atomisp_unregister_subdev(struct v4l2_subdev *subdev);
 int v4l2_get_acpi_sensor_info(struct device *dev, char **module_id_str);
 
 /* 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))
-#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_MRFD	__IS_SOC(INTEL_FAM6_ATOM_SILVERMONT_MID)
-#define IS_MOFD	__IS_SOC(INTEL_FAM6_ATOM_AIRMONT_MID)
+#define __IS_SOC(x) (boot_cpu_data.x86_vfm == x)
+#define __IS_SOCS(x, y) (boot_cpu_data.x86_vfm == x || boot_cpu_data.x86_vfm == y)
+
+#define IS_MFLD	__IS_SOC(INTEL_ATOM_SALTWELL_MID)
+#define IS_BYT	__IS_SOC(INTEL_ATOM_SILVERMONT)
+#define IS_CHT	__IS_SOC(INTEL_ATOM_AIRMONT)
+#define IS_MRFD	__IS_SOC(INTEL_ATOM_SILVERMONT_MID)
+#define IS_MOFD	__IS_SOC(INTEL_ATOM_AIRMONT_MID)
 
 /* Both CHT and MOFD come with ISP2401 */
-#define IS_ISP2401 __IS_SOCS(INTEL_FAM6_ATOM_AIRMONT, \
-			     INTEL_FAM6_ATOM_AIRMONT_MID)
+#define IS_ISP2401 __IS_SOCS(INTEL_ATOM_AIRMONT, \
+			     INTEL_ATOM_AIRMONT_MID)
 
 #endif /* ATOMISP_PLATFORM_H_ */
#3 lore raw

Em Wed, 12 Jun 2024 10:10:14 +0200
Hans de Goede <[email protected]> escreveu:

Quoted 10 lines

Hi Tony,

Quoted 7 lines · Tony Luck

New CPU #defines encode vendor and family as well as model.

---

Quoted 8 lines
Quoted 2 lines

Mauro, Hans, Greg: Which one of you owns this one. Can you take a look please. Let me know if changes are needed.

I'll pick this one up. But atomisp support is a side project, so I only work on this every few weeks.

My intent is to get this send to Mauro (media-next) in time for the 6.11 merge window.

Hans,

It seems that you already acked to this one, right?

If so, please add my acked-by, if this will end being merged via some other tree.

Tony,

I don't object having this merged via your tree with Hans ack.

We may also have it merged on media via Hans tree. He usually send me one or two pull requests per Kernel cycle with lots of atomisp patches on it.

Regards,
Mauro

Thanks,
Mauro

author
#4 lore raw
Quoted 10 lines
Quoted 2 lines

My intent is to get this send to Mauro (media-next) in time for the 6.11 merge window.

Hans,

It seems that you already acked to this one, right?

If so, please add my acked-by, if this will end being merged via some other tree.

Quoted 8 lines

Tony,

I don't object having this merged via your tree with Hans ack.

We may also have it merged on media via Hans tree. He usually send me one or two pull requests per Kernel cycle with lots of atomisp patches on it.

The only tree I currently have that feeds to linux-next is the RAS tree I share with Boris. This doesn't belong there.

I'm asking various subsystem maintainers to take these through the appropriate trees and having quite good success. This patch is one of seven looking for a home.

So please take it through the media tree.

Thanks

-Tony

#5 lore raw

Em Thu, 13 Jun 2024 15:35:57 +0000
"Luck, Tony" <[email protected]> escreveu:

Quoted 19 lines
Quoted 10 lines
Quoted 2 lines

My intent is to get this send to Mauro (media-next) in time for the 6.11 merge window.

Hans,

It seems that you already acked to this one, right?

If so, please add my acked-by, if this will end being merged via some other tree.

Quoted 8 lines

Tony,

I don't object having this merged via your tree with Hans ack.

We may also have it merged on media via Hans tree. He usually send me one or two pull requests per Kernel cycle with lots of atomisp patches on it.

Quoted 8 lines

The only tree I currently have that feeds to linux-next is the RAS tree I share with Boris. This doesn't belong there.

I'm asking various subsystem maintainers to take these through the appropriate trees and having quite good success. This patch is one of seven looking for a home.

So please take it through the media tree.

Ok!

I'll pick it and merge it.

Hans, no need to pick it on your tree ;-)

Regards,
Mauro