public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Add support for Intersil isl1208 RTC
Date: Thu, 13 Mar 2008 22:30:23 +0100	[thread overview]
Message-ID: <20080313213023.GB1766@game.jcrosoft.org> (raw)
In-Reply-To: <1204185230-13436-1-git-send-email-tor@excito.com>

On 08:53 Thu 28 Feb     , Tor Krill wrote:
> Signed-off-by: Tor Krill <tor@excito.com>
> ---
>  README                |    1 +
>  drivers/rtc/Makefile  |    1 +
>  drivers/rtc/isl1208.c |  176 +++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 178 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/rtc/isl1208.c
> 
> diff --git a/README b/README
> index 491397a..b230fde 100644
> --- a/README
> +++ b/README
> @@ -669,6 +669,7 @@ The following options need to be configured:
>  		CONFIG_RTC_DS1337	- use Maxim, Inc. DS1337 RTC
>  		CONFIG_RTC_DS1338	- use Maxim, Inc. DS1338 RTC
>  		CONFIG_RTC_DS164x	- use Dallas DS164x RTC
> +		CONFIG_RTC_ISL1208	- use Intersil ISL1208 RTC
>  		CONFIG_RTC_MAX6900	- use Maxim, Inc. MAX6900 RTC
>  
>  		Note that if the RTC uses I2C, then the I2C interface
> diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
> index 2af2bf4..a0d3472 100644
> --- a/drivers/rtc/Makefile
> +++ b/drivers/rtc/Makefile
> @@ -53,6 +53,7 @@ COBJS-y += rs5c372.o
>  COBJS-y += rx8025.o
>  COBJS-y += mcfrtc.o
>  COBJS-y += x1205.o
> +COBJS-y += isl1208.o
>  
>  COBJS	:= $(COBJS-y)
>  SRCS	:= $(COBJS:.o=.c)
> diff --git a/drivers/rtc/isl1208.c b/drivers/rtc/isl1208.c
> new file mode 100644
> index 0000000..d52d23d
> --- /dev/null
> +++ b/drivers/rtc/isl1208.c
> @@ -0,0 +1,176 @@
> +/*
> + * (C) Copyright 2008
> + * Tor Krill, Excito Elektronik i Sk?ne , tor at excito.com
> + *
> + * Modelled after the ds1337 driver
> + *
> + * 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
> + */
> +
> +/*
> + * Date & Time support (no alarms) for Intersil
> + * ISL1208 Real Time Clock (RTC).
> + */
> +
> +#include <common.h>
> +#include <command.h>
> +#include <rtc.h>
> +#include <i2c.h>
> +
> +#if defined(CONFIG_RTC_ISL1208) && defined(CONFIG_CMD_DATE)
Please move it to the Makefile
> +
> +/*---------------------------------------------------------------------*/
> +#undef DEBUG_RTC
Please remove it
> +
> +#ifdef DEBUG_RTC
> +#define DEBUGR(fmt,args...) printf(fmt ,##args)
> +#else
> +#define DEBUGR(fmt,args...)
> +#endif
> +/*---------------------------------------------------------------------*/
> +
> +/*
> + * RTC register addresses
> + */
> +
> +#define RTC_SEC_REG_ADDR        0x0
> +#define RTC_MIN_REG_ADDR        0x1
> +#define RTC_HR_REG_ADDR         0x2
> +#define RTC_DATE_REG_ADDR       0x3
> +#define RTC_MON_REG_ADDR        0x4
> +#define RTC_YR_REG_ADDR         0x5
> +#define RTC_DAY_REG_ADDR        0x6
> +#define RTC_STAT_REG_ADDR       0x7
Please use tab not spaces
> +/*
> + * RTC control register bits
> + */
> +
[Snip]
> +
> +/*
> + * Helper functions
> + */
> +

> +static
> +uchar rtc_read (uchar reg)
On one line please
> +{
> +	return (i2c_reg_read (CFG_I2C_RTC_ADDR, reg));
> +}
> +
> +
Please only one empty line
> +static void rtc_write (uchar reg, uchar val)
> +{
> +	i2c_reg_write (CFG_I2C_RTC_ADDR, reg, val);
> +}
> +
Best Regards,
J.

  parent reply	other threads:[~2008-03-13 21:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-28  7:53 [U-Boot-Users] [PATCH] Add support for Intersil isl1208 RTC Tor Krill
2008-03-13 13:44 ` Tor Krill
2008-03-13 21:30 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-03-15 14:40 Tor Krill
2008-03-16  0:21 ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080313213023.GB1766@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox