public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/5] powerpc/ibm_iic: remove support for OCP
       [not found] <20080610142702.354823071@arndb.de>
@ 2008-06-10 14:27 ` arnd-r2nGTMty4D4
       [not found]   ` <20080610142947.974805307-r2nGTMty4D4@public.gmane.org>
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: arnd-r2nGTMty4D4 @ 2008-06-10 14:27 UTC (permalink / raw)
  To: paulus-eUNUBHrolfbYtjvyW6yDsg
  Cc: Ben Dooks, Kumar Gala, linuxppc-dev-u79uwXL29TY76Z2rM5mHXA,
	i2c-GZX6beZjE8VD60Wz+7aTrA

[-- Attachment #1: 0003-powerpc-ibm_iic-remove-support-for-OCP.patch --]
[-- Type: text/plain, Size: 5767 bytes --]

OCP is dead, so all code referring to it can go away as well.

Cc: i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Cc: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
---
 drivers/i2c/busses/i2c-ibm_iic.c |  181 --------------------------------------
 1 files changed, 0 insertions(+), 181 deletions(-)

diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index 85dbf34..3a364a7 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
@@ -42,13 +42,7 @@
 #include <asm/io.h>
 #include <linux/i2c.h>
 #include <linux/i2c-id.h>
-
-#ifdef CONFIG_IBM_OCP
-#include <asm/ocp.h>
-#include <asm/ibm4xx.h>
-#else
 #include <linux/of_platform.h>
-#endif
 
 #include "i2c-ibm_iic.h"
 
@@ -665,180 +659,6 @@ static inline u8 iic_clckdiv(unsigned int opb)
 	return (u8)((opb + 9) / 10 - 1);
 }
 
