13 Jul, 2018

1 commit

  • I2C clients may misunderstand recovery pulses if they can't read SDA to
    bail out early. In the worst case, as a write operation. To avoid that
    and if we can write SDA, try to send STOP to avoid the
    misinterpretation.

    Signed-off-by: Wolfram Sang
    Reviewed-by: Peter Rosin
    Signed-off-by: Wolfram Sang
    Cc: stable@kernel.org

    Wolfram Sang
     

14 Jun, 2018

1 commit

  • Pull i2c updates from Wolfram Sang:

    - mainly feature additions to drivers (stm32f7, qup, xlp9xx, mlxcpld, ...)

    - conversion to use the i2c_8bit_addr_from_msg macro consistently

    - move includes to platform_data

    - core updates to allow the (still in review) I3C subsystem to connect

    - and the regular share of smaller driver updates

    * 'i2c/for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (68 commits)
    i2c: qup: fix building without CONFIG_ACPI
    i2c: tegra: Remove suspend-resume
    i2c: imx-lpi2c: Switch to SPDX identifier
    i2c: mxs: Switch to SPDX identifier
    i2c: busses: make use of i2c_8bit_addr_from_msg
    i2c: algos: make use of i2c_8bit_addr_from_msg
    i2c: rcar: document R8A77980 bindings
    i2c: qup: Add command-line parameter to override SCL frequency
    i2c: qup: Correct duty cycle for FM and FM+
    i2c: qup: Add support for Fast Mode Plus
    i2c: qup: add probe path for Centriq ACPI devices
    i2c: robotfuzz-osif: drop pointless test
    i2c: robotfuzz-osif: remove pointless local variable
    i2c: rk3x: Don't print visible virtual mapping MMIO address
    i2c: opal: don't check number of messages in the driver
    i2c: ibm_iic: don't check number of messages in the driver
    i2c: imx: Switch to SPDX identifier
    i2c: mux: pca954x: merge calls to of_match_device and of_device_get_match_data
    i2c: mux: demux-pinctrl: use proper parent device for demux adapter
    i2c: mux: improve error message for failed symlink
    ...

    Linus Torvalds
     

22 May, 2018

1 commit

  • Currently, of_i2c_register_devices() is responsible for retaining
    info->of_node, but we're about to expose a function to parse I2C board
    info without registering the I2C device.

    We could possibly let this function retain ->of_node, but this approach
    is prone to reference leak since people will have to remember to call
    of_node_put() if something goes wrong between the OF node parsing and
    the registration step.
    Let's just retain the ->of_node in i2c_new_register() instead.

    Signed-off-by: Boris Brezillon
    Signed-off-by: Wolfram Sang

    Boris Brezillon
     

15 May, 2018

2 commits


12 Apr, 2018

1 commit

  • The API docs describe i2c_transfer() as taking a pointer to an array
    of i2c_msg containing at least 1 entry, but leaves it to the individual
    drivers to sanity check the msgs and num parameters. Let's do this in
    core code instead.

    Signed-off-by: Ard Biesheuvel
    [wsa: changed '< 1']
    Signed-off-by: Wolfram Sang

    Ard Biesheuvel
     

04 Apr, 2018

1 commit

  • No changes in refcount semantics -- key init is false; replace

    static_key_slow_inc|dec with static_branch_inc|dec
    static_key_false with static_branch_unlikely

    Added a '_key' suffix to i2c_trace_msg, for better self
    documentation.

    Signed-off-by: Davidlohr Bueso
    Reviewed-by: David Howells
    Signed-off-by: Wolfram Sang

    Davidlohr Bueso
     

03 Apr, 2018

1 commit

  • According to the event i2c_result defined in include/trace/events/i2c.h,
    the second parameter should be the number of messages instead of the
    ended loop index. The value of ended loop index is the same as ret.

    Signed-off-by: Ahbong Chang
    Reviewed-by: Todd Poynor
    Reviewed-by: David Howells
    Signed-off-by: Wolfram Sang

    Ahbong Chang
     

24 Mar, 2018

1 commit


18 Mar, 2018

1 commit


06 Mar, 2018

1 commit


05 Mar, 2018

1 commit

  • The buses should honor the firmware interface used to register the device,
    but the I2C core reports a MODALIAS of the form i2c: even for I2C
    devices registered via OF.

    This means that user-space will never get an OF stype uevent MODALIAS even
    when the drivers modules contain aliases exported from both the I2C and OF
    device ID tables. For example, an Atmel maXTouch Touchscreen registered by
    a DT node with compatible "atmel,maxtouch" has the following module alias:

    $ cat /sys/class/i2c-adapter/i2c-8/8-004b/modalias
    i2c:maxtouch

    So udev won't be able to auto-load a module for an OF-only device driver.
    Many OF-only drivers duplicate the OF device ID table entries in an I2C ID
    table only has a workaround for how the I2C core reports the module alias.

    This patch changes the I2C core to report an OF related MODALIAS uevent if
    the device was registered via OF. So for the previous example, after this
    patch, the reported MODALIAS for the Atmel maXTouch will be the following:

    $ cat /sys/class/i2c-adapter/i2c-8/8-004b/modalias
    of:NtrackpadTCatmel,maxtouch

    NOTE: This patch may break out-of-tree drivers that were relying on this
    behavior, and only had an I2C device ID table even when the device
    was registered via OF. There are no remaining drivers in mainline
    that do this, but out-of-tree drivers have to be fixed and define
    a proper OF device ID table to have module auto-loading working.

    Signed-off-by: Javier Martinez Canillas
    Tested-by: Dmitry Mastykin
    Signed-off-by: Wolfram Sang

    Javier Martinez Canillas
     

