From patchwork Thu Jul 16 11:26:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 496656 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C2FAD1402A9 for ; Thu, 16 Jul 2015 21:29:41 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 8EF2C1A1DA1 for ; Thu, 16 Jul 2015 21:29:41 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 8E2411A08CA for ; Thu, 16 Jul 2015 21:28:28 +1000 (AEST) Received: by pdbep18 with SMTP id ep18so44377151pdb.1 for ; Thu, 16 Jul 2015 04:28:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=M1eGT1x8xQhwxVA86JFQhbaJURAMoDgpoEDHjFZtCbI=; b=l6eBETFNncMubarWH8wXLwfmS6bKqJjJ94/OuXLRiJ/lcTJy3NKa1Ea2ENV/Etc3vS Xp8D3FmOQ1ZwgToJYBO9/HhPqLe+NHm7Dzva/QWtfe376jhae+x3LD0QjgEnHQQ8+cSA 3NClpTd0V3CxSIXVqoFBUCZlULicU/mUTKLXi/OlhxkdLHbh884fKMZN5os5n35fJ2ld W5LAQ4Vky71cR8cE/8OKyp9k85hLH6d9dAufcnl8+DuWpUWEI+akqI1DjuxfBklHwZNg krbYIRaL10yMADC3bohhw4NgmMpNGcUF5Ql3AacJU0jEZA88bRgtBsvx6PvqHIgRCAcV 0jDQ== X-Gm-Message-State: ALoCoQnrm/i5/J7NDQHi/W2Jwbmoe0P6mM9+G6Xr9USLgVNE5loOu1070jCFAyAT0Zh5d5cKV2gD X-Received: by 10.70.23.196 with SMTP id o4mr17891002pdf.164.1437046106428; Thu, 16 Jul 2015 04:28:26 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id r4sm7719782pap.8.2015.07.16.04.28.24 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Jul 2015 04:28:25 -0700 (PDT) From: Viresh Kumar To: Thomas Gleixner , Daniel Lezcano Subject: [PATCH 13/23] powerpc/time: Migrate to new 'set-state' interface Date: Thu, 16 Jul 2015 16:56:25 +0530 Message-Id: <4eb5253c39b903f1c314825cb80d8f3bec141682.1437044517.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Tejun Heo , Paul Mackerras , Anton Blanchard , Viresh Kumar , Neelesh Gupta , Michael Turquette , Christoph Lameter , linuxppc-dev@lists.ozlabs.org, Cyril Bur MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 --- 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 43922509a483..1be1092c7204 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 */