Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'i2c-embedded/for-current' of git://git.pengutronix.de/git/wsa/linux

Pull i2c embedded fixes from Wolfram Sang:
"The last bunch of (typical) i2c-embedded driver fixes for 3.6.

Also update the MAINTAINERS file to point to my tree since people keep
asking where to find their patches."

* 'i2c-embedded/for-current' of git://git.pengutronix.de/git/wsa/linux:
i2c: algo: pca: Fix mode selection for PCA9665
MAINTAINERS: fix tree for current i2c-embedded development
i2c: mxs: correctly setup speed for non devicetree
i2c: pnx: Fix read transactions of >= 2 bytes
i2c: pnx: Fix bit definitions

+42 -33
+1 -1
MAINTAINERS
··· 3388 3388 L: linux-i2c@vger.kernel.org 3389 3389 W: http://i2c.wiki.kernel.org/ 3390 3390 T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/ 3391 - T: git git://git.fluff.org/bjdooks/linux.git 3391 + T: git git://git.pengutronix.de/git/wsa/linux.git 3392 3392 S: Maintained 3393 3393 F: Documentation/i2c/ 3394 3394 F: drivers/i2c/
+3 -3
drivers/i2c/algos/i2c-algo-pca.c
··· 476 476 /* To avoid integer overflow, use clock/100 for calculations */ 477 477 clock = pca_clock(pca_data) / 100; 478 478 479 - if (pca_data->i2c_clock > 10000) { 479 + if (pca_data->i2c_clock > 1000000) { 480 480 mode = I2C_PCA_MODE_TURBO; 481 481 min_tlow = 14; 482 482 min_thi = 5; 483 483 raise_fall_time = 22; /* Raise 11e-8s, Fall 11e-8s */ 484 - } else if (pca_data->i2c_clock > 4000) { 484 + } else if (pca_data->i2c_clock > 400000) { 485 485 mode = I2C_PCA_MODE_FASTP; 486 486 min_tlow = 17; 487 487 min_thi = 9; 488 488 raise_fall_time = 22; /* Raise 11e-8s, Fall 11e-8s */ 489 - } else if (pca_data->i2c_clock > 1000) { 489 + } else if (pca_data->i2c_clock > 100000) { 490 490 mode = I2C_PCA_MODE_FAST; 491 491 min_tlow = 44; 492 492 min_thi = 20;
+6 -7
drivers/i2c/busses/i2c-mxs.c
··· 365 365 struct device_node *node = dev->of_node; 366 366 int ret; 367 367 368 - if (!node) 369 - return -EINVAL; 370 - 371 - i2c->speed = &mxs_i2c_95kHz_config; 372 368 ret = of_property_read_u32(node, "clock-frequency", &speed); 373 369 if (ret) 374 370 dev_warn(dev, "No I2C speed selected, using 100kHz\n"); ··· 415 419 return err; 416 420 417 421 i2c->dev = dev; 422 + i2c->speed = &mxs_i2c_95kHz_config; 418 423 419 - err = mxs_i2c_get_ofdata(i2c); 420 - if (err) 421 - return err; 424 + if (dev->of_node) { 425 + err = mxs_i2c_get_ofdata(i2c); 426 + if (err) 427 + return err; 428 + } 422 429 423 430 platform_set_drvdata(pdev, i2c); 424 431
+31 -22
drivers/i2c/busses/i2c-pnx.c
··· 48 48 mcntrl_afie = 0x00000002, 49 49 mcntrl_naie = 0x00000004, 50 50 mcntrl_drmie = 0x00000008, 51 - mcntrl_daie = 0x00000020, 52 - mcntrl_rffie = 0x00000040, 51 + mcntrl_drsie = 0x00000010, 52 + mcntrl_rffie = 0x00000020, 53 + mcntrl_daie = 0x00000040, 53 54 mcntrl_tffie = 0x00000080, 54 55 mcntrl_reset = 0x00000100, 55 56 mcntrl_cdbmode = 0x00000400, ··· 291 290 * or we didn't 'ask' for it yet. 292 291 */ 293 292 if (ioread32(I2C_REG_STS(alg_data)) & mstatus_rfe) { 294 - dev_dbg(&alg_data->adapter.dev, 295 - "%s(): Write dummy data to fill Rx-fifo...\n", 296 - __func__); 293 + /* 'Asking' is done asynchronously, e.g. dummy TX of several 294 + * bytes is done before the first actual RX arrives in FIFO. 295 + * Therefore, ordered bytes (via TX) are counted separately. 296 + */ 297 + if (alg_data->mif.order) { 298 + dev_dbg(&alg_data->adapter.dev, 299 + "%s(): Write dummy data to fill Rx-fifo...\n", 300 + __func__); 297 301 298 - if (alg_data->mif.len == 1) { 299 - /* Last byte, do not acknowledge next rcv. */ 300 - val |= stop_bit; 302 + if (alg_data->mif.order == 1) { 303 + /* Last byte, do not acknowledge next rcv. */ 304 + val |= stop_bit; 305 + 306 + /* 307 + * Enable interrupt RFDAIE (data in Rx fifo), 308 + * and disable DRMIE (need data for Tx) 309 + */ 310 + ctl = ioread32(I2C_REG_CTL(alg_data)); 311 + ctl |= mcntrl_rffie | mcntrl_daie; 312 + ctl &= ~mcntrl_drmie; 313 + iowrite32(ctl, I2C_REG_CTL(alg_data)); 314 + } 301 315 302 316 /* 303 - * Enable interrupt RFDAIE (data in Rx fifo), 304 - * and disable DRMIE (need data for Tx) 317 + * Now we'll 'ask' for data: 318 + * For each byte we want to receive, we must 319 + * write a (dummy) byte to the Tx-FIFO. 305 320 */ 306 - ctl = ioread32(I2C_REG_CTL(alg_data)); 307 - ctl |= mcntrl_rffie | mcntrl_daie; 308 - ctl &= ~mcntrl_drmie; 309 - iowrite32(ctl, I2C_REG_CTL(alg_data)); 321 + iowrite32(val, I2C_REG_TX(alg_data)); 322 + alg_data->mif.order--; 310 323 } 311 - 312 - /* 313 - * Now we'll 'ask' for data: 314 - * For each byte we want to receive, we must 315 - * write a (dummy) byte to the Tx-FIFO. 316 - */ 317 - iowrite32(val, I2C_REG_TX(alg_data)); 318 - 319 324 return 0; 320 325 } 321 326 ··· 521 514 522 515 alg_data->mif.buf = pmsg->buf; 523 516 alg_data->mif.len = pmsg->len; 517 + alg_data->mif.order = pmsg->len; 524 518 alg_data->mif.mode = (pmsg->flags & I2C_M_RD) ? 525 519 I2C_SMBUS_READ : I2C_SMBUS_WRITE; 526 520 alg_data->mif.ret = 0; ··· 574 566 /* Cleanup to be sure... */ 575 567 alg_data->mif.buf = NULL; 576 568 alg_data->mif.len = 0; 569 + alg_data->mif.order = 0; 577 570 578 571 dev_dbg(&alg_data->adapter.dev, "%s(): exiting, stat = %x\n", 579 572 __func__, ioread32(I2C_REG_STS(alg_data)));
+1
include/linux/i2c-pnx.h
··· 22 22 struct timer_list timer; /* Timeout */ 23 23 u8 * buf; /* Data buffer */ 24 24 int len; /* Length of data buffer */ 25 + int order; /* RX Bytes to order via TX */ 25 26 }; 26 27 27 28 struct i2c_pnx_algo_data {