[U-Boot] [PATCH 2/4] I2C Add initial support for TWL4030

Heiko Schocher hs at denx.de
Wed Jun 10 19:45:02 CEST 2009


Hello Tom,

Tom Rix wrote:
> The TWL4030 supplies many peripheral for OMAP3 boards. These include
> power management, usb and, keyboard.
> 
> The product description is found here:
> 
> http://focus.ti.com/docs/prod/folders/print/tps65950.html
> 
> Product reference document, tps65950.pdf, is found here:
> 
> http://www.ti.com/lit/gpn/tps65950
> 
> Signed-off-by: Tom Rix <Tom.Rix at windriver.com>
> ---
>  drivers/i2c/Makefile      |    1 +
>  drivers/i2c/twl4030_i2c.c |   37 ++++++++
>  include/twl4030.h         |  221 +++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 259 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/i2c/twl4030_i2c.c
>  create mode 100644 include/twl4030.h
> 
> diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
> index ef32f13..97d9128 100644
> --- a/drivers/i2c/Makefile
> +++ b/drivers/i2c/Makefile
> @@ -36,6 +36,7 @@ COBJS-$(CONFIG_DRIVER_S3C24X0_I2C) += s3c24x0_i2c.o
>  COBJS-$(CONFIG_S3C44B0_I2C) += s3c44b0_i2c.o
>  COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
>  COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
> +COBJS-$(CONFIG_DRIVER_TWL4030_I2C) += twl4030_i2c.o
>  
>  COBJS	:= $(COBJS-y)
>  SRCS	:= $(COBJS:.o=.c)
> diff --git a/drivers/i2c/twl4030_i2c.c b/drivers/i2c/twl4030_i2c.c
> new file mode 100644
> index 0000000..774f813
> --- /dev/null
> +++ b/drivers/i2c/twl4030_i2c.c
> @@ -0,0 +1,37 @@
> +/*
> + * Copyright (c) 2009 Wind River Systems, Inc.
> + * Tom Rix <Tom.Rix at windriver.com>
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + *
> + * Derived from code on omapzoom, git://git.omapzoom.com/repo/u-boot.git
> + *
> + * Copyright (C) 2007-2009 Texas Instruments, Inc.
> + */
> +
> +#include <twl4030.h>
> +
> +/* Functions to read and write from TWL4030 */
> +static inline int twl4030_i2c_write_u8(u8 chip_no, u8 val, u8 reg)
> +{
> +	return i2c_write(chip_no, reg, 1, &val, 1);
> +}
> +
> +static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg)
> +{
> +	return i2c_read(chip_no, reg, 1, val, 1);
> +}
> +

? Is your patch complete?

Where are i2c_read(), i2c_write(),... functions, like in the other
i2c drivers in u-boot? This seems no i2c driver to me, more than
some board specific code, which you can add in your board.c ...
or something like drivers/misc, if this is code is used in more than
one plattform ... ?

> diff --git a/include/twl4030.h b/include/twl4030.h
> new file mode 100644
> index 0000000..d17fea5
> --- /dev/null
> +++ b/include/twl4030.h
> @@ -0,0 +1,221 @@
> +/*
[...]

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