mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 05:44:11 +00:00
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>
This commit is contained in:
parent
3eeadf8ff9
commit
ac9538f600
3 changed files with 24 additions and 10 deletions
|
@ -23,12 +23,17 @@
|
||||||
|
|
||||||
#include "intel-lpss.h"
|
#include "intel-lpss.h"
|
||||||
|
|
||||||
/* Some DSDTs have an unused GEXP ACPI device conflicting with I2C4 resources */
|
static const struct pci_device_id quirk_ids[] = {
|
||||||
static const struct pci_device_id ignore_resource_conflicts_ids[] = {
|
{
|
||||||
/* Microsoft Surface Go (version 1) I2C4 */
|
/* Microsoft Surface Go (version 1) I2C4 */
|
||||||
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1182), },
|
PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1182),
|
||||||
/* Microsoft Surface Go 2 I2C4 */
|
.driver_data = QUIRK_IGNORE_RESOURCE_CONFLICTS,
|
||||||
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1237), },
|
},
|
||||||
|
{
|
||||||
|
/* Microsoft Surface Go 2 I2C4 */
|
||||||
|
PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1237),
|
||||||
|
.driver_data = QUIRK_IGNORE_RESOURCE_CONFLICTS,
|
||||||
|
},
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -36,6 +41,7 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev,
|
||||||
const struct pci_device_id *id)
|
const struct pci_device_id *id)
|
||||||
{
|
{
|
||||||
const struct intel_lpss_platform_info *data = (void *)id->driver_data;
|
const struct intel_lpss_platform_info *data = (void *)id->driver_data;
|
||||||
|
const struct pci_device_id *quirk_pci_info;
|
||||||
struct intel_lpss_platform_info *info;
|
struct intel_lpss_platform_info *info;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -55,8 +61,9 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev,
|
||||||
info->mem = pci_resource_n(pdev, 0);
|
info->mem = pci_resource_n(pdev, 0);
|
||||||
info->irq = pci_irq_vector(pdev, 0);
|
info->irq = pci_irq_vector(pdev, 0);
|
||||||
|
|
||||||
if (pci_match_id(ignore_resource_conflicts_ids, pdev))
|
quirk_pci_info = pci_match_id(quirk_ids, pdev);
|
||||||
info->ignore_resource_conflicts = true;
|
if (quirk_pci_info)
|
||||||
|
info->quirks = quirk_pci_info->driver_data;
|
||||||
|
|
||||||
pdev->d3cold_delay = 0;
|
pdev->d3cold_delay = 0;
|
||||||
|
|
||||||
|
|
|
@ -412,7 +412,7 @@ int intel_lpss_probe(struct device *dev,
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
lpss->cell->swnode = info->swnode;
|
lpss->cell->swnode = info->swnode;
|
||||||
lpss->cell->ignore_resource_conflicts = info->ignore_resource_conflicts;
|
lpss->cell->ignore_resource_conflicts = info->quirks & QUIRK_IGNORE_RESOURCE_CONFLICTS;
|
||||||
|
|
||||||
intel_lpss_init_dev(lpss);
|
intel_lpss_init_dev(lpss);
|
||||||
|
|
||||||
|
|
|
@ -11,16 +11,23 @@
|
||||||
#ifndef __MFD_INTEL_LPSS_H
|
#ifndef __MFD_INTEL_LPSS_H
|
||||||
#define __MFD_INTEL_LPSS_H
|
#define __MFD_INTEL_LPSS_H
|
||||||
|
|
||||||
|
#include <linux/bits.h>
|
||||||
#include <linux/pm.h>
|
#include <linux/pm.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Some DSDTs have an unused GEXP ACPI device conflicting with I2C4 resources.
|
||||||
|
* Set to ignore resource conflicts with ACPI declared SystemMemory regions.
|
||||||
|
*/
|
||||||
|
#define QUIRK_IGNORE_RESOURCE_CONFLICTS BIT(0)
|
||||||
|
|
||||||
struct device;
|
struct device;
|
||||||
struct resource;
|
struct resource;
|
||||||
struct software_node;
|
struct software_node;
|
||||||
|
|
||||||
struct intel_lpss_platform_info {
|
struct intel_lpss_platform_info {
|
||||||
struct resource *mem;
|
struct resource *mem;
|
||||||
bool ignore_resource_conflicts;
|
|
||||||
int irq;
|
int irq;
|
||||||
|
unsigned int quirks;
|
||||||
unsigned long clk_rate;
|
unsigned long clk_rate;
|
||||||
const char *clk_con_id;
|
const char *clk_con_id;
|
||||||
const struct software_node *swnode;
|
const struct software_node *swnode;
|
||||||
|
|
Loading…
Reference in a new issue