05 Feb, 2018

1 commit

  • 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
    ...

    Linus Torvalds
     

17 Jan, 2018

1 commit


16 Jan, 2018

3 commits


04 Dec, 2017

2 commits

  • Those two functions are very similar, the only differences are that one
    needs the I2C_M_RD flag for its message while the other one needs the
    buffer casted to drop the const. Introduce a generic helper which allows
    to specify the flags (also needed later for DMA safe variants of these
    calls) and let the casting be done in the inlining functions which are
    now calling the new helper function.

    Signed-off-by: Wolfram Sang
    Reviewed-by: Jonathan Cameron
    Signed-off-by: Wolfram Sang

    Wolfram Sang
     
  • One helper checks if DMA is suitable and optionally creates a bounce
    buffer, if not. The other function returns the bounce buffer and makes
    sure the data is properly copied back to the message.

    Reviewed-by: Jonathan Cameron
    Signed-off-by: Wolfram Sang
    Signed-off-by: Wolfram Sang

    Wolfram Sang
     

28 Nov, 2017

3 commits

  • The correct header to include for the gpiod interface is
    .

    Fixes: 3991c5c80beaf7eb9 ("i2c: Switch to using gpiod interface for gpio bus recovery")
    Signed-off-by: Phil Reid
    Reviewed-by: Jarkko Nikula
    Signed-off-by: Wolfram Sang

    Phil Reid
     
  • Remove all reference to code related to using integer based ids for
    scl/sda gpio for bus recovery. All in tree drivers are now using the
    gpio descriptors to specific the required gpios.

    Reviewed-by: Andy Shevchenko
    Signed-off-by: Phil Reid
    Reviewed-by: Jarkko Nikula
    Signed-off-by: Wolfram Sang

    Phil Reid
     
  • Currently the i2c gpio recovery code uses gpio integer interface
    instead of the gpiod. This change switch the core code to use
    the gpiod while still retaining compatibility with the gpio integer
    interface. This will allow individual driver to be updated and tested
    individual to switch to using the gpiod interface.

    Reviewed-by: Jarkko Nikula
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Phil Reid
    Signed-off-by: Wolfram Sang

    Phil Reid
     

02 Nov, 2017

2 commits


29 Oct, 2017

2 commits


27 Oct, 2017

1 commit

  • For devices not instantiated through ACPI the i2c-client's device-name
    gets set to - by default, e.g. "0-0022" this means that
    the device-name is dependent on the order in which the i2c-busses are
    enumerated.

    In some cases having a predictable constant device-name is desirable,
    for example on non device-tree platforms the link between a regulator
    and its consumers is specified by the platform code by setting
    regulator_init_data.consumers. This array identifies the regulator's
    consumers by dev_name and supply(-name). Which requires a constant
    dev_name.

    This commit adds a dev_name field to i2c_board_info allowing
    platform code to set a contstant dev_name so that the device can
    be identified by its dev_name in other platform code.

    Signed-off-by: Hans de Goede
    Acked-by: Mark Brown (live at ELCE17)
    Acked-by: Andy Shevchenko (live at ELCE17)
    Signed-off-by: Wolfram Sang

    Hans de Goede
     

15 Aug, 2017

1 commit

  • I2C drivers were required to have an I2C device ID table even if were for
    devices that would only be registered using a specific firmware interface
    (e.g: OF or ACPI).

    But commit da10c06a044b ("i2c: Make I2C ID tables non-mandatory for DT'ed
    devices") changed the I2C core to relax the requirement and allow drivers
    to avoid defining this table.

    Unfortunately it only took into account drivers for OF-only devices and
    forgot about ACPI-only ones, and this was fixed by commit c64ffff7a9d1
    ("i2c: core: Allow empty id_table in ACPI case as well").

    But the latter didn't update the original comment, so it doesn't reflect
    what the code does now.

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Wolfram Sang

    Javier Martinez Canillas
     

31 Jul, 2017

1 commit

  • For now empty ID table is not allowed with ACPI and prevents driver to
    be probed.

    Add a check to allow empty ID table.

    This introduces a helper i2c_acpi_match_device().

    Note, we rename some static function in i2c-core-acpi.c to distinguish
    with public API.

    Fixes: da10c06a044b ("i2c: Make I2C ID tables non-mandatory for DT'ed devices")
    Signed-off-by: Andy Shevchenko
    Tested-by: Rajmohan Mani
    Acked-by: Mika Westerberg
    [wsa: needed to get some drivers probed again]
    Signed-off-by: Wolfram Sang

    Andy Shevchenko
     

01 Jun, 2017

7 commits