18 Sep, 2020

1 commit

  • Some ACPI i2c-devices _STA method (which is used to detect if the device
    is present) use autodetection code which probes which device is present
    over i2c. This requires the I2C ACPI OpRegion handler to be registered
    before we enumerate i2c-clients under the i2c-adapter.

    This fixes the i2c touchpad on the Lenovo ThinkBook 14-IIL and
    ThinkBook 15 IIL not getting an i2c-client instantiated and thus not
    working.

    BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1842039
    Signed-off-by: Hans de Goede
    Reviewed-by: Mika Westerberg
    Signed-off-by: Wolfram Sang

    Hans de Goede
     

25 Aug, 2020

1 commit

  • When commit c64ffff7a9d1 ("i2c: core: Allow empty id_table in ACPI case
    as well") fixed the enumeration of I²C devices on ACPI enabled platforms
    when driver has no ID table, it missed the PRP0001 support.

    i2c_device_match() and i2c_acpi_match_device() differently match
    driver against given device. Use acpi_driver_match_device(), that is used
    in the former, in i2c_device_probe() and don't fail PRP0001 enumeration
    when no ID table exist.

    Fixes: c64ffff7a9d1 ("i2c: core: Allow empty id_table in ACPI case as well")
    BugLink: https://stackoverflow.com/q/63519678/2511795
    Signed-off-by: Andy Shevchenko
    Reviewed-by: Mika Westerberg
    Signed-off-by: Wolfram Sang

    Andy Shevchenko
     

05 Aug, 2020

2 commits

  • Even if I2C bus GPIO recovery is optional, devm_gpiod_get() can return
    -EPROBE_DEFER, so we should at least treat that. This ends up with
    i2c_register_adapter() to be able to return -EPROBE_DEFER.

    Signed-off-by: Codrin Ciubotariu
    Signed-off-by: Wolfram Sang

    Codrin Ciubotariu
     
  • Multiple I2C bus drivers use similar bindings to obtain information needed
    for I2C recovery. For example, for platforms using device-tree, the
    properties look something like this:

    &i2c {
    ...
    pinctrl-names = "default", "gpio";
    pinctrl-0 = ;
    pinctrl-1 = ;
    sda-gpios = ;
    scl-gpios = ;
    ...
    }

    For this reason, we can add this common initialization in the core. This
    way, other I2C bus drivers will be able to support GPIO recovery just by
    providing a pointer to platform's pinctrl and calling i2c_recover_bus()
    when SDA is stuck low.

    Signed-off-by: Codrin Ciubotariu
    [wsa: inverted one logic for better readability, minor update to kdoc]
    Signed-off-by: Wolfram Sang

    Codrin Ciubotariu
     

28 Jul, 2020

1 commit


25 Jul, 2020

1 commit


19 Jun, 2020

1 commit


27 May, 2020

1 commit


22 May, 2020

1 commit


20 May, 2020

2 commits


05 May, 2020

2 commits

  • The old email is still active, but for easier handling, I am going to
    use my kernel.org address from now on. Also, add a mailmap for the now
    defunct Pengutronix address.

    Signed-off-by: Wolfram Sang

    Wolfram Sang
     
  • In case of the I2C client exposes the flag I2C_CLIENT_HOST_NOTIFY,
    pm_runtime_get_sync is called in order to always keep active the
    adapter. However later on, pm_runtime_put_sync is never called
    within the function in case of an error. This commit add this
    error handling.

    Fixes: 72bfcee11cf8 ("i2c: Prevent runtime suspend of adapter when Host Notify is required")
    Signed-off-by: Alain Volmat
    Reviewed-by: Jarkko Nikula
    Signed-off-by: Wolfram Sang

    Alain Volmat
     

15 Apr, 2020

2 commits


25 Mar, 2020

2 commits

  • Some drivers may allow to override properties with 0 value when defaults
    are not in use, thus, replace memset() with corresponding per property
    update.

    Signed-off-by: Andy Shevchenko
    Tested-by: Wolfram Sang
    Signed-off-by: Wolfram Sang

    Andy Shevchenko
     
  • There are few maximum bus frequencies being used in the I²C core code.
    Provide generic definitions for bus frequencies and use them in the core.

    The drivers may use predefined constants where it is appropriate.
    Some of them are already using these under slightly different names.
    We will convert them later to use newly introduced defines.

    Note, the name of modes are chosen to follow well established naming
    scheme [1].

    These definitions will also help to avoid typos in the numbers that
    may lead to subtle errors.

    [1]: https://en.wikipedia.org/wiki/I%C2%B2C#Differences_between_modes

    Acked-by: Mika Westerberg
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Wolfram Sang

    Andy Shevchenko
     

16 Jan, 2020

2 commits


10 Jan, 2020

1 commit


17 Dec, 2019

1 commit

  • Convert the i2c core sysfs attributes from DEVICE_ATTR() to
    DEVICE_ATTR_*(), to reduce boilerplate.
    This requires renaming some functions.

    Although no suitable macro exists for the delete_device attribute,
    rename i2c_sysfs_delete_device() to delete_device_store() for
    consistency.

    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Luca Ceresoli
    Reviewed-by: Kieran Bingham
    Signed-off-by: Wolfram Sang

    Geert Uytterhoeven
     

11 Dec, 2019

1 commit

  • All in-kernel users have been converted to
    {devm_}i2c_new_dummy_device(). Remove the old API.

    Signed-off-by: Wolfram Sang
    Reviewed-by: Niklas Söderlund
    Tested-by: Luca Ceresoli
    Reviewed-by: Luca Ceresoli
    Signed-off-by: Wolfram Sang

    Wolfram Sang
     

29 Nov, 2019

1 commit

  • In the general move to have i2c_new_*_device functions which return
    ERR_PTR instead of NULL, this patch converts i2c_new_probed_device().

    There are only few users, so this patch converts the I2C core and all
    users in one go. The function gets renamed to i2c_new_scanned_device()
    so out-of-tree users will get a build failure to understand they need to
    adapt their error checking code.

    Signed-off-by: Wolfram Sang
    Reviewed-by: Luca Ceresoli
    Reviewed-by: Max Staudt
    Signed-off-by: Wolfram Sang

    Wolfram Sang
     

16 Nov, 2019

1 commit

  • There are no in-tree users of these helpers anymore, and there
    shouldn't. Most use cases went away once the driver model started to
    refcount for us. There have been users like the media subsystem, but
    they all switched to better refcounting methods meanwhile. Media did
    this in 2008. Last user (IPMI) left 2018. Remove this cruft.

    Signed-off-by: Wolfram Sang
    Reviewed-by: Niklas Söderlund
    Reviewed-by: Jean Delvare
    Tested-by: Luca Ceresoli
    Reviewed-by: Luca Ceresoli
    Reviewed-by: Geert Uytterhoeven

    Wolfram Sang
     

25 Oct, 2019

1 commit

  • i2c-digital-filter-width-ns:
    This optional timing property specifies the width of the spikes on the i2c
    lines (in ns) that can be filtered out by built-in digital filters which are
    embedded in some i2c controllers.
    i2c-analog-filter-cutoff-frequency:
    This optional timing property specifies the cutoff frequency of a low-pass
    analog filter built-in i2c controllers. This low pass filter is used to filter
    out high frequency noise on the i2c lines. Specified in Hz.
    Include these properties in the timings structure and read them as integers.

    Signed-off-by: Eugen Hristev
    Acked-by: Ludovic Desroches
    Reviewed-by: Peter Rosin
    Signed-off-by: Wolfram Sang

    Eugen Hristev
     

25 Sep, 2019

1 commit

  • Pull i2c updates from Wolfram Sang:

    - new driver for ICY, an Amiga Zorro card :)

    - axxia driver gained slave mode support, NXP driver gained ACPI

    - the slave EEPROM backend gained 16 bit address support

    - and lots of regular driver updates and reworks

    * 'i2c/for-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (52 commits)
    i2c: tegra: Move suspend handling to NOIRQ phase
    i2c: imx: ACPI support for NXP i2c controller
    i2c: uniphier(-f): remove all dev_dbg()
    i2c: uniphier(-f): use devm_platform_ioremap_resource()
    i2c: slave-eeprom: Add comment about address handling
    i2c: exynos5: Remove IRQF_ONESHOT
    i2c: stm32f7: Make structure stm32f7_i2c_algo constant
    i2c: cht-wc: drop check because i2c_unregister_device() is NULL safe
    i2c-eeprom_slave: Add support for more eeprom models
    i2c: fsi: Add of_put_node() before break
    i2c: synquacer: Make synquacer_i2c_ops constant
    i2c: hix5hd2: Remove IRQF_ONESHOT
    i2c: i801: Use iTCO version 6 in Cannon Lake PCH and beyond
    watchdog: iTCO: Add support for Cannon Lake PCH iTCO
    i2c: iproc: Make bcm_iproc_i2c_quirks constant
    i2c: iproc: Add full name of devicetree node to adapter name
    i2c: piix4: Add ACPI support
    i2c: piix4: Fix probing of reserved ports on AMD Family 16h Model 30h
    i2c: ocores: use request_any_context_irq() to register IRQ handler
    i2c: designware: Fix optional reset error handling
    ...

    Linus Torvalds
     

18 Sep, 2019

1 commit

  • Pull documentation updates from Jonathan Corbet:
    "It's a somewhat calmer cycle for docs this time, as the churn of the
    mass RST conversion is happily mostly behind us.

    - A new document on reproducible builds.

    - We finally got around to zapping the documentation for hardware
    support that was removed in 2004; one doesn't want to rush these
    things.

    - The usual assortment of fixes, typo corrections, etc"

    * tag 'docs-5.4' of git://git.lwn.net/linux: (67 commits)
    Documentation: kbuild: Add document about reproducible builds
    docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]
    Documentation: Add "earlycon=sbi" to the admin guide
    doc:lock: remove reference to clever use of read-write lock
    devices.txt: improve entry for comedi (char major 98)
    docs: mtd: Update spi nor reference driver
    doc: arm64: fix grammar dtb placed in no attributes region
    Documentation: sysrq: don't recommend 'S' 'U' before 'B'
    mailmap: Update email address for Quentin Perret
    docs: ftrace: clarify when tracing is disabled by the trace file
    docs: process: fix broken link
    Documentation/arm/samsung-s3c24xx: Remove stray U+FEFF character to fix title
    Documentation/arm/sa1100/assabet: Fix 'make assabet_defconfig' command
    Documentation/arm/sa1100: Remove some obsolete documentation
    docs/zh_CN: update Chinese howto.rst for latexdocs making
    Documentation: virt: Fix broken reference to virt tree's index
    docs: Fix typo on pull requests guide
    kernel-doc: Allow anonymous enum
    Documentation: sphinx: Don't parse socket() as identifier reference
    Documentation: sphinx: Add missing comma to list of strings
    ...

    Linus Torvalds
     

30 Aug, 2019

1 commit


14 Aug, 2019

1 commit

  • In the general move to have i2c_new_*_device functions which return
    ERR_PTR instead of NULL, this patch converts i2c_new_secondary_device().

    There are only few users, so this patch converts the I2C core and all
    users in one go. The function gets renamed to i2c_new_ancillary_device()
    so out-of-tree users will get a build failure to understand they need to
    adapt their error checking code.

    Signed-off-by: Wolfram Sang
    Reviewed-by: Kieran Bingham # adv748x
    Reviewed-by: Laurent Pinchart # adv7511 + adv7604
    Reviewed-by: Hans Verkuil # adv7604
    Signed-off-by: Wolfram Sang

    Wolfram Sang
     

07 Aug, 2019

1 commit


01 Aug, 2019

1 commit


16 Jul, 2019

1 commit

  • Pull i2c updates from Wolfram Sang:
    "New stuff from the I2C world:

    - in the core, getting irqs from ACPI is now similar to OF

    - new driver for MediaTek MT7621/7628/7688 SoCs

    - bcm2835, i801, and tegra drivers got some more attention

    - GPIO API cleanups

    - cleanups in the core headers

    - lots of usual driver updates"

    * 'i2c/for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (74 commits)
    i2c: mt7621: Fix platform_no_drv_owner.cocci warnings
    i2c: cpm: remove casting dma_alloc
    dt-bindings: i2c: sun6i-p2wi: Fix the binding example
    dt-bindings: i2c: mv64xxx: Fix the example compatible
    i2c: i801: Documentation update
    i2c: i801: Add support for Intel Tiger Lake
    i2c: i801: Fix PCI ID sorting
    dt-bindings: i2c-stm32: document optional dmas
    i2c: i2c-stm32f7: Add I2C_SMBUS_I2C_BLOCK_DATA support
    i2c: core: Tidy up handling of init_irq
    i2c: core: Move ACPI gpio IRQ handling into i2c_acpi_get_irq
    i2c: core: Move ACPI IRQ handling to probe time
    i2c: acpi: Factor out getting the IRQ from ACPI
    i2c: acpi: Use available IRQ helper functions
    i2c: core: Allow whole core to use i2c_dev_irq_from_resources
    eeprom: at24: modify a comment referring to platform data
    dt-bindings: i2c: omap: Add new compatible for J721E SoCs
    dt-bindings: i2c: mv64xxx: Add YAML schemas
    dt-bindings: i2c: sun6i-p2wi: Add YAML schemas
    i2c: mt7621: Add MediaTek MT7621/7628/7688 I2C driver
    ...

    Linus Torvalds
     

