All of lore.kernel.org
 help / color / mirror / Atom feed
From: greg@kroah.com (Greg KH)
To: linux-kernel@vger.kernel.org, sensors@stimpy.netroedge.com
Subject: [PATCH] i2c driver fixes for 2.6.0
Date: Thu, 19 May 2005 06:24:32 +0000	[thread overview]
Message-ID: <10728219713483@kroah.com> (raw)
In-Reply-To: <10728219711770@kroah.com>
In-Reply-To: <10728219692713@kroah.com>

ChangeSet 1.1496.8.37, 2003/12/30 12:09:49-08:00, khali@linux-fr.org

[PATCH] I2C: remove bus scan logic from i2c chip drivers

This patch drops bus scan from i2c-algo-ite and i2c-ibm_iic. It also
removes the incomplete and broken SLO_IO stuff from i2c-algo-ite.


 drivers/i2c/algos/i2c-algo-ite.c |   36 ------------------------------------
 drivers/i2c/busses/i2c-ibm_iic.c |   34 ----------------------------------
 2 files changed, 70 deletions(-)


diff -Nru a/drivers/i2c/algos/i2c-algo-ite.c b/drivers/i2c/algos/i2c-algo-ite.c
--- a/drivers/i2c/algos/i2c-algo-ite.c	Tue Dec 30 12:28:59 2003
+++ b/drivers/i2c/algos/i2c-algo-ite.c	Tue Dec 30 12:28:59 2003
@@ -60,27 +60,13 @@
  	/* debug the protocol by showing transferred bits */
 #define DEF_TIMEOUT 16
 
-/* debugging - slow down transfer to have a look at the data .. 	*/
-/* I use this with two leds&resistors, each one connected to sda,scl 	*/
-/* respectively. This makes sure that the algorithm works. Some chips   */
-/* might not like this, as they have an internal timeout of some mils	*/
-/*
-#define SLO_IO      jif=jiffies;while(jiffies<=jif+i2c_table[minor].veryslow)\
-                        cond_resched();
-*/
-
 
 /* ----- global variables ---------------------------------------------	*/
 
-#ifdef SLO_IO
-	int jif;
-#endif
-
 /* module parameters:
  */
 static int i2c_debug=1;
 static int iic_test=0;	/* see if the line-setting functions work	*/
-static int iic_scan=0;	/* have a look at what's hanging 'round		*/
 
 /* --- setting states on the bus with the right timing: ---------------	*/
 
