- 17 6月, 2016 1 次提交
-
-
由 Benjamin Tissoires 提交于
.alert() is meant to be generic, but there is currently no way for the device driver to know which protocol generated the alert. Add a parameter in .alert() to help the device driver to understand what is given in data. This patch is required to have the support of SMBus Host Notify protocol through .alert(). Tested-by: NAndrew Duggan <aduggan@synaptics.com> For hwmon: Acked-by: NGuenter Roeck <linux@roeck-us.net> For IPMI: Acked-by: NCorey Minyard <cminyard@mvista.com> Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 14 6月, 2016 1 次提交
-
-
由 Jean-Michel Hautbois 提交于
Some I2C devices have multiple addresses assigned, for example each address corresponding to a different internal register map page of the device. So far drivers which need support for this have handled this with a driver specific and non-generic implementation, e.g. passing the additional address via platform data. This patch provides a new helper function called i2c_new_secondary_device() which is intended to provide a generic way to get the secondary address as well as instantiate a struct i2c_client for the secondary address. The function expects a pointer to the primary i2c_client, a name for the secondary address and an optional default address. The name is used as a handle to specify which secondary address to get. The default address is used as a fallback in case no secondary address was explicitly specified. In case no secondary address and no default address were specified the function returns NULL. For now the function only supports look-up of the secondary address from devicetree, but it can be extended in the future to for example support board files and/or ACPI. Signed-off-by: NJean-Michel Hautbois <jean-michel.hautbois@veo-labs.com> Acked-by: NRob Herring <robh@kernel.org> Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 05 5月, 2016 2 次提交
-
-
由 Peter Rosin 提交于
With a i2c topology like the following GPIO ---| ------ BAT1 | v / I2C -----+----------+---- MUX | \ EEPROM ------ BAT2 there is a locking problem with the GPIO controller since it is a client on the same i2c bus that it muxes. Transfers to the mux clients (e.g. BAT1) will lock the whole i2c bus prior to attempting to switch the mux to the correct i2c segment. In the above case, the GPIO device is an I/O expander with an i2c interface, and since the GPIO subsystem knows nothing (and rightfully so) about the lockless needs of the i2c mux code, this results in a deadlock when the GPIO driver issues i2c transfers to modify the mux. So, observing that while it is needed to have the i2c bus locked during the actual MUX update in order to avoid random garbage on the slave side, it is not strictly a must to have it locked over the whole sequence of a full select-transfer-deselect mux client operation. The mux itself needs to be locked, so transfers to clients behind the mux are serialized, and the mux needs to be stable during all i2c traffic (otherwise individual mux slave segments might see garbage, or worse). Introduce this new locking concept as "mux-locked" muxes, and call the pre-existing mux locking scheme "parent-locked". Modify the i2c mux locking so that muxes that are "mux-locked" locks only the muxes on the parent adapter instead of the whole i2c bus when there is a transfer to the slave side of the mux. This lock serializes transfers to the slave side of the muxes on the parent adapter. Add code to i2c-mux-gpio and i2c-mux-pinctrl that checks if all involved gpio/pinctrl devices have a parent that is an i2c adapter in the same adapter tree that is muxed, and request a "mux-locked mux" if that is the case. Modify the select-transfer-deselect code for "mux-locked" muxes so that each of the select-transfer-deselect ops locks the mux parent adapter individually. Signed-off-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Peter Rosin 提交于
Add i2c_lock_bus() and i2c_unlock_bus(), which call the new lock_bus and unlock_bus ops in the adapter. These funcs/ops take an additional flags argument that indicates for what purpose the adapter is locked. There are two flags, I2C_LOCK_ROOT_ADAPTER and I2C_LOCK_SEGMENT, but they are both implemented the same. For now. Locking the root adapter means that the whole bus is locked, locking the segment means that only the current bus segment is locked (i.e. i2c traffic on the parent side of a mux is still allowed even if the child side of the mux is locked). Also support a trylock_bus op (but no function to call it, as it is not expected to be needed outside of the i2c core). Implement i2c_lock_adapter/i2c_unlock_adapter in terms of the new locking scheme (i.e. lock with the I2C_LOCK_ROOT_ADAPTER flag). Locking the root adapter and locking the segment is the same thing for all root adapters (e.g. in the normal case of a simple topology with no i2c muxes). The two locking variants are also the same for traditional muxes (aka parent-locked muxes). These muxes traverse the tree, locking each level as they go until they reach the root. This patch is preparatory for a later patch in the series introducing mux-locked muxes, which behave differently depending on the requested locking. Since all current users are using i2c_lock_adapter, which is a wrapper for I2C_LOCK_ROOT_ADAPTER, we only need to annotate the calls that will not need to lock the root adapter for mux-locked muxes. I.e. the instances that needs to use I2C_LOCK_SEGMENT instead of i2c_lock_adapter/I2C_LOCK_ROOT_ADAPTER. Those instances are in the i2c_transfer and i2c_smbus_xfer functions, so that mux-locked muxes can single out normal i2c accesses to its slave side and adjust the locking for those accesses. Signed-off-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 12 4月, 2016 1 次提交
-
-
由 Wolfram Sang 提交于
Drivers do this in various ways, let's use one standard way of doing it. Note: I2C_M_RD is bit 0, so the code could be simplified. To be extremly robust and to advertise good coding practices, I still use the ternary operator and let the compilers do the optimizing job. Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 13 1月, 2016 1 次提交
-
-
由 Paul Gortmaker 提交于
In commit f309d444 ("platform_device: better support builtin boilerplate avoidance") we introduced the builtin_driver macro. Here we use that support and extend it to I2C driver registration, so where a driver is clearly non-modular and builtin-only, we can register it in a similar fashion. And existing code that is clearly non-modular can be updated with the simple mapping of module_i2c_driver(...) ---> builtin_i2c_driver(...) We've essentially cloned the former to make the latter, and taken out the remove/module_exit parts since those never get used in a non-modular build of the code. A similar thing was done in commit b4eb6cdb ("PCI: Add builtin_pci_driver() to avoid registration boilerplate"). Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 14 12月, 2015 1 次提交
-
-
由 Wolfram Sang 提交于
Inspired from the i2c-rk3x driver (thanks guys!) but refactored and extended. See built-in docs for further information. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 01 12月, 2015 2 次提交
-
-
由 Nicola Corna 提交于
This patch adds a i2c_check_quirks helper function to check the quirk flags of an i2c adapter, in a similar way to i2c_check_functionality. Signed-off-by: NNicola Corna <nicola@corna.info> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Nicola Corna 提交于
Add I2C_AQ_NO_CLK_STRETCH quirk flag, to be used when clock stretching is not supported. Signed-off-by: NNicola Corna <nicola@corna.info> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 24 8月, 2015 2 次提交
-
-
由 Irina Tirdea 提交于
There are devices that need to handle block transactions regardless of the capabilities exported by the adapter. For performance reasons, they need to use i2c read blocks if available, otherwise emulate the block transaction with word or byte transactions. Add support for a helper function that would read a data block using the best transfer available: I2C_FUNC_SMBUS_READ_I2C_BLOCK, I2C_FUNC_SMBUS_READ_WORD_DATA or I2C_FUNC_SMBUS_READ_BYTE_DATA. Signed-off-by: NIrina Tirdea <irina.tirdea@intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
And update indentation with one more tab, sigh... Tested-by: NAndrey Danin <danindrey@mail.ru> Acked-by: NStephen Warren <swarren@nvidia.com> Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 10 8月, 2015 1 次提交
-
-
由 Vladimir Zapolskiy 提交于
of_find_i2c_adapter_by_node() call requires quite often missing put_device(), and i2c_put_adapter() releases a device locked by i2c_get_adapter() only. In general module_put(adapter->owner) and put_device(dev) are not interchangeable. This is a common error reproduction scenario as a result of the misusage described above (for clearness this is run on iMX6 platform with HDMI and I2C bus drivers compiled as kernel modules): root@mx6q:~# lsmod | grep i2c i2c_imx 10213 0 root@mx6q:~# lsmod | grep dw_hdmi_imx dw_hdmi_imx 3631 0 dw_hdmi 11846 1 dw_hdmi_imx imxdrm 8674 3 dw_hdmi_imx,imx_ipuv3_crtc,imx_ldb drm_kms_helper 113765 5 dw_hdmi,imxdrm,imx_ipuv3_crtc,imx_ldb root@mx6q:~# rmmod dw_hdmi_imx root@mx6q:~# lsmod | grep i2c i2c_imx 10213 -1 ^^^^^ root@mx6q:~# rmmod i2c_imx rmmod: ERROR: Module i2c_imx is in use To fix existing users of these interfaces and to avoid any further confusion and misusage in future, add one more interface of_get_i2c_adapter_by_node(), it is similar to i2c_get_adapter() in sense that an I2C bus device driver found and locked by user can be correctly unlocked by i2c_put_adapter(). Signed-off-by: NVladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 10 4月, 2015 1 次提交
-
-
由 Grygorii Strashko 提交于
This patch changes type of input parameter for prepare/unprepare_recovery() callbacks from struct i2c_bus_recovery_info * to struct i2c_adapter *. This allows to simplify implementation of these callbacks and avoid type conversations from i2c_bus_recovery_info to i2c_adapter. The i2c_bus_recovery_info can be simply retrieved from struct i2c_adapter which contains pointer on it. There are no users currently, so this is safe to do. Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: NAlexander Sverdlin <alexander.sverdlin@nokia.com> Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 27 3月, 2015 1 次提交
-
-
由 Wolfram Sang 提交于
After more discussion, brave users, and additional datasheet evaluation, some API updates for the new I2C slave framework became imminent. The slave events now get some easier to understand naming. Also, the event handling has been simplified to only need a single call to the slave callback when an action by the backend is required. Reported-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: NGeert Uytterhoeven <geert+renesas@glider.be> Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 17 3月, 2015 1 次提交
-
-
由 Rafael J. Wysocki 提交于
Now that we have struct fwnode_handle, we can use that to point to ACPI companions from struct device objects instead of pointing to struct acpi_device directly. There are two benefits from that. First, the somewhat ugly and hackish struct acpi_dev_node can be dropped and, second, the same struct fwnode_handle pointer can be used in the future to point to other (non-ACPI) firmware device node types. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: NGrant Likely <grant.likely@linaro.org>
-
- 13 3月, 2015 1 次提交
-
-
由 Wolfram Sang 提交于
The number of I2C adapters which are not fully I2C compatible is rising, sadly. Drivers usually do handle the flaws, still the user receives only some errno for a transfer which normally can be expected to work. This patch introduces a formal description of flaws. One advantage is that the core can check before the actual transfer if the messages could be transferred at all. This is done in the next patch. Another advantage is that we can pass this information to the user so the restrictions are exactly known and further actions can be based on that. This will be done later after some stabilization period for this description. Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Tested-by: NRay Jui <rjui@broadcom.com> Tested-by: NIvan T. Ivanov <iivanov@mm-sol.com> Tested-by: NNeelesh Gupta <neelegup@linux.vnet.ibm.com> Tested-By: NLudovic Desroches <ludovic.desroches@atmel.com>
-
- 27 1月, 2015 1 次提交
-
-
由 Jean Delvare 提交于
Make the slave support depend on CONFIG_I2C_SLAVE. Otherwise it gets included unconditionally, even when it is not needed. I2C bus drivers which implement slave support must select I2C_SLAVE. Signed-off-by: NJean Delvare <jdelvare@suse.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 23 12月, 2014 1 次提交
-
-
由 Lars-Peter Clausen 提交于
There haven't been any I2C driver that use the legacy suspend/resume callbacks for a while now and new drivers are supposed to use PM ops. So remove support for legacy suspend/resume for I2C drivers. Since there aren't any special bus specific things to do during suspend/resume and since the PM core will automatically fallback directly to using the device's PM ops if no bus PM ops are specified there is no need to have any I2C bus PM ops. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 12 12月, 2014 1 次提交
-
-
由 Wolfram Sang 提交于
Finally(!), make Linux support being an I2C slave. Most of the existing infrastructure is reused. We mainly add i2c_slave_register/unregister() calls which tells i2c bus drivers to activate the slave mode. Then, they also get a callback to report slave events to. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 04 11月, 2014 1 次提交
-
-
由 Masanari Iida 提交于
This patch fix speeling typo found in html files within Documentation/DocBook/device-drivers. It is because html files are generated from comments in source, so I have to fix comments in the source. Signed-off-by: NMasanari Iida <standby24x7@gmail.com> Acked-by: NRandy Dunlap <rdunlap@infradead.org> Acked-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NJonathan Corbet <corbet@lwn.net>
-
- 25 9月, 2014 1 次提交
-
-
由 Wolfram Sang 提交于
Commit 5d98e61d ("I2C/ACPI: Add i2c ACPI operation region support") renamed the i2c-core module. This may cause regressions for distributions, so put the ACPI code back into the core. Reported-by: NJean Delvare <jdelvare@suse.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Tested-by: NLan Tianyu <tianyu.lan@intel.com> Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
-
- 19 8月, 2014 1 次提交
-
-
由 Lan Tianyu 提交于
Commit da3c6647(I2C/ACPI: Clean up I2C ACPI code and Add CONFIG_I2C_ACPI config) adds a new kernel config I2C_ACPI and make I2C core built in when the config is selected. This is wrong because distributions etc generally compile I2C as a module and the commit broken that. This patch is to rename I2C_ACPI to ACPI_I2C_OPREGION. New config only controls ACPI I2C operation region code and depends on I2C=y. Signed-off-by: NLan Tianyu <tianyu.lan@intel.com> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> [wsa: removed unrelated change for Kconfig] Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 27 6月, 2014 2 次提交
-
-
由 Lan Tianyu 提交于
Clean up ACPI related code in the i2c core and add CONFIG_I2C_ACPI to enable I2C ACPI code. Current there is a race between removing I2C ACPI operation region and ACPI AML code accessing. So make i2c core built-in if CONFIG_I2C_ACPI is set. Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NLan Tianyu <tianyu.lan@intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Lan Tianyu 提交于
ACPI 5.0 spec(5.5.2.4.5) defines GenericSerialBus(i2c, spi, uart) operation region. It allows ACPI aml code able to access such kind of devices to implement some ACPI standard method. ACPI Spec defines some access attribute to associate with i2c protocol. AttribQuick Read/Write Quick Protocol AttribSendReceive Send/Receive Byte Protocol AttribByte Read/Write Byte Protocol AttribWord Read/Write Word Protocol AttribBlock Read/Write Block Protocol AttribBytes Read/Write N-Bytes Protocol AttribProcessCall Process Call Protocol AttribBlockProcessCall Write Block-Read Block Process Call Protocol AttribRawBytes Raw Read/Write N-BytesProtocol AttribRawProcessBytes Raw Process Call Protocol On the Asus T100TA, Bios use GenericSerialBus operation region to access i2c device to get battery info. Sample code From Asus T100TA Scope (_SB.I2C1) { Name (UMPC, ResourceTemplate () { I2cSerialBus (0x0066, ControllerInitiated, 0x00061A80, AddressingMode7Bit, "\\_SB.I2C1", 0x00, ResourceConsumer, , ) }) ... OperationRegion (DVUM, GenericSerialBus, Zero, 0x0100) Field (DVUM, BufferAcc, NoLock, Preserve) { Connection (UMPC), Offset (0x81), AccessAs (BufferAcc, AttribBytes (0x3E)), FGC0, 8 } ... } Device (BATC) { Name (_HID, EisaId ("PNP0C0A")) // _HID: Hardware ID Name (_UID, One) // _UID: Unique ID ... Method (_BST, 0, NotSerialized) // _BST: Battery Status { If (LEqual (AVBL, One)) { Store (FGC0, BFFG) If (LNotEqual (STAT, One)) { ShiftRight (CHST, 0x04, Local0) And (Local0, 0x03, Local0) If (LOr (LEqual (Local0, One), LEqual (Local0, 0x02))) { Store (0x02, Local1) } ... } The i2c operation region is defined under I2C1 scope. _BST method under battery device BATC read battery status from the field "FCG0". The request would be sent to i2c operation region handler. This patch is to add i2c ACPI operation region support. Due to there are only "Byte" and "Bytes" protocol access on the Asus T100TA, other protocols have not been tested. About RawBytes and RawProcessBytes protocol, they needs specific drivers to interpret reference data from AML code according ACPI 5.0 SPEC(5.5.2.4.5.3.9 and 5.5.2.4.5.3.10). So far, not found such case and will add when find real case. Signed-off-by: NLan Tianyu <tianyu.lan@intel.com> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 06 3月, 2014 1 次提交
-
-
由 Wolfram Sang 提交于
Class based instantiation can cause noticeable delays when booting. This mechanism is used when it is not possible to describe slaves on I2C busses. As we do have other mechanisms, most embedded I2C will not need classes and for embedded it is explicitly not recommended to use them. Add a deprecation warning for drivers which want to disable class based instantiation in the near future to gain boot-up time, so users relying on this technique can switch to something better. They really should. Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 27 1月, 2014 1 次提交
-
-
由 Ben Dooks 提交于
Add some kerneldoc style documentaton to the i2c_algorithm structure, and point the master_xfer return codes at the right place in Documentation/i2c/fault_codes Signed-off-by: NBen Dooks <ben.dooks@codethink.co.uk> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 15 1月, 2014 1 次提交
-
-
由 Stephen Warren 提交于
The body of i2c_parent_is_i2c_adapter() is currently guarded by I2C_MUX. It should be CONFIG_I2C_MUX instead. Among potentially other problems, this resulted in i2c_lock_adapter() only locking I2C mux child adapters, and not the parent adapter. In turn, this could allow inter-mingling of mux child selection and I2C transactions, which could result in I2C transactions being directed to the wrong I2C bus, and possibly even switching between busses in the middle of a transaction. One concrete issue caused by this bug was corrupted HDMI EDID reads during boot on the NVIDIA Tegra Seaboard system, although this only became apparent in recent linux-next, when the boot timing was changed just enough to trigger the race condition. Fixes: 3923172b ("i2c: reduce parent checking to a NOOP in non-I2C_MUX case") Cc: Phil Carmody <phil.carmody@partner.samsung.com> Cc: <stable@vger.kernel.org> Signed-off-by: NStephen Warren <swarren@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 04 10月, 2013 1 次提交
-
-
由 Lars-Peter Clausen 提交于
The 'driver' field of the i2c_client struct is redundant. The same data can be accessed through to_i2c_driver(client->dev.driver). The generated code for both approaches in more or less the same. E.g. on ARM the expression client->driver->command(...) generates ... ldr r3, [r0, #28] ldr r3, [r3, #32] blx r3 ... and the expression to_i2c_driver(client->dev.driver)->command(...) generates ... ldr r3, [r0, #160] ldr r3, [r3, #-4] blx r3 ... Other architectures will generate similar code. All users of the 'driver' field outside of the I2C core have already been converted. So this only leaves the core itself. This patch converts the remaining few users in the I2C core and then removes the 'driver' field from the i2c_client struct. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 23 8月, 2013 2 次提交
-
-
由 Mika Westerberg 提交于
This follows what has already been done for the DeviceTree helpers. Move the ACPI helpers from drivers/acpi/acpi_i2c.c to the I2C core and update documentation accordingly. This also solves a problem reported by Jerry Snitselaar that we can't build the ACPI I2C helpers as a module. Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
I2C of helpers used to live in of_i2c.c but experience (from SPI) shows that it is much cleaner to have this in the core. This also removes a circular dependency between the helpers and the core, and so we can finally register child nodes in the core instead of doing this manually in each driver. So, fix the drivers and documentation, too. Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 07 8月, 2013 1 次提交
-
-
由 Phil Carmody 提交于
In 0826374b - i2c: Multiplexed I2C bus core support core i2c code increased in size and complexity even when I2C_MUX wasn't selected. Turning this check into a constant NULL in the n case lets the client functions in be simplified too, not needing to include never-called calls to the mux-specific helpers. Signed-off-by: NPhil Carmody <phil.carmody@partner.samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 02 4月, 2013 2 次提交
-
-
由 Lars-Peter Clausen 提交于
i2c_del_adapter() is usually called from a drivers remove callback. The Linux device driver model does not allow the remove callback to fail and all resources allocated in the probe callback need to be freed, as well as all resources which have been provided to the rest of the kernel(for example a I2C adapter) need to be revoked. So any function revoking such resources isn't allowed to fail either. i2c_del_adapter() adheres to this requirement and will never fail. But i2c_del_adapter()'s return type is int, which may cause driver authors to think that it can fail. This led to code constructs like: ret = i2c_del_adapter(...); BUG_ON(ret); Since i2c_del_adapter() always returns 0 the BUG_ON is never hit and essentially becomes dead code, which means it can be removed. Making the return type of i2c_del_adapter() void makes it explicit that the function will never fail and should prevent constructs like the above from re-appearing in the kernel code. All callers of i2c_del_adapter() have already been updated in a previous patch to ignore the return value, so the conversion of the return type from int to void can be done without causing any build failures. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Lars-Peter Clausen 提交于
The detach_adapter callback has been deprecated for quite some time and has no user left. Keeping it alive blocks other cleanups, so remove it. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 24 3月, 2013 1 次提交
-
-
由 Viresh Kumar 提交于
Add i2c bus recovery infrastructure to i2c adapters as specified in the i2c protocol Rev. 03 section 3.1.16 titled "Bus clear". http://www.nxp.com/documents/user_manual/UM10204.pdf Sometimes during operation i2c bus hangs and we need to give dummy clocks to slave device to start the transfer again. Now we may have capability in the bus controller to generate these clocks or platform may have gpio pins which can be toggled to generate dummy clocks. This patch supports both. This patch also adds in generic bus recovery routines gpio or scl line based which can be used by bus controller. In addition controller driver may provide its own version of the bus recovery routine. This doesn't support multi-master recovery for now. Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org> [wsa: changed gpio type to int and minor reformatting] Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 23 11月, 2012 1 次提交
-
-
由 Mika Westerberg 提交于
ACPI 5 introduced I2cSerialBus resource that makes it possible to enumerate and configure the I2C slave devices behind the I2C controller. This patch adds helper functions to support I2C slave enumeration. An ACPI enabled I2C controller driver only needs to call acpi_i2c_register_devices() in order to get its slave devices enumerated, created and bound to the corresponding ACPI handle. Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 13 10月, 2012 1 次提交
-
-
由 David Howells 提交于
Signed-off-by: NDavid Howells <dhowells@redhat.com> Acked-by: NArnd Bergmann <arnd@arndb.de> Acked-by: NThomas Gleixner <tglx@linutronix.de> Acked-by: NMichael Kerrisk <mtk.manpages@gmail.com> Acked-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: NDave Jones <davej@redhat.com>
-
- 06 10月, 2012 1 次提交
-
-
由 Vivien Didelot 提交于
s/address_data/address_list/ in addition to c3813d6a. Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 24 7月, 2012 1 次提交
-
-
由 Laurent Pinchart 提交于
SCCB is a serial communication bus developed by Omnivision. Its 2-wire mode is very similar to SMBus byte data transactions, but requires the controller to ignore the ACK bit and to insert a stop condition after each message. Add a device SCCB flag and a message stop flag to be passed to controller drivers. [JD: Kill rogue definition in go7007 driver.] Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 30 6月, 2012 1 次提交
-
-
由 Jean Delvare 提交于
Some drivers (in particular for TV cards) need exclusive access to their I2C buses for specific operations. Export an unlocked flavor of i2c_transfer to give them full control. The unlocked flavor has the following limitations: * Obviously, caller must hold the i2c adapter lock. * No debug messages are logged. We don't want to log messages while holding a rt_mutex. * No check is done on the existence of adap->algo->master_xfer. It is thus the caller's responsibility to ensure that the function is OK to call. Signed-off-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
-
- 30 5月, 2012 1 次提交
-
-
由 Mark Brown 提交于
Since there are uses for I2C_M_NOSTART which are much more sensible and standard than most of the protocol mangling functionality (the main one being gather writes to devices where something like a register address needs to be inserted before a block of data) create a new I2C_FUNC_NOSTART for this feature and update all the users to use it. Also strengthen the disrecommendation of the protocol mangling while we're at it. In the case of regmap-i2c we remove the requirement for mangling as I2C_M_NOSTART is the only mangling feature which is being used. Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: NWolfram Sang <w.sang@pengutronix.de> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-