From patchwork Mon Aug 10 09:52:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 52176 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 380F22152A for ; Mon, 10 Aug 2015 09:58:58 +0000 (UTC) Received: by wicul11 with SMTP id ul11sf37339978wic.1 for ; Mon, 10 Aug 2015 02:58:57 -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=456lSpzrVWymdv4bVKyz0CHj7yDCvSa/q76sAbMHM3Q=; b=A3vxJ1N3Bqz4T5/mZORWNM37AgaTuddgsApYY6XxWr9KPaeLFG5sJ+TUFBYxXKwP4U S2HqnbD8/fphS9bfrDZjPspMjB1iGecsDRfa1SV4aLqfmNURtRnfkHu+y9dQdNCoIA4v HuVbzrtYskDvYM0mvWHP5ITkcxcRy7k7Mwq9J0kBixkAiRoDzIc5TEGG/4yh9F6YL+SO +jN8l+SoVKpC4WScCIJ8hbFcSZFohhb9ftdZBwcNordc8/Jx13rMFKEp0gQo6UZAWr2f SEQwv0EuOZeGWqwMQNhrhYSUMLRXJLAm0MtaVfdTsoZUD4e2G/DKUmD/Q3zt+KDDJkAM pPrw== X-Gm-Message-State: ALoCoQluhYI5A1q4MPAgcgjWJQVMDsnx4KK63WUyFWA+cLAxtAkBroHXLK1IW5hXPQw4m9zBXrhA X-Received: by 10.112.148.101 with SMTP id tr5mr6072687lbb.13.1439200737549; Mon, 10 Aug 2015 02:58:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.242.2 with SMTP id wm2ls676135lac.38.gmail; Mon, 10 Aug 2015 02:58:57 -0700 (PDT) X-Received: by 10.152.10.97 with SMTP id h1mr19642865lab.45.1439200737363; Mon, 10 Aug 2015 02:58:57 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id q7si13775423laq.23.2015.08.10.02.58.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 02:58:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbbpo9 with SMTP id po9so92208136lbb.2 for ; Mon, 10 Aug 2015 02:58:57 -0700 (PDT) X-Received: by 10.152.44.196 with SMTP id g4mr1026256lam.56.1439200736953; Mon, 10 Aug 2015 02:58:56 -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.7.198 with SMTP id l6csp1829482lba; Mon, 10 Aug 2015 02:58:55 -0700 (PDT) X-Received: by 10.70.118.163 with SMTP id kn3mr37845952pdb.115.1439200735013; Mon, 10 Aug 2015 02:58:55 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vs4si32259469pbc.134.2015.08.10.02.58.53; Mon, 10 Aug 2015 02:58:55 -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 S1755125AbbHJJ6v (ORCPT + 28 others); Mon, 10 Aug 2015 05:58:51 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:37058 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933347AbbHJJy7 (ORCPT ); Mon, 10 Aug 2015 05:54:59 -0400 Received: by wibhh20 with SMTP id hh20so142968422wib.0 for ; Mon, 10 Aug 2015 02:54:58 -0700 (PDT) X-Received: by 10.194.191.129 with SMTP id gy1mr9013788wjc.86.1439200498354; Mon, 10 Aug 2015 02:54:58 -0700 (PDT) Received: from localhost.localdomain (sju31-1-78-210-255-2.fbx.proxad.net. [78.210.255.2]) by smtp.gmail.com with ESMTPSA id jr5sm28598154wjc.14.2015.08.10.02.54.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Aug 2015 02:54:57 -0700 (PDT) From: Daniel Lezcano To: mingo@kernel.org Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, Viresh Kumar , Michal Simek , "David S. Miller" , Richard Cochran Subject: [PATCH 62/74] microblaze/timer: Migrate to new 'set-state' interface Date: Mon, 10 Aug 2015 11:52:19 +0200 Message-Id: <1439200352-26767-62-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439200352-26767-1-git-send-email-daniel.lezcano@linaro.org> References: <55C87382.4070309@linaro.org> <1439200352-26767-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.217.169 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: Viresh Kumar Migrate microblaze 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. We weren't doing anything in ->set_mode(RESUME or ONESHOT) and so tick_resume() set_state_oneshot() aren't implemented. Cc: Michal Simek Cc: "David S. Miller" Cc: Richard Cochran Signed-off-by: Viresh Kumar Signed-off-by: Daniel Lezcano --- arch/microblaze/kernel/timer.c | 46 +++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c index c897745..67e2ef4 100644 --- a/arch/microblaze/kernel/timer.c +++ b/arch/microblaze/kernel/timer.c @@ -122,37 +122,29 @@ static int xilinx_timer_set_next_event(unsigned long delta, return 0; } -static void xilinx_timer_set_mode(enum clock_event_mode mode, - struct clock_event_device *evt) +static int xilinx_timer_shutdown(struct clock_event_device *evt) { - switch (mode) { - case CLOCK_EVT_MODE_PERIODIC: - pr_info("%s: periodic\n", __func__); - xilinx_timer0_start_periodic(freq_div_hz); - break; - case CLOCK_EVT_MODE_ONESHOT: - pr_info("%s: oneshot\n", __func__); - break; - case CLOCK_EVT_MODE_UNUSED: - pr_info("%s: unused\n", __func__); - break; - case CLOCK_EVT_MODE_SHUTDOWN: - pr_info("%s: shutdown\n", __func__); - xilinx_timer0_stop(); - break; - case CLOCK_EVT_MODE_RESUME: - pr_info("%s: resume\n", __func__); - break; - } + pr_info("%s\n", __func__); + xilinx_timer0_stop(); + return 0; +} + +static int xilinx_timer_set_periodic(struct clock_event_device *evt) +{ + pr_info("%s\n", __func__); + xilinx_timer0_start_periodic(freq_div_hz); + return 0; } static struct clock_event_device clockevent_xilinx_timer = { - .name = "xilinx_clockevent", - .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC, - .shift = 8, - .rating = 300, - .set_next_event = xilinx_timer_set_next_event, - .set_mode = xilinx_timer_set_mode, + .name = "xilinx_clockevent", + .features = CLOCK_EVT_FEAT_ONESHOT | + CLOCK_EVT_FEAT_PERIODIC, + .shift = 8, + .rating = 300, + .set_next_event = xilinx_timer_set_next_event, + .set_state_shutdown = xilinx_timer_shutdown, + .set_state_periodic = xilinx_timer_set_periodic, }; static inline void timer_ack(void)