29 Jun, 2019

4 commits


26 Jun, 2019

1 commit

  • Nobody (including me) noticed that these functions were exported but not
    added to the header :/

    Fixes: 7159dbdae3c5 ("i2c: core: improve return value handling of i2c_new_device and i2c_new_dummy")
    Signed-off-by: Wolfram Sang
    Reviewed-by: Bartosz Golaszewski
    Reviewed-by: Kieran Bingham
    Signed-off-by: Wolfram Sang

    Wolfram Sang
     

15 Jun, 2019

1 commit


31 May, 2019

1 commit

  • Based on 3 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version [author] [kishon] [vijay] [abraham]
    [i] [kishon]@[ti] [com] this program is distributed in the hope that
    it will be useful but without any warranty without even the implied
    warranty of merchantability or fitness for a particular purpose see
    the gnu general public license for more details

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version [author] [graeme] [gregory]
    [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
    [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
    [hk] [hemahk]@[ti] [com] this program is distributed in the hope
    that it will be useful but without any warranty without even the
    implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 1105 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

18 May, 2019

1 commit

  • i2c_new_dummy is typically called from the probe function of the
    driver for the primary i2c client. It requires calls to
    i2c_unregister_device in the error path of the probe function and
    in the remove function.
    This can be simplified by introducing a device-managed version.

    Note the changed error case return value type: i2c_new_dummy returns
    NULL whilst devm_i2c_new_dummy_device returns an ERR_PTR.

    Signed-off-by: Heiner Kallweit
    [wsa: rename new functions and fix minor kdoc issues]
    Signed-off-by: Wolfram Sang
    Reviewed-by: Peter Rosin
    Reviewed-by: Kieran Bingham
    Reviewed-by: Bartosz Golaszewski
    Signed-off-by: Wolfram Sang

    Heiner Kallweit