[PATCH] mfd: i2c: convert SCx200 driver from using raw PCI to platform device

Previous thread: linux-next: Tree for December 31 by Stephen Rothwell on Thursday, December 30, 2010 - 8:58 pm. (4 messages)

Next thread: [PATCH] cx23885, cimax2.c: Fix case of two CAM insertion irq. by Igor M. Liplianin on Thursday, December 30, 2010 - 10:04 pm. (1 message)
From: Andres Salomon
Date: Thursday, December 30, 2010 - 9:27 pm

Note: this relies on the cs5535-mfd patches that are currently in the
MFD next tree.  It's been tested on CS5536 hardware, but I don't have
access to any old SCx200 hardware to verify that I didn't break the ISA
stuff.


From: Andres Salomon <dilinger@queued.net>

The SCx200 ACB driver supports ISA hardware as well as PCI.  The PCI hardware
is CS5535/CS5536 based, and the device that it grabs is handled by the
cs5535-mfd driver.  This converts the SCx200 driver to use a platform_driver
rather than the previous PCI hackery.

The driver used to manually track the iface list (via linked list); now it
only does this for ISA devices.  PCI ifaces are handled through standard
driver model lists.

It's unclear what happens in case of errors in the old ISA code; rather than
pretending the code actually cares, I've dropped the (implicit) ignorance
of return values and marked it with a comment.

Signed-off-by: Andres Salomon <dilinger@queued.net>
---
 drivers/i2c/busses/scx200_acb.c |  200 ++++++++++++++++-----------------------
 1 files changed, 80 insertions(+), 120 deletions(-)

diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c
index 53fab51..986e5f6 100644
--- a/drivers/i2c/busses/scx200_acb.c
+++ b/drivers/i2c/busses/scx200_acb.c
@@ -29,6 +29,7 @@
 #include <linux/init.h>
 #include <linux/i2c.h>
 #include <linux/pci.h>
+#include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/mutex.h>
 #include <linux/slab.h>
@@ -40,6 +41,7 @@
 
 MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>");
 MODULE_DESCRIPTION("NatSemi SCx200 ACCESS.bus Driver");
+MODULE_ALIAS("platform:cs5535-smb");
 MODULE_LICENSE("GPL");
 
 #define MAX_DEVICES 4
@@ -84,10 +86,6 @@ struct scx200_acb_iface {
 	u8 *ptr;
 	char needs_reset;
 	unsigned len;
-
-	/* PCI device info */
-	struct pci_dev *pdev;
-	int bar;
 };
 
 /* Register Definitions */
@@ -391,7 +389,7 @@ static const struct i2c_algorithm scx200_acb_algorithm = {
 static struct ...
Previous thread: linux-next: Tree for December 31 by Stephen Rothwell on Thursday, December 30, 2010 - 8:58 pm. (4 messages)

Next thread: [PATCH] cx23885, cimax2.c: Fix case of two CAM insertion irq. by Igor M. Liplianin on Thursday, December 30, 2010 - 10:04 pm. (1 message)