From patchwork Sun Mar 31 21:56:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Clouter X-Patchwork-Id: 232631 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-la0-x23d.google.com (mail-la0-x23d.google.com [IPv6:2a00:1450:4010:c03::23d]) (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 862FA2C0189 for ; Mon, 1 Apr 2013 08:56:40 +1100 (EST) Received: by mail-la0-f61.google.com with SMTP id gw10sf697196lab.16 for ; Sun, 31 Mar 2013 14:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-received:mime-version:x-beenthere:x-received:received-spf:from:to :cc:subject:date:message-id:x-mailer:in-reply-to:references :x-wormnet-spam-score:x-wormnet-spam-report: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=KU4Odf2NVq+yYo0Vp5rivBDnc0xb5hesFBfmUZW8VHw=; b=sHLWK8VDgdNzlXm6mrdmtezSLYhNu2ywbz7/gFX3ttuXA/8Qie2QJ1QdzErV6w0vUb MnehRHt91q+F7LRJL6bx3RlBNEJHQlrjpLdPoC9wMMCYHF1kbKjdEI7639MIZhqfE89O SZnDEmu0oAdmkZeLAg7f2JcYwbu4NqinWLMYrgfr8Y9oW11ql7Sh5JlB24V2NZteK4qz W1hFl9zVIS3pMD29c6mT+nPsTRTzMbe3em68VY2T7wy1O9Iq3Em847y0PbtlNG3BWc+o lepOs/Rvdcx6K9wiQQ8TgPeWlo2PXWcE8gwK2Ew4kL1MtHuD9ISRLNP8FOGCnTPZG1Fz 6jgg== X-Received: by 10.180.20.68 with SMTP id l4mr329223wie.7.1364766995805; Sun, 31 Mar 2013 14:56:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.180.107.73 with SMTP id ha9ls321428wib.27.gmail; Sun, 31 Mar 2013 14:56:35 -0700 (PDT) X-Received: by 10.180.96.225 with SMTP id dv1mr1200191wib.6.1364766995274; Sun, 31 Mar 2013 14:56:35 -0700 (PDT) Received: from marmot.wormnet.eu (marmot.wormnet.eu. [2a03:9800:10:2d:3203:b3a5:8bdc:5b68]) by gmr-mx.google.com with ESMTPS id b10si336460wiw.1.2013.03.31.14.56.35 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 31 Mar 2013 14:56:35 -0700 (PDT) Received-SPF: neutral (google.com: 2a03:9800:10:2d:3203:b3a5:8bdc:5b68 is neither permitted nor denied by best guess record for domain of prvs=0802e14cf1=alex@digriz.org.uk) client-ip=2a03:9800:10:2d:3203:b3a5:8bdc:5b68; Received: from [2a01:348:45:1000:d0c7:5dd8:2ab9:8725] (helo=berk.digriz.org.uk) by marmot.wormnet.eu with smtp (Exim 4.80) (envelope-from ) id 1UMQEg-0005WQ-Qw; Sun, 31 Mar 2013 22:56:24 +0100 Received: (nullmailer pid 7144 invoked by uid 1000); Sun, 31 Mar 2013 21:56:13 -0000 From: Alexander Clouter To: Alessandro Zummo , Hartley Sweeten , Grant Likely , Jason Cooper , Ryan Mallon , Rob Herring Cc: devicetree-discuss@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, rtc-linux@googlegroups.com, Alexander Clouter Subject: [rtc-linux] [PATCH 3/3] arm: ep93xx: fixup ts72xx to be able to use the rtc-m48t86 again. Date: Sun, 31 Mar 2013 22:56:11 +0100 Message-Id: <1364766971-5914-4-git-send-email-alex@digriz.org.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1364766971-5914-1-git-send-email-alex@digriz.org.uk> References: <1364766971-5914-1-git-send-email-alex@digriz.org.uk> X-WormNet-Spam-Score: -1.1 (-) X-WormNet-Spam-Report: from marmot.wormnet.eu -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.8 RDNS_NONE Delivered to internal network by a host with no rDNS Tokens: new, 114; hammy, 64; neutral, 47; spammy, 3. X-Original-Sender: alex@digriz.org.uk X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 2a03:9800:10:2d:3203:b3a5:8bdc:5b68 is neither permitted nor denied by best guess record for domain of prvs=0802e14cf1=alex@digriz.org.uk) smtp.mail=prvs=0802e14cf1=alex@digriz.org.uk; dkim=pass header.i=@digriz.org.uk 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 fixes the board to be able to use the rtc-m48t86 driver again. Signed-off-by: Alexander Clouter --- arch/arm/mach-ep93xx/ts72xx.c | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index 61f4b5d..c0ed3bf 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include @@ -179,31 +179,18 @@ static void __init ts72xx_register_flash(void) } } - -static unsigned char ts72xx_rtc_readbyte(unsigned long addr) -{ - __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE); - return __raw_readb(TS72XX_RTC_DATA_VIRT_BASE); -} - -static void ts72xx_rtc_writebyte(unsigned char value, unsigned long addr) -{ - __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE); - __raw_writeb(value, TS72XX_RTC_DATA_VIRT_BASE); -} - -static struct m48t86_ops ts72xx_rtc_ops = { - .readbyte = ts72xx_rtc_readbyte, - .writebyte = ts72xx_rtc_writebyte, +static struct resource ts72xx_rtc_resources[] = { + DEFINE_RES_NAMED(TS72XX_RTC_INDEX_PHYS_BASE, 4, + "rtc_index", IORESOURCE_MEM), + DEFINE_RES_NAMED(TS72XX_RTC_DATA_PHYS_BASE, 4, + "rtc_data", IORESOURCE_MEM), }; static struct platform_device ts72xx_rtc_device = { .name = "rtc-m48t86", .id = -1, - .dev = { - .platform_data = &ts72xx_rtc_ops, - }, - .num_resources = 0, + .resource = ts72xx_rtc_resources, + .num_resources = ARRAY_SIZE(ts72xx_rtc_resources), }; static struct resource ts72xx_wdt_resources[] = {