-#ifdef CONFIG_IBM_OCP
-/*
- * Register single IIC interface
- */
-static int __devinit iic_probe(struct ocp_device *ocp){
-
-	struct ibm_iic_private* dev;
-	struct i2c_adapter* adap;
-	struct ocp_func_iic_data* iic_data = ocp->def->additions;
-	int ret;
-
-	if (!iic_data)
-		printk(KERN_WARNING"ibm-iic%d: missing additional data!\n",
-			ocp->def->index);
-
-	if (!(dev = kzalloc(sizeof(*dev), GFP_KERNEL))) {
-		printk(KERN_ERR "ibm-iic%d: failed to allocate device data\n",
-			ocp->def->index);
-		return -ENOMEM;
-	}
-
-	dev->idx = ocp->def->index;
-	ocp_set_drvdata(ocp, dev);
-
-	if (!request_mem_region(ocp->def->paddr, sizeof(struct iic_regs),
-				"ibm_iic")) {
-		ret = -EBUSY;
-		goto fail1;
-	}
-
-	if (!(dev->vaddr = ioremap(ocp->def->paddr, sizeof(struct iic_regs)))){
-		printk(KERN_ERR "ibm-iic%d: failed to ioremap device registers\n",
-			dev->idx);
-		ret = -ENXIO;
-		goto fail2;
-	}
-
-	init_waitqueue_head(&dev->wq);
-
-	dev->irq = iic_force_poll ? -1 : ocp->def->irq;
-	if (dev->irq >= 0){
-		/* Disable interrupts until we finish initialization,
-		   assumes level-sensitive IRQ setup...
-		 */
-		iic_interrupt_mode(dev, 0);
-		if (request_irq(dev->irq, iic_handler, 0, "IBM IIC", dev)){
-			printk(KERN_ERR "ibm-iic%d: request_irq %d failed\n",
-				dev->idx, dev->irq);
-			/* Fallback to the polling mode */
-			dev->irq = -1;
-		}
-	}
-
-	if (dev->irq < 0)
-		printk(KERN_WARNING "ibm-iic%d: using polling mode\n",
-			dev->idx);
-
-	/* Board specific settings */
-	dev->fast_mode = iic_force_fast ? 1 : (iic_data ? iic_data->fast_mode : 0);
-
-	/* clckdiv is the same for *all* IIC interfaces,
-	 * but I'd rather make a copy than introduce another global. --ebs
-	 */
-	dev->clckdiv = iic_clckdiv(ocp_sys_info.opb_bus_freq);
-	DBG("%d: clckdiv = %d\n", dev->idx, dev->clckdiv);
-
-	/* Initialize IIC interface */
-	iic_dev_init(dev);
-
-	/* Register it with i2c layer */
-	adap = &dev->adap;
-	adap->dev.parent = &ocp->dev;
-	strcpy(adap->name, "IBM IIC");
-	i2c_set_adapdata(adap, dev);
-	adap->id = I2C_HW_OCP;
-	adap->class = I2C_CLASS_HWMON;
-	adap->algo = &iic_algo;
-	adap->client_register = NULL;
-	adap->client_unregister = NULL;
-	adap->timeout = 1;
-
-	/*
-	 * If "dev->idx" is negative we consider it as zero.
-	 * The reason to do so is to avoid sysfs names that only make
-	 * sense when there are multiple adapters.
-	 */
-	adap->nr = dev->idx >= 0 ? dev->idx : 0;
-
-	if ((ret = i2c_add_numbered_adapter(adap)) < 0) {
-		printk(KERN_ERR "ibm-iic%d: failed to register i2c adapter\n",
-			dev->idx);
-		goto fail;
-	}
-
-	printk(KERN_INFO "ibm-iic%d: using %s mode\n", dev->idx,
-		dev->fast_mode ? "fast (400 kHz)" : "standard (100 kHz)");
-
-	return 0;
-
-fail:
-	if (dev->irq >= 0){
-		iic_interrupt_mode(dev, 0);
-		free_irq(dev->irq, dev);
-	}
-
-	iounmap(dev->vaddr);
-fail2:
-	release_mem_region(ocp->def->paddr, sizeof(struct iic_regs));
-fail1:
-	ocp_set_drvdata(ocp, NULL);
-	kfree(dev);
-	return ret;
-}
-
-/*
- * Cleanup initialized IIC interface
- */
-static void __devexit iic_remove(struct ocp_device *ocp)
-{
-	struct ibm_iic_private* dev = (struct ibm_iic_private*)ocp_get_drvdata(ocp);
-	BUG_ON(dev == NULL);
-	if (i2c_del_adapter(&dev->adap)){
-		printk(KERN_ERR "ibm-iic%d: failed to delete i2c adapter :(\n",
-			dev->idx);
-		/* That's *very* bad, just shutdown IRQ ... */
-		if (dev->irq >= 0){
-		    iic_interrupt_mode(dev, 0);
-		    free_irq(dev->irq, dev);
-		    dev->irq = -1;
-		}
-	} else {
-		if (dev->irq >= 0){
-		    iic_interrupt_mode(dev, 0);
-		    free_irq(dev->irq, dev);
-		}
-		iounmap(dev->vaddr);
-		release_mem_region(ocp->def->paddr, sizeof(struct iic_regs));
-		kfree(dev);
-	}
-}
-
-static struct ocp_device_id ibm_iic_ids[] __devinitdata =
-{
-	{ .vendor = OCP_VENDOR_IBM, .function = OCP_FUNC_IIC },
-	{ .vendor = OCP_VENDOR_INVALID }
-};
-
-MODULE_DEVICE_TABLE(ocp, ibm_iic_ids);
-
-static struct ocp_driver ibm_iic_driver =
-{
-	.name 		= "iic",
-	.id_table	= ibm_iic_ids,
-	.probe		= iic_probe,
-	.remove		= __devexit_p(iic_remove),
-#if defined(CONFIG_PM)
-	.suspend	= NULL,
-	.resume		= NULL,
-#endif
-};
-
-static int __init iic_init(void)
-{
-	printk(KERN_INFO "IBM IIC driver v" DRIVER_VERSION "\n");
-	return ocp_register_driver(&ibm_iic_driver);
-}
-
-static void __exit iic_exit(void)
-{
-	ocp_unregister_driver(&ibm_iic_driver);
-}
-
-#else  /* !CONFIG_IBM_OCP */
-
 static int __devinit iic_request_irq(struct of_device *ofdev,
 				     struct ibm_iic_private *dev)
 {
@@ -1011,7 +831,6 @@ static void __exit iic_exit(void)
 {
 	of_unregister_platform_driver(&ibm_iic_driver);
 }
-#endif /* CONFIG_IBM_OCP */
 
 module_init(iic_init);
 module_exit(iic_exit);
-- 
1.5.4.3

-- 


_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/5] powerpc/ibm_iic: remove support for OCP
       [not found]   ` <20080610142947.974805307-r2nGTMty4D4@public.gmane.org>
@ 2008-06-10 16:00     ` Jean Delvare
  0 siblings, 0 replies; 5+ messages in thread
