From patchwork Thu Jul 16 11:26:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51168 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BAE0E22A28 for ; Thu, 16 Jul 2015 11:31:09 +0000 (UTC) Received: by lbcjf8 with SMTP id jf8sf17630178lbc.0 for ; Thu, 16 Jul 2015 04:31:08 -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=ic9Qqb4wy69IOamSTOsBQukbLPPs2aPOMMFsewsJ5xc=; b=Uiy9rd0NnsjADIU25Y2BTrOE0jgmLxm5IUI6Fb7QBRka+JH02OD/NlFKDpNyA5qvXN mB0D+wuOPUfSVvyDZQCUMvjI8rKfNd0wuVDOBuJ8I4uNALPkwIuFcRastwQ/DYBWKMzM 9ib10OCwPHUjoH5U71uWPDya+nFS7yMmxmpO+tKuQOvuNizc6r4VndaBkJqvpzxIOcFA Im1wbGPDkTNt/1JKtJoMLHXd66IUk92Zui1DP12yaGdda7eVJpWv1fmA5ct0BvLBt60N 1r3rqEtnLKF//mHGJZRcbJn9XsFWuSFtqMIFncCjf50W+uasPZ4DZSh5iYQnz7KRjpV3 5EwA== X-Gm-Message-State: ALoCoQnL21K4i8GSju05vF45ighynM3zhzuSK1CztkBZJaDzaMomiEZSbdT9GtN9u6Mak/038Lc/ X-Received: by 10.152.179.136 with SMTP id dg8mr4651829lac.4.1437046268689; Thu, 16 Jul 2015 04:31:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.1 with SMTP id o1ls355760lao.12.gmail; Thu, 16 Jul 2015 04:31:08 -0700 (PDT) X-Received: by 10.112.166.106 with SMTP id zf10mr8948461lbb.36.1437046268453; Thu, 16 Jul 2015 04:31:08 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id p7si6709068lag.32.2015.07.16.04.31.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 04:31:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lblf12 with SMTP id f12so41796239lbl.2 for ; Thu, 16 Jul 2015 04:31:08 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr8677523lac.41.1437046268306; Thu, 16 Jul 2015 04:31:08 -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 hn6csp193067lbb; Thu, 16 Jul 2015 04:31:06 -0700 (PDT) X-Received: by 10.66.65.142 with SMTP id x14mr17698404pas.135.1437046266126; Thu, 16 Jul 2015 04:31:06 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2si12545179pdi.162.2015.07.16.04.31.05; Thu, 16 Jul 2015 04:31:06 -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 S1755330AbbGPL2n (ORCPT + 27 others); Thu, 16 Jul 2015 07:28:43 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:33511 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755258AbbGPL2i (ORCPT ); Thu, 16 Jul 2015 07:28:38 -0400 Received: by pdbqm3 with SMTP id qm3so43018337pdb.0 for ; Thu, 16 Jul 2015 04:28:38 -0700 (PDT) X-Received: by 10.70.129.44 with SMTP id nt12mr17973266pdb.116.1437046118492; Thu, 16 Jul 2015 04:28:38 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id y3sm7642559pbt.80.2015.07.16.04.28.36 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Jul 2015 04:28:38 -0700 (PDT) From: Viresh Kumar To: Thomas Gleixner , Daniel Lezcano Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Viresh Kumar , Chen Liqin , Lennox Wu , Michael Opdenacker Subject: [PATCH 15/23] score/time: Migrate to new 'set-state' interface Date: Thu, 16 Jul 2015 16:56:27 +0530 Message-Id: <7fd5b4d131f15b936a87dd8f21c75fdb19a6c981.1437044517.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.217.173 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 score 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 ONESHOT/SHUTDOWN/RESUME modes and so callbacks for them aren't implemented. Cc: Chen Liqin Cc: Lennox Wu Cc: Michael Opdenacker Signed-off-by: Viresh Kumar --- arch/score/kernel/time.c | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/arch/score/kernel/time.c b/arch/score/kernel/time.c index 24770cd9b473..679b8d7b0350 100644 --- a/arch/score/kernel/time.c +++ b/arch/score/kernel/time.c @@ -55,31 +55,20 @@ static int score_timer_set_next_event(unsigned long delta, return 0; } -static void score_timer_set_mode(enum clock_event_mode mode, - struct clock_event_device *evdev) +static int score_timer_set_periodic(struct clock_event_device *evt) { - switch (mode) { - case CLOCK_EVT_MODE_PERIODIC: - outl((TMR_M_PERIODIC | TMR_IE_ENABLE), P_TIMER0_CTRL); - outl(SYSTEM_CLOCK/HZ, P_TIMER0_PRELOAD); - outl(inl(P_TIMER0_CTRL) | TMR_ENABLE, P_TIMER0_CTRL); - break; - case CLOCK_EVT_MODE_ONESHOT: - case CLOCK_EVT_MODE_SHUTDOWN: - case CLOCK_EVT_MODE_RESUME: - case CLOCK_EVT_MODE_UNUSED: - break; - default: - BUG(); - } + outl((TMR_M_PERIODIC | TMR_IE_ENABLE), P_TIMER0_CTRL); + outl(SYSTEM_CLOCK / HZ, P_TIMER0_PRELOAD); + outl(inl(P_TIMER0_CTRL) | TMR_ENABLE, P_TIMER0_CTRL); + return 0; } static struct clock_event_device score_clockevent = { - .name = "score_clockevent", - .features = CLOCK_EVT_FEAT_PERIODIC, - .shift = 16, - .set_next_event = score_timer_set_next_event, - .set_mode = score_timer_set_mode, + .name = "score_clockevent", + .features = CLOCK_EVT_FEAT_PERIODIC, + .shift = 16, + .set_next_event = score_timer_set_next_event, + .set_state_periodic = score_timer_set_periodic, }; void __init time_init(void)