From patchwork Wed Jun 15 08:59:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priyanka Jain X-Patchwork-Id: 100499 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id B716DB7470 for ; Wed, 15 Jun 2011 19:00:37 +1000 (EST) Received: from VA3EHSOBE008.bigfish.com (va3ehsobe001.messaging.microsoft.com [216.32.180.11]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.global.frontbridge.com", Issuer "Cybertrust SureServer Standard Validation CA" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 5E148B6FA3 for ; Wed, 15 Jun 2011 19:00:25 +1000 (EST) Received: from mail127-va3-R.bigfish.com (10.7.14.251) by VA3EHSOBE008.bigfish.com (10.7.40.28) with Microsoft SMTP Server id 14.1.225.22; Wed, 15 Jun 2011 09:00:18 +0000 Received: from mail127-va3 (localhost.localdomain [127.0.0.1]) by mail127-va3-R.bigfish.com (Postfix) with ESMTP id 58DB51D820D; Wed, 15 Jun 2011 09:00:17 +0000 (UTC) X-SpamScore: 3 X-BigFish: VS3(zzc8kzz1202hzz8275bhz2dh87h2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail127-va3 (localhost.localdomain [127.0.0.1]) by mail127-va3 (MessageSwitch) id 1308128403673360_25875; Wed, 15 Jun 2011 09:00:03 +0000 (UTC) Received: from VA3EHSMHS022.bigfish.com (unknown [10.7.14.252]) by mail127-va3.bigfish.com (Postfix) with ESMTP id A7E19570059; Wed, 15 Jun 2011 09:00:02 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS022.bigfish.com (10.7.99.32) with Microsoft SMTP Server (TLS) id 14.1.225.22; Wed, 15 Jun 2011 08:59:56 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.289.8; Wed, 15 Jun 2011 03:59:56 -0500 Received: from nmglablinux21.freescale.com ([10.232.20.243]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p5F8xrMb018848; Wed, 15 Jun 2011 03:59:54 -0500 (CDT) Received: by nmglablinux21.freescale.com (Postfix, from userid 65011109) id 353F75DC80; Wed, 15 Jun 2011 14:29:52 +0530 (IST) From: Priyanka Jain To: , , , , , , , , , , , Subject: [PATCH][v2] Add support for RTC device: pt7c4338 in rtc-ds1307.c Date: Wed, 15 Jun 2011 14:29:50 +0530 Message-ID: <1308128390-23347-1-git-send-email-Priyanka.Jain@freescale.com> X-Mailer: git-send-email 1.6.5.6 MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com Cc: Priyanka Jain X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org PT7C4338 chip is being manufactured by Pericom Technology Inc. It is a serial real-time clock which provides: 1)Low-power clock/calendar. 2)Programmable square-wave output. It has 56 bytes of nonvolatile RAM. Its register set is same as that of rtc device: DS1307. Signed-off-by: Priyanka Jain --- Change for v2: Incorporting Andrew Morton's comments to shorten patch by using hunk: { "pt7c4338", ds_1307 } Changes : This patch will supersede patch: "RTC driver(Linux) for PT7C4338 chip" Incorporting Wolfram Sang's comments to reuse ds1307 driver. drivers/rtc/Kconfig | 6 +++--- drivers/rtc/rtc-ds1307.c | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index b8f4e9e..c6045dd 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -126,13 +126,13 @@ comment "I2C RTC drivers" if I2C config RTC_DRV_DS1307 - tristate "Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025" + tristate "Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025, PT7C4338" help If you say yes here you get support for various compatible RTC chips (often with battery backup) connected with I2C. This driver should handle DS1307, DS1337, DS1338, DS1339, DS1340, ST M41T00, - EPSON RX-8025 and probably other chips. In some cases the RTC - must already have been initialized (by manufacturing or a + EPSON RX-8025, PT7C4338 and probably other chips. In some cases + the RTC must already have been initialized (by manufacturing or a bootloader). The first seven registers on these chips hold an RTC, and other diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index 4724ba3..e851394 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c @@ -4,6 +4,8 @@ * Copyright (C) 2005 James Chapman (ds1337 core) * Copyright (C) 2006 David Brownell * Copyright (C) 2009 Matthias Fuchs (rx8025 support) + * Copyright (C) 2011 Priyanka Jain (Priyanka.Jain@freescale.com) + * (pt7c4338 support) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -149,6 +151,7 @@ static const struct i2c_device_id ds1307_id[] = { { "ds1340", ds_1340 }, { "ds3231", ds_3231 }, { "m41t00", m41t00 }, + { "pt7c4338", ds_1307 }, { "rx8025", rx_8025 }, { } };