diff options
author | David Cohen <david.a.cohen@linux.intel.com> | 2013-10-17 15:35:36 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2013-10-17 16:41:50 -0700 |
commit | 40a96d54ee2232045783e657eb9224cd723dcb40 (patch) | |
tree | 917d337e1b724744cee6ca7610187a821e374a8a /arch/x86/platform/intel-mid/sfi.c | |
parent | 66ac50137049b3d3fab39e5ae245e1562aee5acd (diff) | |
download | linux-40a96d54ee2232045783e657eb9224cd723dcb40.tar.bz2 |
intel_mid: Move platform device setups to their own platform_<device>.* files
As Intel rolling out more SoC's after Moorestown, we need to
re-structure the code in a way that is backward compatible and easy to
expand. This patch implements a flexible way to support multiple boards
and devices.
This patch does not add any new functional support. It just refactors
the existing code to increase the modularity and decrease the code
duplication for supporting multiple soc's and boards.
Currently intel-mid.c has both board and soc related code in one file.
This patch moves the board related code to new files and let linker
script to create SFI devite table following this:
1. Move the SFI device specific code to
arch/x86/platform/intel-mid/device-libs/platform_<device>.*
A new device file is added for every supported device. This code will
get conditionally compiled by using corresponding device driver
CONFIG option.
2. Move the device_ids location to .x86_intel_mid_dev.init section by
using new sfi_device() macro.
This patch was based on previous code from Sathyanarayanan Kuppuswamy.
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Link: http://lkml.kernel.org/r/1382049336-21316-13-git-send-email-david.a.cohen@linux.intel.com
Signed-off-by: David Cohen <david.a.cohen@linux.intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/platform/intel-mid/sfi.c')
-rw-r--r-- | arch/x86/platform/intel-mid/sfi.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/platform/intel-mid/sfi.c b/arch/x86/platform/intel-mid/sfi.c index 3f1c171e5ce3..c84c1ca396bf 100644 --- a/arch/x86/platform/intel-mid/sfi.c +++ b/arch/x86/platform/intel-mid/sfi.c @@ -42,7 +42,6 @@ #include <asm/intel_scu_ipc.h> #include <asm/apb_timer.h> #include <asm/reboot.h> -#include "intel_mid_weak_decls.h" #define SFI_SIG_OEM0 "OEM0" #define MAX_IPCDEVS 24 @@ -403,19 +402,20 @@ static void __init sfi_handle_i2c_dev(struct sfi_device_table_entry *pentry, i2c_register_board_info(pentry->host_num, &i2c_info, 1); } +extern struct devs_id *const __x86_intel_mid_dev_start[], + *const __x86_intel_mid_dev_end[]; + static struct devs_id __init *get_device_id(u8 type, char *name) { - struct devs_id *dev = device_ids; - - if (device_ids == NULL) - return NULL; + struct devs_id *const *dev_table; - while (dev->name[0]) { + for (dev_table = __x86_intel_mid_dev_start; + dev_table < __x86_intel_mid_dev_end; dev_table++) { + struct devs_id *dev = *dev_table; if (dev->type == type && !strncmp(dev->name, name, SFI_NAME_LEN)) { return dev; } - dev++; } return NULL; |