From: Jean Delvare @ 2008-06-10 16:00 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: Kumar Gala, linuxppc-dev-u79uwXL29TY76Z2rM5mHXA,
	paulus-eUNUBHrolfbYtjvyW6yDsg, i2c-GZX6beZjE8VD60Wz+7aTrA,
	Ben Dooks

Hi Arnd,

On Tue, 10 Jun 2008 16:27:05 +0200, arnd-r2nGTMty4D4@public.gmane.org wrote:
> OCP is dead, so all code referring to it can go away as well.
> 
> Cc: i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
> Cc: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
> Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
> ---
>  drivers/i2c/busses/i2c-ibm_iic.c |  181 --------------------------------------
>  1 files changed, 0 insertions(+), 181 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
> index 85dbf34..3a364a7 100644
> --- a/drivers/i2c/busses/i2c-ibm_iic.c
> +++ b/drivers/i2c/busses/i2c-ibm_iic.c
> (...)

I've already received, and applied, a patch doing exactly that, from
Stefan Roese:
http://lists.lm-sensors.org/pipermail/i2c/2008-June/003910.html

-- 
Jean Delvare

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/5] powerpc/ibm_iic: remove support for OCP
  2008-06-10 14:27 ` [PATCH 3/5] powerpc/ibm_iic: remove support for OCP arnd-r2nGTMty4D4
       [not found]   ` <20080610142947.974805307-r2nGTMty4D4@public.gmane.org>
@ 2008-06-10 16:23   ` Josh Boyer
  2008-06-10 16:24   ` Stephen Rothwell
  2 siblings, 0 replies; 5+ messages in thread
From: Josh Boyer @ 2008-06-10 16:23 UTC (permalink / raw)
  To: arnd; +Cc: linuxppc-dev, paulus, i2c, Ben Dooks

On Tue, 10 Jun 2008 16:27:05 +0200
arnd@arndb.de wrote:

> OCP is dead, so all code referring to it can go away as well.

Stefan already sent this out, and I think Jean has it queued up.

josh

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/5] powerpc/ibm_iic: remove support for OCP
  2008-06-10 14:27 ` [PATCH 3/5] powerpc/ibm_iic: remove support for OCP arnd-r2nGTMty4D4
       [not found]   ` <20080610142947.974805307-r2nGTMty4D4@public.gmane.org>
  2008-06-10 16:23   ` Josh Boyer
@ 2008-06-10 16:24   ` Stephen Rothwell
  2008-06-10 18:40     ` Arnd Bergmann
  2 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2008-06-10 16:24 UTC (permalink / raw)
  To: arnd; +Cc: linuxppc-dev, paulus, i2c, Ben Dooks


[-- Attachment #1.1: Type: text/plain, Size: 578 bytes --]

Hi Arnd,

On Tue, 10 Jun 2008 16:27:05 +0200 arnd@arndb.de wrote:
>
> OCP is dead, so all code referring to it can go away as well.
> 
> Cc: i2c@lm-sensors.org
> Cc: Ben Dooks <ben-linux@fluff.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

There is already a patch in the i2c tree to do this one.  Commit id
c73327b0f4d96f76a9b57eecdc7594a98c04ab62 ("i2c-ibm_iic: Remove deprecated
OCP style part") in today's linux-next tree if you want to compare.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 146 bytes --]

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/5] powerpc/ibm_iic: remove support for OCP
  2008-06-10 16:24   ` Stephen Rothwell
@ 2008-06-10 18:40     ` Arnd Bergmann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2008-06-10 18:40 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Stephen Rothwell, paulus, i2c, Ben Dooks

On Tuesday 10 June 2008, Stephen Rothwell wrote:
> There is already a patch in the i2c tree to do this one.  Commit id
> c73327b0f4d96f76a9b57eecdc7594a98c04ab62 ("i2c-ibm_iic: Remove deprecated
> OCP style part") in today's linux-next tree if you want to compare.

Ok, I removed it from my git tree now.

	Arnd <><

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-06-10 18:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20080610142702.354823071@arndb.de>
2008-06-10 14:27 ` [PATCH 3/5] powerpc/ibm_iic: remove support for OCP arnd-r2nGTMty4D4
     [not found]   ` <20080610142947.974805307-r2nGTMty4D4@public.gmane.org>
2008-06-10 16:00     ` Jean Delvare
2008-06-10 16:23   ` Josh Boyer
2008-06-10 16:24   ` Stephen Rothwell
2008-06-10 18:40     ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox