Merge branch 'i2c/for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 4 Feb 2018 18:57:43 +0000 (10:57 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 4 Feb 2018 18:57:43 +0000 (10:57 -0800)
Pull i2c updates from Wolfram Sang:
 "I2C has the following changes for you:

   - new flag to mark DMA safe buffers in i2c_msg. Also, some
     infrastructure around it. And docs.

   - huge refactoring of the at24 driver led by the new maintainer
     Bartosz

   - update I2C bus recovery to send STOP after recovery

   - conversion from gpio to gpiod for I2C bus recovery

   - adding a fault-injector to the i2c-gpio driver

   - lots of small driver improvements, and bigger ones to
     i2c-sh_mobile"

* 'i2c/for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (99 commits)
  i2c: mv64xxx: Add myself as maintainer for this driver
  i2c: mv64xxx: Fix clock resource by adding an optional bus clock
  i2c: mv64xxx: Remove useless test before clk_disable_unprepare
  i2c: mxs: use true and false for boolean values
  i2c: meson: update doc description to fix build warnings
  i2c: meson: add configurable divider factors
  dt-bindings: i2c: update documentation for the Meson-AXG
  i2c: imx-lpi2c: add runtime pm support
  i2c: rcar: fix some trivial typos in comments
  i2c: davinci: fix the cpufreq transition
  i2c: rk3x: add proper kerneldoc header
  i2c: rk3x: account for const type of of_device_id.data
  i2c: acorn: remove outdated path from file header
  i2c: acorn: add MODULE_LICENSE tag
  i2c: rcar: implement bus recovery
  i2c: send STOP after successful bus recovery
  i2c: ensure SDA is released in recovery if SDA is controllable
  i2c: add 'set_sda' to bus_recovery_info
  i2c: add identifier in declarations for i2c_bus_recovery
  i2c: make kerneldoc about bus recovery more precise
  ...

1  2 
MAINTAINERS
drivers/i2c/busses/i2c-designware-core.h
drivers/i2c/busses/i2c-designware-platdrv.c
drivers/i2c/i2c-core-base.c
drivers/i2c/i2c-core-smbus.c

diff --cc MAINTAINERS
@@@ -6580,6 -6520,6 +6582,12 @@@ F:     drivers/i2c/i2c-mux.
  F:    drivers/i2c/muxes/
  F:    include/linux/i2c-mux.h
  
++I2C MV64XXX MARVELL AND ALLWINNER DRIVER
++M:    Gregory CLEMENT <gregory.clement@free-electrons.com>
++L:    linux-i2c@vger.kernel.org
++S:    Maintained
++F:    drivers/i2c/busses/i2c-mv64xxx.c
++
  I2C OVER PARALLEL PORT
  M:    Jean Delvare <jdelvare@suse.com>
  L:    linux-i2c@vger.kernel.org
@@@ -471,9 -430,16 +448,9 @@@ static int dw_i2c_plat_suspend(struct d
  {
        struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
  
 -      if (i_dev->suspended) {
 -              i_dev->skip_resume = true;
 -              return 0;
 -      }
 -
        i_dev->disable(i_dev);
-       i2c_dw_plat_prepare_clk(i_dev, false);
+       i2c_dw_prepare_clk(i_dev, false);
  
 -      i_dev->suspended = true;
 -
        return 0;
  }
  
@@@ -481,9 -447,19 +458,9 @@@ static int dw_i2c_plat_resume(struct de
  {
        struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
  
-       i2c_dw_plat_prepare_clk(i_dev, true);
 -      if (!i_dev->suspended)
 -              return 0;
 -
 -      if (i_dev->skip_resume) {
 -              i_dev->skip_resume = false;
 -              return 0;
 -      }
 -
+       i2c_dw_prepare_clk(i_dev, true);
        i_dev->init(i_dev);
  
 -      i_dev->suspended = false;
 -
        return 0;
  }
  
Simple merge
@@@ -395,21 -418,24 +418,25 @@@ static s32 i2c_smbus_xfer_emulated(stru
                msg[1].flags |= I2C_M_RECV_LEN;
                msg[1].len = 1; /* block length will be added by
                                   the underlying bus driver */
+               i2c_smbus_try_get_dmabuf(&msg[1], 0);
                break;
        case I2C_SMBUS_I2C_BLOCK_DATA:
 +              if (data->block[0] > I2C_SMBUS_BLOCK_MAX) {
 +                      dev_err(&adapter->dev, "Invalid block %s size %d\n",
 +                              read_write == I2C_SMBUS_READ ? "read" : "write",
 +                              data->block[0]);
 +                      return -EINVAL;
 +              }
 +
                if (read_write == I2C_SMBUS_READ) {
                        msg[1].len = data->block[0];
+                       i2c_smbus_try_get_dmabuf(&msg[1], 0);
                } else {
                        msg[0].len = data->block[0] + 1;
 -                      if (msg[0].len > I2C_SMBUS_BLOCK_MAX + 1) {
 -                              dev_err(&adapter->dev,
 -                                      "Invalid block write size %d\n",
 -                                      data->block[0]);
 -                              return -EINVAL;
 -                      }
+                       i2c_smbus_try_get_dmabuf(&msg[0], command);
                        for (i = 1; i <= data->block[0]; i++)
-                               msgbuf0[i] = data->block[i];
+                               msg[0].buf[i] = data->block[i];
                }
                break;
        default: