162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci *  lpc_ich.c - LPC interface for Intel ICH
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci *  LPC bridge function of the Intel ICH contains many other
662306a36Sopenharmony_ci *  functional units, such as Interrupt controllers, Timers,
762306a36Sopenharmony_ci *  Power Management, System Management, GPIO, RTC, and LPC
862306a36Sopenharmony_ci *  Configuration Registers.
962306a36Sopenharmony_ci *
1062306a36Sopenharmony_ci *  This driver is derived from lpc_sch.
1162306a36Sopenharmony_ci *
1262306a36Sopenharmony_ci *  Copyright (c) 2017, 2021-2022 Intel Corporation
1362306a36Sopenharmony_ci *  Copyright (c) 2011 Extreme Engineering Solution, Inc.
1462306a36Sopenharmony_ci *  Author: Aaron Sierra <asierra@xes-inc.com>
1562306a36Sopenharmony_ci *
1662306a36Sopenharmony_ci *  This driver supports the following I/O Controller hubs:
1762306a36Sopenharmony_ci *	(See the intel documentation on http://developer.intel.com.)
1862306a36Sopenharmony_ci *	document number 290655-003, 290677-014: 82801AA (ICH), 82801AB (ICHO)
1962306a36Sopenharmony_ci *	document number 290687-002, 298242-027: 82801BA (ICH2)
2062306a36Sopenharmony_ci *	document number 290733-003, 290739-013: 82801CA (ICH3-S)
2162306a36Sopenharmony_ci *	document number 290716-001, 290718-007: 82801CAM (ICH3-M)
2262306a36Sopenharmony_ci *	document number 290744-001, 290745-025: 82801DB (ICH4)
2362306a36Sopenharmony_ci *	document number 252337-001, 252663-008: 82801DBM (ICH4-M)
2462306a36Sopenharmony_ci *	document number 273599-001, 273645-002: 82801E (C-ICH)
2562306a36Sopenharmony_ci *	document number 252516-001, 252517-028: 82801EB (ICH5), 82801ER (ICH5R)
2662306a36Sopenharmony_ci *	document number 300641-004, 300884-013: 6300ESB
2762306a36Sopenharmony_ci *	document number 301473-002, 301474-026: 82801F (ICH6)
2862306a36Sopenharmony_ci *	document number 313082-001, 313075-006: 631xESB, 632xESB
2962306a36Sopenharmony_ci *	document number 307013-003, 307014-024: 82801G (ICH7)
3062306a36Sopenharmony_ci *	document number 322896-001, 322897-001: NM10
3162306a36Sopenharmony_ci *	document number 313056-003, 313057-017: 82801H (ICH8)
3262306a36Sopenharmony_ci *	document number 316972-004, 316973-012: 82801I (ICH9)
3362306a36Sopenharmony_ci *	document number 319973-002, 319974-002: 82801J (ICH10)
3462306a36Sopenharmony_ci *	document number 322169-001, 322170-003: 5 Series, 3400 Series (PCH)
3562306a36Sopenharmony_ci *	document number 320066-003, 320257-008: EP80597 (IICH)
3662306a36Sopenharmony_ci *	document number 324645-001, 324646-001: Cougar Point (CPT)
3762306a36Sopenharmony_ci */
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci#include <linux/kernel.h>
4262306a36Sopenharmony_ci#include <linux/module.h>
4362306a36Sopenharmony_ci#include <linux/errno.h>
4462306a36Sopenharmony_ci#include <linux/acpi.h>
4562306a36Sopenharmony_ci#include <linux/pci.h>
4662306a36Sopenharmony_ci#include <linux/pinctrl/pinctrl.h>
4762306a36Sopenharmony_ci#include <linux/mfd/core.h>
4862306a36Sopenharmony_ci#include <linux/mfd/lpc_ich.h>
4962306a36Sopenharmony_ci#include <linux/platform_data/itco_wdt.h>
5062306a36Sopenharmony_ci#include <linux/platform_data/x86/p2sb.h>
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci#define ACPIBASE		0x40
5362306a36Sopenharmony_ci#define ACPIBASE_GPE_OFF	0x28
5462306a36Sopenharmony_ci#define ACPIBASE_GPE_END	0x2f
5562306a36Sopenharmony_ci#define ACPIBASE_SMI_OFF	0x30
5662306a36Sopenharmony_ci#define ACPIBASE_SMI_END	0x33
5762306a36Sopenharmony_ci#define ACPIBASE_PMC_OFF	0x08
5862306a36Sopenharmony_ci#define ACPIBASE_PMC_END	0x0c
5962306a36Sopenharmony_ci#define ACPIBASE_TCO_OFF	0x60
6062306a36Sopenharmony_ci#define ACPIBASE_TCO_END	0x7f
6162306a36Sopenharmony_ci#define ACPICTRL_PMCBASE	0x44
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci#define ACPIBASE_GCS_OFF	0x3410
6462306a36Sopenharmony_ci#define ACPIBASE_GCS_END	0x3414
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci#define SPIBASE_BYT		0x54
6762306a36Sopenharmony_ci#define SPIBASE_BYT_SZ		512
6862306a36Sopenharmony_ci#define SPIBASE_BYT_EN		BIT(1)
6962306a36Sopenharmony_ci#define BYT_BCR			0xfc
7062306a36Sopenharmony_ci#define BYT_BCR_WPD		BIT(0)
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ci#define SPIBASE_LPT		0x3800
7362306a36Sopenharmony_ci#define SPIBASE_LPT_SZ		512
7462306a36Sopenharmony_ci#define BCR			0xdc
7562306a36Sopenharmony_ci#define BCR_WPD			BIT(0)
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci#define GPIOBASE_ICH0		0x58
7862306a36Sopenharmony_ci#define GPIOCTRL_ICH0		0x5C
7962306a36Sopenharmony_ci#define GPIOBASE_ICH6		0x48
8062306a36Sopenharmony_ci#define GPIOCTRL_ICH6		0x4C
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci#define RCBABASE		0xf0
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci#define wdt_io_res(i) wdt_res(0, i)
8562306a36Sopenharmony_ci#define wdt_mem_res(i) wdt_res(ICH_RES_MEM_OFF, i)
8662306a36Sopenharmony_ci#define wdt_res(b, i) (&wdt_ich_res[(b) + (i)])
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_cistruct lpc_ich_priv {
8962306a36Sopenharmony_ci	int chipset;
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci	int abase;		/* ACPI base */
9262306a36Sopenharmony_ci	int actrl_pbase;	/* ACPI control or PMC base */
9362306a36Sopenharmony_ci	int gbase;		/* GPIO base */
9462306a36Sopenharmony_ci	int gctrl;		/* GPIO control */
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci	int abase_save;		/* Cached ACPI base value */
9762306a36Sopenharmony_ci	int actrl_pbase_save;		/* Cached ACPI control or PMC base value */
9862306a36Sopenharmony_ci	int gctrl_save;		/* Cached GPIO control value */
9962306a36Sopenharmony_ci};
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_cistatic struct resource wdt_ich_res[] = {
10262306a36Sopenharmony_ci	/* ACPI - TCO */
10362306a36Sopenharmony_ci	{
10462306a36Sopenharmony_ci		.flags = IORESOURCE_IO,
10562306a36Sopenharmony_ci	},
10662306a36Sopenharmony_ci	/* ACPI - SMI */
10762306a36Sopenharmony_ci	{
10862306a36Sopenharmony_ci		.flags = IORESOURCE_IO,
10962306a36Sopenharmony_ci	},
11062306a36Sopenharmony_ci	/* GCS or PMC */
11162306a36Sopenharmony_ci	{
11262306a36Sopenharmony_ci		.flags = IORESOURCE_MEM,
11362306a36Sopenharmony_ci	},
11462306a36Sopenharmony_ci};
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_cistatic struct resource gpio_ich_res[] = {
11762306a36Sopenharmony_ci	/* GPIO */
11862306a36Sopenharmony_ci	{
11962306a36Sopenharmony_ci		.flags = IORESOURCE_IO,
12062306a36Sopenharmony_ci	},
12162306a36Sopenharmony_ci	/* ACPI - GPE0 */
12262306a36Sopenharmony_ci	{
12362306a36Sopenharmony_ci		.flags = IORESOURCE_IO,
12462306a36Sopenharmony_ci	},
12562306a36Sopenharmony_ci};
12662306a36Sopenharmony_ci
12762306a36Sopenharmony_cistatic struct resource intel_spi_res[] = {
12862306a36Sopenharmony_ci	{
12962306a36Sopenharmony_ci		.flags = IORESOURCE_MEM,
13062306a36Sopenharmony_ci	}
13162306a36Sopenharmony_ci};
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_cistatic struct mfd_cell lpc_ich_wdt_cell = {
13462306a36Sopenharmony_ci	.name = "iTCO_wdt",
13562306a36Sopenharmony_ci	.num_resources = ARRAY_SIZE(wdt_ich_res),
13662306a36Sopenharmony_ci	.resources = wdt_ich_res,
13762306a36Sopenharmony_ci	.ignore_resource_conflicts = true,
13862306a36Sopenharmony_ci};
13962306a36Sopenharmony_ci
14062306a36Sopenharmony_cistatic struct mfd_cell lpc_ich_gpio_cell = {
14162306a36Sopenharmony_ci	.name = "gpio_ich",
14262306a36Sopenharmony_ci	.num_resources = ARRAY_SIZE(gpio_ich_res),
14362306a36Sopenharmony_ci	.resources = gpio_ich_res,
14462306a36Sopenharmony_ci	.ignore_resource_conflicts = true,
14562306a36Sopenharmony_ci};
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_ci#define APL_GPIO_NORTH		0
14862306a36Sopenharmony_ci#define APL_GPIO_NORTHWEST	1
14962306a36Sopenharmony_ci#define APL_GPIO_WEST		2
15062306a36Sopenharmony_ci#define APL_GPIO_SOUTHWEST	3
15162306a36Sopenharmony_ci#define APL_GPIO_NR_DEVICES	4
15262306a36Sopenharmony_ci
15362306a36Sopenharmony_ci/* Offset data for Apollo Lake GPIO controllers */
15462306a36Sopenharmony_cistatic resource_size_t apl_gpio_offsets[APL_GPIO_NR_DEVICES] = {
15562306a36Sopenharmony_ci	[APL_GPIO_NORTH]	= 0xc50000,
15662306a36Sopenharmony_ci	[APL_GPIO_NORTHWEST]	= 0xc40000,
15762306a36Sopenharmony_ci	[APL_GPIO_WEST]		= 0xc70000,
15862306a36Sopenharmony_ci	[APL_GPIO_SOUTHWEST]	= 0xc00000,
15962306a36Sopenharmony_ci};
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_ci#define APL_GPIO_RESOURCE_SIZE		0x1000
16262306a36Sopenharmony_ci
16362306a36Sopenharmony_ci#define APL_GPIO_IRQ			14
16462306a36Sopenharmony_ci
16562306a36Sopenharmony_cistatic struct resource apl_gpio_resources[APL_GPIO_NR_DEVICES][2] = {
16662306a36Sopenharmony_ci	[APL_GPIO_NORTH] = {
16762306a36Sopenharmony_ci		DEFINE_RES_MEM(0, 0),
16862306a36Sopenharmony_ci		DEFINE_RES_IRQ(APL_GPIO_IRQ),
16962306a36Sopenharmony_ci	},
17062306a36Sopenharmony_ci	[APL_GPIO_NORTHWEST] = {
17162306a36Sopenharmony_ci		DEFINE_RES_MEM(0, 0),
17262306a36Sopenharmony_ci		DEFINE_RES_IRQ(APL_GPIO_IRQ),
17362306a36Sopenharmony_ci	},
17462306a36Sopenharmony_ci	[APL_GPIO_WEST] = {
17562306a36Sopenharmony_ci		DEFINE_RES_MEM(0, 0),
17662306a36Sopenharmony_ci		DEFINE_RES_IRQ(APL_GPIO_IRQ),
17762306a36Sopenharmony_ci	},
17862306a36Sopenharmony_ci	[APL_GPIO_SOUTHWEST] = {
17962306a36Sopenharmony_ci		DEFINE_RES_MEM(0, 0),
18062306a36Sopenharmony_ci		DEFINE_RES_IRQ(APL_GPIO_IRQ),
18162306a36Sopenharmony_ci	},
18262306a36Sopenharmony_ci};
18362306a36Sopenharmony_ci
18462306a36Sopenharmony_cistatic const struct mfd_cell apl_gpio_devices[APL_GPIO_NR_DEVICES] = {
18562306a36Sopenharmony_ci	[APL_GPIO_NORTH] = {
18662306a36Sopenharmony_ci		.name = "apollolake-pinctrl",
18762306a36Sopenharmony_ci		.id = APL_GPIO_NORTH,
18862306a36Sopenharmony_ci		.num_resources = ARRAY_SIZE(apl_gpio_resources[APL_GPIO_NORTH]),
18962306a36Sopenharmony_ci		.resources = apl_gpio_resources[APL_GPIO_NORTH],
19062306a36Sopenharmony_ci		.ignore_resource_conflicts = true,
19162306a36Sopenharmony_ci	},
19262306a36Sopenharmony_ci	[APL_GPIO_NORTHWEST] = {
19362306a36Sopenharmony_ci		.name = "apollolake-pinctrl",
19462306a36Sopenharmony_ci		.id = APL_GPIO_NORTHWEST,
19562306a36Sopenharmony_ci		.num_resources = ARRAY_SIZE(apl_gpio_resources[APL_GPIO_NORTHWEST]),
19662306a36Sopenharmony_ci		.resources = apl_gpio_resources[APL_GPIO_NORTHWEST],
19762306a36Sopenharmony_ci		.ignore_resource_conflicts = true,
19862306a36Sopenharmony_ci	},
19962306a36Sopenharmony_ci	[APL_GPIO_WEST] = {
20062306a36Sopenharmony_ci		.name = "apollolake-pinctrl",
20162306a36Sopenharmony_ci		.id = APL_GPIO_WEST,
20262306a36Sopenharmony_ci		.num_resources = ARRAY_SIZE(apl_gpio_resources[APL_GPIO_WEST]),
20362306a36Sopenharmony_ci		.resources = apl_gpio_resources[APL_GPIO_WEST],
20462306a36Sopenharmony_ci		.ignore_resource_conflicts = true,
20562306a36Sopenharmony_ci	},
20662306a36Sopenharmony_ci	[APL_GPIO_SOUTHWEST] = {
20762306a36Sopenharmony_ci		.name = "apollolake-pinctrl",
20862306a36Sopenharmony_ci		.id = APL_GPIO_SOUTHWEST,
20962306a36Sopenharmony_ci		.num_resources = ARRAY_SIZE(apl_gpio_resources[APL_GPIO_SOUTHWEST]),
21062306a36Sopenharmony_ci		.resources = apl_gpio_resources[APL_GPIO_SOUTHWEST],
21162306a36Sopenharmony_ci		.ignore_resource_conflicts = true,
21262306a36Sopenharmony_ci	},
21362306a36Sopenharmony_ci};
21462306a36Sopenharmony_ci
21562306a36Sopenharmony_cistatic struct mfd_cell lpc_ich_spi_cell = {
21662306a36Sopenharmony_ci	.name = "intel-spi",
21762306a36Sopenharmony_ci	.num_resources = ARRAY_SIZE(intel_spi_res),
21862306a36Sopenharmony_ci	.resources = intel_spi_res,
21962306a36Sopenharmony_ci	.ignore_resource_conflicts = true,
22062306a36Sopenharmony_ci};
22162306a36Sopenharmony_ci
22262306a36Sopenharmony_ci/* chipset related info */
22362306a36Sopenharmony_cienum lpc_chipsets {
22462306a36Sopenharmony_ci	LPC_ICH = 0,	/* ICH */
22562306a36Sopenharmony_ci	LPC_ICH0,	/* ICH0 */
22662306a36Sopenharmony_ci	LPC_ICH2,	/* ICH2 */
22762306a36Sopenharmony_ci	LPC_ICH2M,	/* ICH2-M */
22862306a36Sopenharmony_ci	LPC_ICH3,	/* ICH3-S */
22962306a36Sopenharmony_ci	LPC_ICH3M,	/* ICH3-M */
23062306a36Sopenharmony_ci	LPC_ICH4,	/* ICH4 */
23162306a36Sopenharmony_ci	LPC_ICH4M,	/* ICH4-M */
23262306a36Sopenharmony_ci	LPC_CICH,	/* C-ICH */
23362306a36Sopenharmony_ci	LPC_ICH5,	/* ICH5 & ICH5R */
23462306a36Sopenharmony_ci	LPC_6300ESB,	/* 6300ESB */
23562306a36Sopenharmony_ci	LPC_ICH6,	/* ICH6 & ICH6R */
23662306a36Sopenharmony_ci	LPC_ICH6M,	/* ICH6-M */
23762306a36Sopenharmony_ci	LPC_ICH6W,	/* ICH6W & ICH6RW */
23862306a36Sopenharmony_ci	LPC_631XESB,	/* 631xESB/632xESB */
23962306a36Sopenharmony_ci	LPC_ICH7,	/* ICH7 & ICH7R */
24062306a36Sopenharmony_ci	LPC_ICH7DH,	/* ICH7DH */
24162306a36Sopenharmony_ci	LPC_ICH7M,	/* ICH7-M & ICH7-U */
24262306a36Sopenharmony_ci	LPC_ICH7MDH,	/* ICH7-M DH */
24362306a36Sopenharmony_ci	LPC_NM10,	/* NM10 */
24462306a36Sopenharmony_ci	LPC_ICH8,	/* ICH8 & ICH8R */
24562306a36Sopenharmony_ci	LPC_ICH8DH,	/* ICH8DH */
24662306a36Sopenharmony_ci	LPC_ICH8DO,	/* ICH8DO */
24762306a36Sopenharmony_ci	LPC_ICH8M,	/* ICH8M */
24862306a36Sopenharmony_ci	LPC_ICH8ME,	/* ICH8M-E */
24962306a36Sopenharmony_ci	LPC_ICH9,	/* ICH9 */
25062306a36Sopenharmony_ci	LPC_ICH9R,	/* ICH9R */
25162306a36Sopenharmony_ci	LPC_ICH9DH,	/* ICH9DH */
25262306a36Sopenharmony_ci	LPC_ICH9DO,	/* ICH9DO */
25362306a36Sopenharmony_ci	LPC_ICH9M,	/* ICH9M */
25462306a36Sopenharmony_ci	LPC_ICH9ME,	/* ICH9M-E */
25562306a36Sopenharmony_ci	LPC_ICH10,	/* ICH10 */
25662306a36Sopenharmony_ci	LPC_ICH10R,	/* ICH10R */
25762306a36Sopenharmony_ci	LPC_ICH10D,	/* ICH10D */
25862306a36Sopenharmony_ci	LPC_ICH10DO,	/* ICH10DO */
25962306a36Sopenharmony_ci	LPC_PCH,	/* PCH Desktop Full Featured */
26062306a36Sopenharmony_ci	LPC_PCHM,	/* PCH Mobile Full Featured */
26162306a36Sopenharmony_ci	LPC_P55,	/* P55 */
26262306a36Sopenharmony_ci	LPC_PM55,	/* PM55 */
26362306a36Sopenharmony_ci	LPC_H55,	/* H55 */
26462306a36Sopenharmony_ci	LPC_QM57,	/* QM57 */
26562306a36Sopenharmony_ci	LPC_H57,	/* H57 */
26662306a36Sopenharmony_ci	LPC_HM55,	/* HM55 */
26762306a36Sopenharmony_ci	LPC_Q57,	/* Q57 */
26862306a36Sopenharmony_ci	LPC_HM57,	/* HM57 */
26962306a36Sopenharmony_ci	LPC_PCHMSFF,	/* PCH Mobile SFF Full Featured */
27062306a36Sopenharmony_ci	LPC_QS57,	/* QS57 */
27162306a36Sopenharmony_ci	LPC_3400,	/* 3400 */
27262306a36Sopenharmony_ci	LPC_3420,	/* 3420 */
27362306a36Sopenharmony_ci	LPC_3450,	/* 3450 */
27462306a36Sopenharmony_ci	LPC_EP80579,	/* EP80579 */
27562306a36Sopenharmony_ci	LPC_CPT,	/* Cougar Point */
27662306a36Sopenharmony_ci	LPC_CPTD,	/* Cougar Point Desktop */
27762306a36Sopenharmony_ci	LPC_CPTM,	/* Cougar Point Mobile */
27862306a36Sopenharmony_ci	LPC_PBG,	/* Patsburg */
27962306a36Sopenharmony_ci	LPC_DH89XXCC,	/* DH89xxCC */
28062306a36Sopenharmony_ci	LPC_PPT,	/* Panther Point */
28162306a36Sopenharmony_ci	LPC_LPT,	/* Lynx Point */
28262306a36Sopenharmony_ci	LPC_LPT_LP,	/* Lynx Point-LP */
28362306a36Sopenharmony_ci	LPC_WBG,	/* Wellsburg */
28462306a36Sopenharmony_ci	LPC_AVN,	/* Avoton SoC */
28562306a36Sopenharmony_ci	LPC_BAYTRAIL,   /* Bay Trail SoC */
28662306a36Sopenharmony_ci	LPC_COLETO,	/* Coleto Creek */
28762306a36Sopenharmony_ci	LPC_WPT_LP,	/* Wildcat Point-LP */
28862306a36Sopenharmony_ci	LPC_BRASWELL,	/* Braswell SoC */
28962306a36Sopenharmony_ci	LPC_LEWISBURG,	/* Lewisburg */
29062306a36Sopenharmony_ci	LPC_9S,		/* 9 Series */
29162306a36Sopenharmony_ci	LPC_APL,	/* Apollo Lake SoC */
29262306a36Sopenharmony_ci	LPC_GLK,	/* Gemini Lake SoC */
29362306a36Sopenharmony_ci	LPC_COUGARMOUNTAIN,/* Cougar Mountain SoC*/
29462306a36Sopenharmony_ci};
29562306a36Sopenharmony_ci
29662306a36Sopenharmony_cistatic struct lpc_ich_info lpc_chipset_info[] = {
29762306a36Sopenharmony_ci	[LPC_ICH] = {
29862306a36Sopenharmony_ci		.name = "ICH",
29962306a36Sopenharmony_ci		.iTCO_version = 1,
30062306a36Sopenharmony_ci	},
30162306a36Sopenharmony_ci	[LPC_ICH0] = {
30262306a36Sopenharmony_ci		.name = "ICH0",
30362306a36Sopenharmony_ci		.iTCO_version = 1,
30462306a36Sopenharmony_ci	},
30562306a36Sopenharmony_ci	[LPC_ICH2] = {
30662306a36Sopenharmony_ci		.name = "ICH2",
30762306a36Sopenharmony_ci		.iTCO_version = 1,
30862306a36Sopenharmony_ci	},
30962306a36Sopenharmony_ci	[LPC_ICH2M] = {
31062306a36Sopenharmony_ci		.name = "ICH2-M",
31162306a36Sopenharmony_ci		.iTCO_version = 1,
31262306a36Sopenharmony_ci	},
31362306a36Sopenharmony_ci	[LPC_ICH3] = {
31462306a36Sopenharmony_ci		.name = "ICH3-S",
31562306a36Sopenharmony_ci		.iTCO_version = 1,
31662306a36Sopenharmony_ci	},
31762306a36Sopenharmony_ci	[LPC_ICH3M] = {
31862306a36Sopenharmony_ci		.name = "ICH3-M",
31962306a36Sopenharmony_ci		.iTCO_version = 1,
32062306a36Sopenharmony_ci	},
32162306a36Sopenharmony_ci	[LPC_ICH4] = {
32262306a36Sopenharmony_ci		.name = "ICH4",
32362306a36Sopenharmony_ci		.iTCO_version = 1,
32462306a36Sopenharmony_ci	},
32562306a36Sopenharmony_ci	[LPC_ICH4M] = {
32662306a36Sopenharmony_ci		.name = "ICH4-M",
32762306a36Sopenharmony_ci		.iTCO_version = 1,
32862306a36Sopenharmony_ci	},
32962306a36Sopenharmony_ci	[LPC_CICH] = {
33062306a36Sopenharmony_ci		.name = "C-ICH",
33162306a36Sopenharmony_ci		.iTCO_version = 1,
33262306a36Sopenharmony_ci	},
33362306a36Sopenharmony_ci	[LPC_ICH5] = {
33462306a36Sopenharmony_ci		.name = "ICH5 or ICH5R",
33562306a36Sopenharmony_ci		.iTCO_version = 1,
33662306a36Sopenharmony_ci	},
33762306a36Sopenharmony_ci	[LPC_6300ESB] = {
33862306a36Sopenharmony_ci		.name = "6300ESB",
33962306a36Sopenharmony_ci		.iTCO_version = 1,
34062306a36Sopenharmony_ci	},
34162306a36Sopenharmony_ci	[LPC_ICH6] = {
34262306a36Sopenharmony_ci		.name = "ICH6 or ICH6R",
34362306a36Sopenharmony_ci		.iTCO_version = 2,
34462306a36Sopenharmony_ci		.gpio_version = ICH_V6_GPIO,
34562306a36Sopenharmony_ci	},
34662306a36Sopenharmony_ci	[LPC_ICH6M] = {
34762306a36Sopenharmony_ci		.name = "ICH6-M",
34862306a36Sopenharmony_ci		.iTCO_version = 2,
34962306a36Sopenharmony_ci		.gpio_version = ICH_V6_GPIO,
35062306a36Sopenharmony_ci	},
35162306a36Sopenharmony_ci	[LPC_ICH6W] = {
35262306a36Sopenharmony_ci		.name = "ICH6W or ICH6RW",
35362306a36Sopenharmony_ci		.iTCO_version = 2,
35462306a36Sopenharmony_ci		.gpio_version = ICH_V6_GPIO,
35562306a36Sopenharmony_ci	},
35662306a36Sopenharmony_ci	[LPC_631XESB] = {
35762306a36Sopenharmony_ci		.name = "631xESB/632xESB",
35862306a36Sopenharmony_ci		.iTCO_version = 2,
35962306a36Sopenharmony_ci		.gpio_version = ICH_V6_GPIO,
36062306a36Sopenharmony_ci	},
36162306a36Sopenharmony_ci	[LPC_ICH7] = {
36262306a36Sopenharmony_ci		.name = "ICH7 or ICH7R",
36362306a36Sopenharmony_ci		.iTCO_version = 2,
36462306a36Sopenharmony_ci		.gpio_version = ICH_V7_GPIO,
36562306a36Sopenharmony_ci	},
36662306a36Sopenharmony_ci	[LPC_ICH7DH] = {
36762306a36Sopenharmony_ci		.name = "ICH7DH",
36862306a36Sopenharmony_ci		.iTCO_version = 2,
36962306a36Sopenharmony_ci		.gpio_version = ICH_V7_GPIO,
37062306a36Sopenharmony_ci	},
37162306a36Sopenharmony_ci	[LPC_ICH7M] = {
37262306a36Sopenharmony_ci		.name = "ICH7-M or ICH7-U",
37362306a36Sopenharmony_ci		.iTCO_version = 2,
37462306a36Sopenharmony_ci		.gpio_version = ICH_V7_GPIO,
37562306a36Sopenharmony_ci	},
37662306a36Sopenharmony_ci	[LPC_ICH7MDH] = {
37762306a36Sopenharmony_ci		.name = "ICH7-M DH",
37862306a36Sopenharmony_ci		.iTCO_version = 2,
37962306a36Sopenharmony_ci		.gpio_version = ICH_V7_GPIO,
38062306a36Sopenharmony_ci	},
38162306a36Sopenharmony_ci	[LPC_NM10] = {
38262306a36Sopenharmony_ci		.name = "NM10",
38362306a36Sopenharmony_ci		.iTCO_version = 2,
38462306a36Sopenharmony_ci		.gpio_version = ICH_V7_GPIO,
38562306a36Sopenharmony_ci	},
38662306a36Sopenharmony_ci	[LPC_ICH8] = {
38762306a36Sopenharmony_ci		.name = "ICH8 or ICH8R",
38862306a36Sopenharmony_ci		.iTCO_version = 2,
38962306a36Sopenharmony_ci		.gpio_version = ICH_V7_GPIO,
39062306a36Sopenharmony_ci	},
39162306a36Sopenharmony_ci	[LPC_ICH8DH] = {
39262306a36Sopenharmony_ci		.name = "ICH8DH",
39362306a36Sopenharmony_ci		.iTCO_version = 2,
39462306a36Sopenharmony_ci		.gpio_version = ICH_V7_GPIO,
39562306a36Sopenharmony_ci	},
39662306a36Sopenharmony_ci	[LPC_ICH8DO] = {
39762306a36Sopenharmony_ci		.name = "ICH8DO",
39862306a36Sopenharmony_ci		.iTCO_version = 2,
39962306a36Sopenharmony_ci		.gpio_version = ICH_V7_GPIO,
40062306a36Sopenharmony_ci	},
40162306a36Sopenharmony_ci	[LPC_ICH8M] = {
40262306a36Sopenharmony_ci		.name = "ICH8M",
40362306a36Sopenharmony_ci		.iTCO_version = 2,
40462306a36Sopenharmony_ci		.gpio_version = ICH_V7_GPIO,
40562306a36Sopenharmony_ci	},
40662306a36Sopenharmony_ci	[LPC_ICH8ME] = {
40762306a36Sopenharmony_ci		.name = "ICH8M-E",
40862306a36Sopenharmony_ci		.iTCO_version = 2,
40962306a36Sopenharmony_ci		.gpio_version = ICH_V7_GPIO,
41062306a36Sopenharmony_ci	},
41162306a36Sopenharmony_ci	[LPC_ICH9] = {
41262306a36Sopenharmony_ci		.name = "ICH9",
41362306a36Sopenharmony_ci		.iTCO_version = 2,
41462306a36Sopenharmony_ci		.gpio_version = ICH_V9_GPIO,
41562306a36Sopenharmony_ci	},
41662306a36Sopenharmony_ci	[LPC_ICH9R] = {
41762306a36Sopenharmony_ci		.name = "ICH9R",
41862306a36Sopenharmony_ci		.iTCO_version = 2,
41962306a36Sopenharmony_ci		.gpio_version = ICH_V9_GPIO,
42062306a36Sopenharmony_ci	},
42162306a36Sopenharmony_ci	[LPC_ICH9DH] = {
42262306a36Sopenharmony_ci		.name = "ICH9DH",
42362306a36Sopenharmony_ci		.iTCO_version = 2,
42462306a36Sopenharmony_ci		.gpio_version = ICH_V9_GPIO,
42562306a36Sopenharmony_ci	},
42662306a36Sopenharmony_ci	[LPC_ICH9DO] = {
42762306a36Sopenharmony_ci		.name = "ICH9DO",
42862306a36Sopenharmony_ci		.iTCO_version = 2,
42962306a36Sopenharmony_ci		.gpio_version = ICH_V9_GPIO,
43062306a36Sopenharmony_ci	},
43162306a36Sopenharmony_ci	[LPC_ICH9M] = {
43262306a36Sopenharmony_ci		.name = "ICH9M",
43362306a36Sopenharmony_ci		.iTCO_version = 2,
43462306a36Sopenharmony_ci		.gpio_version = ICH_V9_GPIO,
43562306a36Sopenharmony_ci	},
43662306a36Sopenharmony_ci	[LPC_ICH9ME] = {
43762306a36Sopenharmony_ci		.name = "ICH9M-E",
43862306a36Sopenharmony_ci		.iTCO_version = 2,
43962306a36Sopenharmony_ci		.gpio_version = ICH_V9_GPIO,
44062306a36Sopenharmony_ci	},
44162306a36Sopenharmony_ci	[LPC_ICH10] = {
44262306a36Sopenharmony_ci		.name = "ICH10",
44362306a36Sopenharmony_ci		.iTCO_version = 2,
44462306a36Sopenharmony_ci		.gpio_version = ICH_V10CONS_GPIO,
44562306a36Sopenharmony_ci	},
44662306a36Sopenharmony_ci	[LPC_ICH10R] = {
44762306a36Sopenharmony_ci		.name = "ICH10R",
44862306a36Sopenharmony_ci		.iTCO_version = 2,
44962306a36Sopenharmony_ci		.gpio_version = ICH_V10CONS_GPIO,
45062306a36Sopenharmony_ci	},
45162306a36Sopenharmony_ci	[LPC_ICH10D] = {
45262306a36Sopenharmony_ci		.name = "ICH10D",
45362306a36Sopenharmony_ci		.iTCO_version = 2,
45462306a36Sopenharmony_ci		.gpio_version = ICH_V10CORP_GPIO,
45562306a36Sopenharmony_ci	},
45662306a36Sopenharmony_ci	[LPC_ICH10DO] = {
45762306a36Sopenharmony_ci		.name = "ICH10DO",
45862306a36Sopenharmony_ci		.iTCO_version = 2,
45962306a36Sopenharmony_ci		.gpio_version = ICH_V10CORP_GPIO,
46062306a36Sopenharmony_ci	},
46162306a36Sopenharmony_ci	[LPC_PCH] = {
46262306a36Sopenharmony_ci		.name = "PCH Desktop Full Featured",
46362306a36Sopenharmony_ci		.iTCO_version = 2,
46462306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
46562306a36Sopenharmony_ci	},
46662306a36Sopenharmony_ci	[LPC_PCHM] = {
46762306a36Sopenharmony_ci		.name = "PCH Mobile Full Featured",
46862306a36Sopenharmony_ci		.iTCO_version = 2,
46962306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
47062306a36Sopenharmony_ci	},
47162306a36Sopenharmony_ci	[LPC_P55] = {
47262306a36Sopenharmony_ci		.name = "P55",
47362306a36Sopenharmony_ci		.iTCO_version = 2,
47462306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
47562306a36Sopenharmony_ci	},
47662306a36Sopenharmony_ci	[LPC_PM55] = {
47762306a36Sopenharmony_ci		.name = "PM55",
47862306a36Sopenharmony_ci		.iTCO_version = 2,
47962306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
48062306a36Sopenharmony_ci	},
48162306a36Sopenharmony_ci	[LPC_H55] = {
48262306a36Sopenharmony_ci		.name = "H55",
48362306a36Sopenharmony_ci		.iTCO_version = 2,
48462306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
48562306a36Sopenharmony_ci	},
48662306a36Sopenharmony_ci	[LPC_QM57] = {
48762306a36Sopenharmony_ci		.name = "QM57",
48862306a36Sopenharmony_ci		.iTCO_version = 2,
48962306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
49062306a36Sopenharmony_ci	},
49162306a36Sopenharmony_ci	[LPC_H57] = {
49262306a36Sopenharmony_ci		.name = "H57",
49362306a36Sopenharmony_ci		.iTCO_version = 2,
49462306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
49562306a36Sopenharmony_ci	},
49662306a36Sopenharmony_ci	[LPC_HM55] = {
49762306a36Sopenharmony_ci		.name = "HM55",
49862306a36Sopenharmony_ci		.iTCO_version = 2,
49962306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
50062306a36Sopenharmony_ci	},
50162306a36Sopenharmony_ci	[LPC_Q57] = {
50262306a36Sopenharmony_ci		.name = "Q57",
50362306a36Sopenharmony_ci		.iTCO_version = 2,
50462306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
50562306a36Sopenharmony_ci	},
50662306a36Sopenharmony_ci	[LPC_HM57] = {
50762306a36Sopenharmony_ci		.name = "HM57",
50862306a36Sopenharmony_ci		.iTCO_version = 2,
50962306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
51062306a36Sopenharmony_ci	},
51162306a36Sopenharmony_ci	[LPC_PCHMSFF] = {
51262306a36Sopenharmony_ci		.name = "PCH Mobile SFF Full Featured",
51362306a36Sopenharmony_ci		.iTCO_version = 2,
51462306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
51562306a36Sopenharmony_ci	},
51662306a36Sopenharmony_ci	[LPC_QS57] = {
51762306a36Sopenharmony_ci		.name = "QS57",
51862306a36Sopenharmony_ci		.iTCO_version = 2,
51962306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
52062306a36Sopenharmony_ci	},
52162306a36Sopenharmony_ci	[LPC_3400] = {
52262306a36Sopenharmony_ci		.name = "3400",
52362306a36Sopenharmony_ci		.iTCO_version = 2,
52462306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
52562306a36Sopenharmony_ci	},
52662306a36Sopenharmony_ci	[LPC_3420] = {
52762306a36Sopenharmony_ci		.name = "3420",
52862306a36Sopenharmony_ci		.iTCO_version = 2,
52962306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
53062306a36Sopenharmony_ci	},
53162306a36Sopenharmony_ci	[LPC_3450] = {
53262306a36Sopenharmony_ci		.name = "3450",
53362306a36Sopenharmony_ci		.iTCO_version = 2,
53462306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
53562306a36Sopenharmony_ci	},
53662306a36Sopenharmony_ci	[LPC_EP80579] = {
53762306a36Sopenharmony_ci		.name = "EP80579",
53862306a36Sopenharmony_ci		.iTCO_version = 2,
53962306a36Sopenharmony_ci	},
54062306a36Sopenharmony_ci	[LPC_CPT] = {
54162306a36Sopenharmony_ci		.name = "Cougar Point",
54262306a36Sopenharmony_ci		.iTCO_version = 2,
54362306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
54462306a36Sopenharmony_ci	},
54562306a36Sopenharmony_ci	[LPC_CPTD] = {
54662306a36Sopenharmony_ci		.name = "Cougar Point Desktop",
54762306a36Sopenharmony_ci		.iTCO_version = 2,
54862306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
54962306a36Sopenharmony_ci	},
55062306a36Sopenharmony_ci	[LPC_CPTM] = {
55162306a36Sopenharmony_ci		.name = "Cougar Point Mobile",
55262306a36Sopenharmony_ci		.iTCO_version = 2,
55362306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
55462306a36Sopenharmony_ci	},
55562306a36Sopenharmony_ci	[LPC_PBG] = {
55662306a36Sopenharmony_ci		.name = "Patsburg",
55762306a36Sopenharmony_ci		.iTCO_version = 2,
55862306a36Sopenharmony_ci	},
55962306a36Sopenharmony_ci	[LPC_DH89XXCC] = {
56062306a36Sopenharmony_ci		.name = "DH89xxCC",
56162306a36Sopenharmony_ci		.iTCO_version = 2,
56262306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
56362306a36Sopenharmony_ci	},
56462306a36Sopenharmony_ci	[LPC_PPT] = {
56562306a36Sopenharmony_ci		.name = "Panther Point",
56662306a36Sopenharmony_ci		.iTCO_version = 2,
56762306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
56862306a36Sopenharmony_ci	},
56962306a36Sopenharmony_ci	[LPC_LPT] = {
57062306a36Sopenharmony_ci		.name = "Lynx Point",
57162306a36Sopenharmony_ci		.iTCO_version = 2,
57262306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
57362306a36Sopenharmony_ci		.spi_type = INTEL_SPI_LPT,
57462306a36Sopenharmony_ci	},
57562306a36Sopenharmony_ci	[LPC_LPT_LP] = {
57662306a36Sopenharmony_ci		.name = "Lynx Point_LP",
57762306a36Sopenharmony_ci		.iTCO_version = 2,
57862306a36Sopenharmony_ci		.spi_type = INTEL_SPI_LPT,
57962306a36Sopenharmony_ci	},
58062306a36Sopenharmony_ci	[LPC_WBG] = {
58162306a36Sopenharmony_ci		.name = "Wellsburg",
58262306a36Sopenharmony_ci		.iTCO_version = 2,
58362306a36Sopenharmony_ci	},
58462306a36Sopenharmony_ci	[LPC_AVN] = {
58562306a36Sopenharmony_ci		.name = "Avoton SoC",
58662306a36Sopenharmony_ci		.iTCO_version = 3,
58762306a36Sopenharmony_ci		.gpio_version = AVOTON_GPIO,
58862306a36Sopenharmony_ci		.spi_type = INTEL_SPI_BYT,
58962306a36Sopenharmony_ci	},
59062306a36Sopenharmony_ci	[LPC_BAYTRAIL] = {
59162306a36Sopenharmony_ci		.name = "Bay Trail SoC",
59262306a36Sopenharmony_ci		.iTCO_version = 3,
59362306a36Sopenharmony_ci		.spi_type = INTEL_SPI_BYT,
59462306a36Sopenharmony_ci	},
59562306a36Sopenharmony_ci	[LPC_COLETO] = {
59662306a36Sopenharmony_ci		.name = "Coleto Creek",
59762306a36Sopenharmony_ci		.iTCO_version = 2,
59862306a36Sopenharmony_ci	},
59962306a36Sopenharmony_ci	[LPC_WPT_LP] = {
60062306a36Sopenharmony_ci		.name = "Wildcat Point_LP",
60162306a36Sopenharmony_ci		.iTCO_version = 2,
60262306a36Sopenharmony_ci		.spi_type = INTEL_SPI_LPT,
60362306a36Sopenharmony_ci	},
60462306a36Sopenharmony_ci	[LPC_BRASWELL] = {
60562306a36Sopenharmony_ci		.name = "Braswell SoC",
60662306a36Sopenharmony_ci		.iTCO_version = 3,
60762306a36Sopenharmony_ci		.spi_type = INTEL_SPI_BYT,
60862306a36Sopenharmony_ci	},
60962306a36Sopenharmony_ci	[LPC_LEWISBURG] = {
61062306a36Sopenharmony_ci		.name = "Lewisburg",
61162306a36Sopenharmony_ci		.iTCO_version = 2,
61262306a36Sopenharmony_ci	},
61362306a36Sopenharmony_ci	[LPC_9S] = {
61462306a36Sopenharmony_ci		.name = "9 Series",
61562306a36Sopenharmony_ci		.iTCO_version = 2,
61662306a36Sopenharmony_ci		.gpio_version = ICH_V5_GPIO,
61762306a36Sopenharmony_ci	},
61862306a36Sopenharmony_ci	[LPC_APL] = {
61962306a36Sopenharmony_ci		.name = "Apollo Lake SoC",
62062306a36Sopenharmony_ci		.iTCO_version = 5,
62162306a36Sopenharmony_ci		.spi_type = INTEL_SPI_BXT,
62262306a36Sopenharmony_ci	},
62362306a36Sopenharmony_ci	[LPC_GLK] = {
62462306a36Sopenharmony_ci		.name = "Gemini Lake SoC",
62562306a36Sopenharmony_ci		.spi_type = INTEL_SPI_BXT,
62662306a36Sopenharmony_ci	},
62762306a36Sopenharmony_ci	[LPC_COUGARMOUNTAIN] = {
62862306a36Sopenharmony_ci		.name = "Cougar Mountain SoC",
62962306a36Sopenharmony_ci		.iTCO_version = 3,
63062306a36Sopenharmony_ci	},
63162306a36Sopenharmony_ci};
63262306a36Sopenharmony_ci
63362306a36Sopenharmony_ci/*
63462306a36Sopenharmony_ci * This data only exists for exporting the supported PCI ids
63562306a36Sopenharmony_ci * via MODULE_DEVICE_TABLE.  We do not actually register a
63662306a36Sopenharmony_ci * pci_driver, because the I/O Controller Hub has also other
63762306a36Sopenharmony_ci * functions that probably will be registered by other drivers.
63862306a36Sopenharmony_ci */
63962306a36Sopenharmony_cistatic const struct pci_device_id lpc_ich_ids[] = {
64062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x0f1c), LPC_BAYTRAIL},
64162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c41), LPC_CPT},
64262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c42), LPC_CPTD},
64362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c43), LPC_CPTM},
64462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c44), LPC_CPT},
64562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c45), LPC_CPT},
64662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c46), LPC_CPT},
64762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c47), LPC_CPT},
64862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c48), LPC_CPT},
64962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c49), LPC_CPT},
65062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c4a), LPC_CPT},
65162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c4b), LPC_CPT},
65262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c4c), LPC_CPT},
65362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c4d), LPC_CPT},
65462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c4e), LPC_CPT},
65562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c4f), LPC_CPT},
65662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c50), LPC_CPT},
65762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c51), LPC_CPT},
65862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c52), LPC_CPT},
65962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c53), LPC_CPT},
66062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c54), LPC_CPT},
66162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c55), LPC_CPT},
66262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c56), LPC_CPT},
66362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c57), LPC_CPT},
66462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c58), LPC_CPT},
66562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c59), LPC_CPT},
66662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c5a), LPC_CPT},
66762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c5b), LPC_CPT},
66862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c5c), LPC_CPT},
66962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c5d), LPC_CPT},
67062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c5e), LPC_CPT},
67162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1c5f), LPC_CPT},
67262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1d40), LPC_PBG},
67362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1d41), LPC_PBG},
67462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e40), LPC_PPT},
67562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e41), LPC_PPT},
67662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e42), LPC_PPT},
67762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e43), LPC_PPT},
67862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e44), LPC_PPT},
67962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e45), LPC_PPT},
68062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e46), LPC_PPT},
68162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e47), LPC_PPT},
68262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e48), LPC_PPT},
68362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e49), LPC_PPT},
68462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e4a), LPC_PPT},
68562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e4b), LPC_PPT},
68662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e4c), LPC_PPT},
68762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e4d), LPC_PPT},
68862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e4e), LPC_PPT},
68962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e4f), LPC_PPT},
69062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e50), LPC_PPT},
69162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e51), LPC_PPT},
69262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e52), LPC_PPT},
69362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e53), LPC_PPT},
69462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e54), LPC_PPT},
69562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e55), LPC_PPT},
69662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e56), LPC_PPT},
69762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e57), LPC_PPT},
69862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e58), LPC_PPT},
69962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e59), LPC_PPT},
70062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e5a), LPC_PPT},
70162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e5b), LPC_PPT},
70262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e5c), LPC_PPT},
70362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e5d), LPC_PPT},
70462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e5e), LPC_PPT},
70562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1e5f), LPC_PPT},
70662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1f38), LPC_AVN},
70762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1f39), LPC_AVN},
70862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1f3a), LPC_AVN},
70962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x1f3b), LPC_AVN},
71062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x229c), LPC_BRASWELL},
71162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2310), LPC_DH89XXCC},
71262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2390), LPC_COLETO},
71362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2410), LPC_ICH},
71462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2420), LPC_ICH0},
71562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2440), LPC_ICH2},
71662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x244c), LPC_ICH2M},
71762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2450), LPC_CICH},
71862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2480), LPC_ICH3},
71962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x248c), LPC_ICH3M},
72062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x24c0), LPC_ICH4},
72162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x24cc), LPC_ICH4M},
72262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x24d0), LPC_ICH5},
72362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x25a1), LPC_6300ESB},
72462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2640), LPC_ICH6},
72562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2641), LPC_ICH6M},
72662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2642), LPC_ICH6W},
72762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2670), LPC_631XESB},
72862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2671), LPC_631XESB},
72962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2672), LPC_631XESB},
73062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2673), LPC_631XESB},
73162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2674), LPC_631XESB},
73262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2675), LPC_631XESB},
73362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2676), LPC_631XESB},
73462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2677), LPC_631XESB},
73562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2678), LPC_631XESB},
73662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2679), LPC_631XESB},
73762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x267a), LPC_631XESB},
73862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x267b), LPC_631XESB},
73962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x267c), LPC_631XESB},
74062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x267d), LPC_631XESB},
74162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x267e), LPC_631XESB},
74262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x267f), LPC_631XESB},
74362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x27b0), LPC_ICH7DH},
74462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x27b8), LPC_ICH7},
74562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x27b9), LPC_ICH7M},
74662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x27bc), LPC_NM10},
74762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x27bd), LPC_ICH7MDH},
74862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2810), LPC_ICH8},
74962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2811), LPC_ICH8ME},
75062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2812), LPC_ICH8DH},
75162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2814), LPC_ICH8DO},
75262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2815), LPC_ICH8M},
75362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2912), LPC_ICH9DH},
75462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2914), LPC_ICH9DO},
75562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2916), LPC_ICH9R},
75662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2917), LPC_ICH9ME},
75762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2918), LPC_ICH9},
75862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2919), LPC_ICH9M},
75962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3197), LPC_GLK},
76062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x2b9c), LPC_COUGARMOUNTAIN},
76162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3a14), LPC_ICH10DO},
76262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3a16), LPC_ICH10R},
76362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3a18), LPC_ICH10},
76462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3a1a), LPC_ICH10D},
76562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3b00), LPC_PCH},
76662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3b01), LPC_PCHM},
76762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3b02), LPC_P55},
76862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3b03), LPC_PM55},
76962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3b06), LPC_H55},
77062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3b07), LPC_QM57},
77162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3b08), LPC_H57},
77262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3b09), LPC_HM55},
77362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3b0a), LPC_Q57},
77462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3b0b), LPC_HM57},
77562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3b0d), LPC_PCHMSFF},
77662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3b0f), LPC_QS57},
77762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3b12), LPC_3400},
77862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3b14), LPC_3420},
77962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x3b16), LPC_3450},
78062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x5031), LPC_EP80579},
78162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x5ae8), LPC_APL},
78262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c40), LPC_LPT},
78362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c41), LPC_LPT},
78462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c42), LPC_LPT},
78562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c43), LPC_LPT},
78662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c44), LPC_LPT},
78762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c45), LPC_LPT},
78862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c46), LPC_LPT},
78962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c47), LPC_LPT},
79062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c48), LPC_LPT},
79162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c49), LPC_LPT},
79262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c4a), LPC_LPT},
79362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c4b), LPC_LPT},
79462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c4c), LPC_LPT},
79562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c4d), LPC_LPT},
79662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c4e), LPC_LPT},
79762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c4f), LPC_LPT},
79862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c50), LPC_LPT},
79962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c51), LPC_LPT},
80062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c52), LPC_LPT},
80162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c53), LPC_LPT},
80262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c54), LPC_LPT},
80362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c55), LPC_LPT},
80462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c56), LPC_LPT},
80562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c57), LPC_LPT},
80662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c58), LPC_LPT},
80762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c59), LPC_LPT},
80862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c5a), LPC_LPT},
80962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c5b), LPC_LPT},
81062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c5c), LPC_LPT},
81162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c5d), LPC_LPT},
81262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c5e), LPC_LPT},
81362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8c5f), LPC_LPT},
81462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8cc1), LPC_9S},
81562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8cc2), LPC_9S},
81662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8cc3), LPC_9S},
81762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8cc4), LPC_9S},
81862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8cc6), LPC_9S},
81962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d40), LPC_WBG},
82062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d41), LPC_WBG},
82162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d42), LPC_WBG},
82262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d43), LPC_WBG},
82362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d44), LPC_WBG},
82462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d45), LPC_WBG},
82562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d46), LPC_WBG},
82662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d47), LPC_WBG},
82762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d48), LPC_WBG},
82862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d49), LPC_WBG},
82962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d4a), LPC_WBG},
83062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d4b), LPC_WBG},
83162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d4c), LPC_WBG},
83262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d4d), LPC_WBG},
83362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d4e), LPC_WBG},
83462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d4f), LPC_WBG},
83562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d50), LPC_WBG},
83662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d51), LPC_WBG},
83762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d52), LPC_WBG},
83862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d53), LPC_WBG},
83962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d54), LPC_WBG},
84062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d55), LPC_WBG},
84162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d56), LPC_WBG},
84262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d57), LPC_WBG},
84362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d58), LPC_WBG},
84462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d59), LPC_WBG},
84562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d5a), LPC_WBG},
84662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d5b), LPC_WBG},
84762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d5c), LPC_WBG},
84862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d5d), LPC_WBG},
84962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d5e), LPC_WBG},
85062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x8d5f), LPC_WBG},
85162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x9c40), LPC_LPT_LP},
85262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x9c41), LPC_LPT_LP},
85362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x9c42), LPC_LPT_LP},
85462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x9c43), LPC_LPT_LP},
85562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x9c44), LPC_LPT_LP},
85662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x9c45), LPC_LPT_LP},
85762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x9c46), LPC_LPT_LP},
85862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x9c47), LPC_LPT_LP},
85962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x9cc1), LPC_WPT_LP},
86062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x9cc2), LPC_WPT_LP},
86162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x9cc3), LPC_WPT_LP},
86262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x9cc5), LPC_WPT_LP},
86362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x9cc6), LPC_WPT_LP},
86462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x9cc7), LPC_WPT_LP},
86562306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0x9cc9), LPC_WPT_LP},
86662306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0xa1c1), LPC_LEWISBURG},
86762306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0xa1c2), LPC_LEWISBURG},
86862306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0xa1c3), LPC_LEWISBURG},
86962306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0xa1c4), LPC_LEWISBURG},
87062306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0xa1c5), LPC_LEWISBURG},
87162306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0xa1c6), LPC_LEWISBURG},
87262306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0xa1c7), LPC_LEWISBURG},
87362306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0xa242), LPC_LEWISBURG},
87462306a36Sopenharmony_ci	{ PCI_VDEVICE(INTEL, 0xa243), LPC_LEWISBURG},
87562306a36Sopenharmony_ci	{ 0, },			/* End of list */
87662306a36Sopenharmony_ci};
87762306a36Sopenharmony_ciMODULE_DEVICE_TABLE(pci, lpc_ich_ids);
87862306a36Sopenharmony_ci
87962306a36Sopenharmony_cistatic void lpc_ich_restore_config_space(struct pci_dev *dev)
88062306a36Sopenharmony_ci{
88162306a36Sopenharmony_ci	struct lpc_ich_priv *priv = pci_get_drvdata(dev);
88262306a36Sopenharmony_ci
88362306a36Sopenharmony_ci	if (priv->abase_save >= 0) {
88462306a36Sopenharmony_ci		pci_write_config_byte(dev, priv->abase, priv->abase_save);
88562306a36Sopenharmony_ci		priv->abase_save = -1;
88662306a36Sopenharmony_ci	}
88762306a36Sopenharmony_ci
88862306a36Sopenharmony_ci	if (priv->actrl_pbase_save >= 0) {
88962306a36Sopenharmony_ci		pci_write_config_byte(dev, priv->actrl_pbase,
89062306a36Sopenharmony_ci			priv->actrl_pbase_save);
89162306a36Sopenharmony_ci		priv->actrl_pbase_save = -1;
89262306a36Sopenharmony_ci	}
89362306a36Sopenharmony_ci
89462306a36Sopenharmony_ci	if (priv->gctrl_save >= 0) {
89562306a36Sopenharmony_ci		pci_write_config_byte(dev, priv->gctrl, priv->gctrl_save);
89662306a36Sopenharmony_ci		priv->gctrl_save = -1;
89762306a36Sopenharmony_ci	}
89862306a36Sopenharmony_ci}
89962306a36Sopenharmony_ci
90062306a36Sopenharmony_cistatic void lpc_ich_enable_acpi_space(struct pci_dev *dev)
90162306a36Sopenharmony_ci{
90262306a36Sopenharmony_ci	struct lpc_ich_priv *priv = pci_get_drvdata(dev);
90362306a36Sopenharmony_ci	u8 reg_save;
90462306a36Sopenharmony_ci
90562306a36Sopenharmony_ci	switch (lpc_chipset_info[priv->chipset].iTCO_version) {
90662306a36Sopenharmony_ci	case 3:
90762306a36Sopenharmony_ci		/*
90862306a36Sopenharmony_ci		 * Some chipsets (eg Avoton) enable the ACPI space in the
90962306a36Sopenharmony_ci		 * ACPI BASE register.
91062306a36Sopenharmony_ci		 */
91162306a36Sopenharmony_ci		pci_read_config_byte(dev, priv->abase, &reg_save);
91262306a36Sopenharmony_ci		pci_write_config_byte(dev, priv->abase, reg_save | 0x2);
91362306a36Sopenharmony_ci		priv->abase_save = reg_save;
91462306a36Sopenharmony_ci		break;
91562306a36Sopenharmony_ci	default:
91662306a36Sopenharmony_ci		/*
91762306a36Sopenharmony_ci		 * Most chipsets enable the ACPI space in the ACPI control
91862306a36Sopenharmony_ci		 * register.
91962306a36Sopenharmony_ci		 */
92062306a36Sopenharmony_ci		pci_read_config_byte(dev, priv->actrl_pbase, &reg_save);
92162306a36Sopenharmony_ci		pci_write_config_byte(dev, priv->actrl_pbase, reg_save | 0x80);
92262306a36Sopenharmony_ci		priv->actrl_pbase_save = reg_save;
92362306a36Sopenharmony_ci		break;
92462306a36Sopenharmony_ci	}
92562306a36Sopenharmony_ci}
92662306a36Sopenharmony_ci
92762306a36Sopenharmony_cistatic void lpc_ich_enable_gpio_space(struct pci_dev *dev)
92862306a36Sopenharmony_ci{
92962306a36Sopenharmony_ci	struct lpc_ich_priv *priv = pci_get_drvdata(dev);
93062306a36Sopenharmony_ci	u8 reg_save;
93162306a36Sopenharmony_ci
93262306a36Sopenharmony_ci	pci_read_config_byte(dev, priv->gctrl, &reg_save);
93362306a36Sopenharmony_ci	pci_write_config_byte(dev, priv->gctrl, reg_save | 0x10);
93462306a36Sopenharmony_ci	priv->gctrl_save = reg_save;
93562306a36Sopenharmony_ci}
93662306a36Sopenharmony_ci
93762306a36Sopenharmony_cistatic void lpc_ich_enable_pmc_space(struct pci_dev *dev)
93862306a36Sopenharmony_ci{
93962306a36Sopenharmony_ci	struct lpc_ich_priv *priv = pci_get_drvdata(dev);
94062306a36Sopenharmony_ci	u8 reg_save;
94162306a36Sopenharmony_ci
94262306a36Sopenharmony_ci	pci_read_config_byte(dev, priv->actrl_pbase, &reg_save);
94362306a36Sopenharmony_ci	pci_write_config_byte(dev, priv->actrl_pbase, reg_save | 0x2);
94462306a36Sopenharmony_ci
94562306a36Sopenharmony_ci	priv->actrl_pbase_save = reg_save;
94662306a36Sopenharmony_ci}
94762306a36Sopenharmony_ci
94862306a36Sopenharmony_cistatic int lpc_ich_finalize_wdt_cell(struct pci_dev *dev)
94962306a36Sopenharmony_ci{
95062306a36Sopenharmony_ci	struct itco_wdt_platform_data *pdata;
95162306a36Sopenharmony_ci	struct lpc_ich_priv *priv = pci_get_drvdata(dev);
95262306a36Sopenharmony_ci	struct lpc_ich_info *info;
95362306a36Sopenharmony_ci	struct mfd_cell *cell = &lpc_ich_wdt_cell;
95462306a36Sopenharmony_ci
95562306a36Sopenharmony_ci	pdata = devm_kzalloc(&dev->dev, sizeof(*pdata), GFP_KERNEL);
95662306a36Sopenharmony_ci	if (!pdata)
95762306a36Sopenharmony_ci		return -ENOMEM;
95862306a36Sopenharmony_ci
95962306a36Sopenharmony_ci	info = &lpc_chipset_info[priv->chipset];
96062306a36Sopenharmony_ci
96162306a36Sopenharmony_ci	pdata->version = info->iTCO_version;
96262306a36Sopenharmony_ci	strscpy(pdata->name, info->name, sizeof(pdata->name));
96362306a36Sopenharmony_ci
96462306a36Sopenharmony_ci	cell->platform_data = pdata;
96562306a36Sopenharmony_ci	cell->pdata_size = sizeof(*pdata);
96662306a36Sopenharmony_ci	return 0;
96762306a36Sopenharmony_ci}
96862306a36Sopenharmony_ci
96962306a36Sopenharmony_cistatic void lpc_ich_finalize_gpio_cell(struct pci_dev *dev)
97062306a36Sopenharmony_ci{
97162306a36Sopenharmony_ci	struct lpc_ich_priv *priv = pci_get_drvdata(dev);
97262306a36Sopenharmony_ci	struct mfd_cell *cell = &lpc_ich_gpio_cell;
97362306a36Sopenharmony_ci
97462306a36Sopenharmony_ci	cell->platform_data = &lpc_chipset_info[priv->chipset];
97562306a36Sopenharmony_ci	cell->pdata_size = sizeof(struct lpc_ich_info);
97662306a36Sopenharmony_ci}
97762306a36Sopenharmony_ci
97862306a36Sopenharmony_ci/*
97962306a36Sopenharmony_ci * We don't check for resource conflict globally. There are 2 or 3 independent
98062306a36Sopenharmony_ci * GPIO groups and it's enough to have access to one of these to instantiate
98162306a36Sopenharmony_ci * the device.
98262306a36Sopenharmony_ci */
98362306a36Sopenharmony_cistatic int lpc_ich_check_conflict_gpio(struct resource *res)
98462306a36Sopenharmony_ci{
98562306a36Sopenharmony_ci	int ret;
98662306a36Sopenharmony_ci	u8 use_gpio = 0;
98762306a36Sopenharmony_ci
98862306a36Sopenharmony_ci	if (resource_size(res) >= 0x50 &&
98962306a36Sopenharmony_ci	    !acpi_check_region(res->start + 0x40, 0x10, "LPC ICH GPIO3"))
99062306a36Sopenharmony_ci		use_gpio |= 1 << 2;
99162306a36Sopenharmony_ci
99262306a36Sopenharmony_ci	if (!acpi_check_region(res->start + 0x30, 0x10, "LPC ICH GPIO2"))
99362306a36Sopenharmony_ci		use_gpio |= 1 << 1;
99462306a36Sopenharmony_ci
99562306a36Sopenharmony_ci	ret = acpi_check_region(res->start + 0x00, 0x30, "LPC ICH GPIO1");
99662306a36Sopenharmony_ci	if (!ret)
99762306a36Sopenharmony_ci		use_gpio |= 1 << 0;
99862306a36Sopenharmony_ci
99962306a36Sopenharmony_ci	return use_gpio ? use_gpio : ret;
100062306a36Sopenharmony_ci}
100162306a36Sopenharmony_ci
100262306a36Sopenharmony_cistatic int lpc_ich_init_gpio(struct pci_dev *dev)
100362306a36Sopenharmony_ci{
100462306a36Sopenharmony_ci	struct lpc_ich_priv *priv = pci_get_drvdata(dev);
100562306a36Sopenharmony_ci	u32 base_addr_cfg;
100662306a36Sopenharmony_ci	u32 base_addr;
100762306a36Sopenharmony_ci	int ret;
100862306a36Sopenharmony_ci	bool acpi_conflict = false;
100962306a36Sopenharmony_ci	struct resource *res;
101062306a36Sopenharmony_ci
101162306a36Sopenharmony_ci	/* Setup power management base register */
101262306a36Sopenharmony_ci	pci_read_config_dword(dev, priv->abase, &base_addr_cfg);
101362306a36Sopenharmony_ci	base_addr = base_addr_cfg & 0x0000ff80;
101462306a36Sopenharmony_ci	if (!base_addr) {
101562306a36Sopenharmony_ci		dev_notice(&dev->dev, "I/O space for ACPI uninitialized\n");
101662306a36Sopenharmony_ci		lpc_ich_gpio_cell.num_resources--;
101762306a36Sopenharmony_ci		goto gpe0_done;
101862306a36Sopenharmony_ci	}
101962306a36Sopenharmony_ci
102062306a36Sopenharmony_ci	res = &gpio_ich_res[ICH_RES_GPE0];
102162306a36Sopenharmony_ci	res->start = base_addr + ACPIBASE_GPE_OFF;
102262306a36Sopenharmony_ci	res->end = base_addr + ACPIBASE_GPE_END;
102362306a36Sopenharmony_ci	ret = acpi_check_resource_conflict(res);
102462306a36Sopenharmony_ci	if (ret) {
102562306a36Sopenharmony_ci		/*
102662306a36Sopenharmony_ci		 * This isn't fatal for the GPIO, but we have to make sure that
102762306a36Sopenharmony_ci		 * the platform_device subsystem doesn't see this resource
102862306a36Sopenharmony_ci		 * or it will register an invalid region.
102962306a36Sopenharmony_ci		 */
103062306a36Sopenharmony_ci		lpc_ich_gpio_cell.num_resources--;
103162306a36Sopenharmony_ci		acpi_conflict = true;
103262306a36Sopenharmony_ci	} else {
103362306a36Sopenharmony_ci		lpc_ich_enable_acpi_space(dev);
103462306a36Sopenharmony_ci	}
103562306a36Sopenharmony_ci
103662306a36Sopenharmony_cigpe0_done:
103762306a36Sopenharmony_ci	/* Setup GPIO base register */
103862306a36Sopenharmony_ci	pci_read_config_dword(dev, priv->gbase, &base_addr_cfg);
103962306a36Sopenharmony_ci	base_addr = base_addr_cfg & 0x0000ff80;
104062306a36Sopenharmony_ci	if (!base_addr) {
104162306a36Sopenharmony_ci		dev_notice(&dev->dev, "I/O space for GPIO uninitialized\n");
104262306a36Sopenharmony_ci		ret = -ENODEV;
104362306a36Sopenharmony_ci		goto gpio_done;
104462306a36Sopenharmony_ci	}
104562306a36Sopenharmony_ci
104662306a36Sopenharmony_ci	/* Older devices provide fewer GPIO and have a smaller resource size. */
104762306a36Sopenharmony_ci	res = &gpio_ich_res[ICH_RES_GPIO];
104862306a36Sopenharmony_ci	res->start = base_addr;
104962306a36Sopenharmony_ci	switch (lpc_chipset_info[priv->chipset].gpio_version) {
105062306a36Sopenharmony_ci	case ICH_V5_GPIO:
105162306a36Sopenharmony_ci	case ICH_V10CORP_GPIO:
105262306a36Sopenharmony_ci		res->end = res->start + 128 - 1;
105362306a36Sopenharmony_ci		break;
105462306a36Sopenharmony_ci	default:
105562306a36Sopenharmony_ci		res->end = res->start + 64 - 1;
105662306a36Sopenharmony_ci		break;
105762306a36Sopenharmony_ci	}
105862306a36Sopenharmony_ci
105962306a36Sopenharmony_ci	ret = lpc_ich_check_conflict_gpio(res);
106062306a36Sopenharmony_ci	if (ret < 0) {
106162306a36Sopenharmony_ci		/* this isn't necessarily fatal for the GPIO */
106262306a36Sopenharmony_ci		acpi_conflict = true;
106362306a36Sopenharmony_ci		goto gpio_done;
106462306a36Sopenharmony_ci	}
106562306a36Sopenharmony_ci	lpc_chipset_info[priv->chipset].use_gpio = ret;
106662306a36Sopenharmony_ci	lpc_ich_enable_gpio_space(dev);
106762306a36Sopenharmony_ci
106862306a36Sopenharmony_ci	lpc_ich_finalize_gpio_cell(dev);
106962306a36Sopenharmony_ci	ret = mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO,
107062306a36Sopenharmony_ci			      &lpc_ich_gpio_cell, 1, NULL, 0, NULL);
107162306a36Sopenharmony_ci
107262306a36Sopenharmony_cigpio_done:
107362306a36Sopenharmony_ci	if (acpi_conflict)
107462306a36Sopenharmony_ci		pr_warn("Resource conflict(s) found affecting %s\n",
107562306a36Sopenharmony_ci				lpc_ich_gpio_cell.name);
107662306a36Sopenharmony_ci	return ret;
107762306a36Sopenharmony_ci}
107862306a36Sopenharmony_ci
107962306a36Sopenharmony_cistatic int lpc_ich_init_wdt(struct pci_dev *dev)
108062306a36Sopenharmony_ci{
108162306a36Sopenharmony_ci	struct lpc_ich_priv *priv = pci_get_drvdata(dev);
108262306a36Sopenharmony_ci	u32 base_addr_cfg;
108362306a36Sopenharmony_ci	u32 base_addr;
108462306a36Sopenharmony_ci	int ret;
108562306a36Sopenharmony_ci	struct resource *res;
108662306a36Sopenharmony_ci
108762306a36Sopenharmony_ci	/* If we have ACPI based watchdog use that instead */
108862306a36Sopenharmony_ci	if (acpi_has_watchdog())
108962306a36Sopenharmony_ci		return -ENODEV;
109062306a36Sopenharmony_ci
109162306a36Sopenharmony_ci	/* Setup power management base register */
109262306a36Sopenharmony_ci	pci_read_config_dword(dev, priv->abase, &base_addr_cfg);
109362306a36Sopenharmony_ci	base_addr = base_addr_cfg & 0x0000ff80;
109462306a36Sopenharmony_ci	if (!base_addr) {
109562306a36Sopenharmony_ci		dev_notice(&dev->dev, "I/O space for ACPI uninitialized\n");
109662306a36Sopenharmony_ci		ret = -ENODEV;
109762306a36Sopenharmony_ci		goto wdt_done;
109862306a36Sopenharmony_ci	}
109962306a36Sopenharmony_ci
110062306a36Sopenharmony_ci	res = wdt_io_res(ICH_RES_IO_TCO);
110162306a36Sopenharmony_ci	res->start = base_addr + ACPIBASE_TCO_OFF;
110262306a36Sopenharmony_ci	res->end = base_addr + ACPIBASE_TCO_END;
110362306a36Sopenharmony_ci
110462306a36Sopenharmony_ci	res = wdt_io_res(ICH_RES_IO_SMI);
110562306a36Sopenharmony_ci	res->start = base_addr + ACPIBASE_SMI_OFF;
110662306a36Sopenharmony_ci	res->end = base_addr + ACPIBASE_SMI_END;
110762306a36Sopenharmony_ci
110862306a36Sopenharmony_ci	lpc_ich_enable_acpi_space(dev);
110962306a36Sopenharmony_ci
111062306a36Sopenharmony_ci	/*
111162306a36Sopenharmony_ci	 * iTCO v2:
111262306a36Sopenharmony_ci	 * Get the Memory-Mapped GCS register. To get access to it
111362306a36Sopenharmony_ci	 * we have to read RCBA from PCI Config space 0xf0 and use
111462306a36Sopenharmony_ci	 * it as base. GCS = RCBA + ICH6_GCS(0x3410).
111562306a36Sopenharmony_ci	 *
111662306a36Sopenharmony_ci	 * iTCO v3:
111762306a36Sopenharmony_ci	 * Get the Power Management Configuration register.  To get access
111862306a36Sopenharmony_ci	 * to it we have to read the PMC BASE from config space and address
111962306a36Sopenharmony_ci	 * the register at offset 0x8.
112062306a36Sopenharmony_ci	 */
112162306a36Sopenharmony_ci	if (lpc_chipset_info[priv->chipset].iTCO_version == 1) {
112262306a36Sopenharmony_ci		/* Don't register iomem for TCO ver 1 */
112362306a36Sopenharmony_ci		lpc_ich_wdt_cell.num_resources--;
112462306a36Sopenharmony_ci	} else if (lpc_chipset_info[priv->chipset].iTCO_version == 2) {
112562306a36Sopenharmony_ci		pci_read_config_dword(dev, RCBABASE, &base_addr_cfg);
112662306a36Sopenharmony_ci		base_addr = base_addr_cfg & 0xffffc000;
112762306a36Sopenharmony_ci		if (!(base_addr_cfg & 1)) {
112862306a36Sopenharmony_ci			dev_notice(&dev->dev, "RCBA is disabled by "
112962306a36Sopenharmony_ci					"hardware/BIOS, device disabled\n");
113062306a36Sopenharmony_ci			ret = -ENODEV;
113162306a36Sopenharmony_ci			goto wdt_done;
113262306a36Sopenharmony_ci		}
113362306a36Sopenharmony_ci		res = wdt_mem_res(ICH_RES_MEM_GCS_PMC);
113462306a36Sopenharmony_ci		res->start = base_addr + ACPIBASE_GCS_OFF;
113562306a36Sopenharmony_ci		res->end = base_addr + ACPIBASE_GCS_END;
113662306a36Sopenharmony_ci	} else if (lpc_chipset_info[priv->chipset].iTCO_version == 3) {
113762306a36Sopenharmony_ci		lpc_ich_enable_pmc_space(dev);
113862306a36Sopenharmony_ci		pci_read_config_dword(dev, ACPICTRL_PMCBASE, &base_addr_cfg);
113962306a36Sopenharmony_ci		base_addr = base_addr_cfg & 0xfffffe00;
114062306a36Sopenharmony_ci
114162306a36Sopenharmony_ci		res = wdt_mem_res(ICH_RES_MEM_GCS_PMC);
114262306a36Sopenharmony_ci		res->start = base_addr + ACPIBASE_PMC_OFF;
114362306a36Sopenharmony_ci		res->end = base_addr + ACPIBASE_PMC_END;
114462306a36Sopenharmony_ci	}
114562306a36Sopenharmony_ci
114662306a36Sopenharmony_ci	ret = lpc_ich_finalize_wdt_cell(dev);
114762306a36Sopenharmony_ci	if (ret)
114862306a36Sopenharmony_ci		goto wdt_done;
114962306a36Sopenharmony_ci
115062306a36Sopenharmony_ci	ret = mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO,
115162306a36Sopenharmony_ci			      &lpc_ich_wdt_cell, 1, NULL, 0, NULL);
115262306a36Sopenharmony_ci
115362306a36Sopenharmony_ciwdt_done:
115462306a36Sopenharmony_ci	return ret;
115562306a36Sopenharmony_ci}
115662306a36Sopenharmony_ci
115762306a36Sopenharmony_cistatic int lpc_ich_init_pinctrl(struct pci_dev *dev)
115862306a36Sopenharmony_ci{
115962306a36Sopenharmony_ci	struct resource base;
116062306a36Sopenharmony_ci	unsigned int i;
116162306a36Sopenharmony_ci	int ret;
116262306a36Sopenharmony_ci
116362306a36Sopenharmony_ci	/* Check, if GPIO has been exported as an ACPI device */
116462306a36Sopenharmony_ci	if (acpi_dev_present("INT3452", NULL, -1))
116562306a36Sopenharmony_ci		return -EEXIST;
116662306a36Sopenharmony_ci
116762306a36Sopenharmony_ci	ret = p2sb_bar(dev->bus, 0, &base);
116862306a36Sopenharmony_ci	if (ret)
116962306a36Sopenharmony_ci		return ret;
117062306a36Sopenharmony_ci
117162306a36Sopenharmony_ci	for (i = 0; i < ARRAY_SIZE(apl_gpio_devices); i++) {
117262306a36Sopenharmony_ci		struct resource *mem = &apl_gpio_resources[i][0];
117362306a36Sopenharmony_ci		resource_size_t offset = apl_gpio_offsets[i];
117462306a36Sopenharmony_ci
117562306a36Sopenharmony_ci		/* Fill MEM resource */
117662306a36Sopenharmony_ci		mem->start = base.start + offset;
117762306a36Sopenharmony_ci		mem->end = base.start + offset + APL_GPIO_RESOURCE_SIZE - 1;
117862306a36Sopenharmony_ci		mem->flags = base.flags;
117962306a36Sopenharmony_ci	}
118062306a36Sopenharmony_ci
118162306a36Sopenharmony_ci	return mfd_add_devices(&dev->dev, 0, apl_gpio_devices,
118262306a36Sopenharmony_ci			       ARRAY_SIZE(apl_gpio_devices), NULL, 0, NULL);
118362306a36Sopenharmony_ci}
118462306a36Sopenharmony_ci
118562306a36Sopenharmony_cistatic bool lpc_ich_byt_set_writeable(void __iomem *base, void *data)
118662306a36Sopenharmony_ci{
118762306a36Sopenharmony_ci	u32 val;
118862306a36Sopenharmony_ci
118962306a36Sopenharmony_ci	val = readl(base + BYT_BCR);
119062306a36Sopenharmony_ci	if (!(val & BYT_BCR_WPD)) {
119162306a36Sopenharmony_ci		val |= BYT_BCR_WPD;
119262306a36Sopenharmony_ci		writel(val, base + BYT_BCR);
119362306a36Sopenharmony_ci		val = readl(base + BYT_BCR);
119462306a36Sopenharmony_ci	}
119562306a36Sopenharmony_ci
119662306a36Sopenharmony_ci	return val & BYT_BCR_WPD;
119762306a36Sopenharmony_ci}
119862306a36Sopenharmony_ci
119962306a36Sopenharmony_cistatic bool lpc_ich_set_writeable(struct pci_bus *bus, unsigned int devfn)
120062306a36Sopenharmony_ci{
120162306a36Sopenharmony_ci	u32 bcr;
120262306a36Sopenharmony_ci
120362306a36Sopenharmony_ci	pci_bus_read_config_dword(bus, devfn, BCR, &bcr);
120462306a36Sopenharmony_ci	if (!(bcr & BCR_WPD)) {
120562306a36Sopenharmony_ci		bcr |= BCR_WPD;
120662306a36Sopenharmony_ci		pci_bus_write_config_dword(bus, devfn, BCR, bcr);
120762306a36Sopenharmony_ci		pci_bus_read_config_dword(bus, devfn, BCR, &bcr);
120862306a36Sopenharmony_ci	}
120962306a36Sopenharmony_ci
121062306a36Sopenharmony_ci	return bcr & BCR_WPD;
121162306a36Sopenharmony_ci}
121262306a36Sopenharmony_ci
121362306a36Sopenharmony_cistatic bool lpc_ich_lpt_set_writeable(void __iomem *base, void *data)
121462306a36Sopenharmony_ci{
121562306a36Sopenharmony_ci	struct pci_dev *pdev = data;
121662306a36Sopenharmony_ci
121762306a36Sopenharmony_ci	return lpc_ich_set_writeable(pdev->bus, pdev->devfn);
121862306a36Sopenharmony_ci}
121962306a36Sopenharmony_ci
122062306a36Sopenharmony_cistatic bool lpc_ich_bxt_set_writeable(void __iomem *base, void *data)
122162306a36Sopenharmony_ci{
122262306a36Sopenharmony_ci	struct pci_dev *pdev = data;
122362306a36Sopenharmony_ci
122462306a36Sopenharmony_ci	return lpc_ich_set_writeable(pdev->bus, PCI_DEVFN(13, 2));
122562306a36Sopenharmony_ci}
122662306a36Sopenharmony_ci
122762306a36Sopenharmony_cistatic int lpc_ich_init_spi(struct pci_dev *dev)
122862306a36Sopenharmony_ci{
122962306a36Sopenharmony_ci	struct lpc_ich_priv *priv = pci_get_drvdata(dev);
123062306a36Sopenharmony_ci	struct resource *res = &intel_spi_res[0];
123162306a36Sopenharmony_ci	struct intel_spi_boardinfo *info;
123262306a36Sopenharmony_ci	u32 spi_base, rcba;
123362306a36Sopenharmony_ci	int ret;
123462306a36Sopenharmony_ci
123562306a36Sopenharmony_ci	info = devm_kzalloc(&dev->dev, sizeof(*info), GFP_KERNEL);
123662306a36Sopenharmony_ci	if (!info)
123762306a36Sopenharmony_ci		return -ENOMEM;
123862306a36Sopenharmony_ci
123962306a36Sopenharmony_ci	info->type = lpc_chipset_info[priv->chipset].spi_type;
124062306a36Sopenharmony_ci
124162306a36Sopenharmony_ci	switch (info->type) {
124262306a36Sopenharmony_ci	case INTEL_SPI_BYT:
124362306a36Sopenharmony_ci		pci_read_config_dword(dev, SPIBASE_BYT, &spi_base);
124462306a36Sopenharmony_ci		if (spi_base & SPIBASE_BYT_EN) {
124562306a36Sopenharmony_ci			res->start = spi_base & ~(SPIBASE_BYT_SZ - 1);
124662306a36Sopenharmony_ci			res->end = res->start + SPIBASE_BYT_SZ - 1;
124762306a36Sopenharmony_ci
124862306a36Sopenharmony_ci			info->set_writeable = lpc_ich_byt_set_writeable;
124962306a36Sopenharmony_ci		}
125062306a36Sopenharmony_ci		break;
125162306a36Sopenharmony_ci
125262306a36Sopenharmony_ci	case INTEL_SPI_LPT:
125362306a36Sopenharmony_ci		pci_read_config_dword(dev, RCBABASE, &rcba);
125462306a36Sopenharmony_ci		if (rcba & 1) {
125562306a36Sopenharmony_ci			spi_base = round_down(rcba, SPIBASE_LPT_SZ);
125662306a36Sopenharmony_ci			res->start = spi_base + SPIBASE_LPT;
125762306a36Sopenharmony_ci			res->end = res->start + SPIBASE_LPT_SZ - 1;
125862306a36Sopenharmony_ci
125962306a36Sopenharmony_ci			info->set_writeable = lpc_ich_lpt_set_writeable;
126062306a36Sopenharmony_ci			info->data = dev;
126162306a36Sopenharmony_ci		}
126262306a36Sopenharmony_ci		break;
126362306a36Sopenharmony_ci
126462306a36Sopenharmony_ci	case INTEL_SPI_BXT:
126562306a36Sopenharmony_ci		/*
126662306a36Sopenharmony_ci		 * The P2SB is hidden by BIOS and we need to unhide it in
126762306a36Sopenharmony_ci		 * order to read BAR of the SPI flash device. Once that is
126862306a36Sopenharmony_ci		 * done we hide it again.
126962306a36Sopenharmony_ci		 */
127062306a36Sopenharmony_ci		ret = p2sb_bar(dev->bus, PCI_DEVFN(13, 2), res);
127162306a36Sopenharmony_ci		if (ret)
127262306a36Sopenharmony_ci			return ret;
127362306a36Sopenharmony_ci
127462306a36Sopenharmony_ci		info->set_writeable = lpc_ich_bxt_set_writeable;
127562306a36Sopenharmony_ci		info->data = dev;
127662306a36Sopenharmony_ci		break;
127762306a36Sopenharmony_ci
127862306a36Sopenharmony_ci	default:
127962306a36Sopenharmony_ci		return -EINVAL;
128062306a36Sopenharmony_ci	}
128162306a36Sopenharmony_ci
128262306a36Sopenharmony_ci	if (!res->start)
128362306a36Sopenharmony_ci		return -ENODEV;
128462306a36Sopenharmony_ci
128562306a36Sopenharmony_ci	lpc_ich_spi_cell.platform_data = info;
128662306a36Sopenharmony_ci	lpc_ich_spi_cell.pdata_size = sizeof(*info);
128762306a36Sopenharmony_ci
128862306a36Sopenharmony_ci	return mfd_add_devices(&dev->dev, PLATFORM_DEVID_NONE,
128962306a36Sopenharmony_ci			       &lpc_ich_spi_cell, 1, NULL, 0, NULL);
129062306a36Sopenharmony_ci}
129162306a36Sopenharmony_ci
129262306a36Sopenharmony_cistatic int lpc_ich_probe(struct pci_dev *dev,
129362306a36Sopenharmony_ci				const struct pci_device_id *id)
129462306a36Sopenharmony_ci{
129562306a36Sopenharmony_ci	struct lpc_ich_priv *priv;
129662306a36Sopenharmony_ci	int ret;
129762306a36Sopenharmony_ci	bool cell_added = false;
129862306a36Sopenharmony_ci
129962306a36Sopenharmony_ci	priv = devm_kzalloc(&dev->dev,
130062306a36Sopenharmony_ci			    sizeof(struct lpc_ich_priv), GFP_KERNEL);
130162306a36Sopenharmony_ci	if (!priv)
130262306a36Sopenharmony_ci		return -ENOMEM;
130362306a36Sopenharmony_ci
130462306a36Sopenharmony_ci	priv->chipset = id->driver_data;
130562306a36Sopenharmony_ci
130662306a36Sopenharmony_ci	priv->actrl_pbase_save = -1;
130762306a36Sopenharmony_ci	priv->abase_save = -1;
130862306a36Sopenharmony_ci
130962306a36Sopenharmony_ci	priv->abase = ACPIBASE;
131062306a36Sopenharmony_ci	priv->actrl_pbase = ACPICTRL_PMCBASE;
131162306a36Sopenharmony_ci
131262306a36Sopenharmony_ci	priv->gctrl_save = -1;
131362306a36Sopenharmony_ci	if (priv->chipset <= LPC_ICH5) {
131462306a36Sopenharmony_ci		priv->gbase = GPIOBASE_ICH0;
131562306a36Sopenharmony_ci		priv->gctrl = GPIOCTRL_ICH0;
131662306a36Sopenharmony_ci	} else {
131762306a36Sopenharmony_ci		priv->gbase = GPIOBASE_ICH6;
131862306a36Sopenharmony_ci		priv->gctrl = GPIOCTRL_ICH6;
131962306a36Sopenharmony_ci	}
132062306a36Sopenharmony_ci
132162306a36Sopenharmony_ci	pci_set_drvdata(dev, priv);
132262306a36Sopenharmony_ci
132362306a36Sopenharmony_ci	if (lpc_chipset_info[priv->chipset].iTCO_version) {
132462306a36Sopenharmony_ci		ret = lpc_ich_init_wdt(dev);
132562306a36Sopenharmony_ci		if (!ret)
132662306a36Sopenharmony_ci			cell_added = true;
132762306a36Sopenharmony_ci	}
132862306a36Sopenharmony_ci
132962306a36Sopenharmony_ci	if (lpc_chipset_info[priv->chipset].gpio_version) {
133062306a36Sopenharmony_ci		ret = lpc_ich_init_gpio(dev);
133162306a36Sopenharmony_ci		if (!ret)
133262306a36Sopenharmony_ci			cell_added = true;
133362306a36Sopenharmony_ci	}
133462306a36Sopenharmony_ci
133562306a36Sopenharmony_ci	if (priv->chipset == LPC_APL) {
133662306a36Sopenharmony_ci		ret = lpc_ich_init_pinctrl(dev);
133762306a36Sopenharmony_ci		if (!ret)
133862306a36Sopenharmony_ci			cell_added = true;
133962306a36Sopenharmony_ci	}
134062306a36Sopenharmony_ci
134162306a36Sopenharmony_ci	if (lpc_chipset_info[priv->chipset].spi_type) {
134262306a36Sopenharmony_ci		ret = lpc_ich_init_spi(dev);
134362306a36Sopenharmony_ci		if (!ret)
134462306a36Sopenharmony_ci			cell_added = true;
134562306a36Sopenharmony_ci	}
134662306a36Sopenharmony_ci
134762306a36Sopenharmony_ci	/*
134862306a36Sopenharmony_ci	 * We only care if at least one or none of the cells registered
134962306a36Sopenharmony_ci	 * successfully.
135062306a36Sopenharmony_ci	 */
135162306a36Sopenharmony_ci	if (!cell_added) {
135262306a36Sopenharmony_ci		dev_warn(&dev->dev, "No MFD cells added\n");
135362306a36Sopenharmony_ci		lpc_ich_restore_config_space(dev);
135462306a36Sopenharmony_ci		return -ENODEV;
135562306a36Sopenharmony_ci	}
135662306a36Sopenharmony_ci
135762306a36Sopenharmony_ci	return 0;
135862306a36Sopenharmony_ci}
135962306a36Sopenharmony_ci
136062306a36Sopenharmony_cistatic void lpc_ich_remove(struct pci_dev *dev)
136162306a36Sopenharmony_ci{
136262306a36Sopenharmony_ci	mfd_remove_devices(&dev->dev);
136362306a36Sopenharmony_ci	lpc_ich_restore_config_space(dev);
136462306a36Sopenharmony_ci}
136562306a36Sopenharmony_ci
136662306a36Sopenharmony_cistatic struct pci_driver lpc_ich_driver = {
136762306a36Sopenharmony_ci	.name		= "lpc_ich",
136862306a36Sopenharmony_ci	.id_table	= lpc_ich_ids,
136962306a36Sopenharmony_ci	.probe		= lpc_ich_probe,
137062306a36Sopenharmony_ci	.remove		= lpc_ich_remove,
137162306a36Sopenharmony_ci};
137262306a36Sopenharmony_ci
137362306a36Sopenharmony_cimodule_pci_driver(lpc_ich_driver);
137462306a36Sopenharmony_ci
137562306a36Sopenharmony_ciMODULE_AUTHOR("Aaron Sierra <asierra@xes-inc.com>");
137662306a36Sopenharmony_ciMODULE_DESCRIPTION("LPC interface for Intel ICH");
137762306a36Sopenharmony_ciMODULE_LICENSE("GPL");
1378