From patchwork Thu Jun 18 10:54:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50011 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 71BA4228CC for ; Thu, 18 Jun 2015 10:57:39 +0000 (UTC) Received: by lagh6 with SMTP id h6sf20492389lag.0 for ; Thu, 18 Jun 2015 03:57:38 -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=0SEqK9/qIoQ5D3ZhOVn45OszRl0uqBBQnHc+HuqQiSg=; b=Hb7rB183/CRkZOIEpqWrdhqOTK9dgvw9JE3IpDVzOHtawGQ+1SckeYroJk18UNNbb/ /x0PUVXo8qs7aAojeR3KTieJI4XRgtkBE8/L+Qh7dZdiXMiIPl3cYv0Hoe+lEGmKkRWK 9QtbvpXwSKwf++caxRYh6dvRlgvMltS9Cfp7TJ0y0b9YM05P0ICg/+mXppqcClOskSwC uK82Qa2/l0dWpL6VK5GHc1+9UtINhmN/Q2ioQj6w7CotAgy1tellu3wxZ3cg96jLCmpf X6XDEWzP19S2iAD04fh0Atmxuf/ze0Jd7gL9mQfk1muaedUWFLGxaE0mplv3mhDLFKPZ +EHg== X-Gm-Message-State: ALoCoQmk2+3cBS/ZLUx3XCZF1ZtC5TG4GOdnw3dB+PT23x38iiuotDxUanJG9CH1QmktYDgfP9iw X-Received: by 10.112.13.200 with SMTP id j8mr9858581lbc.14.1434625058514; Thu, 18 Jun 2015 03:57:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.105 with SMTP id lb9ls446707lab.10.gmail; Thu, 18 Jun 2015 03:57:38 -0700 (PDT) X-Received: by 10.112.119.198 with SMTP id kw6mr12131767lbb.97.1434625058345; Thu, 18 Jun 2015 03:57:38 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id u9si6183522lau.48.2015.06.18.03.57.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 03:57:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by lacny3 with SMTP id ny3so51777676lac.3 for ; Thu, 18 Jun 2015 03:57:38 -0700 (PDT) X-Received: by 10.112.222.133 with SMTP id qm5mr12512858lbc.86.1434625058196; Thu, 18 Jun 2015 03:57:38 -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 hn6csp1095413lbb; Thu, 18 Jun 2015 03:57:36 -0700 (PDT) X-Received: by 10.70.63.1 with SMTP id c1mr20057242pds.88.1434625053353; Thu, 18 Jun 2015 03:57:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ro16si10809309pab.235.2015.06.18.03.57.32; Thu, 18 Jun 2015 03:57:33 -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 S1754963AbbFRK52 (ORCPT + 30 others); Thu, 18 Jun 2015 06:57:28 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:36647 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754404AbbFRK4n (ORCPT ); Thu, 18 Jun 2015 06:56:43 -0400 Received: by pdjm12 with SMTP id m12so64152943pdj.3 for ; Thu, 18 Jun 2015 03:56:43 -0700 (PDT) X-Received: by 10.66.119.70 with SMTP id ks6mr20173780pab.78.1434625003493; Thu, 18 Jun 2015 03:56:43 -0700 (PDT) Received: from localhost ([122.167.70.98]) by mx.google.com with ESMTPSA id m3sm4969666pdd.29.2015.06.18.03.56.42 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Jun 2015 03:56:43 -0700 (PDT) From: Viresh Kumar To: Thomas Gleixner , Daniel Lezcano Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Viresh Kumar , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement Subject: [PATCH 28/41] clocksource: orion: Migrate to new 'set-state' interface Date: Thu, 18 Jun 2015 16:24:42 +0530 Message-Id: <7797e21f79565a7c078df1c789a2f10cefb37f78.1434622147.git.viresh.kumar@linaro.org> 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.215.54 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 orion 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. Cc: Jason Cooper Cc: Andrew Lunn Cc: Sebastian Hesselbarth Cc: Gregory Clement Signed-off-by: Viresh Kumar --- drivers/clocksource/time-orion.c | 46 +++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/drivers/clocksource/time-orion.c b/drivers/clocksource/time-orion.c index 0b3ce0399c51..0ece7427b497 100644 --- a/drivers/clocksource/time-orion.c +++ b/drivers/clocksource/time-orion.c @@ -60,30 +60,36 @@ static int orion_clkevt_next_event(unsigned long delta, return 0; } -static void orion_clkevt_mode(enum clock_event_mode mode, - struct clock_event_device *dev) +static int orion_clkevt_shutdown(struct clock_event_device *dev) { - if (mode == CLOCK_EVT_MODE_PERIODIC) { - /* setup and enable periodic timer at 1/HZ intervals */ - writel(ticks_per_jiffy - 1, timer_base + TIMER1_RELOAD); - writel(ticks_per_jiffy - 1, timer_base + TIMER1_VAL); - atomic_io_modify(timer_base + TIMER_CTRL, - TIMER1_RELOAD_EN | TIMER1_EN, - TIMER1_RELOAD_EN | TIMER1_EN); - } else { - /* disable timer */ - atomic_io_modify(timer_base + TIMER_CTRL, - TIMER1_RELOAD_EN | TIMER1_EN, 0); - } + /* disable timer */ + atomic_io_modify(timer_base + TIMER_CTRL, + TIMER1_RELOAD_EN | TIMER1_EN, 0); + return 0; +} + +static int orion_clkevt_set_periodic(struct clock_event_device *dev) +{ + /* setup and enable periodic timer at 1/HZ intervals */ + writel(ticks_per_jiffy - 1, timer_base + TIMER1_RELOAD); + writel(ticks_per_jiffy - 1, timer_base + TIMER1_VAL); + atomic_io_modify(timer_base + TIMER_CTRL, + TIMER1_RELOAD_EN | TIMER1_EN, + TIMER1_RELOAD_EN | TIMER1_EN); + return 0; } static struct clock_event_device orion_clkevt = { - .name = "orion_event", - .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC, - .shift = 32, - .rating = 300, - .set_next_event = orion_clkevt_next_event, - .set_mode = orion_clkevt_mode, + .name = "orion_event", + .features = CLOCK_EVT_FEAT_ONESHOT | + CLOCK_EVT_FEAT_PERIODIC, + .shift = 32, + .rating = 300, + .set_next_event = orion_clkevt_next_event, + .set_state_shutdown = orion_clkevt_shutdown, + .set_state_periodic = orion_clkevt_set_periodic, + .set_state_oneshot = orion_clkevt_shutdown, + .tick_resume = orion_clkevt_shutdown, }; static irqreturn_t orion_clkevt_irq_handler(int irq, void *dev_id)