diff options
Diffstat (limited to 'drivers/i2c/algos')
-rw-r--r-- | drivers/i2c/algos/i2c-algo-bit.c | 4 | ||||
-rw-r--r-- | drivers/i2c/algos/i2c-algo-ite.c | 4 | ||||
-rw-r--r-- | drivers/i2c/algos/i2c-algo-pca.c | 16 | ||||
-rw-r--r-- | drivers/i2c/algos/i2c-algo-pcf.c | 4 | ||||
-rw-r--r-- | drivers/i2c/algos/i2c-algo-sgi.c | 5 | ||||
-rw-r--r-- | drivers/i2c/algos/i2c-algo-sibyte.c | 4 |
6 files changed, 8 insertions, 29 deletions
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c index fb5b732238ed..df05df1a0ef6 100644 --- a/drivers/i2c/algos/i2c-algo-bit.c +++ b/drivers/i2c/algos/i2c-algo-bit.c | |||
@@ -519,8 +519,6 @@ static u32 bit_func(struct i2c_adapter *adap) | |||
519 | /* -----exported algorithm data: ------------------------------------- */ | 519 | /* -----exported algorithm data: ------------------------------------- */ |
520 | 520 | ||
521 | static struct i2c_algorithm i2c_bit_algo = { | 521 | static struct i2c_algorithm i2c_bit_algo = { |
522 | .name = "Bit-shift algorithm", | ||
523 | .id = I2C_ALGO_BIT, | ||
524 | .master_xfer = bit_xfer, | 522 | .master_xfer = bit_xfer, |
525 | .functionality = bit_func, | 523 | .functionality = bit_func, |
526 | }; | 524 | }; |
@@ -541,8 +539,6 @@ int i2c_bit_add_bus(struct i2c_adapter *adap) | |||
541 | DEB2(dev_dbg(&adap->dev, "hw routines registered.\n")); | 539 | DEB2(dev_dbg(&adap->dev, "hw routines registered.\n")); |
542 | 540 | ||
543 | /* register new adapter to i2c module... */ | 541 | /* register new adapter to i2c module... */ |
544 | |||
545 | adap->id |= i2c_bit_algo.id; | ||
546 | adap->algo = &i2c_bit_algo; | 542 | adap->algo = &i2c_bit_algo; |
547 | 543 | ||
548 | adap->timeout = 100; /* default values, should */ | 544 | adap->timeout = 100; /* default values, should */ |
diff --git a/drivers/i2c/algos/i2c-algo-ite.c b/drivers/i2c/algos/i2c-algo-ite.c index e6cae39f47aa..2db7bfc85225 100644 --- a/drivers/i2c/algos/i2c-algo-ite.c +++ b/drivers/i2c/algos/i2c-algo-ite.c | |||
@@ -713,8 +713,6 @@ static u32 iic_func(struct i2c_adapter *adap) | |||
713 | /* -----exported algorithm data: ------------------------------------- */ | 713 | /* -----exported algorithm data: ------------------------------------- */ |
714 | 714 | ||
715 | static struct i2c_algorithm iic_algo = { | 715 | static struct i2c_algorithm iic_algo = { |
716 | .name = "ITE IIC algorithm", | ||
717 | .id = I2C_ALGO_IIC, | ||
718 | .master_xfer = iic_xfer, | 716 | .master_xfer = iic_xfer, |
719 | .algo_control = algo_control, /* ioctl */ | 717 | .algo_control = algo_control, /* ioctl */ |
720 | .functionality = iic_func, | 718 | .functionality = iic_func, |
@@ -738,8 +736,6 @@ int i2c_iic_add_bus(struct i2c_adapter *adap) | |||
738 | adap->name)); | 736 | adap->name)); |
739 | 737 | ||
740 | /* register new adapter to i2c module... */ | 738 | /* register new adapter to i2c module... */ |
741 | |||
742 | adap->id |= iic_algo.id; | ||
743 | adap->algo = &iic_algo; | 739 | adap->algo = &iic_algo; |
744 | 740 | ||
745 | adap->timeout = 100; /* default values, should */ | 741 | adap->timeout = 100; /* default values, should */ |
diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c index cc3a952401f2..beb10edfe9c1 100644 --- a/drivers/i2c/algos/i2c-algo-pca.c +++ b/drivers/i2c/algos/i2c-algo-pca.c | |||
@@ -187,12 +187,14 @@ static int pca_xfer(struct i2c_adapter *i2c_adap, | |||
187 | int numbytes = 0; | 187 | int numbytes = 0; |
188 | int state; | 188 | int state; |
189 | int ret; | 189 | int ret; |
190 | int timeout = 100; | ||
190 | 191 | ||
191 | state = pca_status(adap); | 192 | while ((state = pca_status(adap)) != 0xf8 && timeout--) { |
192 | if ( state != 0xF8 ) { | 193 | msleep(10); |
193 | dev_dbg(&i2c_adap->dev, "bus is not idle. status is %#04x\n", state ); | 194 | } |
194 | /* FIXME: what to do. Force stop ? */ | 195 | if (state != 0xf8) { |
195 | return -EREMOTEIO; | 196 | dev_dbg(&i2c_adap->dev, "bus is not idle. status is %#04x\n", state); |
197 | return -EIO; | ||
196 | } | 198 | } |
197 | 199 | ||
198 | DEB1("{{{ XFER %d messages\n", num); | 200 | DEB1("{{{ XFER %d messages\n", num); |
@@ -354,8 +356,6 @@ static int pca_init(struct i2c_algo_pca_data *adap) | |||
354 | } | 356 | } |
355 | 357 | ||
356 | static struct i2c_algorithm pca_algo = { | 358 | static struct i2c_algorithm pca_algo = { |
357 | .name = "PCA9564 algorithm", | ||
358 | .id = I2C_ALGO_PCA, | ||
359 | .master_xfer = pca_xfer, | 359 | .master_xfer = pca_xfer, |
360 | .functionality = pca_func, | 360 | .functionality = pca_func, |
361 | }; | 361 | }; |
@@ -369,8 +369,6 @@ int i2c_pca_add_bus(struct i2c_adapter *adap) | |||
369 | int rval; | 369 | int rval; |
370 | 370 | ||
371 | /* register new adapter to i2c module... */ | 371 | /* register new adapter to i2c module... */ |
372 | |||
373 | adap->id |= pca_algo.id; | ||
374 | adap->algo = &pca_algo; | 372 | adap->algo = &pca_algo; |
375 | 373 | ||
376 | adap->timeout = 100; /* default values, should */ | 374 | adap->timeout = 100; /* default values, should */ |
diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c index 8d087dac32af..6e498df1f717 100644 --- a/drivers/i2c/algos/i2c-algo-pcf.c +++ b/drivers/i2c/algos/i2c-algo-pcf.c | |||
@@ -459,8 +459,6 @@ static u32 pcf_func(struct i2c_adapter *adap) | |||
459 | /* -----exported algorithm data: ------------------------------------- */ | 459 | /* -----exported algorithm data: ------------------------------------- */ |
460 | 460 | ||
461 | static struct i2c_algorithm pcf_algo = { | 461 | static struct i2c_algorithm pcf_algo = { |
462 | .name = "PCF8584 algorithm", | ||
463 | .id = I2C_ALGO_PCF, | ||
464 | .master_xfer = pcf_xfer, | 462 | .master_xfer = pcf_xfer, |
465 | .functionality = pcf_func, | 463 | .functionality = pcf_func, |
466 | }; | 464 | }; |
@@ -476,8 +474,6 @@ int i2c_pcf_add_bus(struct i2c_adapter *adap) | |||
476 | DEB2(dev_dbg(&adap->dev, "hw routines registered.\n")); | 474 | DEB2(dev_dbg(&adap->dev, "hw routines registered.\n")); |
477 | 475 | ||
478 | /* register new adapter to i2c module... */ | 476 | /* register new adapter to i2c module... */ |
479 | |||
480 | adap->id |= pcf_algo.id; | ||
481 | adap->algo = &pcf_algo; | 477 | adap->algo = &pcf_algo; |
482 | 478 | ||
483 | adap->timeout = 100; /* default values, should */ | 479 | adap->timeout = 100; /* default values, should */ |
diff --git a/drivers/i2c/algos/i2c-algo-sgi.c b/drivers/i2c/algos/i2c-algo-sgi.c index 422721b241e5..932c4fa86c73 100644 --- a/drivers/i2c/algos/i2c-algo-sgi.c +++ b/drivers/i2c/algos/i2c-algo-sgi.c | |||
@@ -149,7 +149,7 @@ static int sgi_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, | |||
149 | err = i2c_write(adap, p->buf, p->len); | 149 | err = i2c_write(adap, p->buf, p->len); |
150 | } | 150 | } |
151 | 151 | ||
152 | return err; | 152 | return (err < 0) ? err : i; |
153 | } | 153 | } |
154 | 154 | ||
155 | static u32 sgi_func(struct i2c_adapter *adap) | 155 | static u32 sgi_func(struct i2c_adapter *adap) |
@@ -158,8 +158,6 @@ static u32 sgi_func(struct i2c_adapter *adap) | |||
158 | } | 158 | } |
159 | 159 | ||
160 | static struct i2c_algorithm sgi_algo = { | 160 | static struct i2c_algorithm sgi_algo = { |
161 | .name = "SGI algorithm", | ||
162 | .id = I2C_ALGO_SGI, | ||
163 | .master_xfer = sgi_xfer, | 161 | .master_xfer = sgi_xfer, |
164 | .functionality = sgi_func, | 162 | .functionality = sgi_func, |
165 | }; | 163 | }; |
@@ -169,7 +167,6 @@ static struct i2c_algorithm sgi_algo = { | |||
169 | */ | 167 | */ |
170 | int i2c_sgi_add_bus(struct i2c_adapter *adap) | 168 | int i2c_sgi_add_bus(struct i2c_adapter *adap) |
171 | { | 169 | { |
172 | adap->id |= sgi_algo.id; | ||
173 | adap->algo = &sgi_algo; | 170 | adap->algo = &sgi_algo; |
174 | 171 | ||
175 | return i2c_add_adapter(adap); | 172 | return i2c_add_adapter(adap); |
diff --git a/drivers/i2c/algos/i2c-algo-sibyte.c b/drivers/i2c/algos/i2c-algo-sibyte.c index f2785499237b..8ed5ad12552f 100644 --- a/drivers/i2c/algos/i2c-algo-sibyte.c +++ b/drivers/i2c/algos/i2c-algo-sibyte.c | |||
@@ -135,8 +135,6 @@ static u32 bit_func(struct i2c_adapter *adap) | |||
135 | /* -----exported algorithm data: ------------------------------------- */ | 135 | /* -----exported algorithm data: ------------------------------------- */ |
136 | 136 | ||
137 | static struct i2c_algorithm i2c_sibyte_algo = { | 137 | static struct i2c_algorithm i2c_sibyte_algo = { |
138 | .name = "SiByte algorithm", | ||
139 | .id = I2C_ALGO_SIBYTE, | ||
140 | .smbus_xfer = smbus_xfer, | 138 | .smbus_xfer = smbus_xfer, |
141 | .algo_control = algo_control, /* ioctl */ | 139 | .algo_control = algo_control, /* ioctl */ |
142 | .functionality = bit_func, | 140 | .functionality = bit_func, |
@@ -151,8 +149,6 @@ int i2c_sibyte_add_bus(struct i2c_adapter *i2c_adap, int speed) | |||
151 | struct i2c_algo_sibyte_data *adap = i2c_adap->algo_data; | 149 | struct i2c_algo_sibyte_data *adap = i2c_adap->algo_data; |
152 | 150 | ||
153 | /* register new adapter to i2c module... */ | 151 | /* register new adapter to i2c module... */ |
154 | |||
155 | i2c_adap->id |= i2c_sibyte_algo.id; | ||
156 | i2c_adap->algo = &i2c_sibyte_algo; | 152 | i2c_adap->algo = &i2c_sibyte_algo; |
157 | 153 | ||
158 | /* Set the frequency to 100 kHz */ | 154 | /* Set the frequency to 100 kHz */ |