From patchwork Thu Jul 16 11:26:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51156 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 00DB322A28 for ; Thu, 16 Jul 2015 11:28:03 +0000 (UTC) Received: by wizo10 with SMTP id o10sf3923176wiz.0 for ; Thu, 16 Jul 2015 04:28:02 -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=aXOWkSDCf+b5B+QApEUzQ8L2PAojFJDvH22vax6Hb0Y=; b=XHidR3Aq7lqjOyRrIShdYqwRE79o6Xt0Nsq9qTOoC6mR8y7a0QW69j0PVwQmz2lzDh AGW+12aDO8asc8Rcz4OtAJBp0pWWk2Md73zAzFs2ui3tNKn1VUwHj5BpxS5+H9oeURhJ qe6vZGpus1nSf4RoGJr56Nuin1MkkIDJdvaTdCKlOuFNrtbtw18Py6B6xxSdTlWTvitU FaTq4TD0sJvS4ht04g3lktK//hsvS0+07SQHUUggjC/kudH2WXHI7LbeKQpjHWDrpviz H2F7uEvg51oHkB2YJlm0FUdHW4yeWsaEagJwwDeVaw4v8PjX1ZoifHfBuUuIEbW+Jjz4 uYLw== X-Gm-Message-State: ALoCoQkhV8xqMpButhjV9WcnPocBosNVyJiBXSgAnIl/Lx+/or+xlN9VWy4h/B0gRwN9qw40FDEY X-Received: by 10.112.189.131 with SMTP id gi3mr4725493lbc.6.1437046082306; Thu, 16 Jul 2015 04:28:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.41 with SMTP id bd9ls35526lab.93.gmail; Thu, 16 Jul 2015 04:28:01 -0700 (PDT) X-Received: by 10.152.224.162 with SMTP id rd2mr8821456lac.43.1437046081840; Thu, 16 Jul 2015 04:28:01 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id ur9si6682669lac.98.2015.07.16.04.28.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 04:28:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbbzr7 with SMTP id zr7so41811950lbb.1 for ; Thu, 16 Jul 2015 04:28:01 -0700 (PDT) X-Received: by 10.152.37.228 with SMTP id b4mr8830358lak.117.1437046081739; Thu, 16 Jul 2015 04:28:01 -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 hn6csp191455lbb; Thu, 16 Jul 2015 04:28:00 -0700 (PDT) X-Received: by 10.66.119.239 with SMTP id kx15mr17981018pab.156.1437046079938; Thu, 16 Jul 2015 04:27:59 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hn9si12550120pdb.133.2015.07.16.04.27.58; Thu, 16 Jul 2015 04:27:59 -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 S932203AbbGPL1y (ORCPT + 27 others); Thu, 16 Jul 2015 07:27:54 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:34608 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932087AbbGPL1w (ORCPT ); Thu, 16 Jul 2015 07:27:52 -0400 Received: by pdbep18 with SMTP id ep18so44369701pdb.1 for ; Thu, 16 Jul 2015 04:27:51 -0700 (PDT) X-Received: by 10.70.39.74 with SMTP id n10mr17714359pdk.57.1437046071851; Thu, 16 Jul 2015 04:27:51 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id zj15sm7726134pab.1.2015.07.16.04.27.50 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Jul 2015 04:27:51 -0700 (PDT) From: Viresh Kumar To: Thomas Gleixner , Daniel Lezcano Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Viresh Kumar , Michal Simek , "David S. Miller" , Richard Cochran Subject: [PATCH 09/23] microblaze/timer: Migrate to new 'set-state' interface Date: Thu, 16 Jul 2015 16:56:21 +0530 Message-Id: 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.175 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 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 --- 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 c8977450e28c..67e2ef48d2d0 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)