1. 27 Sep, 2020 7 commits
    • Krzysztof Kozlowski's avatar
      dt-bindings: i2c: imx-lpi2c: Fix i.MX 8QXP compatible matching · 755f6292
      Krzysztof Kozlowski authored
      The i.MX 8QXP DTSes use two compatibles so update the binding to fix
      dtbs_check warnings like:
      
        arch/arm64/boot/dts/freescale/imx8qxp-mek.dt.yaml: i2c@5a820000:
          compatible: ['fsl,imx8qxp-lpi2c', 'fsl,imx7ulp-lpi2c'] is too long
      Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      755f6292
    • Krzysztof Kozlowski's avatar
      dt-bindings: i2c: imx-lpi2c: Add properties and use unevaluatedProperties · 41c38c27
      Krzysztof Kozlowski authored
      Additional properties actually might appear (e.g. power-domains) so
      describe all typical properties, reference generic i2c schema and use
      unevaluatedProperties to fix dtbs_check warnings like:
      
        arch/arm64/boot/dts/freescale/imx8qxp-ai_ml.dt.yaml: i2c@5a800000:
          'assigned-clock-rates', 'assigned-clocks', 'clock-names', 'power-domains' do not match any of the regexes: 'pinctrl-[0-9]+'
      
        arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dt.yaml: i2c@5a800000:
          'touchscreen@2c' does not match any of the regexes: 'pinctrl-[0-9]+'
      Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      41c38c27
    • Krzysztof Kozlowski's avatar
      i2c: imx: Fix external abort on interrupt in exit paths · e50e4f0b
      Krzysztof Kozlowski authored
      If interrupt comes late, during probe error path or device remove (could
      be triggered with CONFIG_DEBUG_SHIRQ), the interrupt handler
      i2c_imx_isr() will access registers with the clock being disabled.  This
      leads to external abort on non-linefetch on Toradex Colibri VF50 module
      (with Vybrid VF5xx):
      
          Unhandled fault: external abort on non-linefetch (0x1008) at 0x8882d003
          Internal error: : 1008 [#1] ARM
          Modules linked in:
          CPU: 0 PID: 1 Comm: swapper Not tainted 5.7.0 #607
          Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
            (i2c_imx_isr) from [<8017009c>] (free_irq+0x25c/0x3b0)
            (free_irq) from [<805844ec>] (release_nodes+0x178/0x284)
            (release_nodes) from [<80580030>] (really_probe+0x10c/0x348)
            (really_probe) from [<80580380>] (driver_probe_device+0x60/0x170)
            (driver_probe_device) from [<80580630>] (device_driver_attach+0x58/0x60)
            (device_driver_attach) from [<805806bc>] (__driver_attach+0x84/0xc0)
            (__driver_attach) from [<8057e228>] (bus_for_each_dev+0x68/0xb4)
            (bus_for_each_dev) from [<8057f3ec>] (bus_add_driver+0x144/0x1ec)
            (bus_add_driver) from [<80581320>] (driver_register+0x78/0x110)
            (driver_register) from [<8010213c>] (do_one_initcall+0xa8/0x2f4)
            (do_one_initcall) from [<80c0100c>] (kernel_init_freeable+0x178/0x1dc)
            (kernel_init_freeable) from [<80807048>] (kernel_init+0x8/0x110)
            (kernel_init) from [<80100114>] (ret_from_fork+0x14/0x20)
      
      Additionally, the i2c_imx_isr() could wake up the wait queue
      (imx_i2c_struct->queue) before its initialization happens.
      
      The resource-managed framework should not be used for interrupt handling,
      because the resource will be released too late - after disabling clocks.
      The interrupt handler is not prepared for such case.
      
      Fixes: 1c4b6c3b ("i2c: imx: implement bus recovery")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
      Acked-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      e50e4f0b
    • Krzysztof Kozlowski's avatar
      i2c: rk3x: Simplify with dev_err_probe() · 91a73027
      Krzysztof Kozlowski authored
      Common pattern of handling deferred probe can be simplified with
      dev_err_probe().  Less code and the error value gets printed.
      Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
      Reviewed-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      91a73027
    • Khalil Blaiech's avatar
      i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC · b5b5b320
      Khalil Blaiech authored
      Add BlueField I2C driver to offer master and slave support for
      Mellanox BlueField SoCs. The driver implements an SMBus adapter
      and interfaces to multiple busses that can be probed using both
      ACPI and Device Tree infrastructures.
      
      The driver supports several SMBus operations to transfer data
      back and forth from/to various I2C devices. It is mainly intended
      to be consumed by userspace tools and utilities, such as i2c-tools
      and decode-dimms to collect memory module information.
      
      On the other hand, the driver has a slave function to support,
      among others, an IPMB interface that requires both master and
      slave functions to handle transfers between the BlueField SoC
      and a board management controllers (e.g., BMC).
      Signed-off-by: default avatarKhalil Blaiech <kblaiech@mellanox.com>
      Reviewed-by: default avatarVadim Pasternak <vadimp@mellanox.com>
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      b5b5b320
    • Khalil Blaiech's avatar
      dt-bindings: i2c: I2C binding for Mellanox BlueField SoC · d9becc53
      Khalil Blaiech authored
      Add device tree bindings documentation for Mellanox BlueField
      I2C SMBus controller.
      Signed-off-by: default avatarKhalil Blaiech <kblaiech@mellanox.com>
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      d9becc53
    • Wolfram Sang's avatar
      Merge tag 'at24-updates-for-v5.10' of... · 668ba5e6
      Wolfram Sang authored
      Merge tag 'at24-updates-for-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into i2c/for-5.10
      
      at24 updates for v5.10
      
      - add support for masking sensitive data in VAIO EEPROMs
      - set the nvmem TYPE to NVMEM_TYPE_EEPROM
      - add support for the new 'label' property
      - set the nvmem ID to NVMEM_DEVID_AUTO by default (for backward
        compatibility) or to NVMEM_DEVID_NONE if label is defined
      668ba5e6
  2. 25 Sep, 2020 1 commit
  3. 24 Sep, 2020 2 commits
    • Jon Hunter's avatar
      dt-bindings: eeprom: at24: Add label property for AT24 · 412b7a52
      Jon Hunter authored
      Add a label property for the AT24 EEPROM to allow a custom name to be
      used for identifying the EEPROM on a board. This is useful when there
      is more than one EEPROM present.
      Signed-off-by: default avatarJon Hunter <jonathanh@nvidia.com>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      412b7a52
    • Jon Hunter's avatar
      eeprom: at24: Initialise AT24 NVMEM ID field · f434f9b7
      Jon Hunter authored
      The AT24 EEPROM driver does not initialise the 'id' field of the
      nvmem_config structure and because the entire structure is not
      initialised, it ends up with a random value. This causes the NVMEM
      driver to append the device 'devid' value to name of the NVMEM
      device. Ideally for I2C devices such as the AT24 that already have a
      unique name, we would not bother to append the 'devid'. However, given
      that this has always been done for AT24 devices, we cannot remove the
      'devid' as this will change the name of the userspace sysfs node for
      the NVMEM device. Nonetheless we should ensure that the 'id' field of
      the nvmem_config structure is initialised so that there is no chance of
      a random value causes problems in the future. Therefore, set the NVMEM
      config.id to NVMEM_DEVID_AUTO for AT24 EEPROMs so that the 'devid' is
      always appended.
      Signed-off-by: default avatarJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      f434f9b7
  4. 21 Sep, 2020 13 commits
  5. 18 Sep, 2020 7 commits
  6. 17 Sep, 2020 1 commit
  7. 09 Sep, 2020 4 commits
  8. 28 Aug, 2020 4 commits
  9. 25 Aug, 2020 1 commit
    • Jean Delvare's avatar
      eeprom: at24: Tidy at24_read() · 99363d1c
      Jean Delvare authored
      The elegant code in at24_read() has the drawback that we now need
      to make a copy of all parameters to pass them to the post-processing
      callback function if there is one. Rewrite the loop in such a way that
      the parameters are not modified, so saving them is no longer needed.
      Signed-off-by: default avatarJean Delvare <jdelvare@suse.de>
      Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      99363d1c