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/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
"Three more driver bugfixes, and two doc improvements fixing build
warnings while we are here"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: pca-platform: Use platform_irq_get_optional
i2c: st: fix missing struct parameter description
i2c: nvidia-gpu: Handle timeout correctly in gpu_i2c_check_status()
i2c: fix a doc warning
i2c: hix5hd2: add missed clk_disable_unprepare in remove

+12 -14
+1
drivers/i2c/busses/i2c-hix5hd2.c
··· 477 477 i2c_del_adapter(&priv->adap); 478 478 pm_runtime_disable(priv->dev); 479 479 pm_runtime_set_suspended(priv->dev); 480 + clk_disable_unprepare(priv->clk); 480 481 481 482 return 0; 482 483 }
+7 -11
drivers/i2c/busses/i2c-nvidia-gpu.c
··· 8 8 #include <linux/delay.h> 9 9 #include <linux/i2c.h> 10 10 #include <linux/interrupt.h> 11 + #include <linux/iopoll.h> 11 12 #include <linux/module.h> 12 13 #include <linux/pci.h> 13 14 #include <linux/platform_device.h> ··· 76 75 77 76 static int gpu_i2c_check_status(struct gpu_i2c_dev *i2cd) 78 77 { 79 - unsigned long target = jiffies + msecs_to_jiffies(1000); 80 78 u32 val; 79 + int ret; 81 80 82 - do { 83 - val = readl(i2cd->regs + I2C_MST_CNTL); 84 - if (!(val & I2C_MST_CNTL_CYCLE_TRIGGER)) 85 - break; 86 - if ((val & I2C_MST_CNTL_STATUS) != 87 - I2C_MST_CNTL_STATUS_BUS_BUSY) 88 - break; 89 - usleep_range(500, 600); 90 - } while (time_is_after_jiffies(target)); 81 + ret = readl_poll_timeout(i2cd->regs + I2C_MST_CNTL, val, 82 + !(val & I2C_MST_CNTL_CYCLE_TRIGGER) || 83 + (val & I2C_MST_CNTL_STATUS) != I2C_MST_CNTL_STATUS_BUS_BUSY, 84 + 500, 1000 * USEC_PER_MSEC); 91 85 92 - if (time_is_before_jiffies(target)) { 86 + if (ret) { 93 87 dev_err(i2cd->dev, "i2c timeout error %x\n", val); 94 88 return -ETIMEDOUT; 95 89 }
+1 -1
drivers/i2c/busses/i2c-pca-platform.c
··· 140 140 int ret = 0; 141 141 int irq; 142 142 143 - irq = platform_get_irq(pdev, 0); 143 + irq = platform_get_irq_optional(pdev, 0); 144 144 /* If irq is 0, we do polling. */ 145 145 if (irq < 0) 146 146 irq = 0;
+1
drivers/i2c/busses/i2c-st.c
··· 434 434 /** 435 435 * st_i2c_rd_fill_tx_fifo() - Fill the Tx FIFO in read mode 436 436 * @i2c_dev: Controller's private data 437 + * @max: Maximum amount of data to fill into the Tx FIFO 437 438 * 438 439 * This functions fills the Tx FIFO with fixed pattern when 439 440 * in read mode to trigger clock.
+2 -2
include/linux/i2c.h
··· 506 506 * @smbus_xfer_atomic: same as @smbus_xfer. Yet, only using atomic context 507 507 * so e.g. PMICs can be accessed very late before shutdown. Optional. 508 508 * @functionality: Return the flags that this algorithm/adapter pair supports 509 - * from the I2C_FUNC_* flags. 509 + * from the ``I2C_FUNC_*`` flags. 510 510 * @reg_slave: Register given client to I2C slave mode of this adapter 511 511 * @unreg_slave: Unregister given client from I2C slave mode of this adapter 512 512 * ··· 515 515 * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584 516 516 * to name two of the most common. 517 517 * 518 - * The return codes from the @master_xfer{_atomic} fields should indicate the 518 + * The return codes from the ``master_xfer{_atomic}`` fields should indicate the 519 519 * type of error code that occurred during the transfer, as documented in the 520 520 * Kernel Documentation file Documentation/i2c/fault-codes.rst. 521 521 */