From patchwork Mon Aug 10 09:52:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 52162 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 65B802152A for ; Mon, 10 Aug 2015 09:55:38 +0000 (UTC) Received: by labia3 with SMTP id ia3sf37656176lab.1 for ; Mon, 10 Aug 2015 02:55: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=MHM6x8jQ+AvX/QQZ4tWTG+JDoo4UJeHFwecrN/IDGqs=; b=ebuy5p37+Wc2X/C8xOtnFk0kESHEg6v/co33PmyMzIDRCrd+bYyG6AOdW5yp+ir/Hn p+2P02+okg3vVPU9taDcv1RfVZXaqfha5XycqQV3dCXN2+Fw2riy1bZ5fw/+BkAa8Bqc RQq+277p9dk6MzGIAeai9LOfWBd+diA/HNeh80jDV+et960RitmAv9TU5vaz+k5hPRyJ V+pjj823uHSG78aryVPmhTPywEBvrMztyBtJNmxn7POdtFQ8r0YKjF5BZnSZoxbs5+Vk uEWCsInVoLQEu+hQuYMYtarLrLgx3XgK02X+Q7LFzOj16pkflE1oelipjmaWLurmR1Y8 Jjhw== X-Gm-Message-State: ALoCoQnNss96vQzxuK0FFR7TCC9TzzQyEcdHzRiRPixWwNBk/s4frkJ4ruLq55rsNAQ3H1fEFmNv X-Received: by 10.112.139.65 with SMTP id qw1mr6062828lbb.24.1439200537419; Mon, 10 Aug 2015 02:55:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.162 with SMTP id z2ls166614laj.101.gmail; Mon, 10 Aug 2015 02:55:37 -0700 (PDT) X-Received: by 10.112.199.66 with SMTP id ji2mr7509731lbc.1.1439200537107; Mon, 10 Aug 2015 02:55:37 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id lm12si13754075lac.61.2015.08.10.02.55.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 02:55:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by labd1 with SMTP id d1so37079134lab.1 for ; Mon, 10 Aug 2015 02:55:37 -0700 (PDT) X-Received: by 10.152.22.133 with SMTP id d5mr12968311laf.112.1439200536933; Mon, 10 Aug 2015 02:55:36 -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 l6csp1828148lba; Mon, 10 Aug 2015 02:55:35 -0700 (PDT) X-Received: by 10.68.143.40 with SMTP id sb8mr42066456pbb.21.1439200517973; Mon, 10 Aug 2015 02:55:17 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sz3si32368137pac.98.2015.08.10.02.55.17; Mon, 10 Aug 2015 02:55:17 -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 S933476AbbHJJzO (ORCPT + 28 others); Mon, 10 Aug 2015 05:55:14 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:33364 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933459AbbHJJzJ (ORCPT ); Mon, 10 Aug 2015 05:55:09 -0400 Received: by wijp15 with SMTP id p15so128600016wij.0 for ; Mon, 10 Aug 2015 02:55:08 -0700 (PDT) X-Received: by 10.180.84.136 with SMTP id z8mr23480592wiy.63.1439200508165; Mon, 10 Aug 2015 02:55:08 -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.55.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Aug 2015 02:55:07 -0700 (PDT) From: Daniel Lezcano To: mingo@kernel.org Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, Viresh Kumar , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, Tejun Heo , Michael Turquette , Anton Blanchard , Christoph Lameter , Neelesh Gupta , Kevin Hao , Cyril Bur Subject: [PATCH 65/74] powerpc/time: Migrate to new 'set-state' interface Date: Mon, 10 Aug 2015 11:52:22 +0200 Message-Id: <1439200352-26767-65-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.215.44 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 powerpc 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(ONSHOT) and so set_state_oneshot() isn't implemented. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Viresh Kumar Signed-off-by: Daniel Lezcano --- arch/powerpc/kernel/time.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 4392250..1be1092 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -99,16 +99,17 @@ static struct clocksource clocksource_timebase = { static int decrementer_set_next_event(unsigned long evt, struct clock_event_device *dev); -static void decrementer_set_mode(enum clock_event_mode mode, - struct clock_event_device *dev); +static int decrementer_shutdown(struct clock_event_device *evt); struct clock_event_device decrementer_clockevent = { - .name = "decrementer", - .rating = 200, - .irq = 0, - .set_next_event = decrementer_set_next_event, - .set_mode = decrementer_set_mode, - .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_C3STOP, + .name = "decrementer", + .rating = 200, + .irq = 0, + .set_next_event = decrementer_set_next_event, + .set_state_shutdown = decrementer_shutdown, + .tick_resume = decrementer_shutdown, + .features = CLOCK_EVT_FEAT_ONESHOT | + CLOCK_EVT_FEAT_C3STOP, }; EXPORT_SYMBOL(decrementer_clockevent); @@ -862,11 +863,10 @@ static int decrementer_set_next_event(unsigned long evt, return 0; } -static void decrementer_set_mode(enum clock_event_mode mode, - struct clock_event_device *dev) +static int decrementer_shutdown(struct clock_event_device *dev) { - if (mode != CLOCK_EVT_MODE_ONESHOT) - decrementer_set_next_event(DECREMENTER_MAX, dev); + decrementer_set_next_event(DECREMENTER_MAX, dev); + return 0; } /* Interrupt handler for the timer broadcast IPI */