From patchwork Thu Feb 12 08:00:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 23004 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from mail-qy0-f60.google.com (mail-qy0-f60.google.com [209.85.221.60]) by ozlabs.org (Postfix) with ESMTP id 45513DDDA2 for ; Thu, 12 Feb 2009 19:00:53 +1100 (EST) Received: by qyk20 with SMTP id 20so1021777qyk.1 for ; Thu, 12 Feb 2009 00:00:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:received:x-sender:x-apparently-to :received:received:received-spf:authentication-results:received :received:received:received:from:to:cc:subject:date:message-id :x-mailer:x-originalarrivaltime:reply-to:sender:precedence :x-google-loop:mailing-list:list-id:list-post:list-help :list-unsubscribe:x-beenthere-env:x-beenthere; bh=oOpm0yQfqDRCBiufcTSBFfwBe8OFbGGEJp62Z/V+unc=; b=Pq8s4Q+j52d4/8RWFBc4c5A9TpAO9SneLRI2Mz4TVE8EPUsV+BnuIb7UrahQ8pbJGa LH+wFqBDg/pzqV0JZEKVVxD/Sdz3eONP9TiWpIwSTd3vBmcrowD6fxu68N9GVwPkna3D +ex9UviwQ/Cw4fvSznnydPA398XrZ74NXhr5c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-sender:x-apparently-to:received-spf:authentication-results:from :to:cc:subject:date:message-id:x-mailer:x-originalarrivaltime :reply-to:sender:precedence:x-google-loop:mailing-list:list-id :list-post:list-help:list-unsubscribe:x-beenthere-env:x-beenthere; b=0oClN5XJr3OYDRd5/XVWaCHeOQ/Ew55ciX/rkz3TIy4bl+IEG0M7lKRgXqojZ8bZ43 5RrZ25LlPTTQ9EgAkG0PY6hwawzIu0TsvSU/uFDStgY51n3GGRok9gQnGp6HbH7pDhhr dAlUtaEj2yeVvL+rfgPZqUuklg7UA2ymtfZpE= Received: by 10.229.82.72 with SMTP id a8mr82588qcl.12.1234425648793; Thu, 12 Feb 2009 00:00:48 -0800 (PST) Received: by 10.176.92.38 with SMTP id p38gr1897yqb.0; Thu, 12 Feb 2009 00:00:48 -0800 (PST) X-Sender: jocke@gentoo-jocke.transmode.se X-Apparently-To: rtc-linux@googlegroups.com Received: by 10.223.107.68 with SMTP id a4mr10046fap.11.1234425647675; Thu, 12 Feb 2009 00:00:47 -0800 (PST) Received: from gw1.transmode.se (gw1.transmode.se [213.115.205.20]) by mx.google.com with ESMTP id 14si1561693bwz.5.2009.02.12.00.00.47; Thu, 12 Feb 2009 00:00:47 -0800 (PST) Received-SPF: pass (google.com: domain of jocke@gentoo-jocke.transmode.se designates 213.115.205.20 as permitted sender) client-ip=213.115.205.20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of jocke@gentoo-jocke.transmode.se designates 213.115.205.20 as permitted sender) smtp.mail=jocke@gentoo-jocke.transmode.se Received: from tmnt04.transmode.se (tmnt04.transmode.se [192.168.46.15]) by gw1.transmode.se (Postfix) with ESMTP id 305437307D for ; Thu, 12 Feb 2009 09:00:47 +0100 (CET) Received: from gentoo-jocke.transmode.se ([192.168.1.15]) by tmnt04.transmode.se over TLS secured channel with Microsoft SMTPSVC(5.0.2195.6713); Thu, 12 Feb 2009 09:00:46 +0100 Received: from gentoo-jocke.transmode.se (localhost.localdomain [127.0.0.1]) by gentoo-jocke.transmode.se (8.14.0/8.14.0) with ESMTP id n1C80kTs004530; Thu, 12 Feb 2009 09:00:46 +0100 Received: (from jocke@localhost) by gentoo-jocke.transmode.se (8.14.0/8.14.0/Submit) id n1C80kt0004529; Thu, 12 Feb 2009 09:00:46 +0100 From: Joakim Tjernlund To: rtc-linux@googlegroups.com Cc: Joakim Tjernlund Subject: [rtc-linux] [PATCH] RTC: add support for DS1388 Date: Thu, 12 Feb 2009 09:00:46 +0100 Message-Id: <1234425646-4499-1-git-send-email-Joakim.Tjernlund@transmode.se> X-Mailer: git-send-email 1.6.0.6 X-OriginalArrivalTime: 12 Feb 2009 08:00:46.0626 (UTC) FILETIME=[02EE9020:01C98CE8] Reply-To: rtc-linux@googlegroups.com Sender: rtc-linux@googlegroups.com Precedence: bulk X-Google-Loop: groups Mailing-List: list rtc-linux@googlegroups.com; contact rtc-linux+owner@googlegroups.com List-Id: List-Post: List-Help: List-Unsubscribe: , X-BeenThere-Env: rtc-linux@googlegroups.com X-BeenThere: rtc-linux@googlegroups.com Exstend the ds1307 driver to support ds1388 too. Signed-off-by: Joakim Tjernlund --- drivers/rtc/rtc-ds1307.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index bbf97e6..d27a0bb 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c @@ -34,6 +34,7 @@ enum ds_type { ds_1338, ds_1339, ds_1340, + ds_1388, m41t00, // rs5c372 too? different address... }; @@ -126,6 +127,7 @@ static const struct i2c_device_id ds1307_id[] = { { "ds1337", ds_1337 }, { "ds1338", ds_1338 }, { "ds1339", ds_1339 }, + { "ds1388", ds_1388 }, { "ds1340", ds_1340 }, { "m41t00", m41t00 }, { } @@ -190,7 +192,7 @@ static int ds1307_set_time(struct device *dev, struct rtc_time *t) t->tm_hour, t->tm_mday, t->tm_mon, t->tm_year, t->tm_wday); - *buf++ = 0; /* first register addr */ + *buf++ = ds1307->reg_addr; /* first register addr */ buf[DS1307_REG_SECS] = BIN2BCD(t->tm_sec); buf[DS1307_REG_MIN] = BIN2BCD(t->tm_min); buf[DS1307_REG_HOUR] = BIN2BCD(t->tm_hour); @@ -379,6 +381,9 @@ static int __devinit ds1307_probe(struct i2c_client *client, dev_warn(&client->dev, "SET TIME!\n"); } break; + case ds_1388: + ds1307->reg_addr = 1; /* Seconds starts at 1 */ + break; default: break; } @@ -442,6 +447,7 @@ read_rtc: break; case ds_1337: case ds_1339: + case ds_1388: break; }