Skip to contentSkip to conversation

lpc_sch: Add Intel Centerton Multifunction Device support

PATCH In review Seth Heasley 2 participants 3 messages Mar 21, 2012 – Apr 16, 2012 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lpc_sch: Add Intel Centerton Multifunction Device support

This patch adds the DeviceIDs for the Intel Centerton Legacy Block. The Legacy Block includes SMBus, GPIO, and Watchdog functionality.

---
 drivers/mfd/lpc_sch.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)
drivers/mfd/lpc_sch.c +13 -3
index abc4213..778af13 100644
@@ -36,10 +36,13 @@
 
 #define GPIOBASE	0x44
 #define GPIO_IO_SIZE	64
+#define GPIO_IO_SIZE_128	128
 
 #define WDTBASE		0x84
 #define WDT_IO_SIZE	64
 
+#define PCI_DEVICE_ID_INTEL_CENTERTON_ILB	0x0c60
+
 static struct resource smbus_sch_resource = {
 		.flags = IORESOURCE_IO,
 };
@@ -68,7 +71,7 @@ static struct resource wdt_sch_resource = {
 
 static struct mfd_cell tunnelcreek_cells[] = {
 	{
-		.name = "tunnelcreek_wdt",
+		.name = "ie6xx_wdt",
 		.num_resources = 1,
 		.resources = &wdt_sch_resource,
 	},
@@ -77,6 +80,7 @@ static struct mfd_cell tunnelcreek_cells[] = {
 static DEFINE_PCI_DEVICE_TABLE(lpc_sch_ids) = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_LPC) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ITC_LPC) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CENTERTON_ILB) },
 	{ 0, }
 };
 MODULE_DEVICE_TABLE(pci, lpc_sch_ids);
@@ -115,7 +119,12 @@ static int __devinit lpc_sch_probe(struct pci_dev *dev,
 	}
 
 	gpio_sch_resource.start = base_addr;
-	gpio_sch_resource.end = base_addr + GPIO_IO_SIZE - 1;
+
+	/* Intel Centerton has 128 bytes of I/O space */
+	if (id->device == PCI_DEVICE_ID_INTEL_CENTERTON_ILB)
+		gpio_sch_resource.end = base_addr + GPIO_IO_SIZE_128 - 1;
+	else
+		gpio_sch_resource.end = base_addr + GPIO_IO_SIZE - 1;
 
 	for (i=0; i < ARRAY_SIZE(lpc_sch_cells); i++)
 		lpc_sch_cells[i].id = id->device;
@@ -125,7 +134,8 @@ static int __devinit lpc_sch_probe(struct pci_dev *dev,
 	if (ret)
 		goto out_dev;
 
-	if (id->device == PCI_DEVICE_ID_INTEL_ITC_LPC) {
+	if (id->device == PCI_DEVICE_ID_INTEL_ITC_LPC
+	 || id->device == PCI_DEVICE_ID_INTEL_CENTERTON_ILB) {
 		pci_read_config_dword(dev, WDTBASE, &base_addr_cfg);
 		if (!(base_addr_cfg & (1 << 31))) {
 			dev_err(&dev->dev, "Decode of the WDT I/O range disabled\n");
Signature · 1 line
1.7.4.4
#1 lore raw

Hi Seth,

Quoted 12 lines · Seth Heasley

This patch adds the DeviceIDs for the Intel Centerton Legacy Block. The Legacy Block includes SMBus, GPIO, and Watchdog functionality.

---
 drivers/mfd/lpc_sch.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)
drivers/mfd/lpc_sch.c +0 -0
index abc4213..778af13 100644

drivers/mfd/lpc_sch.c line 45

Quoted 10 lines
drivers/mfd/lpc_sch.c +3 -0
@@ -36,10 +36,13 @@
 
 #define GPIOBASE	0x44
 #define GPIO_IO_SIZE	64
+#define GPIO_IO_SIZE_128	128
 
 #define WDTBASE		0x84
 #define WDT_IO_SIZE	64
 
+#define PCI_DEVICE_ID_INTEL_CENTERTON_ILB	0x0c60
+

So we're not going to need this ID anywhere else ? In the GPIO driver for example ?
If we do need it there, this ID should move to pci_ids.h

drivers/mfd/lpc_sch.c static struct resource wdt_sch_resource = { · line 74

Quoted 9 lines
drivers/mfd/lpc_sch.c +1 -1
 static struct resource smbus_sch_resource = {
 		.flags = IORESOURCE_IO,
 };
@@ -68,7 +71,7 @@ static struct resource wdt_sch_resource = {
 
 static struct mfd_cell tunnelcreek_cells[] = {
 	{
-		.name = "tunnelcreek_wdt",
+		.name = "ie6xx_wdt",

What do we need this change for ?

The rest of the patch looks good.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/
#2 lore raw

Hi Samuel,

Quoted 6 lines

drivers/mfd/lpc_sch.c line 45

Quoted 3 lines
drivers/mfd/lpc_sch.c +2 -0
+#define PCI_DEVICE_ID_INTEL_CENTERTON_ILB	0x0c60
+

So we're not going to need this ID anywhere else ? In the GPIO driver for example ?
If we do need it there, this ID should move to pci_ids.h

Actually, it looks like the GPIO driver *will* need it, so I'll go ahead and move it to pci_ids.h since it's used in more than one driver.

Quoted 10 lines

drivers/mfd/lpc_sch.c static struct resource wdt_sch_resource = { · line 74

Quoted 9 lines

static struct resource smbus_sch_resource = {

drivers/mfd/lpc_sch.c +1 -1
 		.flags = IORESOURCE_IO,
 };
@@ -68,7 +71,7 @@ static struct resource wdt_sch_resource = {
 
 static struct mfd_cell tunnelcreek_cells[] = {
 	{
-		.name = "tunnelcreek_wdt",
+		.name = "ie6xx_wdt",

What do we need this change for ?

As mentioned in a previous email, the wdt driver is being renamed, so I'm reflecting that here.

I'll make a couple of changes and resubmit.

Regards,
-Seth