Commit 14d10f0a48cdfa76773cadcbf0deb233282f6b94
Committed by
Matthew Garrett
1 parent
a00cd11b39
Exists in
master
and in
7 other branches
intel_scu_ipc: detect CPU type automatically
Intel SCU message formats depend upon the processor type. Replace the module option with automatic detection of the processor type. Signed-off-by: Sreedhara DS <sreedhara.ds@intel.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Showing 1 changed file with 12 additions and 7 deletions Side-by-side Diff
drivers/platform/x86/intel_scu_ipc.c
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 | #include <linux/pm.h> |
24 | 24 | #include <linux/pci.h> |
25 | 25 | #include <linux/interrupt.h> |
26 | -#include <asm/setup.h> | |
26 | +#include <asm/mrst.h> | |
27 | 27 | #include <asm/intel_scu_ipc.h> |
28 | 28 | |
29 | 29 | /* IPC defines the following message types */ |
30 | 30 | |
... | ... | @@ -78,13 +78,10 @@ |
78 | 78 | |
79 | 79 | static struct intel_scu_ipc_dev ipcdev; /* Only one for now */ |
80 | 80 | |
81 | -static int platform = 1; | |
82 | -module_param(platform, int, 0); | |
83 | -MODULE_PARM_DESC(platform, "1 for moorestown platform"); | |
81 | +#define PLATFORM_LANGWELL 1 | |
82 | +#define PLATFORM_PENWELL 2 | |
83 | +static int platform; /* Platform type */ | |
84 | 84 | |
85 | - | |
86 | - | |
87 | - | |
88 | 85 | /* |
89 | 86 | * IPC Read Buffer (Read Only): |
90 | 87 | * 16 byte buffer for receiving data from SCU, if IPC command |
... | ... | @@ -817,6 +814,14 @@ |
817 | 814 | |
818 | 815 | static int __init intel_scu_ipc_init(void) |
819 | 816 | { |
817 | + if (boot_cpu_data.x86 == 6 && | |
818 | + boot_cpu_data.x86_model == 0x27 && | |
819 | + boot_cpu_data.x86_mask == 1) | |
820 | + platform = PLATFORM_PENWELL; | |
821 | + else if (boot_cpu_data.x86 == 6 && | |
822 | + boot_cpu_data.x86_model == 0x26) | |
823 | + platform = PLATFORM_LANGWELL; | |
824 | + | |
820 | 825 | return pci_register_driver(&ipc_driver); |
821 | 826 | } |
822 | 827 |