[U-Boot] [PATCH v4 03/16] i2c: add Faraday FTI2C010 I2C controller support

Heiko Schocher hs at denx.de
Tue May 7 15:19:30 CEST 2013


Hello Kuo-Jung,

Am 07.05.2013 08:32, schrieb Kuo-Jung Su:
> From: Kuo-Jung Su <dantesu at faraday-tech.com>
> 
> Faraday FTI2C010 is a multi-function I2C controller
> which supports both master and slave mode.
> This patch simplily implements the master mode only.
> 
> Signed-off-by: Kuo-Jung Su <dantesu at faraday-tech.com>
> CC: Heiko Schocher <hs at denx.de>
> ---
> Changes for v4:
>    - Coding Style cleanup.
>    - Make it a separate patch, rather then a part of
>      Faraday A36x patch series
>    - Use macro constants for timeout control
> 
> Changes for v3:
>    - Coding Style cleanup.
>    - Drop macros for wirtel()/readl(), call them directly.
>    - Always insert a blank line between declarations and code.
>    - Replace all the infinite wait loop with a timeout.
>    - Add '__iomem' to all the declaration of HW register pointers.
> 
> Changes for v2:
>    - Coding Style cleanup.
>    - Use readl(), writel(), clrsetbits_le32() to replace REG() macros.
>    - Use structure based hardware registers to replace the macro constants.
>    - Replace BIT() with BIT_MASK().
> 
>  drivers/i2c/Makefile   |    1 +
>  drivers/i2c/fti2c010.c |  371 ++++++++++++++++++++++++++++++++++++++++++++++++
>  drivers/i2c/fti2c010.h |   81 +++++++++++
>  3 files changed, 453 insertions(+)
>  create mode 100644 drivers/i2c/fti2c010.c
>  create mode 100644 drivers/i2c/fti2c010.h

As I posted the new i2c multibus/multiadapter framework:

http://lists.denx.de/pipermail/u-boot/2013-May/153452.html

maybe it is possible you can adapt your i2c driver based on
this patches?

> diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
> index 5dbdbe3..ed2b8c0 100644
> --- a/drivers/i2c/Makefile
> +++ b/drivers/i2c/Makefile
> @@ -29,6 +29,7 @@ COBJS-$(CONFIG_BFIN_TWI_I2C) += bfin-twi_i2c.o
>  COBJS-$(CONFIG_DRIVER_DAVINCI_I2C) += davinci_i2c.o
>  COBJS-$(CONFIG_DW_I2C) += designware_i2c.o
>  COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o
> +COBJS-$(CONFIG_FTI2C010) += fti2c010.o

For the new framework this should be something like
CONFIG_SYS_I2C_FTI2C010 ... and as I think, this
name would be good also for the old framework.

>  COBJS-$(CONFIG_I2C_MVTWSI) += mvtwsi.o
>  COBJS-$(CONFIG_I2C_MV) += mv_i2c.o
>  COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
[...]

Rest of your patch looks good to me ...

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


More information about the U-Boot mailing list