Add support for Intersil isl1208 RTC
PATCH 1/1 Add support for Intersil isl1208 RTC
Signed-off-by Tor Krill <[email protected]>
--- 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
README +1 -0
@@ -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
drivers/rtc/Makefile +1 -0
@@ -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)
drivers/rtc/isl1208.c new file +176 -0
176 lines not on this page · raw message
Signature · 1 line
1.5.3.7
PATCH 1/1 Add support for Intersil isl1208 RTC
Quoted 5 lines · Tor Krill
Signed-off-by Tor Krill <[email protected]>---
README | 1 + drivers/rtc/Makefile | 1 + drivers/rtc/isl1208.c | 176
---8<-------
Any comments? Maybe i sent it before the merge window opened and thus got no feedback?
/Tor
PATCH 1/1 Add support for Intersil isl1208 RTC
In reply to Tor KrillQuoted 61 lines · Tor Krill
Signed-off-by Tor Krill <[email protected]>--- README | 1 + drivers/rtc/Makefile | 1 + drivers/rtc/isl1208.c | 176 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 178 insertions(+), 0 deletions(-) create mode 100644 drivers/rtc/isl1208.cREADME +1
-0@@ -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 interfacedrivers/rtc/Makefile +1
-0@@ -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)drivers/rtc/isl1208.c new file +23
-0@@ -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 +*/ + +/*
drivers/rtc/isl1208.c line 33
Quoted 10 lines
drivers/rtc/isl1208.c new file +10
-0+* 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
drivers/rtc/isl1208.c line 36
Quoted 3 lines
drivers/rtc/isl1208.c new file +3
-0+ +/*---------------------------------------------------------------------*/ +#undef DEBUG_RTC
Please remove it
Quoted 10 lines
drivers/rtc/isl1208.c new file +10
-0+ +#ifdef DEBUG_RTC +#define DEBUGR(fmt,args...) printf(fmt ,##args) +#else +#define DEBUGR(fmt,args...) +#endif +/*---------------------------------------------------------------------*/ + +/* +* RTC register addresses
drivers/rtc/isl1208.c line 56
Quoted 10 lines
drivers/rtc/isl1208.c new file +10
-0+*/ + +#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
Quoted 4 lines
drivers/rtc/isl1208.c new file +4
-0+/* +* RTC control register bits +*/ +
[Snip]
drivers/rtc/isl1208.c line 154
Quoted 8 lines
drivers/rtc/isl1208.c new file +7
-0+ +/* +* Helper functions +*/ + +static +uchar rtc_read (uchar reg)
On one line please
drivers/rtc/isl1208.c line 159
Quoted 5 lines
drivers/rtc/isl1208.c new file +5
-0+{ +return (i2c_reg_read (CFG_I2C_RTC_ADDR , reg)); +} + +
Please only one empty line
drivers/rtc/isl1208.c line 164
Quoted 5 lines
drivers/rtc/isl1208.c new file +5
-0+static void rtc_write (uchar reg,uchar val) +{ +i2c_reg_write (CFG_I2C_RTC_ADDR , reg, val); +} +
Best Regards,
J.