[U-Boot] [PATCH 0/2] dm: i2c: Provide backwards compatibility

Simon Glass sjg at chromium.org
Tue Jan 13 02:02:06 CET 2015


This series allows you to use driver model for I2C drivers while still
using the old I2C interface. This is achieved by using a dm_ prefix for the
driver model version of i2c_read(), i2c_write() and i2c_probe(), and
providing compatibility version of these and other functions from the old
I2C API.

Przemyslaw's recent series demonstrates that converting everything for a
board / driver at once is hard. My experience with Tegra was not typical -
it seems that in general it will be harder.

This series may allow Przemyslaw to move the PMIC framework over a piece at
a time, without needing to disable it for testing, etc.

This is aimed purely at being a porting convenience and is not intended to
permit 'legacy' I2C code to lie around for longer than it would otherwise.
In fact I hope that it might hasten its departure.

As a matter of policy I believe we should required that a conversion series
consists of the following:

- Patch to enable driver model for I2C, optionally turning on compatibility
- Patches to move each piece of code which uses I2C over to driver model,
    where this code is not used by another unrelated board. Where a related
    (e.g. same SOC) causes a problem, it should be converted
- Patch to remove compatibility, assuming this does not break some other
    board

This should avoid the compatibility option remaining around for a board.


Simon Glass (2):
  dm: i2c: Rename driver model I2C functions to permit compatibility
  dm: i2c: Add a compatbility layer

 Makefile                                  |  7 +++
 board/avionic-design/common/tamonten-ng.c |  2 +-
 board/nvidia/cardhu/cardhu.c              |  8 +--
 board/nvidia/dalmore/dalmore.c            |  6 +-
 board/nvidia/whistler/whistler.c          | 10 ++--
 board/toradex/apalis_t30/apalis_t30.c     |  6 +-
 common/cmd_i2c.c                          | 28 +++++----
 common/exports.c                          |  3 +-
 drivers/i2c/Makefile                      |  1 +
 drivers/i2c/i2c-uclass-compat.c           | 98 +++++++++++++++++++++++++++++++
 drivers/i2c/i2c-uclass.c                  |  9 +--
 drivers/power/as3722.c                    |  4 +-
 drivers/power/tps6586x.c                  |  4 +-
 include/i2c.h                             | 78 ++++++++++++++++++++----
 test/dm/i2c.c                             | 60 +++++++++----------
 15 files changed, 247 insertions(+), 77 deletions(-)
 create mode 100644 drivers/i2c/i2c-uclass-compat.c

-- 
2.2.0.rc0.207.ga3a616c



More information about the U-Boot mailing list