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
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
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 -
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
28 Jul, 2020
1 commit
-
Let's rather use its physical parent device to give proper namings and
connections in debugfs.Signed-off-by: Wolfram Sang
Reviewed-by: Benjamin Tissoires
Signed-off-by: Wolfram Sang
25 Jul, 2020
1 commit
-
This manually reverts commit d1d84bb95364ed604015c2b788caaf3dbca0262f.
The only user has gone two years ago with commit 589edb56b424 ("ACPI /
scan: Create platform device for INT33FE ACPI nodes") and no new user
has showed up. Remove and hope we will never need it again.Signed-off-by: Wolfram Sang
Acked-by: Hans de Goede
Signed-off-by: Wolfram Sang
19 Jun, 2020
1 commit
-
All in-tree users have been converted to the new i2c_new_client_device
function, so remove this deprecated one.Signed-off-by: Wolfram Sang
Signed-off-by: Wolfram Sang
27 May, 2020
1 commit
-
No need to populate a variable if it is used only in debug output which
may get compiled away anyhow.Signed-off-by: Wolfram Sang
Signed-off-by: Wolfram Sang
22 May, 2020
1 commit
-
This reverts commit 6fe12cdbcfe35ad4726a619a9546822d34fc934c. Testing in
linux-next showed it needs some more time.Signed-off-by: Wolfram Sang
20 May, 2020
2 commits
-
Although in the most platforms, the bus power of i2c
are alway on, some platforms disable the i2c bus power
in order to meet low power request.We get and enable bulk regulator in i2c adapter device.
Signed-off-by: Bibby Hsieh
Reviewed-by: Tomasz Figa
Signed-off-by: Wolfram Sang
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
-
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
15 Apr, 2020
2 commits
-
When I wanted to print the chosen values to debug output, I concluded
that a helper function to parse one timing would be helpful.Signed-off-by: Wolfram Sang
Signed-off-by: Wolfram Sang -
All in-tree users have been converted to the new i2c_new_scanned_device
function, so remove this deprecated one.Signed-off-by: Wolfram Sang
Signed-off-by: Wolfram Sang
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 -
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
16 Jan, 2020
2 commits
-
Move away from the deprecated API and return the shiny new ERRPTR where
useful.Signed-off-by: Wolfram Sang
Signed-off-by: Wolfram Sang
10 Jan, 2020
1 commit
-
The I2C specification states that tsu:sto for standard mode timing must
be at minimum 4us. Pictographically, this is:SCL: ____/~~~~~~~~~
SDA: _________/~~~~
->| |
Signed-off-by: Wolfram Sang
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
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
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
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
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
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
...
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
...
30 Aug, 2019
1 commit
-
We are moving towards returning ERR_PTRs when i2c_new_*_device() calls
fail. Make sure its counterpart for unregistering handles ERR_PTRs as
well.Signed-off-by: Wolfram Sang
Reviewed-by: Geert Uytterhoeven
Signed-off-by: Wolfram Sang
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
07 Aug, 2019
1 commit
-
of_find_property() will return NULL if of_node is NULL,
thus of_irq_get_by_name() returns -EINVAL which we ignore,
so no need to double check.Signed-off-by: Andy Shevchenko
Signed-off-by: Wolfram Sang
01 Aug, 2019
1 commit
-
Convert each file at I2C subsystem, renaming them to .rst and
adding to the driver-api book.Signed-off-by: Mauro Carvalho Chehab
Acked-by: Wolfram Sang
Acked-by: Alexandre Belloni
Acked-by: Jonathan Cameron
Signed-off-by: Jonathan Corbet
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
...
29 Jun, 2019
4 commits
-
Only set init_irq during i2c_device_new and only handle client->irq on
the probe/remove paths.Suggested-by: Benjamin Tissoires
Reviewed-by: Mika Westerberg
Reviewed-by: Andy Shevchenko
Signed-off-by: Charles Keepax
Signed-off-by: Wolfram Sang -
It makes sense to contain all the ACPI IRQ handling in a single helper
function.Reviewed-by: Andy Shevchenko
Signed-off-by: Charles Keepax
Reviewed-by: Mika Westerberg
Signed-off-by: Wolfram Sang -
Bring the ACPI path in sync with the device tree path and handle all the
IRQ fetching at probe time. This leaves the only IRQ handling at device
registration time being that which is passed directly through the board
info as either a resource or an actual IRQ number.Reviewed-by: Andy Shevchenko
Signed-off-by: Charles Keepax
Reviewed-by: Mika Westerberg
Signed-off-by: Wolfram Sang -
Remove the static from i2c_dev_irq_from _resources so that other parts
of the core code can use this helper function.Reviewed-by: Mika Westerberg
Reviewed-by: Andy Shevchenko
Signed-off-by: Charles Keepax
Signed-off-by: Wolfram Sang
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
15 Jun, 2019
1 commit
-
Much better to read and understand.
Signed-off-by: Wolfram Sang
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 detailsthis 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 detailsthis 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 detailsextracted 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
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