- 28 Mar, 2009 3 commits
-
-
Zhenwen Xu authored
Some lines over 80. The printk(KERN_ERR ... ) should be dev_err. And some blankspace should be deleted. Signed-off-by:
Zhenwen Xu <helight.xu@gmail.com> Signed-off-by:
Jean Delvare <khlai@linux-fr.org>
-
Jean Delvare authored
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:
Jean Delvare <khali@linux-fr.org> Acked-by:
Wolfram Sang <w.sang@pengutronix.de>
-
Jean Delvare authored
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:
Jean Delvare <khali@linux-fr.org>
-
- 24 Mar, 2009 1 commit
-
-
Ming Lei authored
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:
Ming Lei <tom.leiming@gmail.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- 24 Feb, 2009 1 commit
-
-
Roel Kluin authored
Fix misplaced parentheses. Signed-off-by:
Roel Kluin <roel.kluin@gmail.com> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
- 07 Jan, 2009 1 commit
-
-
Kay Sievers authored
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:
Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by:
Kay Sievers <kay.sievers@vrfy.org> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
- 28 Nov, 2008 1 commit
-
-
Jean Delvare authored
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:
Jean Delvare <khali@linux-fr.org> Tested-by:
Guennadi Liakhovetski <g.liakhovetski@gmx.de>
-
- 22 Oct, 2008 1 commit
-
-
Anton Vorontsov authored
If present the info->archdata is copied into the dev->archdata. Some (OpenFirmware) platforms need it. Signed-off-by:
Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
- 14 Oct, 2008 3 commits
-
-
Prakash Mortha authored
Restore the i2c_smbus_process_call() as one driver (for the Micronas MAP5401) will need it soon. [JD: Update documentation accordingly.] Signed-off-by:
Prakash Mortha <pmortha@escient.com> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
David Brownell authored
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:
David Brownell <dbrownell@users.sourceforge.net> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
David Brownell authored
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:
David Brownell <dbrownell@users.sourceforge.net> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
- 28 Aug, 2008 2 commits
-
-
Jean Delvare authored
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:
Jean Delvare <khali@linux-fr.org> Acked-by:
Uwe Bugla <uwe.bugla@gmx.de>
-
Marc Pignat authored
device_init_wakeup must be called after device_register. Signed-off-by:
Marc Pignat <marc.pignat@hevs.ch> Acked-by:
David Brownell <david-b@pacbell.net> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
- 10 Aug, 2008 2 commits
-
-
Jean Delvare authored
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=11239 Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
Hans Verkuil authored
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:
Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
- 22 Jul, 2008 1 commit
-
-
Greg Kroah-Hartman authored
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:
Greg Kroah-Hartman <gregkh@suse.de>
-
- 16 Jul, 2008 1 commit
-
-
Jean Delvare authored
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/78 Signed-off-by:
Jean Delvare <khali@linux-fr.org> Cc: John Stultz <johnstul@us.ibm.com> Cc: Ingo Molnar <mingo@elte.hu>
-
- 14 Jul, 2008 12 commits
-
-
Jean Delvare authored
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:
Jean Delvare <khali@linux-fr.org>
-
Jean Delvare authored
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:
Jean Delvare <khali@linux-fr.org> Cc: David Brownell <david-b@pacbell.net>
-
Jon Smirl authored
Export the root of the i2c bus so that PowerPC device tree code can iterate over devices on the i2c bus. Signed-off-by:
Jon Smirl <jonsmirl@gmail.com> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
Jean Delvare authored
i2c_driver.id_table is mandatory now, so we can simplify i2c_device_probe() a bit. Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
Jean Delvare authored
i2c_del_driver() can be simplified a bit. Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
Matthias Kaehlcke authored
Use list_for_each_entry_safe() in i2c_del_adapter() and i2c_del_driver(). Signed-off-by:
Matthias Kaehlcke <matthias@kaehlcke.net> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
David Brownell authored
Defend the i2c refcount calls against NULL pointers, as is important (and conventional) for such calls. Note that none of the current callers of i2c_use_client() use its return value. [JD: I hate this but apparently all the other subsystems do it so...] Signed-off-by:
David Brownell <dbrownell@users.sourceforge.net> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
David Brownell authored
Provide kerneldoc for most of the I2C and SMBus I/O calls. Add a comment summarizing some fault reporting issues which affect the ability to provide clean fault reports through I2C master transfer calls. (Making it hard to precisely specify their return values...) Signed-off-by:
David Brownell <dbrownell@users.sourceforge.net> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
Jean Delvare authored
Function i2c_smbus_write_quick has no users left, so we can delete it. Also update the list of these helper functions which are gone but could be added back if needed. Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
David Brownell authored
More updates to the I2C stack's fault reporting: make the core stop returning "-1" (usually "-EPERM") for all faults. Instead, pass lower level fault code up the stack, or return some appropriate errno. This patch happens to touch almost exclusively SMBus calls. Signed-off-by:
David Brownell <dbrownell@users.sourceforge.net> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
Jean Delvare authored
i2c-core doesn't use seq files, so doesn't need to include <linux/seq_file.h>. Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
Dave Young authored
Use class_for_each_device for iteration. Signed-off-by:
Dave Young <hidave.darkstar@gmail.com> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
- 18 May, 2008 1 commit
-
-
Jean Delvare authored
Remove the old driver_name/type scheme for i2c driver matching. Only the standard aliasing model will be used from now on. Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
- 11 May, 2008 1 commit
-
-
Jean Delvare authored
As the old driver_name/type matching scheme is going away soon, change the dummy device mechanism to use the new matching scheme. This has the downside that dummy i2c clients can no longer choose their name, they'll all appear as "dummy" in sysfs and in log messages. I don't think it is a problem in practice though, as there is little reason to use these i2c clients to log messages. Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
- 29 Apr, 2008 1 commit
-
-
Jean Delvare authored
Based on earlier work by Jon Smirl and Jochen Friedrich. This patch allows new-style i2c chip drivers to have alias names using the official kernel aliasing system and MODULE_DEVICE_TABLE(). At this point, the old i2c driver binding scheme (driver_name/type) is still supported. Signed-off-by:
Jean Delvare <khali@linux-fr.org> Cc: Jochen Friedrich <jochen@scram.de> Cc: Jon Smirl <jonsmirl@gmail.com> Cc: Kay Sievers <kay.sievers@vrfy.org>
-
- 22 Apr, 2008 1 commit
-
-
Harvey Harrison authored
__FUNCTION__ is gcc-specific, use __func__. Signed-off-by:
Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
- 18 Apr, 2008 1 commit
-
-
Matthew Wilcox authored
Signed-off-by:
Matthew Wilcox <willy@linux.intel.com>
-
- 23 Mar, 2008 1 commit
-
-
Randy Dunlap authored
Sometimes kernel-doc and xmlto conspire to create output that is invalid and causes problems. Until I know a real/better solution, change the source code that causes this. If anyone has better fixes or can just explain what is happening here, that would be great. xmlto: input does not validate (status 1) mmotm-2008-0314-1449/Documentation/DocBook/kernel-api.xml:71468: parser error : Opening and ending tag mismatch: programlisting line 71464 and para </para><para> ^ mmotm-2008-0314-1449/Documentation/DocBook/kernel-api.xml:71480: parser error : Opening and ending tag mismatch: para line 71473 and programlisting </programlisting></informalexample> ^ make[1]: *** [Documentation/DocBook/kernel-api.html] Error 1 Signed-off-by:
Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
- 12 Mar, 2008 1 commit
-
-
Hans Verkuil authored
Ensure that client->driver is set to NULL if the probe() returns an error (this keeps client->driver and client->dev.driver in sync). Signed-off-by:
Hans Verkuil <hverkuil@xs4all.nl> Acked-by:
David Brownell <dbrownell@users.sourceforge.net> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
- 27 Jan, 2008 4 commits
-
-
David Brownell authored
This adds a i2c_new_dummy() primitive to help work with devices that consume multiple addresses, which include many I2C eeproms and at least one RTC. Signed-off-by:
David Brownell <dbrownell@users.sourceforge.net> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
Jean Delvare authored
It is no longer required to hold adapter->clist_lock to call i2c_check_addr. Signed-off-by:
Jean Delvare <khali@linux-fr.org> Cc: David Brownell <david-b@pacbell.net>
-
Jean Delvare authored
We only need to hold adapter->clist_lock when we touch the client list. Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
David Brownell authored
This goes on top of the patch removing most i2c_adapter.clients usage, updating i2c_attach_client: - Don't call device_register() while holding clist_lock. This removes a self-deadlock when on the i2c_driver.probe() path, for drivers that need to attach new devices (e.g. dummies). - Remove a redundant address check. The driver model core does this as a consequence of guaranteeing unique names. - Move the "device registered" diagnostic so that it never lies; previously, on error paths it would falsely report success. Signed-off-by:
David Brownell <dbrownell@users.sourceforge.net> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-