@@ -757,8 +743,6 @@
  */
 int i2c_iic_add_bus(struct i2c_adapter *adap)
 {
-	int i;
-	short status;
 	struct i2c_algo_iic_data *iic_adap = adap->algo_data;
 
 	if (iic_test) {
@@ -782,24 +766,6 @@
 	i2c_add_adapter(adap);
 	iic_init(iic_adap);
 
-	/* scan bus */
-	/* By default scanning the bus is turned off. */
-	if (iic_scan) {
-		printk(KERN_INFO " i2c-algo-ite: scanning bus %s.\n",
-		       adap->name);
-		for (i = 0x00; i < 0xff; i+=2) {
-			iic_outw(iic_adap, ITE_I2CSAR, i);
-			iic_start(iic_adap);
-			if ( (wait_for_pin(iic_adap, &status) = 0) && 
-			    ((status & ITE_I2CHSR_DNE) = 0) ) { 
-				printk(KERN_INFO "\n(%02x)\n",i>>1); 
-			} else {
-				printk(KERN_INFO "."); 
-				iic_reset(iic_adap);
-			}
-			udelay(iic_adap->udelay);
-		}
-	}
 	return 0;
 }
 
@@ -839,11 +805,9 @@
 MODULE_LICENSE("GPL");
 
 MODULE_PARM(iic_test, "i");
-MODULE_PARM(iic_scan, "i");
 MODULE_PARM(i2c_debug,"i");
 
 MODULE_PARM_DESC(iic_test, "Test if the I2C bus is available");
-MODULE_PARM_DESC(iic_scan, "Scan for active chips on the bus");
 MODULE_PARM_DESC(i2c_debug,
         "debug level - 0 off; 1 normal; 2,3 more verbose; 9 iic-protocol");
 
diff -Nru a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
--- a/drivers/i2c/busses/i2c-ibm_iic.c	Tue Dec 30 12:28:59 2003
+++ b/drivers/i2c/busses/i2c-ibm_iic.c	Tue Dec 30 12:28:59 2003
@@ -48,10 +48,6 @@
 MODULE_DESCRIPTION("IBM IIC driver v" DRIVER_VERSION);
 MODULE_LICENSE("GPL");
 
-static int iic_scan = 0;
-MODULE_PARM(iic_scan, "i");
-MODULE_PARM_DESC(iic_scan, "Scan for active chips on the bus");
-
 static int iic_force_poll = 0;
 MODULE_PARM(iic_force_poll, "i");
 MODULE_PARM_DESC(iic_force_poll, "Force polling mode");
@@ -518,32 +514,6 @@
 };
 
 /*
- * Scan bus for valid 7-bit addresses (ie things that ACK on 1 byte read)
- * We only scan range [0x08 - 0x77], all other addresses are reserved anyway
- */
-static void __devinit iic_scan_bus(struct ibm_iic_private* dev)
-{
-	int found = 0;
-	char dummy;
-	struct i2c_msg msg = {
-		.buf   = &dummy,
-		.len   = sizeof(dummy),
-		.flags = I2C_M_RD
-	};
-	
-	printk(KERN_INFO "ibm-iic%d: scanning bus...\n" KERN_INFO, dev->idx);
-	
-	for (msg.addr = 8; msg.addr < 0x78; ++msg.addr)
-		if (iic_xfer(&dev->adap, &msg, 1) = 1){
-			++found;
-			printk(" 0x%02x", msg.addr);
-		}
-
-	printk("%sibm-iic%d: %d device(s) detected\n", 
-		found ? "\n" KERN_INFO : "", dev->idx, found);
-}
-
-/*
  * Calculates IICx_CLCKDIV value for a specific OPB clock frequency
  */
 static inline u8 iic_clckdiv(unsigned int opb)
@@ -648,10 +618,6 @@
 	
 	printk(KERN_INFO "ibm-iic%d: using %s mode\n", dev->idx,
 		dev->fast_mode ? "fast (400 kHz)" : "standard (100 kHz)");
-
-	/* Scan bus if requested by user */
-	if (iic_scan)
-		iic_scan_bus(dev);
 
 	return 0;
 


WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org, sensors@stimpy.netroedge.com
Subject: Re: [PATCH] i2c driver fixes for 2.6.0
Date: Tue, 30 Dec 2003 14:06:11 -0800	[thread overview]
Message-ID: <10728219713483@kroah.com> (raw)
In-Reply-To: <10728219711770@kroah.com>

ChangeSet 1.1496.8.37, 2003/12/30 12:09:49-08:00, khali@linux-fr.org

[PATCH] I2C: remove bus scan logic from i2c chip drivers

This patch drops bus scan from i2c-algo-ite and i2c-ibm_iic. It also
removes the incomplete and broken SLO_IO stuff from i2c-algo-ite.


 drivers/i2c/algos/i2c-algo-ite.c |   36 ------------------------------------
 drivers/i2c/busses/i2c-ibm_iic.c |   34 ----------------------------------
 2 files changed, 70 deletions(-)


diff -Nru a/drivers/i2c/algos/i2c-algo-ite.c b/drivers/i2c/algos/i2c-algo-ite.c
--- a/drivers/i2c/algos/i2c-algo-ite.c	Tue Dec 30 12:28:59 2003
+++ b/drivers/i2c/algos/i2c-algo-ite.c	Tue Dec 30 12:28:59 2003
@@ -60,27 +60,13 @@
  	/* debug the protocol by showing transferred bits */
 #define DEF_TIMEOUT 16
 
