- 07 12月, 2009 4 次提交
-
-
由 Jean Delvare 提交于
Functions i2c_do_add_adapter() and __attach_adapter() do essentially the same thing, differing only in how the parameters are passed. Same for i2c_do_add_adapter() and __detach_adapter(). Introduce wrappers to normalize the parameters, so that we do not have to duplicate the code. Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: David Brownell <dbrownell@users.sourceforge.net>
-
由 Jean Delvare 提交于
The kind parameter of i2c_detect_address() always has value -1, so we can get rid of it. Next step is to update all i2c detect callback functions to get rid of this now useless parameter. Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
由 Jean Delvare 提交于
The legacy probe and force module parameters are obsolete now, the same can be achieved using the new_device sysfs interface, which is both more flexible and cheaper (it is implemented by i2c-core rather than replicated in every driver module.) The legacy ignore module parameters can be dropped as well. Ignoring can be done by instantiating a "dummy" device at the problematic address. This is the first step of a huge cleanup to i2c-core's i2c_detect function, i2c.h's I2C_CLIENT_INSMOD* macros, and all drivers that made use of them. Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
由 Mika Kuoppala 提交于
Low priority thread holding the i2c bus mutex could block higher priority threads to access the bus resulting in unacceptable latencies. Change the mutex type to rt_mutex preventing priority inversion. Tested-by: NPeter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: NMika Kuoppala <mika.kuoppala@nokia.com> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 26 11月, 2009 1 次提交
-
-
由 Jean Delvare 提交于
Fix userspace_device list corruption. The corruption was caused by clients not being removed when adapters with such clients were themselves removed. Something like the following would trigger it (assuming i2c-stub gets adapter number 3): # modprobe i2c-stub chip_addr=0x50 # echo 24c08 0x50 > /sys/bus/i2c/devices/i2c-3/new_device # rmmod i2c-stub # modprobe i2c-stub chip_addr=0x50 # echo 24c08 0x50 > /sys/bus/i2c/devices/i2c-3/new_device For the records, the stack trace in the kernel logs look like this: kernel: WARNING: at lib/list_debug.c:30 __list_add+0x8b/0x90() kernel: Hardware name: (...) kernel: list_add corruption. prev->next should be next (c137fc84), but was (null). (prev=f57111b8). kernel: Modules linked in: (...) kernel: Pid: 4669, comm: bash Not tainted 2.6.32-rc8 #259 kernel: Call Trace: kernel: [<c111eb8b>] ? __list_add+0x8b/0x90 kernel: [<c111eb8b>] ? __list_add+0x8b/0x90 kernel: [<c103265c>] warn_slowpath_common+0x6c/0xc0 kernel: [<c111eb8b>] ? __list_add+0x8b/0x90 kernel: [<c10326f6>] warn_slowpath_fmt+0x26/0x30 kernel: [<c111eb8b>] __list_add+0x8b/0x90 kernel: [<c11ba165>] i2c_sysfs_new_device+0x1c5/0x250 kernel: [<c10861be>] ? might_fault+0x2e/0x80 kernel: [<c11b9fa0>] ? i2c_sysfs_new_device+0x0/0x250 kernel: [<c118c625>] dev_attr_store+0x25/0x30 kernel: [<c10e305c>] sysfs_write_file+0x9c/0xf0 kernel: [<c109d35c>] vfs_write+0x9c/0x160 kernel: [<c10e2fc0>] ? sysfs_write_file+0x0/0xf0 kernel: [<c109d4dd>] sys_write+0x3d/0x70 kernel: [<c1002ed8>] sysenter_do_call+0x12/0x36 Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 19 9月, 2009 3 次提交
-
-
由 Jean Delvare 提交于
Some user-space applications may be relying on i2c adapters showing up as class devices in sysfs. Provide compatibility links for them for the time being. We will remove them after a long transition period. Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: Kay Sievers <kay.sievers@vrfy.org>
-
由 Jean Delvare 提交于
Kay says i2c adapters shouldn't be class devices but bus devices. Convert them that way, using a device type. Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: Kay Sievers <kay.sievers@vrfy.org>
-
由 Jean Delvare 提交于
This is required for upcoming changes. Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: Kay Sievers <kay.sievers@vrfy.org>
-
- 19 6月, 2009 9 次提交
-
-
由 Rodolfo Giometti 提交于
By using rwsem we can easily manage recursive calls of i2c_scan_static_board_info() function without breaking the locking. Signed-off-by: NRodolfo Giometti <giometti@linux.it> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
由 Jean Delvare 提交于
Add a sysfs interface to instantiate and delete I2C devices. This is primarily a replacement of the force_* module parameters implemented by some i2c drivers. These module parameters were implemented internally by the I2C_CLIENT_INSMOD* macros, which don't scale well. This can also be used when developing a driver on a self-soldered board which doesn't yet have proper I2C device declaration at the platform level, and presumably for various debugging situations. Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: David Brownell <dbrownell@users.sourceforge.net>
-
由 Jean Delvare 提交于
The i2c-core code tends to hold the core lock for longer than it should. Limit locking to the necessary sections for both performance and clarity. This is also a requirement to support I2C multiplexers in the future. Signed-off-by: NJean Delvare <khali@linux-fr.org> Tested-by: NRodolfo Giometti <giometti@linux.it> Cc: David Brownell <dbrownell@users.sourceforge.net>
-
由 Jean Delvare 提交于
We used to maintain our own per-adapter list of i2c clients, but this is redundant with what the driver core does, and no longer needed. Just drop the redundant list. Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: David Brownell <dbrownell@users.sourceforge.net>
-
由 Jean Delvare 提交于
Legacy i2c drivers are gone, all drivers are new-style now, so there is no point to check. Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: David Brownell <dbrownell@users.sourceforge.net>
-
由 Jean Delvare 提交于
Now that i2c_attach_client is no longer exported, it doesn't need to be a separate function. Merge it into its only user, i2c_new_device. Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: David Brownell <dbrownell@users.sourceforge.net>
-
由 Jean Delvare 提交于
The legacy i2c_probe() function has no users left, get rid of it. Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: David Brownell <dbrownell@users.sourceforge.net>
-
由 Jean Delvare 提交于
We converted all the legacy i2c drivers so we can finally get rid of the legacy binding model. Hooray! Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: David Brownell <dbrownell@users.sourceforge.net>
-
由 Jean Delvare 提交于
These methods were useful in the legacy binding model but no longer in the new (standard) binding model. There are no users left so we can drop them. Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: David Brownell <dbrownell@users.sourceforge.net>
-
- 16 6月, 2009 3 次提交
-
-
由 Jean Delvare 提交于
We don't need to give adapters a parent if they don't have one. The driver core will put them in the virtual device directory and all will be fine. Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
由 Clifford Wolf 提交于
Some small changes in i2c core to retry i2c xfers until either the maximum number of retries or the timeout is hit. Signed-off-by: NClifford Wolf <clifford@clifford.at> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
由 Jack Stone 提交于
Remove uneeded void casts. Signed-off-by: NJack Stone <jwjstone@fastmail.fm> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 13 4月, 2009 1 次提交
-
-
由 Jean Delvare 提交于
While it isn't the way the standard device binding model works, it is OK for new-style drivers to implement attach_adapter. It may help convert the renaming legacy drivers to new style drivers faster. Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: David Brownell <dbrownell@users.sourceforge.net>
-
- 29 3月, 2009 3 次提交
-
-
由 Zhenwen Xu 提交于
Some lines over 80. The printk(KERN_ERR ... ) should be dev_err. And some blankspace should be deleted. Signed-off-by: NZhenwen Xu <helight.xu@gmail.com> Signed-off-by: NJean Delvare <khlai@linux-fr.org>
-
由 Jean Delvare 提交于
Setting a default timeout value on a per-algo basis doesn't make any sense. Move the default value setting to i2c-core. Individual adapter drivers can specify a different (non-zero) value if they wish. Also express the timeout value in a way which results in the same duration regarless of the value of HZ. Signed-off-by: NJean Delvare <khali@linux-fr.org> Acked-by: NWolfram Sang <w.sang@pengutronix.de>
-
由 Jean Delvare 提交于
The automatic removal of i2c clients only affects the clients which were created automatically in the first place. Add a comment saying that to avoid any confusion. Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 25 3月, 2009 1 次提交
-
-
由 Ming Lei 提交于
This patch implements uevent suppress in kobject and removes it from struct device, based on the following ideas: 1,Uevent sending should be one attribute of kobject, so suppressing it in kobject layer is more natural than in device layer. By this way, we can do it for other objects embedded with kobject. 2,It may save several bytes for each instance of struct device.(On my omap3(32bit ARM) based box, can save 8bytes per device object) This patch also introduces dev_set|get_uevent_suppress() helpers to set and query uevent_suppress attribute in case to help kobject as private part of struct device in future. [This version is against the latest driver-core patch set of Greg,please ignore the last version.] Signed-off-by: NMing Lei <tom.leiming@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
- 25 2月, 2009 1 次提交
-
-
由 Roel Kluin 提交于
Fix misplaced parentheses. Signed-off-by: NRoel Kluin <roel.kluin@gmail.com> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 07 1月, 2009 1 次提交
-
-
由 Kay Sievers 提交于
This patch is part of a larger patch series which will remove the "char bus_id[20]" name string from struct device. The device name is managed in the kobject anyway, and without any size limitation, and just needlessly copied into "struct device". To set and read the device name dev_name(dev) and dev_set_name(dev) must be used. If your code uses static kobjects, which it shouldn't do, "const char *init_name" can be used to statically provide the name the registered device should have. At registration time, the init_name field is cleared, to enforce the use of dev_name(dev) to access the device name at a later time. We need to get rid of all occurrences of bus_id in the entire tree to be able to enable the new interface. Please apply this patch, and possibly convert any remaining remaining occurrences of bus_id. We want to submit a patch to -next, which will remove bus_id from "struct device", to find the remaining pieces to convert, and finally switch over to the new api, which will remove the 20 bytes array and does no longer have a size limitation. Acked-by: NGreg Kroah-Hartman <gregkh@suse.de> Signed-off-by: NKay Sievers <kay.sievers@vrfy.org> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 28 11月, 2008 1 次提交
-
-
由 Jean Delvare 提交于
i2c clients should be removed in reverse order compared to the probe (actually: bind) order. This matters when several clients depend on each other. Signed-off-by: NJean Delvare <khali@linux-fr.org> Tested-by: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
-
- 23 10月, 2008 1 次提交
-
-
由 Anton Vorontsov 提交于
If present the info->archdata is copied into the dev->archdata. Some (OpenFirmware) platforms need it. Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 14 10月, 2008 3 次提交
-
-
由 Prakash Mortha 提交于
Restore the i2c_smbus_process_call() as one driver (for the Micronas MAP5401) will need it soon. [JD: Update documentation accordingly.] Signed-off-by: NPrakash Mortha <pmortha@escient.com> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
由 David Brownell 提交于
Move I2C driver model init earlier in the boot sequence. This avoids oopsing in statically linked systems when some subsystems register I2C drivers in subsys_initcall() code, but those subsystems are linked (and initialized) before I2C. Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
由 David Brownell 提交于
Guard I2C against oopsing because of init sequence problems, by verifying that i2c_init() has been called before calling any routines that rely on that initialization. This specific test just requires that bus_register(&i2c_bus_type) was called. Examples of this kind of oopsing come from subystems and drivers which register I2C drivers in their subsys_initcall code but which are statically linked before I2C by drivers/Makefile. Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 28 8月, 2008 2 次提交
-
-
由 Jean Delvare 提交于
Some DVB adapters do not support the special I2C transaction that we use for probing purposes. There's no point in logging this event, as there's nothing the user can do and in general there is no actual problem. So, degrade one of these messages to a debug message, and move the other one around so that it is only printed on bogus drivers. Signed-off-by: NJean Delvare <khali@linux-fr.org> Acked-by: NUwe Bugla <uwe.bugla@gmx.de>
-
由 Marc Pignat 提交于
device_init_wakeup must be called after device_register. Signed-off-by: NMarc Pignat <marc.pignat@hevs.ch> Acked-by: NDavid Brownell <david-b@pacbell.net> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 11 8月, 2008 2 次提交
-
-
由 Jean Delvare 提交于
We check for address business in i2c_probe_address(), i2c_detect_address() and i2c_new_probed_device(), but this isn't sufficient. Drivers can call i2c_attach_client() and i2c_new_device() on any address, so we must check the address there as well. This fixes bug #11239: http://bugzilla.kernel.org/show_bug.cgi?id=11239Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
由 Hans Verkuil 提交于
Fix a NULL pointer dereference that happened when calling i2c_new_probed_device on one of the addresses for which we use byte reads instead of quick write for detection purpose (that is: 0x30-0x37 and 0x50-0x5f). Signed-off-by: NHans Verkuil <hverkuil@xs4all.nl> Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
- 22 7月, 2008 1 次提交
-
-
由 Greg Kroah-Hartman 提交于
This mirrors the functionality that driver_for_each_device has as well. We add a start variable, and all callers of the function are fixed up at the same time. The block layer will be using this new functionality in a follow-on patch. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
- 17 7月, 2008 1 次提交
-
-
由 Jean Delvare 提交于
Clear i2c_adapter.dev on adapter removal. This makes it possible to re-add the adapter at a later point, which some drivers (i2c-amd756-s4882, i2c-nforce2-s4985) actually do. This fixes a bug reported by John Stultz here: http://lkml.org/lkml/2008/7/15/720 and by Ingo Molar there: http://lkml.org/lkml/2008/7/16/78Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: John Stultz <johnstul@us.ibm.com> Cc: Ingo Molnar <mingo@elte.hu>
-
- 15 7月, 2008 2 次提交
-
-
由 Jean Delvare 提交于
Add a mechanism to let new-style i2c drivers optionally autodetect devices they would support on selected buses and ask i2c-core to instantiate them. This is a replacement for legacy i2c drivers, much cleaner. Where drivers had to implement both a legacy i2c_driver and a new-style i2c_driver so far, this mechanism makes it possible to get rid of the legacy i2c_driver and implement both enumerated and detected device support with just one (new-style) i2c_driver. Here is a quick conversion guide for these drivers, step by step: * Delete the legacy driver definition, registration and removal. Delete the attach_adapter and detach_client methods of the legacy driver. * Change the prototype of the legacy detect function from static int foo_detect(struct i2c_adapter *adapter, int address, int kind); to static int foo_detect(struct i2c_client *client, int kind, struct i2c_board_info *info); * Set the new-style driver detect callback to this new function, and set its address_data to &addr_data (addr_data is generally provided by I2C_CLIENT_INSMOD.) * Add the appropriate class to the new-style driver. This is typically the class the legacy attach_adapter method was checking for. Class checking is now mandatory (done by i2c-core.) See <linux/i2c.h> for the list of available classes. * Remove the i2c_client allocation and freeing from the detect function. A pre-allocated client is now handed to you by i2c-core, and is freed automatically. * Make the detect function fill the type field of the i2c_board_info structure it was passed as a parameter, and return 0, on success. If the detection fails, return -ENODEV. Signed-off-by: NJean Delvare <khali@linux-fr.org>
-
由 Jean Delvare 提交于
We call adapter->client_register for both legacy and new-style i2c devices, however we only call adapter->client_unregister for legacy drivers. This doesn't make much sense. Usually, drivers will undo in client_unregister what they did in client_register, so we should call neither or both for every given i2c device. In order to ease the transition from legacy to new-style devices, it seems preferable to actually call both. Signed-off-by: NJean Delvare <khali@linux-fr.org> Cc: David Brownell <david-b@pacbell.net>
-