Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/sfi: Enable enumeration of SD devices

SFI specification v0.8.2 defines type of devices which are connected to
SD bus. In particularly WiFi dongle is a such.

Add a callback to enumerate the devices connected to SD bus.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1468322192-62080-1-git-send-email-andriy.shevchenko@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Andy Shevchenko and committed by
Ingo Molnar
05f310e2 707a605b

+45
+15
arch/x86/include/asm/intel-mid.h
··· 49 49 static const struct devs_id *const __intel_mid_sfi_##i##_dev __used \ 50 50 __attribute__((__section__(".x86_intel_mid_dev.init"))) = &i 51 51 52 + /** 53 + * struct mid_sd_board_info - template for SD device creation 54 + * @name: identifies the driver 55 + * @bus_num: board-specific identifier for a given SD controller 56 + * @max_clk: the maximum frequency device supports 57 + * @platform_data: the particular data stored there is driver-specific 58 + */ 59 + struct mid_sd_board_info { 60 + char name[SFI_NAME_LEN]; 61 + int bus_num; 62 + unsigned short addr; 63 + u32 max_clk; 64 + void *platform_data; 65 + }; 66 + 52 67 /* 53 68 * Medfield is the follow-up of Moorestown, it combines two chip solution into 54 69 * one. Other than that it also added always-on and constant tsc and lapic
+29
arch/x86/platform/intel-mid/sfi.c
··· 407 407 i2c_register_board_info(pentry->host_num, &i2c_info, 1); 408 408 } 409 409 410 + static void __init sfi_handle_sd_dev(struct sfi_device_table_entry *pentry, 411 + struct devs_id *dev) 412 + { 413 + struct mid_sd_board_info sd_info; 414 + void *pdata; 415 + 416 + memset(&sd_info, 0, sizeof(sd_info)); 417 + strncpy(sd_info.name, pentry->name, SFI_NAME_LEN); 418 + sd_info.bus_num = pentry->host_num; 419 + sd_info.max_clk = pentry->max_freq; 420 + sd_info.addr = pentry->addr; 421 + pr_debug("SD bus = %d, name = %16.16s, max_clk = %d, addr = 0x%x\n", 422 + sd_info.bus_num, 423 + sd_info.name, 424 + sd_info.max_clk, 425 + sd_info.addr); 426 + pdata = intel_mid_sfi_get_pdata(dev, &sd_info); 427 + if (IS_ERR(pdata)) 428 + return; 429 + 430 + /* Nothing we can do with this for now */ 431 + sd_info.platform_data = pdata; 432 + 433 + pr_debug("Successfully registered %16.16s", sd_info.name); 434 + } 435 + 410 436 extern struct devs_id *const __x86_intel_mid_dev_start[], 411 437 *const __x86_intel_mid_dev_end[]; 412 438 ··· 515 489 break; 516 490 case SFI_DEV_TYPE_I2C: 517 491 sfi_handle_i2c_dev(pentry, dev); 492 + break; 493 + case SFI_DEV_TYPE_SD: 494 + sfi_handle_sd_dev(pentry, dev); 518 495 break; 519 496 case SFI_DEV_TYPE_UART: 520 497 case SFI_DEV_TYPE_HSI:
+1
include/linux/sfi.h
··· 156 156 #define SFI_DEV_TYPE_UART 2 157 157 #define SFI_DEV_TYPE_HSI 3 158 158 #define SFI_DEV_TYPE_IPC 4 159 + #define SFI_DEV_TYPE_SD 5 159 160 160 161 u8 host_num; /* attached to host 0, 1...*/ 161 162 u16 addr;