summaryrefslogtreecommitdiff
path: root/drivers/i2c
AgeCommit message (Collapse)Author
2006-11-29proper flags type of spin_lock_irqsave()Alexey Dobriyan
Convert various spin_lock_irqsave() callers to correctly use `unsigned long' Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-25i2c: Handle i2c_add_adapter failure in i2c algorithm driversMark M. Hoffman
It is possible for i2c_add_adapter() to fail. Several I2C algorithm drivers ignore that fact. This (compile-tested only) patch fixes them. Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-24Fix i2c-ixp4xx compilation breakageJean Delvare
Fix recent i2c-ixp4xx compilation breakage. Sorry for overlooking it. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-23i2c-ixp4xx: fix ") != 0))" typoAlexey Dobriyan
i2c_bit_add_bus() returns -E; -E != 0 => err = 1 probe fails with positive error code Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-11scx200_acb: Fix the block transactionsJean Delvare
The scx200_acb i2c bus driver pretends to support SMBus block transactions, but in fact it implements the more simple I2C block transactions. Additionally, it lacks sanity checks on the length of the block transactions, which could lead to a buffer overrun. This fixes an oops reported by Alexander Atanasov: http://marc.theaimsgroup.com/?l=linux-kernel&m=114970382125094 Thanks to Ben Gardner for fixing my bugs :) Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-11Fix the scx200_acb state machine:Thomas Andrews
* Nack was sent one byte too late on reads >= 2 bytes. * Stop bit was set one byte too late on reads. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-09-22I2C: fix 'ignore' module parameter handlingMark M. Hoffman
This patch fixes a bug in the handling of 'ignore' module parameters of I2C client drivers. Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-05-20[PATCH] scx200_acb: Fix resource name use after freeJean Delvare
We can't pass a string on the stack to request_region. As soon as we leave the function that stack is gone and the string is lost. Let's use the same string we identify the i2c_adapter with instead, it's more simple, more consistent, and just works. This is the second half of fix to bug #6445. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-24[PATCH] m41t00: fix bitmasks when writing to chipDavid Barksdale
Fix the bitmasks used when writing to the M41T00 registers. The original code used a mask of 0x7f when writing to each register, this is incorrect and probably the result of a copy-paste error. As a result years from 1980 to 1999 will be read back as 2000 to 2019. Signed-off-by: David Barksdale <amatus@ocgnet.org> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-24[PATCH] i2c-i801: Fix resume when PEC is usedJean Delvare
Fix for bug #6395: Fail to resume on Tecra M2 with ADM1032 and Intel 82801DBM The BIOS of the Tecra M2 doesn't like it when it has to reboot or resume after the i2c-i801 driver has left the SMBus in PEC mode. I have a more complete fix for 2.6.17 but the simple approach of leaving the SMBus in non-PEC mode after every transaction should do for -stable. That's what the i2c-i801 driver was doing up to 2.6.15 (inclusive). Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-02-13[PATCH] i2c: Drop outdated probe/remove code in i2c-isaJean Delvare
Probe and remove methods are now defined at bus level. No more need to redefine them at driver level in i2c-isa. This lets us get rid of these annoying messages: Driver 'it87-isa' needs updating - please use bus_type methods Thanks to Nicolas Mailhot for reporting the problem and testing the fix. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-02-06[PATCH] i2c: Use ARRAY_SIZE macroTobias Klauser
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]). Some trailing whitespaces are also removed. Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch> Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-02-06[PATCH] i2c: Use module_param in i2c-algo-sibyteEric Sesterhenn
this patch changes MODULE_PARM usage to module_param in i2c-algo-sibyte.c Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-02-06[PATCH] I2C: Resurrect i2c_smbus_write_i2c_block_data.Jean Delvare
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2006-02-06[PATCH] i2c-i801: I2C patch for Intel ICH8Jason Gaston
This patch adds the Intel ICH8 DID to the i2c-i801.c and Kconfig files for I2C support. Signed-off-by: Jason Gaston <Jason.d.gaston@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-13[PATCH] Add i2c_bus_type probe and remove methodsRussell King
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-12[ARM] 3237/1: PXA I2C driver updatesRichard Purdie
Patch from Richard Purdie This patch adds a check to see if the pxa i2c interface is enabled before allowing it to be used and resets it if found to be disabled. This automatically restores the interface if the device has been suspended and resumed without causing any suspend/resume call ordering issues. The patch also fixes a build warning and adds an appropriate module licence (the module is gpl according to the header). Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-01-09Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-mergeLinus Torvalds
2006-01-09[PATCH] 2/5 powerpc: Rework PowerMac i2c part 2Benjamin Herrenschmidt
This is the continuation of the previous patch. This one removes the old PowerMac i2c drivers (i2c-keywest and i2c-pmac-smu) and replaces them both with a single stub driver that uses the new PowerMac low i2c layer. Now that i2c-keywest is gone, the low-i2c code is extended to support interrupt driver transfers. All i2c busses now appear as platform devices. Compatibility with existing drivers should be maintained as the i2c bus names have been kept identical, except for the SMU bus but in that later case, all users has been fixed. With that patch added, matching a device node to an i2c_adapter becomes trivial. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09[PATCH] 1/5 powerpc: Rework PowerMac i2c part 1Benjamin Herrenschmidt
This is the first part of a rework of the PowerMac i2c code. It completely reworks the "low_i2c" layer. It is now more flexible, supports KeyWest, SMU and PMU i2c busses, and provides functions to match device nodes to i2c busses and adapters. This patch also extends & fix some bugs in the SMU driver related to i2c support and removes the clock spreading hacks from the pmac feature code rather than adapting them to the new API since they'll be replaced by the platform function code completely in patch 3/5 Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-08[PATCH] IRQ type flagsRussell King
Some ARM platforms have the ability to program the interrupt controller to detect various interrupt edges and/or levels. For some platforms, this is critical to setup correctly, particularly those which the setting is dependent on the device. Currently, ARM drivers do (eg) the following: err = request_irq(irq, ...); set_irq_type(irq, IRQT_RISING); However, if the interrupt has previously been programmed to be level sensitive (for whatever reason) then this will cause an interrupt storm. Hence, if we combine set_irq_type() with request_irq(), we can then safely set the type prior to unmasking the interrupt. The unfortunate problem is that in order to support this, these flags need to be visible outside of the ARM architecture - drivers such as smc91x need these flags and they're cross-architecture. Finally, the SA_TRIGGER_* flag passed to request_irq() should reflect the property that the device would like. The IRQ controller code should do its best to select the most appropriate supported mode. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-09[PATCH] powerpc: Unify udbg (#2)Benjamin Herrenschmidt
This patch unifies udbg for both ppc32 and ppc64 when building the merged achitecture. xmon now has a single "back end". The powermac udbg stuff gets enriched with some ADB capabilities and btext output. In addition, the early_init callback is now called on ppc32 as well, approx. in the same order as ppc64 regarding device-tree manipulations. The init sequences of ppc32 and ppc64 are getting closer, I'll unify them in a later patch. For now, you can force udbg to the scc using "sccdbg" or to btext using "btextdbg" on powermacs. I'll implement a cleaner way of forcing udbg output to something else than the autodetected OF output device in a later patch. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-07[ARM] Move asm/hardware/clock.h to linux/clk.hRussell King
This is needs to be visible to other architectures using the AMBA bus and peripherals. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-01-07Merge with Linus' kernel.Russell King
2006-01-05[PATCH] i2c: i2c-mv64xxx fix transaction abortionMark A. Greer
When the i2c-mv64xxx i2c driver is signalled to abort a transaction, it aborts it immediately by issuing a stop condition on the bus. This violates the i2c protocol and can cause what appears to be an i2c bus hang. This patch delays issuing the stop condition until the i2c device can reasonably expect a stop condition. Also includes a minor fixup. Signed-off-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2006-01-05[PATCH] i2c: i2c-nforce2 add nforce4 MCP-04 device IDJean Delvare
One more supported PCI ID for the i2c-nforce2 driver. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] i2c: i2c-ibm_iic add I2C_CLASS_HWMONMartin Hicks
Add the ibm_iic driver to the HWMON class so it will scan the bus for connected hardware monitor sensors. Signed-off-by: Martin Hicks <mort@bork.org> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] i2c: I2C_DF_NOTIFY removal comment cleanupsJean Delvare
The removal of I2C_DF_NOTIFY left some out of date comments in the code. Drop them. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] i2c: drop empty i2c_driver.command implementationsLaurent Riffard
Given that implementing i2c_driver.command is optional, there is no point in an empty implementation thereof. Signed-off-by: Laurent Riffard <laurent.riffard@free.fr> Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Michael Geng <linux@MichaelGeng.de> Cc: Petr Vandrovec <vandrove@vc.cvut.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] I2C: move i2c-dev to use dynamic class devicesGreg Kroah-Hartman
i2c-dev doesn't use the reference counting logic of struct class_device so move it to the dynamic method. This makes the code paths simpler and the driver smaller. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Cc: Jean Delvare <khali@linux-fr.org>
2006-01-05[PATCH] I2C: Remove .owner setting from i2c_driver as it's no longer neededGreg Kroah-Hartman
Now that i2c_add_driver() doesn't need the module owner to be set by hand, we can delete it from the drivers. This patch catches all of the drivers that I found in the current tree (if a driver sets the .owner by hand, it's not a problem, just not needed.) Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Cc: Jean Delvare <khali@linux-fr.org>
2006-01-05[PATCH] I2C: Make i2c_add_driver automatically set the proper module ownerGreg Kroah-Hartman
This prevents i2c drivers from messing up and forgetting to set the module owner of their driver. It also reduces the size of their drivers by one line :) Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Cc: Jean Delvare <khali@linux-fr.org>
2006-01-05[PATCH] I2C: Fix up debug build error for previous i2c structure changesGreg Kroah-Hartman
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2006-01-05[PATCH] i2c: Drop i2c_driver.{owner,name}, 2 of 11Laurent Riffard
We should use the i2c_driver.driver's .name and .owner fields instead of the i2c_driver's ones. This patch updates the miscellaneaous i2c chip drivers. Signed-off-by: Laurent Riffard <laurent.riffard@free.fr> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] i2c: Drop i2c_driver.{owner,name}, 1 of 11Laurent Riffard
We should use the i2c_driver.driver's .name and .owner fields instead of the i2c_driver's ones. This patch updates the core of the i2c drivers: it removes .name and .owner fields from the struct i2c_device and modify various functions to use struct device fields instead. Signed-off-by: Laurent Riffard <laurent.riffard@free.fr> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] i2c: Rework client usage count, 3 of 3Jean Delvare
Do not limit the usage count of i2c clients to 1. In other words, change the client usage count behavior from the old I2C_CLIENT_ALLOW_USE to the old I2C_CLIENT_ALLOW_MULTIPLE_USE. The rationale is that no driver actually needs the limiting behavior, and the unlimiting behavior is slightly easier to implement. Update the documentation to reflect this change. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] i2c: Rework client usage count, 2 of 3Jean Delvare
Make I2C_CLIENT_ALLOW_USE the default for all i2c clients. It doesn't hurt if the usage count is actually never used for any given driver, and allows for nice code simplifications in i2c-core. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] i2c: Rework client usage count, 1 of 3Jean Delvare
No i2c client uses the I2C_CLIENT_ALLOW_MULTIPLE_USE flag, drop it. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] i2c: Drop i2c_driver.flags, 2 of 3Jean Delvare
Just about every i2c chip driver sets the I2C_DF_NOTIFY flag, so we can simply make it the default and drop the flag. If any driver really doesn't want to be notified when i2c adapters are added, that driver can simply omit to set .attach_adapter. This approach is also more robust as it prevents accidental NULL pointer dereferences. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] i2c: Add support for Barco LPT->DVI to i2c-parportPeter Korsgaard
The following patch adds support for the Barco LPT->DVI I2C adapter to the i2c-parport driver. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] i2c: Remove duplicate rtc8564 BCD macrosNicolas Kaiser
Remove duplicate of BCD macros. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] i2c: Extend ds1337 initializationMichael Burian
Add code to handle case where board firmware does not start the RTC. Signed-off-by: Jean Delvare <khali@linux-fr.org> CC: James Chapman <jchapman@katalix.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] i2c: i2c-i801 explicitly enables/disables PECMark M. Hoffman
This patch tweaks i2c-i801.c so that the driver always sets the SMBAUXCTL register (which enables/disables PEC) explicitly before each transaction. Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-03[ARM] Remove clk_use()/clk_unuse()Russell King
It seems that clk_use() and clk_unuse() are additional complexity which isn't required anymore. Remove them from the clock framework to avoid the additional confusion which they cause, and update all ARM machine types except for OMAP. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-12-16[PATCH] i2c: Fix i2c-mv64xxx compilation errorMark A. Greer
The busses/i2c-mv64xxx.c driver doesn't currently compile because of an incorrect argument to dev_err(). This patch fixes that. Signed-off-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-17[DRIVER MODEL] Fix merge clashes with ARM ixp2000 / ixp4xx platformsRussell King
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-11-11Merge master.kernel.org:/home/rmk/linux-2.6-drvmodelLinus Torvalds
2005-11-10[PATCH] PCI: removed unneeded .owner field from struct pci_driverGreg Kroah-Hartman
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-11-09[DRIVER MODEL] Convert platform drivers to use struct platform_driverRussell King
This allows us to eliminate the casts in the drivers, and eventually remove the use of the device_driver function pointer methods for platform device drivers. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-11-07[PATCH] i2c-viapro: Some adjustmentsJean Delvare
The big i2c-viapro SMBus driver update which went into 2.6.14-git1 introduced a few minor issues. Nothing critical, but I would like a few adjustments to be merged in to fix the following problems: * VIA should not be spelled Via. * Frodo Looijaard and Philip Edelbrock did not write the i2c-viapro driver. * When debugging is disabled, half of messages would be logged. * Drop an unneeded masking. * Some port reads can be avoided now that the transaction size is passed as a parameter to vt596_transaction(). * SMBus Receive Byte transactions are used for probing too (for EEPROMs), so hide errors on these too. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>