From patchwork Fri May 23 10:30:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 30687 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 52DA320369 for ; Fri, 23 May 2014 10:32:38 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id tp5sf22500201ieb.9 for ; Fri, 23 May 2014 03:32:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=FUGMnytBsqKdR6zWpbVNS9jta6wQ99LS9PyEmfFd6xE=; b=PSmuItXRRshh+vhg/PjGluR+egvoNh64rRYH2OxHTq3MYq1DqS5ox2syPjugEMjALe lSnH4lflfTnjO3zWv9rE3wWRbqFak1tfP/37NEvJOutMN9ygUeMCll18heag/+DOiIck vjAPfrT1AF8panZWUTViduS/+MvLUY9swZQ/5cFVUWc1C+61xhRsiYquOGHcYvBks4cD TN52JgJn6oRyZptQA3xzA0x0HBOWBKPosRgPNHLzrySXS0Q5hJRs/FNi+Lyyqi4aNG4a E/S5iycDlLcG8EgvcMCPJGpXwjKdGPVKNpi+WEoj/8ig3mJt0LuLyuDWglolH6zKEYLJ a5EA== X-Gm-Message-State: ALoCoQlPQJtyyeBVCkZd1gIZr+KXYianDlukzAijFwDux+C1QC/33+PbS5XGu67BGS6dJzIDWWej X-Received: by 10.50.111.15 with SMTP id ie15mr1232028igb.2.1400841157776; Fri, 23 May 2014 03:32:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.133 with SMTP id t5ls1704018qgt.43.gmail; Fri, 23 May 2014 03:32:37 -0700 (PDT) X-Received: by 10.221.42.135 with SMTP id ty7mr3447141vcb.14.1400841157645; Fri, 23 May 2014 03:32:37 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id sa14si1387754veb.32.2014.05.23.03.32.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 03:32:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id jw12so6044699veb.33 for ; Fri, 23 May 2014 03:32:37 -0700 (PDT) X-Received: by 10.58.228.163 with SMTP id sj3mr3444511vec.28.1400841157535; Fri, 23 May 2014 03:32:37 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp19781vcb; Fri, 23 May 2014 03:32:37 -0700 (PDT) X-Received: by 10.67.3.229 with SMTP id bz5mr4708760pad.80.1400841156803; Fri, 23 May 2014 03:32:36 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg4si3275525pbb.67.2014.05.23.03.32.36 for ; Fri, 23 May 2014 03:32:36 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751889AbaEWKbs (ORCPT + 27 others); Fri, 23 May 2014 06:31:48 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:32875 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752373AbaEWKbq (ORCPT ); Fri, 23 May 2014 06:31:46 -0400 Received: by mail-wi0-f179.google.com with SMTP id bs8so620786wib.6 for ; Fri, 23 May 2014 03:31:44 -0700 (PDT) X-Received: by 10.194.60.211 with SMTP id j19mr3250150wjr.51.1400841104897; Fri, 23 May 2014 03:31:44 -0700 (PDT) Received: from localhost.localdomain (AToulouse-654-1-404-187.w82-125.abo.wanadoo.fr. [82.125.3.187]) by mx.google.com with ESMTPSA id s9sm2200908wix.13.2014.05.23.03.31.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 03:31:44 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, mingo@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 07/71] clocksource: sh_cmt: Add memory base to sh_cmt_channel structure Date: Fri, 23 May 2014 12:30:47 +0200 Message-Id: <1400841111-6683-7-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400841111-6683-1-git-send-email-daniel.lezcano@linaro.org> References: <537F214C.8000700@linaro.org> <1400841111-6683-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Laurent Pinchart The channel memory base is channel-specific, add it to the channel structure in preparation for support of multiple channels per device. Signed-off-by: Laurent Pinchart --- drivers/clocksource/sh_cmt.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c index eb93b88..4fcb05d 100644 --- a/drivers/clocksource/sh_cmt.c +++ b/drivers/clocksource/sh_cmt.c @@ -40,6 +40,8 @@ struct sh_cmt_device; struct sh_cmt_channel { struct sh_cmt_device *cmt; + void __iomem *base; + unsigned long flags; unsigned long match_value; unsigned long next_match_value; @@ -130,12 +132,12 @@ static inline unsigned long sh_cmt_read_cmstr(struct sh_cmt_channel *ch) static inline unsigned long sh_cmt_read_cmcsr(struct sh_cmt_channel *ch) { - return ch->cmt->read_control(ch->cmt->mapbase_ch, CMCSR); + return ch->cmt->read_control(ch->base, CMCSR); } static inline unsigned long sh_cmt_read_cmcnt(struct sh_cmt_channel *ch) { - return ch->cmt->read_count(ch->cmt->mapbase_ch, CMCNT); + return ch->cmt->read_count(ch->base, CMCNT); } static inline void sh_cmt_write_cmstr(struct sh_cmt_channel *ch, @@ -147,19 +149,19 @@ static inline void sh_cmt_write_cmstr(struct sh_cmt_channel *ch, static inline void sh_cmt_write_cmcsr(struct sh_cmt_channel *ch, unsigned long value) { - ch->cmt->write_control(ch->cmt->mapbase_ch, CMCSR, value); + ch->cmt->write_control(ch->base, CMCSR, value); } static inline void sh_cmt_write_cmcnt(struct sh_cmt_channel *ch, unsigned long value) { - ch->cmt->write_count(ch->cmt->mapbase_ch, CMCNT, value); + ch->cmt->write_count(ch->base, CMCNT, value); } static inline void sh_cmt_write_cmcor(struct sh_cmt_channel *ch, unsigned long value) { - ch->cmt->write_count(ch->cmt->mapbase_ch, CMCOR, value); + ch->cmt->write_count(ch->base, CMCOR, value); } static unsigned long sh_cmt_get_counter(struct sh_cmt_channel *ch, @@ -702,6 +704,7 @@ static int sh_cmt_setup_channel(struct sh_cmt_channel *ch, memset(ch, 0, sizeof(*ch)); ch->cmt = cmt; + ch->base = cmt->mapbase_ch; irq = platform_get_irq(cmt->pdev, 0); if (irq < 0) {