From patchwork Thu Jun 18 10:54:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50023 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 37ECB228CC for ; Thu, 18 Jun 2015 10:59:44 +0000 (UTC) Received: by wizw5 with SMTP id w5sf20808047wiz.2 for ; Thu, 18 Jun 2015 03:59:43 -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=EN9v6QD2v3pmuwasq+l880ijMvCGJKaz21ovK9CrGRg=; b=nOiUeL3/5mJilHymbl7qJXNdELaIlNYoortwJXxwCAjqlT11uQsf2vWRF8d/fVPTa6 ZPrudD2H4/ncfb/AIgFJ4+SgboXFkZHwTiTyBCe6fh2wXEn0zajOXvTmw1yG1op5crct jYvlU3xmUQG8zLGjTOYgNEWi9Syzszef57VEEDYswFDR4G/7drmamoTRgGonMtvwo853 PBmZtFW3Z4BcOGcmnrvbnKHx3zL9OyLa5BrcVjIpE1XX976cXlq7thFOZzKFpDwecsIO B9QtfWY6FFwwXSbvZys5EavCuQszv1Qcg+DE3ae/Ks2Btxn21bYW7kNyPmv+PTMyh5D8 Q6SQ== X-Gm-Message-State: ALoCoQkwHgbm9WVCEZXaO4BoEhURjGCpHjPyq180wej6wE/hn1OgqiLe4WNgS3X9HGN+XpDb0Jgg X-Received: by 10.112.42.236 with SMTP id r12mr9878090lbl.2.1434625183536; Thu, 18 Jun 2015 03:59:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.242.2 with SMTP id wm2ls130686lac.38.gmail; Thu, 18 Jun 2015 03:59:43 -0700 (PDT) X-Received: by 10.112.90.194 with SMTP id by2mr12549279lbb.62.1434625183362; Thu, 18 Jun 2015 03:59:43 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id tf4si6189157lbb.66.2015.06.18.03.59.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 03:59:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by labbc20 with SMTP id bc20so51842935lab.1 for ; Thu, 18 Jun 2015 03:59:43 -0700 (PDT) X-Received: by 10.112.93.37 with SMTP id cr5mr12573673lbb.106.1434625183207; Thu, 18 Jun 2015 03:59:43 -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 hn6csp1096455lbb; Thu, 18 Jun 2015 03:59:42 -0700 (PDT) X-Received: by 10.66.165.8 with SMTP id yu8mr20204779pab.82.1434625181278; Thu, 18 Jun 2015 03:59:41 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xg10si10794707pbc.254.2015.06.18.03.59.40; Thu, 18 Jun 2015 03:59:41 -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 S1755360AbbFRK7c (ORCPT + 30 others); Thu, 18 Jun 2015 06:59:32 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:36208 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754971AbbFRK5a (ORCPT ); Thu, 18 Jun 2015 06:57:30 -0400 Received: by pdjm12 with SMTP id m12so64165405pdj.3 for ; Thu, 18 Jun 2015 03:57:30 -0700 (PDT) X-Received: by 10.70.135.106 with SMTP id pr10mr19899159pdb.156.1434625049995; Thu, 18 Jun 2015 03:57:29 -0700 (PDT) Received: from localhost ([122.167.70.98]) by mx.google.com with ESMTPSA id ff10sm7729018pab.13.2015.06.18.03.57.28 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Jun 2015 03:57:29 -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 , Daniel Tang Subject: [PATCH 41/41] clocksource: zevio: Migrate to new 'set-state' interface Date: Thu, 18 Jun 2015 16:24:55 +0530 Message-Id: <2492473d6bb8f057af389d6db24af77462af2468.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.41 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 zevio 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: Daniel Tang Signed-off-by: Viresh Kumar --- drivers/clocksource/zevio-timer.c | 44 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/drivers/clocksource/zevio-timer.c b/drivers/clocksource/zevio-timer.c index 7ce442148c3f..ceaa6133f9c2 100644 --- a/drivers/clocksource/zevio-timer.c +++ b/drivers/clocksource/zevio-timer.c @@ -76,32 +76,28 @@ static int zevio_timer_set_event(unsigned long delta, return 0; } -static void zevio_timer_set_mode(enum clock_event_mode mode, - struct clock_event_device *dev) +static int zevio_timer_shutdown(struct clock_event_device *dev) { struct zevio_timer *timer = container_of(dev, struct zevio_timer, clkevt); - switch (mode) { - case CLOCK_EVT_MODE_RESUME: - case CLOCK_EVT_MODE_ONESHOT: - /* Enable timer interrupts */ - writel(TIMER_INTR_MSK, timer->interrupt_regs + IO_INTR_MSK); - writel(TIMER_INTR_ALL, timer->interrupt_regs + IO_INTR_ACK); - break; - case CLOCK_EVT_MODE_SHUTDOWN: - case CLOCK_EVT_MODE_UNUSED: - /* Disable timer interrupts */ - writel(0, timer->interrupt_regs + IO_INTR_MSK); - writel(TIMER_INTR_ALL, timer->interrupt_regs + IO_INTR_ACK); - /* Stop timer */ - writel(CNTL_STOP_TIMER, timer->timer1 + IO_CONTROL); - break; - case CLOCK_EVT_MODE_PERIODIC: - default: - /* Unsupported */ - break; - } + /* Disable timer interrupts */ + writel(0, timer->interrupt_regs + IO_INTR_MSK); + writel(TIMER_INTR_ALL, timer->interrupt_regs + IO_INTR_ACK); + /* Stop timer */ + writel(CNTL_STOP_TIMER, timer->timer1 + IO_CONTROL); + return 0; +} + +static int zevio_timer_set_oneshot(struct clock_event_device *dev) +{ + struct zevio_timer *timer = container_of(dev, struct zevio_timer, + clkevt); + + /* Enable timer interrupts */ + writel(TIMER_INTR_MSK, timer->interrupt_regs + IO_INTR_MSK); + writel(TIMER_INTR_ALL, timer->interrupt_regs + IO_INTR_ACK); + return 0; } static irqreturn_t zevio_timer_interrupt(int irq, void *dev_id) @@ -162,7 +158,9 @@ static int __init zevio_timer_add(struct device_node *node) if (timer->interrupt_regs && irqnr) { timer->clkevt.name = timer->clockevent_name; timer->clkevt.set_next_event = zevio_timer_set_event; - timer->clkevt.set_mode = zevio_timer_set_mode; + timer->clkevt.set_state_shutdown = zevio_timer_shutdown; + timer->clkevt.set_state_oneshot = zevio_timer_set_oneshot; + timer->clkevt.tick_resume = zevio_timer_set_oneshot; timer->clkevt.rating = 200; timer->clkevt.cpumask = cpu_all_mask; timer->clkevt.features = CLOCK_EVT_FEAT_ONESHOT;