From patchwork Thu Jun 18 10:54:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50037 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9056322903 for ; Thu, 18 Jun 2015 11:04:46 +0000 (UTC) Received: by lbcak1 with SMTP id ak1sf19684434lbc.2 for ; Thu, 18 Jun 2015 04:04:45 -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=jFZks/6VcWJwJu12TWOxa2k+LGohALQjmsr87Tq5qxM=; b=R09XiSumYmYXa0RDLLkYHfSy/2iYkAcb/vUzhGr0YKrhSFEXKZZJ9lwELNscmv/Sy4 6u1+Z08O4gkokhDrGf5bhY7Re4efrOJS6gmqrmLaLoZo19vvnSslr10NjO47lGBfP3I7 9h1oLfrkVyIJRSHvwJfwPQukKE1BkjnDMkAaQ4V7qDlI95tCmxxB7mHupys2fnYRuYIx ZKucNdZCDkbLltTsOfjoKFQMrqFfPoaWXTDRt/vCHROPcZCBXtiPA8inzBrd8ByADqpA HQs6OR50TjlD3oIaw5SbZqTOeBKYxpy92HxkGT4mdfB0MoJTXkLNT+R0tvl4CPNZHfGK NICQ== X-Gm-Message-State: ALoCoQnc5Dq1l9XoeakRJUMZKX/pZpfkXn/olGDvYoIMzzcmRaggAxv2hJ6El79VdWn8hY2OyqZX X-Received: by 10.194.158.134 with SMTP id wu6mr7263760wjb.6.1434625485509; Thu, 18 Jun 2015 04:04:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.67 with SMTP id q3ls407909laq.78.gmail; Thu, 18 Jun 2015 04:04:45 -0700 (PDT) X-Received: by 10.112.157.100 with SMTP id wl4mr12536046lbb.20.1434625485251; Thu, 18 Jun 2015 04:04:45 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id of3si6187363lbb.110.2015.06.18.04.04.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 04:04:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbbwc1 with SMTP id wc1so49927747lbb.2 for ; Thu, 18 Jun 2015 04:04:45 -0700 (PDT) X-Received: by 10.112.55.207 with SMTP id u15mr12456608lbp.88.1434625485138; Thu, 18 Jun 2015 04:04:45 -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 hn6csp1099669lbb; Thu, 18 Jun 2015 04:04:44 -0700 (PDT) X-Received: by 10.69.27.33 with SMTP id jd1mr10191013pbd.34.1434625483339; Thu, 18 Jun 2015 04:04:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oi3si10858182pdb.222.2015.06.18.04.04.42; Thu, 18 Jun 2015 04:04:43 -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 S932515AbbFRLE2 (ORCPT + 30 others); Thu, 18 Jun 2015 07:04:28 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:34795 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932332AbbFRK4F (ORCPT ); Thu, 18 Jun 2015 06:56:05 -0400 Received: by pabvl15 with SMTP id vl15so12916752pab.1 for ; Thu, 18 Jun 2015 03:56:04 -0700 (PDT) X-Received: by 10.68.135.233 with SMTP id pv9mr20404859pbb.115.1434624964341; Thu, 18 Jun 2015 03:56:04 -0700 (PDT) Received: from localhost ([122.167.70.98]) by mx.google.com with ESMTPSA id v9sm7656731pdr.96.2015.06.18.03.56.03 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Jun 2015 03:56:03 -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 , Stephen Boyd , Kumar Gala , Andy Gross , David Brown Subject: [PATCH 17/41] clocksource: qcom: Migrate to new 'set-state' interface Date: Thu, 18 Jun 2015 16:24:31 +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.217.169 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 qcom 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. Periodic mode isn't supported by the driver and so the callback isn't provided anymore. Cc: Stephen Boyd Cc: Kumar Gala Cc: Andy Gross Cc: David Brown Signed-off-by: Viresh Kumar --- drivers/clocksource/qcom-timer.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/drivers/clocksource/qcom-timer.c b/drivers/clocksource/qcom-timer.c index cba2d015564c..f8e09f923651 100644 --- a/drivers/clocksource/qcom-timer.c +++ b/drivers/clocksource/qcom-timer.c @@ -47,7 +47,7 @@ static irqreturn_t msm_timer_interrupt(int irq, void *dev_id) { struct clock_event_device *evt = dev_id; /* Stop the timer tick */ - if (evt->mode == CLOCK_EVT_MODE_ONESHOT) { + if (clockevent_state_oneshot(evt)) { u32 ctrl = readl_relaxed(event_base + TIMER_ENABLE); ctrl &= ~TIMER_ENABLE_EN; writel_relaxed(ctrl, event_base + TIMER_ENABLE); @@ -75,26 +75,14 @@ static int msm_timer_set_next_event(unsigned long cycles, return 0; } -static void msm_timer_set_mode(enum clock_event_mode mode, - struct clock_event_device *evt) +static int msm_timer_shutdown(struct clock_event_device *evt) { u32 ctrl; ctrl = readl_relaxed(event_base + TIMER_ENABLE); ctrl &= ~(TIMER_ENABLE_EN | TIMER_ENABLE_CLR_ON_MATCH_EN); - - switch (mode) { - case CLOCK_EVT_MODE_RESUME: - case CLOCK_EVT_MODE_PERIODIC: - break; - case CLOCK_EVT_MODE_ONESHOT: - /* Timer is enabled in set_next_event */ - break; - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - break; - } writel_relaxed(ctrl, event_base + TIMER_ENABLE); + return 0; } static struct clock_event_device __percpu *msm_evt; @@ -126,7 +114,9 @@ static int msm_local_timer_setup(struct clock_event_device *evt) evt->name = "msm_timer"; evt->features = CLOCK_EVT_FEAT_ONESHOT; evt->rating = 200; - evt->set_mode = msm_timer_set_mode; + evt->set_state_shutdown = msm_timer_shutdown; + evt->set_state_oneshot = msm_timer_shutdown; + evt->tick_resume = msm_timer_shutdown; evt->set_next_event = msm_timer_set_next_event; evt->cpumask = cpumask_of(cpu); @@ -147,7 +137,7 @@ static int msm_local_timer_setup(struct clock_event_device *evt) static void msm_local_timer_stop(struct clock_event_device *evt) { - evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt); + evt->set_state_shutdown(evt); disable_percpu_irq(evt->irq); }