From patchwork Thu Jun 18 10:54:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50010 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 96390228CC for ; Thu, 18 Jun 2015 10:57:36 +0000 (UTC) Received: by laar3 with SMTP id r3sf7906450laa.1 for ; Thu, 18 Jun 2015 03:57:35 -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: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=USLpRsohL0IDWwoiHQnl2We+ig+SjEp4VNha2k/6BKE=; b=gD2XmLDvuGqVRxpLbTtJokp5M8cG4jHbOe36hOlJ0Z9Vexl7hE6AavfpglNZbmzNt1 js76kH6TEV1Y/kgb4iCpl4TNV0AopDLb974ljOiVJkWPH+OHvZCFZvgZKLPEi+tkVezT O4YoVxAlgllxC0DIC9XHLouy1RnNnfwzSLKzvJFLSYIE66TGKEceIo9l+zMgE3jcsjVr ZgRv3OlJDILeUcKMr+X8ZS8awvnF7tNibVtYKDs7hc9qqqRWFlfqvRI01wL0VRZqV68h O6OoeEuBgkCSnTLrRSajpSevZ56YUOuF0SNVMvaxYmiw6dYHWc6eTLMgpLMXTcNk7mId k34g== X-Gm-Message-State: ALoCoQlcPO/J/U8V9B6gL4LcnAMyalXpqgJlizj8UE/uF/ApFk/9g3Ge8g576D8TA+h3Q/pTj71s X-Received: by 10.112.203.168 with SMTP id kr8mr9819964lbc.10.1434625055655; Thu, 18 Jun 2015 03:57:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.74 with SMTP id k10ls448312laf.30.gmail; Thu, 18 Jun 2015 03:57:35 -0700 (PDT) X-Received: by 10.112.125.65 with SMTP id mo1mr12689140lbb.0.1434625055481; Thu, 18 Jun 2015 03:57:35 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id xs10si6181323lbb.86.2015.06.18.03.57.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 03:57:35 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbbwc1 with SMTP id wc1so49810507lbb.2 for ; Thu, 18 Jun 2015 03:57:35 -0700 (PDT) X-Received: by 10.112.140.231 with SMTP id rj7mr12315623lbb.76.1434625055370; Thu, 18 Jun 2015 03:57:35 -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.112.108.230 with SMTP id hn6csp1095388lbb; Thu, 18 Jun 2015 03:57:34 -0700 (PDT) X-Received: by 10.66.123.81 with SMTP id ly17mr20421257pab.31.1434625052020; Thu, 18 Jun 2015 03:57:32 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ro16si10809309pab.235.2015.06.18.03.57.30; Thu, 18 Jun 2015 03:57:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754876AbbFRK5R (ORCPT + 30 others); Thu, 18 Jun 2015 06:57:17 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:32971 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932439AbbFRK4d (ORCPT ); Thu, 18 Jun 2015 06:56:33 -0400 Received: by padev16 with SMTP id ev16so59064398pad.0 for ; Thu, 18 Jun 2015 03:56:33 -0700 (PDT) X-Received: by 10.70.93.36 with SMTP id cr4mr19917053pdb.68.1434624993002; Thu, 18 Jun 2015 03:56:33 -0700 (PDT) Received: from localhost ([122.167.70.98]) by mx.google.com with ESMTPSA id f4sm7652052pdc.95.2015.06.18.03.56.31 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Jun 2015 03:56:32 -0700 (PDT) From: Viresh Kumar To: Thomas Gleixner , Daniel Lezcano Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Viresh Kumar , Thierry Reding , Stephen Warren Subject: [PATCH 25/41] clocksource: tegra20: Migrate to new 'set-state' interface Date: Thu, 18 Jun 2015 16:24:39 +0530 Message-Id: <1888421925acbfbcc453488d254faa154cd0fc2b.1434622147.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: 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: viresh.kumar@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.217.171 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: , Migrate tegra20 driver to the new 'set-state' interface provided by clockevents core, the earlier 'set-mode' interface is marked obsolete now. This also enables us to implement callbacks for new states of clockevent devices, for example: ONESHOT_STOPPED. Cc: Thierry Reding Cc: Stephen Warren Signed-off-by: Viresh Kumar --- drivers/clocksource/tegra20_timer.c | 40 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/drivers/clocksource/tegra20_timer.c b/drivers/clocksource/tegra20_timer.c index 5a112d72fc2d..e6083d3d762b 100644 --- a/drivers/clocksource/tegra20_timer.c +++ b/drivers/clocksource/tegra20_timer.c @@ -72,33 +72,31 @@ static int tegra_timer_set_next_event(unsigned long cycles, return 0; } -static void tegra_timer_set_mode(enum clock_event_mode mode, - struct clock_event_device *evt) +static int tegra_timer_shutdown(struct clock_event_device *evt) { - u32 reg; - timer_writel(0, TIMER3_BASE + TIMER_PTV); + return 0; +} - switch (mode) { - case CLOCK_EVT_MODE_PERIODIC: - reg = 0xC0000000 | ((1000000/HZ)-1); - timer_writel(reg, TIMER3_BASE + TIMER_PTV); - break; - case CLOCK_EVT_MODE_ONESHOT: - break; - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - case CLOCK_EVT_MODE_RESUME: - break; - } +static int tegra_timer_set_periodic(struct clock_event_device *evt) +{ + u32 reg = 0xC0000000 | ((1000000 / HZ) - 1); + + timer_writel(0, TIMER3_BASE + TIMER_PTV); + timer_writel(reg, TIMER3_BASE + TIMER_PTV); + return 0; } static struct clock_event_device tegra_clockevent = { - .name = "timer0", - .rating = 300, - .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC, - .set_next_event = tegra_timer_set_next_event, - .set_mode = tegra_timer_set_mode, + .name = "timer0", + .rating = 300, + .features = CLOCK_EVT_FEAT_ONESHOT | + CLOCK_EVT_FEAT_PERIODIC, + .set_next_event = tegra_timer_set_next_event, + .set_state_shutdown = tegra_timer_shutdown, + .set_state_periodic = tegra_timer_set_periodic, + .set_state_oneshot = tegra_timer_shutdown, + .tick_resume = tegra_timer_shutdown, }; static u64 notrace tegra_read_sched_clock(void)