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

Configure Feed

Select the types of activity you want to include in your feed.

mfd: intel-lpss: Switch to generalized quirk table

Introduce generic quirk table, and port existing walkaround for select
Microsoft devices to it. This is a preparation for
QUIRK_CLOCK_DIVIDER_UNITY.

Signed-off-by: Aleksandrs Vinarskis <alex.vinarskis@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231221185142.9224-2-alex.vinarskis@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Aleksandrs Vinarskis and committed by
Lee Jones
ac9538f6 3eeadf8f

+24 -10
+15 -8
drivers/mfd/intel-lpss-pci.c
··· 23 23 24 24 #include "intel-lpss.h" 25 25 26 - /* Some DSDTs have an unused GEXP ACPI device conflicting with I2C4 resources */ 27 - static const struct pci_device_id ignore_resource_conflicts_ids[] = { 28 - /* Microsoft Surface Go (version 1) I2C4 */ 29 - { PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1182), }, 30 - /* Microsoft Surface Go 2 I2C4 */ 31 - { PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1237), }, 26 + static const struct pci_device_id quirk_ids[] = { 27 + { 28 + /* Microsoft Surface Go (version 1) I2C4 */ 29 + PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1182), 30 + .driver_data = QUIRK_IGNORE_RESOURCE_CONFLICTS, 31 + }, 32 + { 33 + /* Microsoft Surface Go 2 I2C4 */ 34 + PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1237), 35 + .driver_data = QUIRK_IGNORE_RESOURCE_CONFLICTS, 36 + }, 32 37 { } 33 38 }; 34 39 ··· 41 36 const struct pci_device_id *id) 42 37 { 43 38 const struct intel_lpss_platform_info *data = (void *)id->driver_data; 39 + const struct pci_device_id *quirk_pci_info; 44 40 struct intel_lpss_platform_info *info; 45 41 int ret; 46 42 ··· 61 55 info->mem = pci_resource_n(pdev, 0); 62 56 info->irq = pci_irq_vector(pdev, 0); 63 57 64 - if (pci_match_id(ignore_resource_conflicts_ids, pdev)) 65 - info->ignore_resource_conflicts = true; 58 + quirk_pci_info = pci_match_id(quirk_ids, pdev); 59 + if (quirk_pci_info) 60 + info->quirks = quirk_pci_info->driver_data; 66 61 67 62 pdev->d3cold_delay = 0; 68 63
+1 -1
drivers/mfd/intel-lpss.c
··· 412 412 return ret; 413 413 414 414 lpss->cell->swnode = info->swnode; 415 - lpss->cell->ignore_resource_conflicts = info->ignore_resource_conflicts; 415 + lpss->cell->ignore_resource_conflicts = info->quirks & QUIRK_IGNORE_RESOURCE_CONFLICTS; 416 416 417 417 intel_lpss_init_dev(lpss); 418 418
+8 -1
drivers/mfd/intel-lpss.h
··· 11 11 #ifndef __MFD_INTEL_LPSS_H 12 12 #define __MFD_INTEL_LPSS_H 13 13 14 + #include <linux/bits.h> 14 15 #include <linux/pm.h> 16 + 17 + /* 18 + * Some DSDTs have an unused GEXP ACPI device conflicting with I2C4 resources. 19 + * Set to ignore resource conflicts with ACPI declared SystemMemory regions. 20 + */ 21 + #define QUIRK_IGNORE_RESOURCE_CONFLICTS BIT(0) 15 22 16 23 struct device; 17 24 struct resource; ··· 26 19 27 20 struct intel_lpss_platform_info { 28 21 struct resource *mem; 29 - bool ignore_resource_conflicts; 30 22 int irq; 23 + unsigned int quirks; 31 24 unsigned long clk_rate; 32 25 const char *clk_con_id; 33 26 const struct software_node *swnode;