public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Denis Turischev <denis@compulab.co.il>
To: Samuel Ortiz <sameo@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Grant Likely <grant.likely@secretlab.ca>,
	David Brownell <dbrownell@users.sourceforge.net>
Subject: [PATCH 2/3] lpc_sch: expand for Tunnel Creek
Date: Sun, 13 Mar 2011 17:28:59 +0200	[thread overview]
Message-ID: <4D7CE2BB.5010802@compulab.co.il> (raw)
In-Reply-To: <4D7CE230.1070004@compulab.co.il>

Intel Poulsbo SCH and Tunnel Creek provide almost the
same LPC interface. Use the same driver for both devices while
storing PCI ID to distinguish between platforms to apply plarform
related quirks.

Signed-off-by: Denis Turischev <denis@compulab.co.il>
---
 drivers/mfd/lpc_sch.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/lpc_sch.c b/drivers/mfd/lpc_sch.c
index 51b2f60..ea3f52c 100644
--- a/drivers/mfd/lpc_sch.c
+++ b/drivers/mfd/lpc_sch.c
@@ -61,6 +61,7 @@ static struct mfd_cell lpc_sch_cells[] = {

 static struct pci_device_id 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) },
 	{ 0, }
 };
 MODULE_DEVICE_TABLE(pci, lpc_sch_ids);
@@ -70,6 +71,7 @@ static int __devinit lpc_sch_probe(struct pci_dev *dev,
 {
 	unsigned int base_addr_cfg;
 	unsigned short base_addr;
+	int i;

 	pci_read_config_dword(dev, SMBASE, &base_addr_cfg);
 	if (!(base_addr_cfg & (1 << 31))) {
@@ -99,7 +101,10 @@ 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;

-	return mfd_add_devices(&dev->dev, -1,
+	for (i=0; i < ARRAY_SIZE(lpc_sch_cells); i++)
+		lpc_sch_cells[i].id = id->device;
+
+	return mfd_add_devices(&dev->dev, 0,
 			lpc_sch_cells, ARRAY_SIZE(lpc_sch_cells), NULL, 0);
 }

-- 
1.7.0.4

  reply	other threads:[~2011-03-13 15:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-13 15:26 [PATCH 1/3] pci_ids: add Intel Tunnel Creek LPC Bridge device ID Denis Turischev
2011-03-13 15:28 ` Denis Turischev [this message]
2011-03-13 15:30   ` [PATCH 3/3] sch_gpio: expand for Tunnel Creak Denis Turischev
2011-03-14 10:53     ` [PATCH 3/3 v2] sch_gpio: expand for Tunnel Creek Denis Turischev
2011-03-14 11:45       ` Samuel Ortiz
2011-03-14 19:20         ` Grant Likely
2011-03-17 23:13     ` [PATCH 3/3] sch_gpio: expand for Tunnel Creak Samuel Ortiz
2011-03-17 23:12   ` [PATCH 2/3] lpc_sch: expand for Tunnel Creek Samuel Ortiz
2011-03-14 11:43 ` [PATCH 1/3] pci_ids: add Intel Tunnel Creek LPC Bridge device ID Samuel Ortiz
2011-03-14 15:50   ` Jesse Barnes
2011-03-17 23:11 ` Samuel Ortiz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D7CE2BB.5010802@compulab.co.il \
    --to=denis@compulab.co.il \
    --cc=dbrownell@users.sourceforge.net \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox