Commit 906c4043 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 83fd69c9 14c1fe69
...@@ -477,6 +477,7 @@ static int hix5hd2_i2c_remove(struct platform_device *pdev) ...@@ -477,6 +477,7 @@ static int hix5hd2_i2c_remove(struct platform_device *pdev)
i2c_del_adapter(&priv->adap); i2c_del_adapter(&priv->adap);
pm_runtime_disable(priv->dev); pm_runtime_disable(priv->dev);
pm_runtime_set_suspended(priv->dev); pm_runtime_set_suspended(priv->dev);
clk_disable_unprepare(priv->clk);
return 0; return 0;
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/iopoll.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
...@@ -75,20 +76,15 @@ static void gpu_enable_i2c_bus(struct gpu_i2c_dev *i2cd) ...@@ -75,20 +76,15 @@ static void gpu_enable_i2c_bus(struct gpu_i2c_dev *i2cd)
static int gpu_i2c_check_status(struct gpu_i2c_dev *i2cd) static int gpu_i2c_check_status(struct gpu_i2c_dev *i2cd)
{ {
unsigned long target = jiffies + msecs_to_jiffies(1000);
u32 val; u32 val;
int ret;
do { ret = readl_poll_timeout(i2cd->regs + I2C_MST_CNTL, val,
val = readl(i2cd->regs + I2C_MST_CNTL); !(val & I2C_MST_CNTL_CYCLE_TRIGGER) ||
if (!(val & I2C_MST_CNTL_CYCLE_TRIGGER)) (val & I2C_MST_CNTL_STATUS) != I2C_MST_CNTL_STATUS_BUS_BUSY,
break; 500, 1000 * USEC_PER_MSEC);
if ((val & I2C_MST_CNTL_STATUS) !=
I2C_MST_CNTL_STATUS_BUS_BUSY) if (ret) {
break;
usleep_range(500, 600);
} while (time_is_after_jiffies(target));
if (time_is_before_jiffies(target)) {
dev_err(i2cd->dev, "i2c timeout error %x\n", val); dev_err(i2cd->dev, "i2c timeout error %x\n", val);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
......
...@@ -140,7 +140,7 @@ static int i2c_pca_pf_probe(struct platform_device *pdev) ...@@ -140,7 +140,7 @@ static int i2c_pca_pf_probe(struct platform_device *pdev)
int ret = 0; int ret = 0;
int irq; int irq;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq_optional(pdev, 0);
/* If irq is 0, we do polling. */ /* If irq is 0, we do polling. */
if (irq < 0) if (irq < 0)
irq = 0; irq = 0;
......
...@@ -434,6 +434,7 @@ static void st_i2c_wr_fill_tx_fifo(struct st_i2c_dev *i2c_dev) ...@@ -434,6 +434,7 @@ static void st_i2c_wr_fill_tx_fifo(struct st_i2c_dev *i2c_dev)
/** /**
* st_i2c_rd_fill_tx_fifo() - Fill the Tx FIFO in read mode * st_i2c_rd_fill_tx_fifo() - Fill the Tx FIFO in read mode
* @i2c_dev: Controller's private data * @i2c_dev: Controller's private data
* @max: Maximum amount of data to fill into the Tx FIFO
* *
* This functions fills the Tx FIFO with fixed pattern when * This functions fills the Tx FIFO with fixed pattern when
* in read mode to trigger clock. * in read mode to trigger clock.
......
...@@ -506,7 +506,7 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info, ...@@ -506,7 +506,7 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info,
* @smbus_xfer_atomic: same as @smbus_xfer. Yet, only using atomic context * @smbus_xfer_atomic: same as @smbus_xfer. Yet, only using atomic context
* so e.g. PMICs can be accessed very late before shutdown. Optional. * so e.g. PMICs can be accessed very late before shutdown. Optional.
* @functionality: Return the flags that this algorithm/adapter pair supports * @functionality: Return the flags that this algorithm/adapter pair supports
* from the I2C_FUNC_* flags. * from the ``I2C_FUNC_*`` flags.
* @reg_slave: Register given client to I2C slave mode of this adapter * @reg_slave: Register given client to I2C slave mode of this adapter
* @unreg_slave: Unregister given client from I2C slave mode of this adapter * @unreg_slave: Unregister given client from I2C slave mode of this adapter
* *
...@@ -515,7 +515,7 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info, ...@@ -515,7 +515,7 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info,
* be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584 * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584
* to name two of the most common. * to name two of the most common.
* *
* The return codes from the @master_xfer{_atomic} fields should indicate the * The return codes from the ``master_xfer{_atomic}`` fields should indicate the
* type of error code that occurred during the transfer, as documented in the * type of error code that occurred during the transfer, as documented in the
* Kernel Documentation file Documentation/i2c/fault-codes.rst. * Kernel Documentation file Documentation/i2c/fault-codes.rst.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment