aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c/algos
AgeCommit message (Collapse)Author
2008-08-10i2c: Let users select algorithm drivers manually againJean Delvare
In kernel 2.6.26, the ability to select I2C algorithm drivers manually was removed, as all in-kernel drivers do that automatically. However there were some complaints that it was a problem for out-of-tree I2C bus drivers. In order to address these complaints, let's allow manual selection of these drivers again, but still hide them by default for better general user experience. This closes bug #11140: http://bugzilla.kernel.org/show_bug.cgi?id=11140 Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-07-14i2c-algo-pcf: Multi-master lost-arbitration improvementEric Brower
Improve lost-arbitration handling of PCF8584. This is necessary for support of a currently out-of-kernel driver for Sun Microsystems E250 environmental management; perhaps others. Signed-off-by: Eric Brower <ebrower@gmail.com> Acked-by: Dan Smolik <marvin@mydatex.cz> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-07-14i2c-pca-algo: Fix error codeWolfram Sang
Give a more concrete error code, when the bus is not idle. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-07-14i2c: Bus drivers return -Errno not -1David Brownell
Tighten error paths used by various i2c adapters (mostly x86) so they return real fault/errno codes instead of a "-1" (which is most often interpreted as "-EPERM"). Build tested, with eyeball review. One minor initial goal is to have adapters consistently return the code "-ENXIO" when addressing a device doesn't get an ACK response, at least in the probe paths where they are already good at stifling related logspam. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-04-22i2c-algo-pca: Extend for future driversWolfram Sang
The separation between algorithm and adapter was unsharp at places. This was partly hidden by the fact, that the ISA-driver allowed just one instance and had all private data in static variables. This patch makes neccessary preparations to add a platform driver on top of the algorithm, while still supporting ISA. Note: Due to lack of hardware, the ISA-driver could not be tested except that it builds. Concerning the core struct i2c_algo_pca_data: - A private data field was added, all hardware dependant data may go here. Similar to other algorithms, now a pointer to this data is passed to the adapter's functions. In order to make as less changes as possible to the ISA-driver, it leaves the private data empty and still only uses its static variables. - A "reset_chip" function pointer was added; such a functionality must come from the adapter, not the algorithm. - use a variable "i2c_clock" instead of a function pointer "get_clock", allowing for write access to a default in case a wrong value was supplied. In the algorithm-file: - move "i2c-pca-algo.h" into "linux/i2c-algo-pca.h" - now using per_instance timeout values (i2c_adap->timeout) - error messages specify the device, not only the driver name - restructure initialization to easily support "i2c_add_numbered_adapter" - drop "retries" and "own" (i2c address) as they were unused (The state-machine for I2C-communication was not touched.) In the ISA-driver: - adapt to new algorithm Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-04-22i2c-algo-pca: Remove trailing whitespaces and unnecessary UTFWolfram Sang
Remove trailing whitespaces to make further patches more readable. Also remove an unnecessary UTF-char for simplicity ("us" for microseconds is fine enough). Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-04-22i2c: Remove the algorithm drivers from the config menuJean Delvare
The algorithm drivers are helper drivers that are selected automatically as needed. There's no point in listing them in the config menu, it can only confuse users and waste their time. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-01-27i2c-algo-pcf: Delete broken 10-bit address supportJean Delvare
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>
2008-01-27i2c-algo-bit: Fix NAK/ARB commentsDavid Brownell
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>
2008-01-27i2c-algo-bit: Whitespace fixes (+ NAK/ARB comments)David Brownell
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>
2007-10-19Convert files to UTF-8 and some cleanupsJan Engelhardt
* Convert files to UTF-8. * Also correct some people's names (one example is Eißfeldt, which was found in a source file. Given that the author used an ß at all in a source file indicates that the real name has in fact a 'ß' and not an 'ss', which is commonly used as a substitute for 'ß' when limited to 7bit.) * Correct town names (Goettingen -> Göttingen) * Update Eberhard Mönkeberg's address (http://lkml.org/lkml/2007/1/8/313) Signed-off-by: Jan Engelhardt <jengelh@gmx.de> Signed-off-by: Adrian Bunk <bunk@kernel.org>
2007-09-09i2c-algo-bit: Read block data bugfixDavid Brownell
This fixes a bug in the way i2c-algo-bit handles I2C_M_RECV_LEN, used to implement i2c_smbus_read_block_data(). Previously, in the absence of PEC (rarely used!) it would NAK the "length" byte: S addr Rd [A] [length] NA That prevents the subsequent data bytes from being read: S addr Rd [A] [length] { A [data] }* NA The primary fix just reorders two code blocks, so the length used in the "should I NAK now?" check incorporates the data which it just read from the slave device. However, that move also highlighted other fault handling glitches. This fixes those by abstracting the RX path ack/nak logic, so it can be used in more than one location. Also, a few CodingStyle issues were also resolved. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-07-12i2c-rpx: RemoveJean Delvare
This driver has been broken forever. It depends on i2c-algo-8xx which has never been in the mainline kernel. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-05-01Use menuconfig objects - I2CJan Engelhardt
Allow the whole I2C menu to be disabled at once without diving into the submenus for deselecting all options (should the user desire so). Signed-off-by: Jan Engelhardt <jengelh@gmx.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-05-01i2c-algo-bit: Improve debuggingJean Delvare
Improve the debugging features of the i2c-algo-bit driver: * Make it possible to compile the driver without debugging support at all, making it much smaller. * Use dev_dbg() for debugging messages where possible, and dev_err() for error messages. * Remove redundant debugging messages. These changes allowed for minor code cleanups, which are included as well. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-05-01i2c-algo-bit: Implement a 50/50 SCL duty cycleJean Delvare
The original i2c-algo-bit implementation uses a 33/66 SCL duty cycle when bits are being written on the bus. While the I2C specification doesn't forbid it, this prevents us from driving the I2C bus to its max speed, limiting us to 66 kbps max on standard I2C busses. Implementing a 50/50 duty cycle instead lets us max out the bandwidth up to the theoretical max of 100 kbps on standard I2C busses. This is particularly important when large amounts of data need to be transfered over the bus, as is the case with some TV adapters when the firmware is being uploaded. In fact this change even allows, at least in theory, fast-mode I2C support at 125, 166 and 250 kbps. There's no way to reach the theoretical max of 400 kbps with this implementation. But I don't think we want to put efforts in that direction anyway: software-driven I2C is very CPU-intensive and bad for latency. Other timing changes: * Don't set SDA high explicitly on error, we're going to issue a stop condition before we leave anyway. * If an error occurs when sending the slave address, yield the CPU before retrying, and remove the additional delay after the new start condition. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-05-01i2c-algo-sgi: Comment and whitespace cleanupsLadislav Michl
Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-05-01i2c-algo-bit: Add i2c_bit_add_numbered_busJean Delvare
Add i2c_bit_add_numbered_bus(), which is equivalent to i2c_bit_add_bus except that it calls i2c_add_numbered_adapter() at the end instead of i2c_add_adapter(). Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-05-01i2c-algo-bit: Emulate SMBus block readJean Delvare
Now that i2c-core lets the i2c bus drivers emulate the SMBus block read and SMBus block process call transaction types, let's implement that in the popular i2c bit-banging driver. This will also act as a reference implementation for other bus drivers which want to do the same. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-05-01i2c-algo-bit: Always send a stop condition before leavingJean Delvare
The i2c-algo-bit driver doesn't behave well on read errors: it'll bail out without even sending a stop condition on the bus, so the bus will be stuck. So make sure that we always send a stop condition on the bus before we leave. The best way to make sure is to always send it at the end of function bit_xfer. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2006-12-10i2c: Discard the i2c algo del_bus wrappersJean Delvare
They are all only calling i2c_del_adapter, so we may as well do it directly. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2006-12-10i2c: Delete the broken i2c-ite bus driverJean Delvare
The rest of the ITE8172 support was already removed from MIPS tree. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> Acked-by: Ralf Baechle <ralf@linux-mips.org>
2006-09-26i2c: Constify i2c_algorithm declarations, part 1Jean Delvare
i2c: Constify i2c_algorithm declarations, part 1 Make struct i2c_algorithm declarations const in all i2c algorithm drivers. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-26i2c-algo-bit: CleanupsJean Delvare
i2c-algo-bit: Cleanups * Uninline long functions (saves around 1 kB or 15%) * Refactor code in sclhi() * Drop redundant udelay on repeated start Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-26i2c-algo-bit: Discard the mdelay data struct memberJean Delvare
i2c-algo-bit: Discard the mdelay data struct member The i2c_algo_bit_data structure has an mdelay member, which is not used by the algorithm code (the code has always been ifdef'd out.) Let's discard it to save some code and memory. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> Cc: Adrian Bunk <bunk@stusta.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-26i2c-algo-sibyte: Merge into i2c-sibyteJean Delvare
i2c-algo-sibyte: Merge into i2c-sibyte Merge i2c-algo-sibyte into i2c-sibyte, as this is a complete, hardware-dependent SMBus implementation and not a reusable algorithm. Perform some basic coding style cleanups while we're here (mainly space-based indentation replaced by tabulations.) Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-26i2c-algo-sibyte: CleanupsJean Delvare
i2c-algo-sibyte: Cleanups * Delete empty algo_control implementation. * Simplify i2c_sibyte_del_bus. * Delete empty module init and cleanup functions. * Drop out-of-date #ifdef MODULE construct. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-07-12[PATCH] i2c-algo-bit: Wipe out dead codeUwe Bugla
i2c-algo-bit: Wipe out dead code Signed-off-by: Uwe Bugla <uwe.bugla@gmx.de> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-07-12[PATCH] i2c: Handle i2c_add_adapter failure in i2c algorithm driversMark M. Hoffman
Content-Disposition: inline; filename=i2c-algo-error-handling-fix.patch 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: 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>
2005-10-28[PATCH] i2c: Discard explicit static initializations to 0Jean Delvare
Kill explicit static initializations to 0 in 10 i2c drivers. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> drivers/i2c/algos/i2c-algo-pca.c | 2 +- drivers/i2c/algos/i2c-algo-sibyte.c | 2 +- drivers/i2c/busses/i2c-ali15x3.c | 4 ++-- drivers/i2c/busses/i2c-amd756.c | 2 +- drivers/i2c/busses/i2c-iop3xx.c | 2 +- drivers/i2c/busses/i2c-piix4.c | 8 ++++---- drivers/i2c/busses/i2c-sis5595.c | 4 ++-- drivers/i2c/busses/i2c-sis630.c | 2 +- drivers/i2c/busses/i2c-sis96x.c | 2 +- drivers/i2c/busses/i2c-via.c | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-)
2005-09-05[PATCH] I2C: Fix sgi_xfer return valueJean Delvare
The sgi_xfer function returns 0 on success instead of the number of transfered messages as it is supposed to. This patch fixes that. Let's just hope that no client chip driver was relying on this misbehavior. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05[PATCH] I2C: Kill i2c_algorithm.id (5/7)Jean Delvare
Merge the algorithm id part (16 upper bits) of the i2c adapters ids into the definition of the adapters ids directly. After that, we don't need to OR both ids together for each i2c_adapter structure. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05[PATCH] I2C: Kill i2c_algorithm.id (4/7)Jean Delvare
There are no more users of i2c_algorithm.id, so we can finally drop this structure member. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05[PATCH] I2C: Kill i2c_algorithm.id (3/7)Jean Delvare
Don't rely on i2c_algorithm.id to alter the i2c adapter's id, use the I2C_ALGO_* value directly instead, because i2c_algorithm will soon have no id member no more. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05[PATCH] I2C: Kill i2c_algorithm.name (1/7)Jean Delvare
The name member of the i2c_algorithm is never used, although all drivers conscientiously fill it. We can drop it completely, this structure doesn't need to have a name. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05[PATCH] I2C: i2c-algo-pca -- gracefully handle a busy busIan Campbell
I've been running with this patch for a while now, and while I've never seen it trigger except with buggy hardware I think it is a cleaner way to handle a busy bus. I had -EBUSY until about 10 minutes ago but -EIO seems to be what most of the existing algo drivers will return in the same circumstances. Signed-off-by: Ian Campbell <icampbell@arcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-07-11[PATCH] I2C: Strip trailing whitespace from stringsJean Delvare
Here is a simple patch originally from Denis Vlasenko, which strips a useless trailing whitespace from 8 strings in 4 i2c drivers. Please apply, thanks. From: Denis Vlasenko <vda@ilport.com.ua> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-21[PATCH] I2C: Spelling fixes for drivers/i2c/algos/i2c-algo-pca.cTobias Klauser
This patch fixes the some misspellings and a trailing whitespace in the comments. Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-21[PATCH] Spelling fixes for drivers/i2c.Steven Cole
Here are some spelling corrections for drivers/i2c. occured -> occurred intialization -> initialization Everytime -> Every time transfering -> transferring relevent -> relevant continous -> continuous neccessary -> necessary explicitely -> explicitly Celcius -> Celsius differenciate -> differentiate Signed-off-by: Steven Cole <elenstev@mesatop.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-21[PATCH] I2C: drivers/i2c/*: #include <linux/config.h> cleanupAlexey Dobriyan
Files that don't use CONFIG_* stuff shouldn't include config.h Files that use CONFIG_* stuff should include config.h It's that simple. ;-) Signed-off-by: Alexey Dobriyan <adobriyan@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-04-16Linux-2.6.12-rc2Linus Torvalds
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!