From patchwork Mon Aug 10 09:52:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 52175 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by patches.linaro.org (Postfix) with ESMTPS id 8C6432152A for ; Mon, 10 Aug 2015 09:58:42 +0000 (UTC) Received: by lbck9 with SMTP id k9sf8382921lbc.0 for ; Mon, 10 Aug 2015 02:58:41 -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=38iEyQgrPeGFUCLcNlPrbdHQ0ICzPgrZcr7hZekshxI=; b=JMy0vGgL2OhvWxezTNh6A3lMwz+HSmwedI5sLJ6VRGnPbDMsYYARJyeMGqGAI/LbAs j50p2uySFIp1oWjJ6PICRTEea7BSazRFc7Tq/bpAlWbdWxsfPBcBgwG5rtUaXND2quSU JopXA5VtV0fZfCmvXV7hNpZdj72K5U34TsUIt2sD4FO5BZvInuY/KO6TecCpEAPh4+yn WDsVXxzmFBBn0B7gNatCyCJKgM3gQAAbeBmB5W8jk1JFVfrvEgm5Dorq4F8RucNKolbH xmwex2FqN1oL0s/BHY41qSdzTuFdlGIh7kmxLqc6LrPAkPikNhZ9VJHfg6+akXvGGgKY 4VuA== X-Gm-Message-State: ALoCoQkcQpaibxBIpaoFGl6eNeJ2TdoJB+vh1uLhpSX8EA3KYblYTtsC5WOMocqIL+cPLJeYVUYN X-Received: by 10.180.83.226 with SMTP id t2mr3453750wiy.5.1439200721579; Mon, 10 Aug 2015 02:58:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.70 with SMTP id y6ls58299lay.55.gmail; Mon, 10 Aug 2015 02:58:41 -0700 (PDT) X-Received: by 10.152.22.4 with SMTP id z4mr19337511lae.81.1439200721375; Mon, 10 Aug 2015 02:58:41 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id l13si3721424laa.174.2015.08.10.02.58.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 02:58:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbbpo9 with SMTP id po9so92204900lbb.2 for ; Mon, 10 Aug 2015 02:58:41 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr19419672laj.88.1439200721158; Mon, 10 Aug 2015 02:58:41 -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 l6csp1829385lba; Mon, 10 Aug 2015 02:58:40 -0700 (PDT) X-Received: by 10.68.241.103 with SMTP id wh7mr42651383pbc.88.1439200719889; Mon, 10 Aug 2015 02:58:39 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id il7si32336789pac.156.2015.08.10.02.58.38; Mon, 10 Aug 2015 02:58:39 -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 S1755091AbbHJJ6h (ORCPT + 28 others); Mon, 10 Aug 2015 05:58:37 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:36026 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754744AbbHJJ5P (ORCPT ); Mon, 10 Aug 2015 05:57:15 -0400 Received: by wicja10 with SMTP id ja10so30406934wic.1 for ; Mon, 10 Aug 2015 02:57:14 -0700 (PDT) X-Received: by 10.180.218.195 with SMTP id pi3mr22327454wic.71.1439200634257; Mon, 10 Aug 2015 02:57:14 -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.57.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Aug 2015 02:57:13 -0700 (PDT) From: Daniel Lezcano To: mingo@kernel.org Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, Viresh Kumar , Guan Xuetao Subject: [PATCH 71/74] unicore/time: Migrate to new 'set-state' interface Date: Mon, 10 Aug 2015 11:52:28 +0200 Message-Id: <1439200352-26767-71-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.174 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 unicore 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 for PERIODIC or RESUME modes and so their callbacks aren't implemented. Cc: Guan Xuetao Signed-off-by: Viresh Kumar Signed-off-by: Daniel Lezcano --- arch/unicore32/kernel/time.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/arch/unicore32/kernel/time.c b/arch/unicore32/kernel/time.c index d3824b2..ac4c544 100644 --- a/arch/unicore32/kernel/time.c +++ b/arch/unicore32/kernel/time.c @@ -46,29 +46,20 @@ puv3_osmr0_set_next_event(unsigned long delta, struct clock_event_device *c) return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0; } -static void -puv3_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c) +static int puv3_osmr0_shutdown(struct clock_event_device *evt) { - switch (mode) { - case CLOCK_EVT_MODE_ONESHOT: - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - writel(readl(OST_OIER) & ~OST_OIER_E0, OST_OIER); - writel(readl(OST_OSSR) & ~OST_OSSR_M0, OST_OSSR); - break; - - case CLOCK_EVT_MODE_RESUME: - case CLOCK_EVT_MODE_PERIODIC: - break; - } + writel(readl(OST_OIER) & ~OST_OIER_E0, OST_OIER); + writel(readl(OST_OSSR) & ~OST_OSSR_M0, OST_OSSR); + return 0; } static struct clock_event_device ckevt_puv3_osmr0 = { - .name = "osmr0", - .features = CLOCK_EVT_FEAT_ONESHOT, - .rating = 200, - .set_next_event = puv3_osmr0_set_next_event, - .set_mode = puv3_osmr0_set_mode, + .name = "osmr0", + .features = CLOCK_EVT_FEAT_ONESHOT, + .rating = 200, + .set_next_event = puv3_osmr0_set_next_event, + .set_state_shutdown = puv3_osmr0_shutdown, + .set_state_oneshot = puv3_osmr0_shutdown, }; static cycle_t puv3_read_oscr(struct clocksource *cs)