- 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>
-
- 12 5月, 2012 1 次提交
-
-
由 Stephen Warren 提交于
This converts a struct device * to a struct i2c_adapter * while verifying that the device really is an I2C adapter. Just like i2c_verify_client. Signed-off-by: NStephen Warren <swarren@nvidia.com> Acked-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <w.sang@pengutronix.de>
-
- 27 3月, 2012 1 次提交
-
-
由 Jean Delvare 提交于
Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 23 11月, 2011 1 次提交
-
-
由 Jean Delvare 提交于
Last piece of code using ANY_I2C_BUS was deleted almost 2 years ago, so ANY_I2C_BUS can go away as well. Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 18 11月, 2011 1 次提交
-
-
由 Lars-Peter Clausen 提交于
This patch introduces the module_i2c_driver macro which is a convenience macro for I2C driver modules similar to module_platform_driver. It is intended to be used by drivers which init/exit section does nothing but register/unregister the I2C driver. By using this macro it is possible to eliminate a few lines of boilerplate code per I2C driver. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Acked-by: NGrant Likely <grant.likely@secretlab.ca> Acked-by: NJonathan Cameron <jic23@cam.ac.uk> Acked-by: NWolfram Sang <w.sang@pengutronix.de> Acked-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
- 01 11月, 2011 2 次提交
-
-
由 Paul Gortmaker 提交于
The <linux/module.h> pretty much brings in the kitchen sink along with it, so it should be avoided wherever reasonably possible in terms of being included from other commonly used <linux/something.h> files, as it results in a measureable increase on compile times. The worst culprit was probably device.h since it is used everywhere. This file also had an implicit dependency/usage of mutex.h which was masked by module.h, and is also fixed here at the same time. There are over a dozen other headers that simply declare the struct instead of pulling in the whole file, so follow their lead and simply make it a few more. Most of the implicit dependencies on module.h being present by these headers pulling it in have been now weeded out, so we can finally make this change with hopefully minimal breakage. Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
-
由 Paul Gortmaker 提交于
The original implementations reference THIS_MODULE in an inline. We could include <linux/export.h>, but it is better to avoid chaining. Fortunately someone else already thought of this, and made a similar inline into a #define in <linux/device.h> for device_schedule_callback(), [see commit 523ded71] so follow that precedent here. Also bubble up any __must_check that were used on the prev. wrapper inline functions up one to the real __register functions, to preserve any prev. sanity checks that were used in those instances. Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
-
- 30 10月, 2011 1 次提交
-
-
由 Jonathan Cameron 提交于
Reimplemented at least 17 times discounting error mangling cases where it could be used. Signed-off-by: NJonathan Cameron <jic23@cam.ac.uk> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 26 5月, 2011 1 次提交
-
-
由 Jean Delvare 提交于
While the JC42-compatible chips are temperature sensors, I2C_CLASS_SPD makes more sense because these chips always live on memory modules. Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: Guenter Roeck <guenter.roeck@ericsson.com>
-
- 20 3月, 2011 5 次提交
-
-
由 Jean Delvare 提交于
There is no user left of i2c_adapter.id, so we can get rid of it. Finally! :) Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
由 Jean Delvare 提交于
The last legitimate user of i2c_driver.attach_adapter and .detach_adapter is gone, so we can finally deprecate these callbacks. The last few drivers which still use these will have to be updated to make use of standard I2C device instantiation ways instead. Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
由 Jean Delvare 提交于
Introduce i2c_for_each_dev(), an i2c device iterator with proper locking for use by i2c-dev. This is needed so that we can get rid of the attach_adapter and detach_adapter legacy callback functions. Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
由 Jean Delvare 提交于
The last remaining ID in <linux/i2c-id.h> is no longer used anywhere, so we can finally get rid of it. Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
由 Jean Delvare 提交于
Rename the parameter of i2c_get_adapter() to "nr", to make it clear we are passing an adapter number and not an adapter ID (which have gone away by now.) Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 22 1月, 2011 1 次提交
-
-
由 Grant Likely 提交于
Having conditional around the of_match_table and the of_node pointers turns out to make driver code use ugly #ifdef blocks. Drop the conditionals and remove the #ifdef blocks from the affected drivers. Also tidy up minor whitespace issues within the same hunks. Signed-off-by: NGrant Likely <grant.likely@secretlab.ca> Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
- 11 1月, 2011 1 次提交
-
-
由 Jean Delvare 提交于
Helper functions for I2C and SMBus transactions don't modify the i2c_client that is passed to them, so it can be marked const. Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 16 11月, 2010 1 次提交
-
-
由 Jean Delvare 提交于
It's about time to make it clear that i2c_adapter.id is deprecated. Hopefully this will remind the last user to move over to a different strategy. Signed-off-by: NJean Delvare <khali@linux-fr.org> Acked-by: NJarod Wilson <jarod@redhat.com> Acked-by: NMauro Carvalho Chehab <mchehab@redhat.com> Acked-by: NHans Verkuil <hverkuil@xs4all.nl>
-
- 01 11月, 2010 1 次提交
-
-
由 Jean Delvare 提交于
There are no users left for I2C_CLASS_TV_ANALOG and I2C_CLASS_TV_DIGITAL, so we can get rid of them. Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 25 10月, 2010 2 次提交
-
-
由 Jean Delvare 提交于
This makes the calling site's code clearer IMHO. Signed-off-by: NJean Delvare <khali@linux-fr.org> Acked-by: NMichael Lawnick <ml.lawnick@gmx.de>
-
由 Jean Delvare 提交于
Only i2c devices can have their type set to i2c_adapter_type, so testing the bus type is redundant. Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: Michael Lawnick <ml.lawnick@gmx.de>
-
- 12 8月, 2010 5 次提交
-
-
由 Michael Lawnick 提交于
Add multiplexed bus core support. I2C multiplexer and switches like pca954x get instantiated as new adapters per port. Signed-off-by: NMichael Lawnick <ml.lawnick@gmx.de> Acked-by: NRodolfo Giometti <giometti@linux.it> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
由 Jean Delvare 提交于
Moving userspace-instantiated clients to separate lists wasn't nearly enough to avoid deadlocks in multiplexed bus cases. We also want to have a dedicated mutex to protect each list. Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: Michael Lawnick <ml.lawnick@gmx.de>
-
由 Jean Delvare 提交于
Uninline i2c adapter locking helper functions, move them to i2c-core, and use them in i2c-core itself. The functions are still exported for external users. This makes future updates to the locking model (which will be needed for multiplexing support) possible and transparent. Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: Michael Lawnick <ml.lawnick@gmx.de>
-
由 Jean Delvare 提交于
Now that i2c-core offers the possibility to provide custom probing function for I2C devices, let's make use of it. Signed-off-by: NJean Delvare <khali@linux-fr.org> Acked-by: NMauro Carvalho Chehab <mchehab@redhat.com>
-
由 Jean Delvare 提交于
The probe method used by i2c_new_probed_device() may not be suitable for all cases. Let the caller provide its own, optional probe function. Signed-off-by: NJean Delvare <khali@linux-fr.org> Acked-by: NMauro Carvalho Chehab <mchehab@redhat.com>
-
- 11 8月, 2010 1 次提交
-
-
由 Randy Dunlap 提交于
Fix kernel-doc warnings in linux/i2c.h: Warning(include/linux/i2c.h:176): No description found for parameter 'alert' Warning(include/linux/i2c.h:259): No description found for parameter 'of_node' Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 04 5月, 2010 1 次提交
-
-
由 Jean Delvare 提交于
Using a single list for all userspace devices leads to a dead lock on multiplexed buses in some circumstances (mux chip instantiated from userspace). This is solved by using a separate list for each bus segment. Signed-off-by: NJean Delvare <khali@linux-fr.org> Acked-by: NMichael Lawnick <ml.lawnick@gmx.de>
-
- 29 4月, 2010 1 次提交
-
-
由 Grant Likely 提交于
The struct device_node *of_node pointer is moving out of dev->archdata and into the struct device proper. of_i2c.c needs to set the of_node pointer before the device is registered. Since the i2c subsystem doesn't allow 2 stage allocation and registration of i2c devices, the of_node pointer needs to be passed via the i2c_board_info structure so that it is set prior to registration. This patch adds of_node to struct i2c_board_info (conditional on CONFIG_OF), sets of_node in i2c_new_device(), and modifies of_i2c.c to use the new parameter. The calling of dev_archdata_set_node() from of_i2c will be removed in a subsequent patch when of_node is removed from archdata and all users are converted over. Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
-
- 02 3月, 2010 2 次提交
-
-
由 Zhangfei Gao 提交于
i2c_master_send & i2c_master_recv do not support more than 64 kb transfer, since msg.len is u16. Signed-off-by: NZhangfei Gao <zgao6@marvell.com> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
由 Jean Delvare 提交于
SMBus alert support. The SMBus alert protocol allows several SMBus slave devices to share a single interrupt pin on the SMBus master, while still allowing the master to know which slave triggered the interrupt. This is based on preliminary work by David Brownell. The key difference between David's implementation and mine is that his was part of i2c-core, while mine is split into a separate, standalone module named i2c-smbus. The i2c-smbus module is meant to include support for all SMBus extensions to the I2C protocol in the future. The benefit of this approach is a zero cost for I2C bus segments which do not need SMBus alert support. Where David's implementation increased the size of struct i2c_adapter by 7% (40 bytes on i386), mine doesn't touch it. Where David's implementation added over 150 lines of code to i2c-core (+10%), mine doesn't touch it. The only change that touches all the users of the i2c subsystem is a new callback in struct i2c_driver (common to both implementations.) I seem to remember Trent was worried about the footprint of David'd implementation, hopefully mine addresses the issue. Signed-off-by: NJean Delvare <khali@linux-fr.org> Acked-by: NJonathan Cameron <jic23@cam.ac.uk> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Trent Piepho <tpiepho@freescale.com>
-
- 15 12月, 2009 1 次提交
-
-
由 Jean Delvare 提交于
There is no user left of I2C_CLIENT_MODULE_PARM, so we can finally get rid of this ugly macro. Signed-off-by: NJean Delvare <khali@linux-fr.org> Tested-by: NWolfram Sang <w.sang@pengutronix.de>
-