aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-stub.c
Commit message (Collapse)AuthorAge
* i2c: remove FSF addressWolfram Sang2014-11-07
| | | | | | | We have a central copy of the GPL for that. Some addresses were already outdated. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
* i2c: stub: Avoid an array overrun on I2C block transfersJean Delvare2014-07-20
| | | | | | | | | | | | I2C block transfers can have a size up to 32 bytes. If starting close to the end of the address space, there may not be enough room to write that many bytes (on I2C block writes) or not enough bytes to be read (on I2C block reads.) In that case, we must shorten the transfer so that it does not exceed the address space. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: stub: Add support for banked register rangesJean Delvare2014-07-17
| | | | | | | | | | | | | Some chips implement banked register ranges. This allows implementing more registers than the limited 8-bit address space originally allows. In order to access a register on these chips, you must first select the proper bank. Add support for this mechanism to the i2c-stub driver so that such chips can be emulated. All the bank settings are passed as module parameters. Signed-off-by: Jean Delvare <jdelvare@suse.de> Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: stub: Remember the number of emulated chipsJean Delvare2014-07-17
| | | | | | | | This makes initialization, cleanup and look-up easier. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: stub: Add support for SMBus block commandsGuenter Roeck2014-07-17
| | | | | | | | | | | | | | | | SMBus block commands are different to I2C block commands since the returned data is not normally accessible with byte or word commands on other command offsets. Add linked list of 'block' commands to support those commands. Access mechanism is quite simple: Block commands must be written before they can be read. Subsequent writes can be partial. Block read commands always return the number of bytes associated with the longest previous write. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* Update Jean Delvare's e-mail addressJean Delvare2014-01-29
| | | | Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-stub: Move to drivers/i2cJean Delvare2012-10-28
Move the i2c-stub driver to drivers/i2c, to match the Kconfig entry. This is less confusing that way. I also fixed all checkpatch warnings and errors. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Peter Huewe <peterhuewe@gmx.de>