From patchwork Fri Jul 3 08:54:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50611 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7156B214B3 for ; Fri, 3 Jul 2015 08:54:59 +0000 (UTC) Received: by wgfk9 with SMTP id k9sf27830558wgf.1 for ; Fri, 03 Jul 2015 01:54:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=KNA+6maVFo8I1jFwxoeAfMvNavStlKns4UehcX1kAQA=; b=ghH5mm/fUpsmOlzkL1oR4TzICpZmZX2tQoLan+rZfqCiFLiVgPkPHpUVIZFOYdPzWP Ht1zOiroFHRK3/6hC06tpvdVJwZX0u7RMO1zaj7pjEU3CNbdupgR/6D6bvBuqWeHx9fx rB/rmz3JRRtinLbJ+XvBSsBH2TpU6wp0qS9IQjmc/PUNIMgTpuahCQtpeRvfjJdGUFdC D0swilqQ39Jv7FFDs18nQ3kjgaRQBn+KbRrw887eVxIL7myX4Uc5+u+8SL1Rhwn2i7R0 wVeBKfMWomJoiBKbxqxNHjd9356CNrbcyB3UBpGauY97bLduQCtIjUXX48e2DOERItV4 VvgA== X-Gm-Message-State: ALoCoQk/r8iGMJP4uzv5Zi6VBVC0lPiTINBtcyO5JHvWJgz72CP2mA55Qngn2Z+sABXgtXlhKxT5 X-Received: by 10.180.97.9 with SMTP id dw9mr6951221wib.2.1435913698787; Fri, 03 Jul 2015 01:54:58 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.133 with SMTP id y5ls465243laj.19.gmail; Fri, 03 Jul 2015 01:54:58 -0700 (PDT) X-Received: by 10.152.28.42 with SMTP id y10mr35326400lag.9.1435913698585; Fri, 03 Jul 2015 01:54:58 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id c4si6664666laf.113.2015.07.03.01.54.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jul 2015 01:54:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by laar3 with SMTP id r3so77457210laa.0 for ; Fri, 03 Jul 2015 01:54:58 -0700 (PDT) X-Received: by 10.152.7.7 with SMTP id f7mr35075514laa.106.1435913698334; Fri, 03 Jul 2015 01:54:58 -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 hn6csp1016319lbb; Fri, 3 Jul 2015 01:54:57 -0700 (PDT) X-Received: by 10.69.27.39 with SMTP id jd7mr75576180pbd.49.1435913696435; Fri, 03 Jul 2015 01:54:56 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4si13346052pdi.136.2015.07.03.01.54.55; Fri, 03 Jul 2015 01:54:56 -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 S1754793AbbGCIyx (ORCPT + 29 others); Fri, 3 Jul 2015 04:54:53 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:35663 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754794AbbGCIyk (ORCPT ); Fri, 3 Jul 2015 04:54:40 -0400 Received: by pdbci14 with SMTP id ci14so60278321pdb.2 for ; Fri, 03 Jul 2015 01:54:40 -0700 (PDT) X-Received: by 10.66.159.34 with SMTP id wz2mr73389221pab.58.1435913680328; Fri, 03 Jul 2015 01:54:40 -0700 (PDT) Received: from localhost ([122.171.186.190]) by mx.google.com with ESMTPSA id y3sm8244325pbt.81.2015.07.03.01.54.38 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 03 Jul 2015 01:54:39 -0700 (PDT) Date: Fri, 3 Jul 2015 14:24:35 +0530 From: Viresh Kumar To: Daniel Lezcano Cc: Thomas Gleixner , linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thierry Reding , Stephen Warren Subject: Re: [PATCH 25/41] clocksource: tegra20: Migrate to new 'set-state' interface Message-ID: <20150703085435.GC23297@linux> References: <1888421925acbfbcc453488d254faa154cd0fc2b.1434622147.git.viresh.kumar@linaro.org> <559593F3.5030802@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <559593F3.5030802@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) 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.215.54 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: , On 02-07-15, 21:41, Daniel Lezcano wrote: > >+ timer_writel(0, TIMER3_BASE + TIMER_PTV); > > Replace with 'tegra_timer_shutdown' Looks fine now ? ---------------8<----------------------- Message-Id: <2b6d1a867e100033f1f406fda39d358a4db80733.1435913653.git.viresh.kumar@linaro.org> From: Viresh Kumar Date: Fri, 27 Feb 2015 13:39:52 +0530 Subject: [PATCH] clocksource: tegra20: Migrate to new 'set-state' interface 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 | 45 ++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 21 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/clocksource/tegra20_timer.c b/drivers/clocksource/tegra20_timer.c index 5a112d72fc2d..6ebda1177e79 100644 --- a/drivers/clocksource/tegra20_timer.c +++ b/drivers/clocksource/tegra20_timer.c @@ -72,33 +72,36 @@ 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 inline void timer_shutdown(struct clock_event_device *evt) { - u32 reg; - timer_writel(0, TIMER3_BASE + TIMER_PTV); +} - 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_shutdown(struct clock_event_device *evt) +{ + timer_shutdown(evt); + return 0; +} + +static int tegra_timer_set_periodic(struct clock_event_device *evt) +{ + u32 reg = 0xC0000000 | ((1000000 / HZ) - 1); + + timer_shutdown(evt); + 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)