-/* debugging - slow down transfer to have a look at the data .. 	*/
-/* I use this with two leds&resistors, each one connected to sda,scl 	*/
-/* respectively. This makes sure that the algorithm works. Some chips   */
-/* might not like this, as they have an internal timeout of some mils	*/
-/*
-#define SLO_IO      jif=jiffies;while(jiffies<=jif+i2c_table[minor].veryslow)\
-                        cond_resched();
-*/
-
 
 /* ----- global variables ---------------------------------------------	*/
 
-#ifdef SLO_IO
-	int jif;
-#endif
-
 /* module parameters:
  */
 static int i2c_debug=1;
 static int iic_test=0;	/* see if the line-setting functions work	*/
-static int iic_scan=0;	/* have a look at what's hanging 'round		*/
 
 /* --- setting states on the bus with the right timing: ---------------	*/
 
@@ -757,8 +743,6 @@
  */
 int i2c_iic_add_bus(struct i2c_adapter *adap)
 {
-	int i;
-	short status;
 	struct i2c_algo_iic_data *iic_adap = adap->algo_data;
 
 	if (iic_test) {
@@ -782,24 +766,6 @@
 	i2c_add_adapter(adap);
 	iic_init(iic_adap);
 
-	/* scan bus */
-	/* By default scanning the bus is turned off. */
-	if (iic_scan) {
-		printk(KERN_INFO " i2c-algo-ite: scanning bus %s.\n",
-		       adap->name);
-		for (i = 0x00; i < 0xff; i+=2) {
-			iic_outw(iic_adap, ITE_I2CSAR, i);
-			iic_start(iic_adap);
-			if ( (wait_for_pin(iic_adap, &status) == 0) && 
-			    ((status & ITE_I2CHSR_DNE) == 0) ) { 
-				printk(KERN_INFO "\n(%02x)\n",i>>1); 
-			} else {
-				printk(KERN_INFO "."); 
-				iic_reset(iic_adap);
-			}
-			udelay(iic_adap->udelay);
-		}
-	}
 	return 0;
 }
 
@@ -839,11 +805,9 @@
 MODULE_LICENSE("GPL");
 
 MODULE_PARM(iic_test, "i");
-MODULE_PARM(iic_scan, "i");
 MODULE_PARM(i2c_debug,"i");
 
 MODULE_PARM_DESC(iic_test, "Test if the I2C bus is available");
-MODULE_PARM_DESC(iic_scan, "Scan for active chips on the bus");
 MODULE_PARM_DESC(i2c_debug,
         "debug level - 0 off; 1 normal; 2,3 more verbose; 9 iic-protocol");
 
diff -Nru a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
--- a/drivers/i2c/busses/i2c-ibm_iic.c	Tue Dec 30 12:28:59 2003
+++ b/drivers/i2c/busses/i2c-ibm_iic.c	Tue Dec 30 12:28:59 2003
@@ -48,10 +48,6 @@
 MODULE_DESCRIPTION("IBM IIC driver v" DRIVER_VERSION);
 MODULE_LICENSE("GPL");
 
-static int iic_scan = 0;
-MODULE_PARM(iic_scan, "i");
-MODULE_PARM_DESC(iic_scan, "Scan for active chips on the bus");
-
 static int iic_force_poll = 0;
 MODULE_PARM(iic_force_poll, "i");
 MODULE_PARM_DESC(iic_force_poll, "Force polling mode");
@@ -518,32 +514,6 @@
 };
 
 /*
- * Scan bus for valid 7-bit addresses (ie things that ACK on 1 byte read)
- * We only scan range [0x08 - 0x77], all other addresses are reserved anyway
- */
-static void __devinit iic_scan_bus(struct ibm_iic_private* dev)
-{
-	int found = 0;
-	char dummy;
-	struct i2c_msg msg = {
-		.buf   = &dummy,
-		.len   = sizeof(dummy),
-		.flags = I2C_M_RD
-	};
-	
-	printk(KERN_INFO "ibm-iic%d: scanning bus...\n" KERN_INFO, dev->idx);
-	
-	for (msg.addr = 8; msg.addr < 0x78; ++msg.addr)
-		if (iic_xfer(&dev->adap, &msg, 1) == 1){
-			++found;
-			printk(" 0x%02x", msg.addr);
-		}
-
-	printk("%sibm-iic%d: %d device(s) detected\n", 
-		found ? "\n" KERN_INFO : "", dev->idx, found);
-}
-
-/*
  * Calculates IICx_CLCKDIV value for a specific OPB clock frequency
  */
 static inline u8 iic_clckdiv(unsigned int opb)
