From patchwork Fri Jul 17 05:11:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51217 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BDA5422A8C for ; Fri, 17 Jul 2015 05:13:03 +0000 (UTC) Received: by lagw2 with SMTP id w2sf23378056lag.3 for ; Thu, 16 Jul 2015 22:13:02 -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=32ndAgARAzl52nycHsJBssjqL8AXkXIMJ50KZRxI6WI=; b=gouqgL/bpr4RwGd0iwB5pED3njf3i20Nue6iCB7utYb/sp2XVak8xRWhEPi1IqTqC3 c44jVZTh0rLPwsxVACf2Hgf4qiocK8cgRDKwB0looEUmY5kxWm5t0vqvcd59l4Wk9RyH bLzVMEo+xWR0hIGOtU4SkHKXpwxcx+S1x3IffxCKL0iysUmfo8d68Xi0SsZT61xlF1mQ /xHP6NBIKSrO527u5C4HimqWcBrXkGhuDHyTXv1+oOam0hGaolp9ZgtgjDfBkCIh1n8O ZGVi3ZrFeyjuNaVCp+HwMJ9NTPdYmvSKdpfV2rYsvVwnk/dlzhOlytI4Yf7gsey/m2ie bMgw== X-Gm-Message-State: ALoCoQl9MsqBg55sc89B2bKgfpwxOAxB2Tz6TzVQqkL16wieaxuSyCW19QLe8qYG+eoEMa5S2vDe X-Received: by 10.113.11.3 with SMTP id ee3mr6562857lbd.9.1437109982773; Thu, 16 Jul 2015 22:13:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.47 with SMTP id t15ls436412lal.77.gmail; Thu, 16 Jul 2015 22:13:02 -0700 (PDT) X-Received: by 10.152.6.69 with SMTP id y5mr12567614lay.72.1437109982524; Thu, 16 Jul 2015 22:13:02 -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 kj18si1231485lbb.126.2015.07.16.22.13.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 22:13:02 -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 m6so55076722lae.0 for ; Thu, 16 Jul 2015 22:13:02 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr12654602laj.88.1437109982383; Thu, 16 Jul 2015 22:13:02 -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 hn6csp668535lbb; Thu, 16 Jul 2015 22:13:01 -0700 (PDT) X-Received: by 10.70.55.1 with SMTP id n1mr25315663pdp.21.1437109980258; Thu, 16 Jul 2015 22:13:00 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dn2si16701042pdb.54.2015.07.16.22.12.59; Thu, 16 Jul 2015 22:13:00 -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 S1756793AbbGQFM0 (ORCPT + 28 others); Fri, 17 Jul 2015 01:12:26 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:34900 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756537AbbGQFMV (ORCPT ); Fri, 17 Jul 2015 01:12:21 -0400 Received: by pactm7 with SMTP id tm7so54913731pac.2 for ; Thu, 16 Jul 2015 22:12:21 -0700 (PDT) X-Received: by 10.66.141.42 with SMTP id rl10mr25313076pab.25.1437109941221; Thu, 16 Jul 2015 22:12:21 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id p9sm9665644pds.92.2015.07.16.22.12.20 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Jul 2015 22:12:20 -0700 (PDT) From: Viresh Kumar To: arm@kernel.org, olof@lixom.net Cc: linaro-kernel@lists.linaro.org, arnd.bergmann@linaro.org, linux-arm-kernel@lists.infradead.org, Viresh Kumar , Eric Miao , Haojian Zhuang , linux-kernel@vger.kernel.org (open list), Russell King Subject: [PATCH 10/18] ARM/mmp/time: Migrate to new 'set-state' interface Date: Fri, 17 Jul 2015 10:41:04 +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 mmp 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) except of local_irq_{save|restore}(), which isn't required and so ->tick_resume isn't implemented. Cc: Eric Miao Cc: Haojian Zhuang Signed-off-by: Viresh Kumar --- arch/arm/mach-mmp/time.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c index 10bfa03e58d4..dbc697b2fda1 100644 --- a/arch/arm/mach-mmp/time.c +++ b/arch/arm/mach-mmp/time.c @@ -124,32 +124,25 @@ static int timer_set_next_event(unsigned long delta, return 0; } -static void timer_set_mode(enum clock_event_mode mode, - struct clock_event_device *dev) +static int timer_set_shutdown(struct clock_event_device *evt) { unsigned long flags; local_irq_save(flags); - switch (mode) { - case CLOCK_EVT_MODE_ONESHOT: - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - /* disable the matching interrupt */ - __raw_writel(0x00, mmp_timer_base + TMR_IER(0)); - break; - case CLOCK_EVT_MODE_RESUME: - case CLOCK_EVT_MODE_PERIODIC: - break; - } + /* disable the matching interrupt */ + __raw_writel(0x00, mmp_timer_base + TMR_IER(0)); local_irq_restore(flags); + + return 0; } static struct clock_event_device ckevt = { - .name = "clockevent", - .features = CLOCK_EVT_FEAT_ONESHOT, - .rating = 200, - .set_next_event = timer_set_next_event, - .set_mode = timer_set_mode, + .name = "clockevent", + .features = CLOCK_EVT_FEAT_ONESHOT, + .rating = 200, + .set_next_event = timer_set_next_event, + .set_state_shutdown = timer_set_shutdown, + .set_state_oneshot = timer_set_shutdown, }; static cycle_t clksrc_read(struct clocksource *cs)