[U-Boot] tps65910x I2C RTC driver

Tom Rini trini at ti.com
Fri Oct 24 19:42:04 CEST 2014


On Sun, Oct 19, 2014 at 05:52:13PM +0400, Dvorkin Dmitry wrote:

> Hello!
> 
> We are developing new board based on TI am33xx. (I'll send patch for
> this new board later.) It have not internal RTC and we're using the
> one from TPS65910 connected by I2C bus.
> May I add this patch to U-Boot source? Thank you.

In general, yes.  First, please see
http://www.denx.de/wiki/U-Boot/Patches and submit it with a
signed-off-by line, in the series with your board port that uses it.
Also, fix all of the checkpatch issues that I suspect it would point
out.  Aside from things like that:

> +#if defined(CONFIG_CMD_DATE)

No, don't guard the whole file on another config option please.

> +/*---------------------------------------------------------------------*/
> +#undef DEBUG_RTC
> +
> +#ifdef DEBUG_RTC
> +#define DEBUGR(fmt,args...) printf(fmt ,##args)
> +#else
> +#define DEBUGR(fmt,args...)
> +#endif

Just use debug() from <common.h> and DEBUG to control it so you don't
need #undef anything in your driver.

> +/* usually TPS65910_CTRL_I2C_ADDR = 0x2D */
> +#ifndef CONFIG_SYS_I2C_RTC_ADDR
> +#define CONFIG_SYS_I2C_RTC_ADDR TPS65910_CTRL_I2C_ADDR
> +#endif

This belongs in the board config file.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141024/e4b63e43/attachment-0001.pgp>


More information about the U-Boot mailing list