@@ -648,10 +618,6 @@
 	
 	printk(KERN_INFO "ibm-iic%d: using %s mode\n", dev->idx,
 		dev->fast_mode ? "fast (400 kHz)" : "standard (100 kHz)");
-
-	/* Scan bus if requested by user */
-	if (iic_scan)
-		iic_scan_bus(dev);
 
 	return 0;
 


  parent reply	other threads:[~2005-05-19  6:24 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-30 22:02 [BK PATCH] i2c driver fixes for 2.6.0 Greg KH
2005-05-19  6:24 ` Greg KH
2003-12-30 22:06 ` [PATCH] " Greg KH
2005-05-19  6:24   ` Greg KH
2003-12-30 22:06   ` Greg KH
2005-05-19  6:24     ` Greg KH
2003-12-30 22:06     ` Greg KH
2005-05-19  6:24       ` Greg KH
2003-12-30 22:06       ` Greg KH
2005-05-19  6:24         ` Greg KH
2003-12-30 22:06         ` Greg KH
2005-05-19  6:24           ` Greg KH
2003-12-30 22:06           ` Greg KH
2005-05-19  6:24             ` Greg KH
2003-12-30 22:06             ` Greg KH
2005-05-19  6:24               ` Greg KH
2003-12-30 22:06               ` Greg KH
2005-05-19  6:24                 ` Greg KH
2003-12-30 22:06                 ` Greg KH
2005-05-19  6:24                   ` Greg KH
2003-12-30 22:06                   ` Greg KH
2005-05-19  6:24                     ` Greg KH
2003-12-30 22:06                     ` Greg KH
2005-05-19  6:24                       ` Greg KH
2003-12-30 22:06                       ` Greg KH
2005-05-19  6:24                         ` Greg KH
2003-12-30 22:06                         ` Greg KH [this message]
2005-05-19  6:24                           ` Greg KH
2003-12-30 22:06                           ` Greg KH
2005-05-19  6:24                             ` Greg KH
2003-12-30 22:06                             ` Greg KH
2005-05-19  6:24                               ` Greg KH
2003-12-30 22:06                               ` Greg KH
2005-05-19  6:24                                 ` Greg KH
2003-12-30 22:06                                 ` Greg KH
2005-05-19  6:24                                   ` Greg KH
2003-12-30 22:06                                   ` Greg KH
2005-05-19  6:24                                     ` Greg KH
2003-12-30 22:06                                     ` Greg KH
2005-05-19  6:24                                       ` Greg KH
2003-12-30 22:06                                       ` Greg KH
2005-05-19  6:24                                         ` Greg KH
2003-12-30 22:06                                         ` Greg KH
2005-05-19  6:24                                           ` Greg KH
2003-12-30 22:06                                           ` Greg KH
2005-05-19  6:24                                             ` Greg KH
2003-12-30 22:06                                             ` Greg KH
2005-05-19  6:24                                               ` Greg KH
2005-05-19  6:24   ` Rusty Russell
2005-05-19  6:24   ` Greg KH
2005-05-19  6:24   ` Tom Rini
2005-05-19  6:24   ` Jean Delvare
2005-05-19  6:24   ` Rusty Russell
2005-05-19  6:24   ` Rusty Russell
2005-05-19  6:24   ` Jean Delvare
2005-05-19  6:24   ` Greg KH
2005-05-19  6:24   ` Greg KH

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=10728219713483@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sensors@stimpy.netroedge.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.