Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / i2c / algos / i2c-algo-ite.c
index 7405aac..2db7bfc 100644 (file)
@@ -107,14 +107,6 @@ static int wait_for_bb(struct i2c_algo_iic_data *adap)
        return(timeout<=0);
 }
 
-/*
- * Puts this process to sleep for a period equal to timeout 
- */
-static inline void iic_sleep(unsigned long timeout)
-{
-       schedule_timeout( timeout * HZ);
-}
-
 /* After we issue a transaction on the IIC bus, this function
  * is called.  It puts this process to sleep until we get an interrupt from
  * from the controller telling us that the transaction we requested in complete.
@@ -216,7 +208,7 @@ static int test_bus(struct i2c_algo_iic_data *adap, char *name) {
                goto bailout;
        }
        sdalo(adap);
-       printk("test_bus:1 scl: %d  sda: %d \n",getscl(adap),
+       printk("test_bus:1 scl: %d  sda: %d\n", getscl(adap),
               getsda(adap));
        if ( 0 != getsda(adap) ) {
                printk("test_bus: %s SDA stuck high!\n",name);
@@ -229,7 +221,7 @@ static int test_bus(struct i2c_algo_iic_data *adap, char *name) {
                goto bailout;
        }               
        sdahi(adap);
-       printk("test_bus:2 scl: %d  sda: %d \n",getscl(adap),
+       printk("test_bus:2 scl: %d  sda: %d\n", getscl(adap),
               getsda(adap));
        if ( 0 == getsda(adap) ) {
                printk("test_bus: %s SDA stuck low!\n",name);
@@ -242,7 +234,7 @@ static int test_bus(struct i2c_algo_iic_data *adap, char *name) {
        goto bailout;
        }
        scllo(adap);
-       printk("test_bus:3 scl: %d  sda: %d \n",getscl(adap),
+       printk("test_bus:3 scl: %d  sda: %d\n", getscl(adap),
               getsda(adap));
        if ( 0 != getscl(adap) ) {
 
@@ -255,7 +247,7 @@ static int test_bus(struct i2c_algo_iic_data *adap, char *name) {
                goto bailout;
        }
        sclhi(adap);
-       printk("test_bus:4 scl: %d  sda: %d \n",getscl(adap),
+       printk("test_bus:4 scl: %d  sda: %d\n", getscl(adap),
               getsda(adap));
        if ( 0 == getscl(adap) ) {
                printk("test_bus: %s SCL stuck low!\n",name);
@@ -498,7 +490,7 @@ static int iic_readbytes(struct i2c_adapter *i2c_adap, char *buf, int count,
  * condition.
  */
 #if 0
-static int iic_combined_transaction(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num) 
+static int iic_combined_transaction(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) 
 {
    int i;
    struct i2c_msg *pmsg;
@@ -608,7 +600,7 @@ static inline int iic_doAddress(struct i2c_algo_iic_data *adap,
  * verify that the bus is not busy or in some unknown state.
  */
 static int iic_xfer(struct i2c_adapter *i2c_adap,
-                   struct i2c_msg msgs[]
+                   struct i2c_msg *msgs
                    int num)
 {
        struct i2c_algo_iic_data *adap = i2c_adap->algo_data;
@@ -721,14 +713,9 @@ static u32 iic_func(struct i2c_adapter *adap)
 /* -----exported algorithm data: ------------------------------------- */
 
 static struct i2c_algorithm iic_algo = {
-       "ITE IIC algorithm",
-       I2C_ALGO_IIC,
-       iic_xfer,               /* master_xfer  */
-       NULL,                           /* smbus_xfer   */
-       NULL,                           /* slave_xmit           */
-       NULL,                           /* slave_recv           */
-       algo_control,                   /* ioctl                */
-       iic_func,                       /* functionality        */
+       .master_xfer    = iic_xfer,
+       .algo_control   = algo_control, /* ioctl */
+       .functionality  = iic_func,
 };
 
 
@@ -749,8 +736,6 @@ int i2c_iic_add_bus(struct i2c_adapter *adap)
                    adap->name));
 
        /* register new adapter to i2c module... */
-
-       adap->id |= iic_algo.id;
        adap->algo = &iic_algo;
 
        adap->timeout = 100;    /* default values, should       */