From patchwork Mon Aug 10 09:52:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 52192 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id 616F62152A for ; Mon, 10 Aug 2015 10:02:48 +0000 (UTC) Received: by lbcje9 with SMTP id je9sf5650267lbc.3 for ; Mon, 10 Aug 2015 03:02:47 -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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=5nrWfnWAG28d6JeHyG+WSLnEv2boYjRKl1kp+pZE1qA=; b=Ce+2E6s+HRO58n8iy26NCIBhb/DC2+IOwo+Ck7mPT78ghPDFS0Kq+b9rJ6ZKj0KJ37 Ivg7il0ttkut4yOc5Bo9Ihmb/yjf1Q+aqS2ZrlmizHxXE2bbf+0/NL1mxpZHOX3blt1w VoZlKJeBtnJbvYdJhCHNhtPrdouSKF21OKG8IrDHQYhihtdZgmPmSeC/ZMyuV4ojf4bx IQBq486ogDBRN5j0NPofySeQcqAkW0ZdUb2B57n1H9ry9bAPd9zwqfz7vTzGUVIld/uQ TGnr33msIzicYHZ9CmjLUFq57pIZhpQCXPipeJ1njQXuLky3WeHso7MbeoTVeBOFrukf ceTA== X-Gm-Message-State: ALoCoQkJc/iKjkTy6/1hKT9/EhwRyXkJl6D+K4eZEP/MxLeJ1xDKw/txkMwBQolQfPjEQBR+R+O7 X-Received: by 10.194.93.198 with SMTP id cw6mr6093747wjb.3.1439200967346; Mon, 10 Aug 2015 03:02:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.226 with SMTP id e2ls87084lah.14.gmail; Mon, 10 Aug 2015 03:02:47 -0700 (PDT) X-Received: by 10.112.199.66 with SMTP id ji2mr7531337lbc.1.1439200967085; Mon, 10 Aug 2015 03:02:47 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id lm12si13764319lac.61.2015.08.10.03.02.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 03:02:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by labd1 with SMTP id d1so37170287lab.1 for ; Mon, 10 Aug 2015 03:02:47 -0700 (PDT) X-Received: by 10.152.164.130 with SMTP id yq2mr12801695lab.76.1439200966978; Mon, 10 Aug 2015 03:02:46 -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.7.198 with SMTP id l6csp1831630lba; Mon, 10 Aug 2015 03:02:45 -0700 (PDT) X-Received: by 10.68.253.195 with SMTP id ac3mr43203291pbd.159.1439200965541; Mon, 10 Aug 2015 03:02:45 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pb9si32274967pbc.121.2015.08.10.03.02.44; Mon, 10 Aug 2015 03:02:45 -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 S932858AbbHJKCm (ORCPT + 28 others); Mon, 10 Aug 2015 06:02:42 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:37556 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933336AbbHJJyg (ORCPT ); Mon, 10 Aug 2015 05:54:36 -0400 Received: by wibhh20 with SMTP id hh20so142955151wib.0 for ; Mon, 10 Aug 2015 02:54:35 -0700 (PDT) X-Received: by 10.180.80.70 with SMTP id p6mr23007261wix.43.1439200475076; Mon, 10 Aug 2015 02:54:35 -0700 (PDT) Received: from localhost.localdomain (sju31-1-78-210-255-2.fbx.proxad.net. [78.210.255.2]) by smtp.gmail.com with ESMTPSA id jr5sm28598154wjc.14.2015.08.10.02.54.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Aug 2015 02:54:34 -0700 (PDT) From: Daniel Lezcano To: mingo@kernel.org Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, Viresh Kumar , Daniel Tang Subject: [PATCH 49/74] clockevents/drivers/zevio: Migrate to new 'set-state' interface Date: Mon, 10 Aug 2015 11:52:06 +0200 Message-Id: <1439200352-26767-49-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439200352-26767-1-git-send-email-daniel.lezcano@linaro.org> References: <55C87382.4070309@linaro.org> <1439200352-26767-1-git-send-email-daniel.lezcano@linaro.org> 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: daniel.lezcano@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.48 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: , From: Viresh Kumar 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 Signed-off-by: Daniel Lezcano --- 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 7ce4421..ceaa613 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;