]> Zhao Yanbai Git Server - minix.git/commit
i2c: general clean-up 36/736/1
authorThomas Cort <tcort@minix3.org>
Mon, 12 Aug 2013 17:39:54 +0000 (13:39 -0400)
committerThomas Cort <tcort@minix3.org>
Tue, 13 Aug 2013 20:29:22 +0000 (16:29 -0400)
commit228e84ad2a6c710591ba1d351fcbae635d17fd33
tree54505d006ed17e3650f629cdaefc7a21323e14f9
parent99e91dab2f13fddc42edbe0b50e89f737185d374
i2c: general clean-up

Implement changes based on Kees comments on the code review:
http://gerrit-minix.few.vu.nl/#/c/676/

Changes:
 - use spin API instead of micro_delay() for busy-wait loops.
 - use read16/write16/set16 from mmio.h to access I2C registers.
 - reduce the timeout for soft reset.
 - in read/write, don't mix variable declaration and initialization.
 - after transfer, wait for access ready instead of blindly delaying.
 - rename constants am335x, dm37xx to AM335X_I2C_BUS, DM37XX_I2C_BUS.
 - rename ADDRESS_MASK to MAX_I2C_SA_MASK for clairity.
 - rename omap_i2c_claim_bus() to omap_i2c_bus_is_free().

Change-Id: Ic221e6134e024ea0a6690f21cff208a728286948
drivers/i2c/arch/earm/omap_i2c.c
drivers/i2c/arch/earm/omap_i2c_registers.h