• Kalle Jokiniemi's avatar
    i2c-omap: add mpu wake up latency constraint in i2c · 20c9d2c4
    Kalle Jokiniemi authored
    While waiting for completion of the i2c transfer, the
    MPU could hit OFF mode and cause several msecs of
    delay that made i2c transfers fail more often. The
    extra delays and subsequent re-trys cause i2c clocks
    to be active more often. This has also an negative
    effect on power consumption.
    
    Created a mechanism for passing and using the
    constraint setting function in driver code. The used
    mpu wake up latency constraints are now set individually
    per bus, and they are calculated based on clock rate
    and fifo size.
    
    Thanks to Jarkko Nikula, Moiz Sonasath, Paul Walmsley,
    and Nishanth Menon for tuning out the details of
    this patch.
    
    Updates by Kevin as requested by Tony:
    
    - Remove omap_set_i2c_constraint_func() in favor of conditionally
      adding the flag in omap_i2c_add_bus() in order to keep all the OMAP
      conditional checking in a single location.
    - Update set_mpu_wkup_lat prototypes to match OMAP PM layer so
      OMAP PM function can be used directly in pdata.
    
    Cc: Moiz Sonasath <m-sonasath@ti.com>
    Cc: Jarkko Nikula <jhnikula@gmail.com>
    Cc: Paul Walmsley <paul@pwsan.com>
    Cc: Nishanth Menon <nm@ti.com>
    Signed-off-by: default avatarKalle Jokiniemi <kalle.jokiniemi@digia.com>
    Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
    Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
    Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
    20c9d2c4
i2c.c 5.44 KB