aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/algos/i2c-algo-pca.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix common misspellingsLucas De Marchi2011-03-311-1/+1
| | | | | | Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
* i2c-algo-pca: Fix coding style issuesFarid Hammane2010-05-211-18/+18
| | | | | | | | | | | Fix up some coding style issues. i2c-algo-pca.c has been built successfully after applying this patch and the binary object is still exactly the same. Other issues found by checkpatch.pl were voluntarily not fixed, either to keep readability, or because of false positive errors. Signed-off-by: Farid Hammane <farid.hammane@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-algo-pca: Drop duplicate variableJean Delvare2010-03-021-2/+0
| | | | | | | Thanks to -Wshadow. Signed-off-by: Jean Delvare <khali@linux-fr.org> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
* i2c-algo-pca: Let PCA9564 recover from unacked data byte (state 0x30)Enrik Berkhan2009-05-051-0/+11
| | | | | | | | | | | | | | | | | | | | | | | Currently, the i2c-algo-pca driver does nothing if the chip enters state 0x30 (Data byte in I2CDAT has been transmitted; NOT ACK has been received). Thus, the i2c bus connected to the controller gets stuck afterwards. I have seen this kind of error on a custom board in certain load situations most probably caused by interference or noise. A possible reaction is to let the controller generate a STOP condition. This is documented in the PCA9564 data sheet (2006-09-01) and the same is done for other NACK states as well. Further, state 0x38 isn't handled completely, either. Try to do another START in this case like the data sheet says. As this couldn't be tested, I've added a comment to try to reset the chip if the START doesn't help as suggested by Wolfram Sang. Signed-off-by: Enrik Berkhan <Enrik.Berkhan@ge.com> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-algo-pca: Fix use of uninitialized variable in debug messageJean Delvare2009-04-131-1/+1
| | | | | | | | A recent change broke debugging of pca_xfer(), fix it. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Wolfram Sang <w.sang@pengutronix.de>
* i2c-algo-pca: Use timeout for checking the state machineWolfram Sang2009-03-281-18/+23
| | | | | | | | | | We now timeout also if the state machine does not change within the given time. For that, the driver-specific completion-functions are extended to return true or false depending on the timeout. This then gets checked in the algorithm. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-algo-pca: Rework waiting for a free busWolfram Sang2009-03-281-7/+10
| | | | | | | | Waiting for a free bus now accepts the timeout value in jiffies and does proper checking using time_before. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-algo-pca: Add PCA9665 supportMarco Aurelio da Costa2009-03-281-14/+166
| | | | | | | Add support for the PCA9665 I2C controller. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Adapt debug macros for KERN_* constantsFrank Seidel2009-03-281-5/+9
| | | | | | | | | | | | According to kerneljanitors todo list all printk calls (beginning a new line) should have an according KERN_* constant. Those are the changes to the debug macros in the i2c subsystem to meet this requirement. Also changing no-debug statements to raw printks again. Signed-off-by: Frank Seidel <frank@f-seidel.de> Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Wolfram Sang <w.sang@pengutronix.de>
* i2c-pca-algo: Fix error codeWolfram Sang2008-07-141-1/+1
| | | | | | | 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>
* i2c-algo-pca: Extend for future driversWolfram Sang2008-04-221-44/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* i2c-algo-pca: Remove trailing whitespaces and unnecessary UTFWolfram Sang2008-04-221-21/+21
| | | | | | | | 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>
* Convert files to UTF-8 and some cleanupsJan Engelhardt2007-10-191-1/+1
| | | | | | | | | | | | | | | | | | * 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>
* i2c: Discard the i2c algo del_bus wrappersJean Delvare2006-12-101-7/+0
| | | | | | | 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>
* i2c: Constify i2c_algorithm declarations, part 1Jean Delvare2006-09-261-1/+1
| | | | | | | | | | | | 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>
* [PATCH] i2c: Handle i2c_add_adapter failure in i2c algorithm driversMark M. Hoffman2006-07-121-3/+3
| | | | | | | | | | | 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>
* [PATCH] i2c: Discard explicit static initializations to 0Jean Delvare2005-10-281-1/+1
| | | | | | | | | | | | | | | | | | | 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(-)
* [PATCH] I2C: Kill i2c_algorithm.id (5/7)Jean Delvare2005-09-051-2/+0
| | | | | | | | | 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>
* [PATCH] I2C: Kill i2c_algorithm.id (4/7)Jean Delvare2005-09-051-1/+0
| | | | | | | | 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>
* [PATCH] I2C: Kill i2c_algorithm.id (3/7)Jean Delvare2005-09-051-1/+1
| | | | | | | | | 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>
* [PATCH] I2C: Kill i2c_algorithm.name (1/7)Jean Delvare2005-09-051-1/+0
| | | | | | | | | 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>
* [PATCH] I2C: i2c-algo-pca -- gracefully handle a busy busIan Campbell2005-09-051-5/+7
| | | | | | | | | | | 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>
* [PATCH] I2C: Spelling fixes for drivers/i2c/algos/i2c-algo-pca.cTobias Klauser2005-06-211-2/+2
| | | | | | | | 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>
* [PATCH] Spelling fixes for drivers/i2c.Steven Cole2005-06-211-2/+2
| | | | | | | | | | | | | | | | | | 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>
* Linux-2.6.12-rc2Linus Torvalds2005-04-161-0/+399
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!