summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
Commit message (Collapse)AuthorAgeFilesLines
* i2c: Limit locking scope in i2c_detach_clientJean Delvare2008-01-271-1/+2
| | | | | | We only need to hold adapter->clist_lock when we touch the client list. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-remove-redundant-i2c_client-list.patchDavid Brownell2008-01-271-14/+8
| | | | | | | | | | | | | | | | | | 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>
* i2c: Stop using the redundant client listDavid Brownell2008-01-272-49/+58
| | | | | | | | | | | | | | | | | | | | | | | | | The i2c_adapter.clients list of i2c_client nodes duplicates driver model state. This patch starts removing that list, letting us remove most existing users of those i2c-core lists. * The core I2C code now iterates over the driver model's list instead of the i2c-internal one in some places where it's safe: - Passing a command/ioctl to each client, a mechanims used almost exclusively by DVB adapters; - Device address checking, in both i2c-core and i2c-dev. * Provide i2c_verify_client() to use with driver model iterators. * Flag the relevant i2c_adapter and i2c_client fields as deprecated, to help prevent new users from appearing. For the moment the list needs to stick around, since some issues show up when deleting devices created by legacy I2C drivers. (They don't follow standard driver model rules. Removing those devices can cause self-deadlocks.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-viapro: Add support for the VT8237SJean Delvare2008-01-272-2/+6
| | | | | | | Add support for another variant of the VT8237. I couldn't test I2C block support but I assume it is present as well. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-piix4: Drop redundant PCI function number checkJean Delvare2008-01-271-26/+15
| | | | | | | Checking the PCI function number doesn't add any value, and it makes adding dynamic IDs to the driver more difficult. Drop this check. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Let the user specify PCI driver data through new_idJean Delvare2008-01-272-0/+10
| | | | | | | | | | | The i2c-amd756 and i2c-viapro drivers make use of the driver_data field of the PCI device ID. When adding device IDs dynamically (by writing to the new_id sysfs file) you cannot set the value of this field by default. It has to be allowed explicitly. Do that, and check the value so that the user can't crash the kernel accidentally. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
* i2c-pxa: Add polling transferMike Rapoport2008-01-271-12/+121
| | | | | | | | | | Add polling I2C transfer implementation for PXA I2C. This is needed for cases where I2C transactions have to occur at times interrups are disabled. Signed-off-by: Mike Rapoport <mike@compulab.co.il> Acked-by: eric miao <eric.miao@marvell.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Support i2c_transfer in atomic contextsMike Rapoport2008-01-271-1/+11
| | | | | | | | | Allow i2c_transfer to be called in contexts where sleeping is not allowed. It is the reponsability of the caller to ensure that the underlying i2c bus driver will not sleep either. Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-sibyte: Remove the bus scan module parameterJean Delvare2008-01-271-28/+1
| | | | | | | | | | The implementation is unsafe, and anyway one can achieve the same from userspace using i2c-dev + i2cdetect. Also tag i2c_sibyte_add_bus __init. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Ralf Baechle <ralf@linux-mips.org>
* i2c-i801: Implement I2C block read supportJean Delvare2008-01-271-25/+54
| | | | | | | | | | | | I2C block read is supported since the ICH5. I couldn't get it to work using the block buffer, so it's using the old-style byte-by-byte mode for now. Note: I'm also updating the driver author... The i2c-i801 driver was really written by Mark Studebaker, even though he based his work on the i2c-piix4 driver which was written by Philip Edelbrock. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: Clear special mode bits as neededJean Delvare2008-01-271-1/+6
| | | | | | | | | | Clear special mode bits (PEC, block buffer) at driver load time, you never know in which state the device was left by its last user. Also make sure that we reset the block buffer mode at the end of every transaction, not only when PEC was used. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: More explicit names for chip featuresJean Delvare2008-01-271-9/+15
| | | | | | | Use separate flags with explicit names to describe the features of the ICH chip. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: Document which chip support what featureJean Delvare2008-01-271-24/+33
| | | | | | | Provide a clearer documentation of which additional features each ICH chip support, and which of these the driver supports. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c/tps65010: move header to <linux/i2c/...>David Brownell2008-01-273-6/+2
| | | | | | | | | Move the tps65010 header file from the OMAP arch directory to the more generic <linux/i2c/...> directory, and remove the spurious dependency of this driver on OMAP. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Rename main mutexJean Delvare2008-01-271-15/+15
| | | | | | | Rename the main mutex in i2c-core from core_lists to core_lock. This makes more sense now that the redundant lists are gone. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Drop redundant i2c_driver.listJean Delvare2008-01-271-23/+35
| | | | | | | | i2c_driver.list is superfluous, this list duplicates the one maintained by the driver core. Drop it. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: David Brownell <dbrownell@users.sourceforge.net>
* i2c: Drop redundant i2c_adapter.listJean Delvare2008-01-271-14/+10
| | | | | | | | i2c_adapter.list is superfluous, this list duplicates the one maintained by the driver core. Drop it. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: David Brownell <dbrownell@users.sourceforge.net>
* i2c: Change prototypes of refcounting functionsJean Delvare2008-01-271-4/+20
| | | | | | | | | | Use more standard prototypes for i2c_use_client() and i2c_release_client(). The former now returns a pointer to the client, and the latter no longer returns anything. This matches what all other subsystems do. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: David Brownell <david-b@pacbell.net>
* i2c: Use the driver model reference countingJean Delvare2008-01-271-44/+2
| | | | | | | | Don't implement our own reference counting mechanism for i2c clients when the driver model already has one. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: David Brownell <david-b@pacbell.net>
* i2c: Deprecate drivers for I2C buses on video adaptersJean Delvare2008-01-271-4/+13
| | | | | | | The framebuffer drivers for these pieces of hardware include support for the DDC/I2C buses, so there is no need for separate drivers. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Don't uselessly set i2c_adapter.retriesJean Delvare2008-01-275-6/+0
| | | | | | | | | | I2C adapter drivers are supposed to handle retries on nack by themselves if they do, so there's no point in setting .retries if they don't. As this retry mechanism is going away (at least in its current form), clean this up now so that we don't get build failures later. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: normal_i2c can be made const (remaining drivers)Jean Delvare2008-01-275-7/+9
| | | | Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Constify client address dataMark M. Hoffman2008-01-271-2/+2
| | | | | | | | This patch allows much of the I2C client address data to move from initdata into text. Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-algo-pcf: Delete broken 10-bit address supportJean Delvare2008-01-271-72/+13
| | | | | | | | The 10-bit address support in i2c-algo-pcf is so heavily broken that it can't have ever been used. Nobody ever complained, so I'll take it that nobody needs it. Let's just delete it. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-algo-bit: Fix NAK/ARB commentsDavid Brownell2008-01-271-4/+20
| | | | | | | | | | | | | Update comments and logging on return path for byte writes. NAK is an error, to be reported or optionally ignored. Timeouts are always errors. Lost arbitration is not currently handled, so don't even list it as an option in the error message. Don't return bogus EFAULT code for inappropriate NAK; EIO is better, there is no bad userspace address in question. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-algo-bit: Whitespace fixes (+ NAK/ARB comments)David Brownell2008-01-271-97/+105
| | | | | | | | Fix *LOTS* of whitespace goofs and checkpatch.pl warnings, strangely parenthesized ternary expressions, and other CodingStyle glitches. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-pxa: Remove hardcoded #ifdef and use cpu_is_pxa27xeric miao2008-01-271-29/+29
| | | | | | | | remove #ifdef CONFIG_PXA27x .. #endif and use cpu_is_pxaXXXX() macros so that a single binary can support PXA25x/PXA27x/PXA3xx at run-time. Signed-off-by: eric miao <eric.miao@marvell.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: some overdue driver removalAdrian Bunk2008-01-273-193/+0
| | | | | | | | | | This patch contains the overdue removal of three I2C drivers. [JD: In fact only i2c-ixp4xx can be removed at the moment, the other two platforms don't implement the generic GPIO layer yet.] Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: the scheduled I2C RTC driver removalAdrian Bunk2008-01-275-1131/+0
| | | | | | | | This patch contains the scheduled removal of legacy I2C RTC drivers with replacement drivers. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-stub: Use a single array for byte and word operationsJean Delvare2008-01-271-7/+8
| | | | | | | This mimics the behavior of actual SMBus chips better. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Mark M. Hoffman <mhoffman@lightlink.com>
* i2c/tsl2550: Add power management addedRodolfo Giometti2008-01-271-0/+21
| | | | | Signed-off-by: Rodolfo Giometti <giometti@linux.it> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Add support for the PCF8575 chipBart Van Assche2008-01-273-1/+230
| | | | | Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-ibm_iic: Whitespace cleanupStefan Roese2008-01-272-99/+99
| | | | | Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-pasemi: use i2c_add_numbered_adapter()Olof Johansson2008-01-271-1/+2
| | | | | | | | | | | | | Use numbered adapter registration to always have the same hardware bus show up at the same number. PWRficient 1682M has three buses, they are all on the same PCI device but different functions. So do the simple thing and register them based on function number. Future products, if having a different number of busses, are expected to have similar behaviour w.r.t. device/function layout. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-nforce2: The nForce2 can do block transactionsJean Delvare2008-01-271-0/+1
| | | | | | | | | My guess is that all the chips supported by this driver support block transactions and reset, but for now we play it safe and only list the ones for which this was actually tested. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Oleg Ryjkov <olegr@olegr.ca>
* driver core: Make the dev_*() family of macros in device.h completeEmil Medve2008-01-241-6/+0
| | | | | | | | Removed duplicates defined elsewhere Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* i2c-sibyte: Fix an error pathJean Delvare2008-01-141-2/+5
| | | | | | | | | | | If the registration of the second I2C channel fails, we really want to unregister the first one before we return with an error. While we're here, fix the printk right above so that it displays the real driver name. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Ralf Baechle <ralf@linux-mips.org>
* i2c: Spelling fixesJoe Perches2008-01-143-3/+3
| | | | | | | [JD: One more fix in i2c-dev.] Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-omap: Fix NULL pointer dereferencingTony Lindgren2008-01-141-1/+1
| | | | | | | | | This patch fixes bug #9581 reported by Marcio Buss. If kzalloc fails, omap_i2c_write_reg() tries to reset an unallocated I2C controller. Cc: Marcio Buss <marciobuss@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c/isp1301_omap: Build fixDavid Brownell2007-12-121-1/+1
| | | | | | | | | Build fix to the isp1301_omap driver ... this driver gets built more often in the OMAP tree than in mainline, partly because the defconfig for H2 (plus probably H3 and H4) needs updating. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Add missing spaces in split log messagesJoe Perches2007-12-122-5/+5
| | | | | Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-gpio: Initialize adapter classAtsushi Nemoto2007-12-121-0/+1
| | | | | | | This is required to let hwmon drivers attach to the adapter. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c/eeprom: Recognize VGN as a valid Sony Vaio name prefixJean Delvare2007-11-151-5/+9
| | | | | | | | Recent (i.e. 2005 and later) Sony Vaio laptops have names beginning with VGN rather than PCG. Update the eeprom driver so that it recognizes these. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c/eeprom: Hide Sony Vaio serial numbersJean Delvare2007-11-151-8/+15
| | | | | | | | | | | The sysfs interface to DMI data takes care to not make the system serial number and UUID world-readable, presumably due to privacy concerns. For consistency, we should not let the eeprom driver export these same strings to the world on Sony Vaio laptops. Instead, only make them readable by root, as we already do for BIOS passwords. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-pasemi: Fix NACK detectionOlof Johansson2007-11-151-0/+5
| | | | | | | | | | | Turns out we don't actually check the status to see if there was a device out there to talk to, just if we had a timeout when doing so. Add the proper check, so we don't falsly think there are devices on the bus that are not there, etc. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-pasemi: Replace obsolete "driverfs" reference with "sysfs"Robert P. J. Day2007-11-151-1/+1
| | | | | Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Make i2c_check_addr staticJean Delvare2007-11-151-2/+1
| | | | | | | i2c_check_addr is only used inside i2c-core now, so we can make it static and stop exporting it. Thanks to David Brownell for noticing. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-dev: Unbound new-style i2c clients aren't busyJean Delvare2007-11-151-1/+25
| | | | | | | | | | | | | Let i2c-dev deal properly with new-style i2c clients. Instead of considering them always busy, it needs to check wether a driver is bound to them or not. This is still not completely correct, as the client could become busy later, but the same problem already existed before new-style clients were introduced. We'll want to fix it someday. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: David Brownell <dbrownell@users.sourceforge.net>
* i2c-dev: "how does it work" commentsDavid Brownell2007-11-151-1/+59
| | | | | | | | | | | | | | | | | | | | | | | | | This adds some "how does this work" comments to the i2c-dev driver, plus separators between the three main components: - The parallel list of i2c_adapters ("i2c_dev_list"), each of which gets a "struct i2c_dev" and a /dev/i2c-X character special file. - An i2cdev_driver gets adapter add/remove notifications, which are used to maintain that list of adapters. - Special file operations, which let userspace talk either directly to the adapter (for i2c_msg operations) or through cached addressing info using an anonymous i2c_client (never registered anywhere). Plus there's the usual module load/unload record keeping. After making sense of this code, I think that the anonymous i2c_client is pretty shady. But since it's never registered, using this code with a system set up for "new style" I2C drivers is no more complicated than always using the I2C_SLAVE_FORCE ioctl (instead of I2C_SLAVE). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* typo fixesMatt LaPlante2007-10-201-5/+5
| | | | | | | | | | | | Most of these fixes were already submitted for old kernel versions, and were approved, but for some reason they never made it into the releases. Because this is a consolidation of a couple old missed patches, it touches both Kconfigs and documentation texts. Signed-off-by: Matt LaPlante <kernel1@cyberdogtech.com> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Adrian Bunk <bunk@kernel.org>
OpenPOWER on IntegriCloud