Paul Menzel has uploaded this change for review.

View Change

drivers/i2c/at24rf08c: Use `smbus_block_write()`

Currently, on the Lenovo T60, it takes 22 ms to write the registers. Try
to shorten that by usig the block write function.

Change-Id: I6c536410263b23cba2fa66605d7b0ff6c5dd20c1
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
---
M src/drivers/i2c/at24rf08c/at24rf08c.c
1 file changed, 3 insertions(+), 11 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/95/38395/1
diff --git a/src/drivers/i2c/at24rf08c/at24rf08c.c b/src/drivers/i2c/at24rf08c/at24rf08c.c
index 624df7d..a11eaec 100644
--- a/src/drivers/i2c/at24rf08c/at24rf08c.c
+++ b/src/drivers/i2c/at24rf08c/at24rf08c.c
@@ -19,8 +19,7 @@

static void at24rf08c_init(struct device *dev)
{
- unsigned int i, j;
-
+ uint8_t block[8] = { 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f };
if (!dev->enabled)
return;

@@ -31,15 +30,8 @@

printk(BIOS_DEBUG, "Locking EEPROM RFID\n");

- for (i = 0; i < 8; i++) {
- /* After a register write AT24RF08C sometimes stops responding.
- Retry several times in case of failure. */
- for (j = 0; j < 100; j++)
- if (smbus_write_byte(dev, i, 0x0f) >= 0) {
- printk(BIOS_DEBUG, "i= = %u, j = %u\n", j);
- break;
- }
- }
+ if (smbus_block_write(dev, 0, 8, block) < 0)
+ printk(BIOS_ERR, "Failed writing at24rf08c configuration!\n");

printk(BIOS_DEBUG, "init EEPROM done\n");
}

To view, visit change 38395. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6c536410263b23cba2fa66605d7b0ff6c5dd20c1
Gerrit-Change-Number: 38395
Gerrit-PatchSet: 1
Gerrit-Owner: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-MessageType: newchange