From patchwork Thu Jul 16 11:26:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51173 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3A45022A28 for ; Thu, 16 Jul 2015 11:36:28 +0000 (UTC) Received: by wgjx7 with SMTP id x7sf18089203wgj.3 for ; Thu, 16 Jul 2015 04:36:27 -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=3zRwiMpynZ/4yQLfTJIjNrIKy7lzspX6JzPAbyJp8Vk=; b=gQAjYcE1qu95ya9K/xJ7iG51MVPI2l39fLC+UHbwY5jIOu1g0l3xhyEPHuf89fynCk PrMMJWKIUMaddUaYqZ9PWs/qa+MV5SGmzsRWT+LdX9HygOZyEp0sUDUUh3a28ZZBpl+h JAWfmmZirntiQRMtnimqA64tdOoay1iQhj5UlpZlRocSi43WZKwv3fFB0gBEyYCGRJ/Q P2Dbg3slUbThJ8maa8WumTNRM0JenRP67ld5I00nZAZrfVIoRnNSZHdUvXNTxl7M6rkk mc7uhIEu1DRwVJacwu69L4I8nH0ZbwAmYhYHQD85ns6Bo/PG7pz18so9O13RLP3Di/h6 SnvQ== X-Gm-Message-State: ALoCoQk4umuLPN7Pu9hUfhkPota4ll5S8QSzvWjYPqaVFaF3aJrxcP8orTUE2hOMzhuHytUJ0C3z X-Received: by 10.112.171.41 with SMTP id ar9mr4728350lbc.24.1437046587366; Thu, 16 Jul 2015 04:36:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.234.108 with SMTP id ud12ls345021lac.43.gmail; Thu, 16 Jul 2015 04:36:26 -0700 (PDT) X-Received: by 10.152.116.75 with SMTP id ju11mr4903000lab.62.1437046586924; Thu, 16 Jul 2015 04:36:26 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id kn15si6710421lbb.85.2015.07.16.04.36.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 04:36:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by laem6 with SMTP id m6so41719900lae.0 for ; Thu, 16 Jul 2015 04:36:26 -0700 (PDT) X-Received: by 10.152.88.42 with SMTP id bd10mr4873260lab.112.1437046586626; Thu, 16 Jul 2015 04:36:26 -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 hn6csp195967lbb; Thu, 16 Jul 2015 04:36:25 -0700 (PDT) X-Received: by 10.70.128.226 with SMTP id nr2mr17830363pdb.139.1437046584905; Thu, 16 Jul 2015 04:36:24 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fx5si12583434pdb.170.2015.07.16.04.36.23; Thu, 16 Jul 2015 04:36:24 -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 S1755953AbbGPLgQ (ORCPT + 27 others); Thu, 16 Jul 2015 07:36:16 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:32836 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755001AbbGPL12 (ORCPT ); Thu, 16 Jul 2015 07:27:28 -0400 Received: by pdbqm3 with SMTP id qm3so43003275pdb.0 for ; Thu, 16 Jul 2015 04:27:27 -0700 (PDT) X-Received: by 10.68.218.42 with SMTP id pd10mr18012033pbc.6.1437046047529; Thu, 16 Jul 2015 04:27:27 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id xd9sm7715987pab.6.2015.07.16.04.27.25 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Jul 2015 04:27:26 -0700 (PDT) From: Viresh Kumar To: Thomas Gleixner , Daniel Lezcano Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Viresh Kumar , Mark Salter , Aurelien Jacquiot , linux-c6x-dev@linux-c6x.org Subject: [PATCH 05/23] c6x/timer64: Migrate to new 'set-state' interface Date: Thu, 16 Jul 2015 16:56:17 +0530 Message-Id: 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.46 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 c6x 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(RESUME) and so tick_resume() isn't implemented. Cc: Mark Salter Cc: Aurelien Jacquiot Cc: linux-c6x-dev@linux-c6x.org Signed-off-by: Viresh Kumar --- arch/c6x/platforms/timer64.c | 52 +++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/arch/c6x/platforms/timer64.c b/arch/c6x/platforms/timer64.c index 3c73d74a4674..c19901e5f055 100644 --- a/arch/c6x/platforms/timer64.c +++ b/arch/c6x/platforms/timer64.c @@ -126,35 +126,37 @@ static int next_event(unsigned long delta, return 0; } -static void set_clock_mode(enum clock_event_mode mode, - struct clock_event_device *evt) +static int set_periodic(struct clock_event_device *evt) { - switch (mode) { - case CLOCK_EVT_MODE_PERIODIC: - timer64_enable(); - timer64_mode = TIMER64_MODE_PERIODIC; - timer64_config(TIMER64_RATE / HZ); - break; - case CLOCK_EVT_MODE_ONESHOT: - timer64_enable(); - timer64_mode = TIMER64_MODE_ONE_SHOT; - break; - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - timer64_mode = TIMER64_MODE_DISABLED; - timer64_disable(); - break; - case CLOCK_EVT_MODE_RESUME: - break; - } + timer64_enable(); + timer64_mode = TIMER64_MODE_PERIODIC; + timer64_config(TIMER64_RATE / HZ); + return 0; +} + +static int set_oneshot(struct clock_event_device *evt) +{ + timer64_enable(); + timer64_mode = TIMER64_MODE_ONE_SHOT; + return 0; +} + +static int shutdown(struct clock_event_device *evt) +{ + timer64_mode = TIMER64_MODE_DISABLED; + timer64_disable(); + return 0; } static struct clock_event_device t64_clockevent_device = { - .name = "TIMER64_EVT32_TIMER", - .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC, - .rating = 200, - .set_mode = set_clock_mode, - .set_next_event = next_event, + .name = "TIMER64_EVT32_TIMER", + .features = CLOCK_EVT_FEAT_ONESHOT | + CLOCK_EVT_FEAT_PERIODIC, + .rating = 200, + .set_state_shutdown = shutdown, + .set_state_periodic = set_periodic, + .set_state_oneshot = set_oneshot, + .set_next_event = next_event, }; static irqreturn_t timer_interrupt(int irq, void *dev_id)