From patchwork Tue Oct 16 14:51:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stigge@antcom.de X-Patchwork-Id: 191810 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-lb0-f184.google.com (mail-lb0-f184.google.com [209.85.217.184]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 702C22C0097 for ; Wed, 17 Oct 2012 01:51:49 +1100 (EST) Received: by mail-lb0-f184.google.com with SMTP id gm13sf2325408lbb.11 for ; Tue, 16 Oct 2012 07:51:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:x-beenthere:received-spf:from:to:cc:subject:date :message-id:x-mailer:x-feas-system-wl:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=90apbz7w3ClGRu7HhbMgJOY0D1UtVOunNWGEiAd5fVc=; b=abukAYZjTX/QOmo6K3dsKCBaMumH3/v+7ZskJk4vTK+6A9DQVSZptBHX0Ql6/oYymO jWe0uSuAd71KsQTj4SRw94c6HTrycY/uk6ckOc2mNSbl6eCk7qfXGycDK6V6azeZmpfY xRYsKKDmt+GlsXkhxLhcxVFUh9Z+ulUIQEPfslcaRL7YQJxeFSjfEaBDrNOdTgavR82L LxPDAnEgCoh32iYGrFmJFQommvhqbKjYtP8gFuZcOFa0LggRwLdWx1iDUIpf54705cpD 4Ljn1DL/DrYxcsB81Xx+jsg6+5bGJpiz0iodnLI4vLMoNY7MsXRpD8kwMiM4/dDLmrLU GwUg== Received: by 10.204.129.91 with SMTP id n27mr404707bks.14.1350399106164; Tue, 16 Oct 2012 07:51:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.204.0.70 with SMTP id 6ls5880002bka.2.gmail; Tue, 16 Oct 2012 07:51:45 -0700 (PDT) Received: by 10.204.129.9 with SMTP id m9mr322002bks.1.1350399105329; Tue, 16 Oct 2012 07:51:45 -0700 (PDT) Received: by 10.204.129.9 with SMTP id m9mr322001bks.1.1350399105313; Tue, 16 Oct 2012 07:51:45 -0700 (PDT) Received: from work-microwave.de (mail.work-microwave.de. [62.245.205.51]) by gmr-mx.google.com with ESMTPS id t1si1875165bkt.1.2012.10.16.07.51.45 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 16 Oct 2012 07:51:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of rst@work-microwave.de designates 62.245.205.51 as permitted sender) client-ip=62.245.205.51; Received: from rst-pc1.lan.work-microwave.de ([192.168.11.78]) (authenticated bits=0) by mail.work-microwave.de with ESMTP id q9GEpdtE022335 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Oct 2012 15:51:41 +0100 Received: by rst-pc1.lan.work-microwave.de (Postfix, from userid 1000) id ECCFEAE06B; Tue, 16 Oct 2012 16:51:38 +0200 (CEST) From: Roland Stigge To: a.zummo@towertech.it, grant.likely@secretlab.ca, rob.herring@calxeda.com, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, s.hauer@pengutronix.de Cc: Roland Stigge Subject: [rtc-linux] [PATCH 1/2] rtc-imxdi: Support for i.MX53 Date: Tue, 16 Oct 2012 16:51:34 +0200 Message-Id: <1350399095-2955-1-git-send-email-stigge@antcom.de> X-Mailer: git-send-email 1.7.10.4 X-FEAS-SYSTEM-WL: rst@work-microwave.de, 192.168.11.78 X-Original-Sender: stigge@antcom.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of rst@work-microwave.de designates 62.245.205.51 as permitted sender) smtp.mail=rst@work-microwave.de Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , This patch enables support for i.MX53 in addition to i.MX25 Signed-off-by: Roland Stigge --- drivers/rtc/Kconfig | 2 +- drivers/rtc/rtc-imxdi.c | 25 ++++++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) --- linux-2.6.orig/drivers/rtc/Kconfig +++ linux-2.6/drivers/rtc/Kconfig @@ -768,7 +768,7 @@ config RTC_DRV_DAVINCI config RTC_DRV_IMXDI tristate "Freescale IMX DryIce Real Time Clock" - depends on SOC_IMX25 + depends on SOC_IMX25 || SOC_IMX53 help Support for Freescale IMX DryIce RTC --- linux-2.6.orig/drivers/rtc/rtc-imxdi.c +++ linux-2.6/drivers/rtc/rtc-imxdi.c @@ -37,6 +37,7 @@ #include #include #include +#include /* DryIce Register Definitions */ @@ -402,11 +403,13 @@ static int dryice_rtc_probe(struct platf mutex_init(&imxdi->write_mutex); - imxdi->clk = clk_get(&pdev->dev, NULL); - if (IS_ERR(imxdi->clk)) - return PTR_ERR(imxdi->clk); - clk_prepare_enable(imxdi->clk); - + /* For IMX53, RTC is available always */ + if (cpu_is_mx25()) { + imxdi->clk = clk_get(&pdev->dev, NULL); + if (IS_ERR(imxdi->clk)) + return PTR_ERR(imxdi->clk); + clk_prepare_enable(imxdi->clk); + } /* * Initialize dryice hardware */ @@ -470,8 +473,10 @@ static int dryice_rtc_probe(struct platf return 0; err: - clk_disable_unprepare(imxdi->clk); - clk_put(imxdi->clk); + if (cpu_is_mx25()) { + clk_disable_unprepare(imxdi->clk); + clk_put(imxdi->clk); + } return rc; } @@ -487,8 +492,10 @@ static int __devexit dryice_rtc_remove(s rtc_device_unregister(imxdi->rtc); - clk_disable_unprepare(imxdi->clk); - clk_put(imxdi->clk); + if (cpu_is_mx25()) { + clk_disable_unprepare(imxdi->clk); + clk_put(imxdi->clk); + } return 0; }