i2c: increase BUFLEN/CMDLEN to 128, add page flag.

128 byte reads are much more common than 32 byte reads. The message
passing + setup/teardown for a read is much more expensive, in terms
of time, than the reading itself. A slightly bigger struct is well
worth the time savings. This reduces read times for /dev/eeprom
from 57 seconds per 4KB to 14 seconds.

Additionally, make sending the page address in the eeprom driver
and utility optional. This can save a little time when reading
within the same page and allows support for smaller devices that
don't support pages (example: chips containing EDID).

Change-Id: Ie48087caee40c11fa241d1555fce9309ddd27b43
This commit is contained in:
Thomas Cort
2013-07-26 19:44:52 -04:00
parent 11be35a165
commit 437177b028
7 changed files with 94 additions and 59 deletions

View File

@@ -98,8 +98,8 @@ typedef struct i2c_ioctl_exec {
void *iie_buf; /* pointer to data buffer */
size_t iie_buflen; /* length of data buffer */
} i2c_ioctl_exec_t;
#define I2C_EXEC_MAX_CMDLEN 32
#define I2C_EXEC_MAX_BUFLEN 32
#define I2C_EXEC_MAX_CMDLEN 128
#define I2C_EXEC_MAX_BUFLEN 128
#define I2C_IOCTL_EXEC _IOW('I', 0, i2c_ioctl_exec_t)