From patchwork Mon Apr 1 23:22:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Clouter X-Patchwork-Id: 232836 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-ea0-x23b.google.com (mail-ea0-x23b.google.com [IPv6:2a00:1450:4013:c01::23b]) (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 E41A62C01BC for ; Tue, 2 Apr 2013 10:23:18 +1100 (EST) Received: by mail-ea0-f187.google.com with SMTP id q14sf1053260eaj.14 for ; Mon, 01 Apr 2013 16:23:14 -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=bMsTUTr1T1TN3+BkRiplupGZIWGzc2JvkHzlSPU8ZAY=; b=TXdq25fji6+LULv8+P/nXaO0BqE2+YYmNBVF4l2ndkFTty7Z9fteGZFJ0omf2PODb1 JCmU7HHuI0ZGaDhcrJAn4+STGYYpZ/BmD888ICOqI2GOdGJLSWDmEqGgIaFPNJ5sXJTF ajojw+1mpfjnxxnb3TyM9v35SsPiPOpGDH6WV8n0RfU0/nxOC3tf235KrQW/SZQfW1Qk 3wDWgGBB3baF6cSrQ7prOf7CbbyVp6dhIIQ5VmVsHJS1hnv+Lja7yDLmHC4eOQ7lSp5v vzQP9Pn228WPP+U7QDWB4g+/tm4u+ZBxt/CjDUBUdTBfxAry5kz19zqxBjKlbw7L+X2/ azVQ== X-Received: by 10.180.88.133 with SMTP id bg5mr910943wib.6.1364858594429; Mon, 01 Apr 2013 16:23:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.180.184.105 with SMTP id et9ls747588wic.46.canary; Mon, 01 Apr 2013 16:23:14 -0700 (PDT) X-Received: by 10.180.86.38 with SMTP id m6mr2136079wiz.0.1364858594105; Mon, 01 Apr 2013 16:23:14 -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 ek20si533775wic.0.2013.04.01.16.23.14 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 01 Apr 2013 16:23:14 -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=080340ab33=alex@digriz.org.uk) client-ip=2a03:9800:10:2d:3203:b3a5:8bdc:5b68; Received: from [2a01:348:45:1000:e978:af85:4e49:7987] (helo=berk.digriz.org.uk) by marmot.wormnet.eu with smtp (Exim 4.80) (envelope-from ) id 1UMo46-0002Im-FX; Tue, 02 Apr 2013 00:23:03 +0100 Received: (nullmailer pid 17773 invoked by uid 1000); Mon, 01 Apr 2013 23:22:47 -0000 From: Alexander Clouter To: Alessandro Zummo , Hartley Sweeten , Grant Likely , Jason Cooper , Ryan Mallon , Rob Herring , Andrew Lunn Cc: devicetree-discuss@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, rtc-linux@googlegroups.com, Alexander Clouter Subject: [rtc-linux] [PATCH 5/6] arm: ep93xx: move ts72xx to use rtc-m48t86 driver side memory interface Date: Tue, 2 Apr 2013 00:22:44 +0100 Message-Id: <1364858565-17192-6-git-send-email-alex@digriz.org.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1364858565-17192-1-git-send-email-alex@digriz.org.uk> References: <1364858565-17192-1-git-send-email-alex@digriz.org.uk> X-WormNet-Spam-Score: 0.6 (/) X-WormNet-Spam-Report: from marmot.wormnet.eu 1.7 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -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, 95; hammy, 96; neutral, 54; 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=080340ab33=alex@digriz.org.uk) smtp.mail=prvs=080340ab33=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: , Remove platform_data hooks into rtc-m48t86 and use named resource regions. Signed-off-by: Alexander Clouter --- arch/arm/mach-ep93xx/ts72xx.c | 38 +++++++------------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index a278639..baadffd 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -45,16 +44,6 @@ static struct map_desc ts72xx_io_desc[] __initdata = { .pfn = __phys_to_pfn(TS72XX_OPTIONS2_PHYS_BASE), .length = TS72XX_OPTIONS2_SIZE, .type = MT_DEVICE, - }, { - .virtual = (unsigned long)TS72XX_RTC_INDEX_VIRT_BASE, - .pfn = __phys_to_pfn(TS72XX_RTC_INDEX_PHYS_BASE), - .length = TS72XX_RTC_INDEX_SIZE, - .type = MT_DEVICE, - }, { - .virtual = (unsigned long)TS72XX_RTC_DATA_VIRT_BASE, - .pfn = __phys_to_pfn(TS72XX_RTC_DATA_PHYS_BASE), - .length = TS72XX_RTC_DATA_SIZE, - .type = MT_DEVICE, } }; @@ -179,31 +168,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_resource[] = { + 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_resource, + .num_resources = ARRAY_SIZE(ts72xx_rtc_resource), }; static struct resource ts72xx_wdt_resources[] = {