From patchwork Mon Jul 6 10:54: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: 50723 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 392C1218EA for ; Mon, 6 Jul 2015 10:58:58 +0000 (UTC) Received: by wipp2 with SMTP id p2sf30597109wip.2 for ; Mon, 06 Jul 2015 03:58:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:in-reply-to:references:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe:cc :mime-version:content-type:content-transfer-encoding:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list; bh=czZtEtm3oX5vn4uRQ18DCJcfeaFrzkqSos5NTN+zMW4=; b=dowHaUgltuVJpOjfJNzpXr0pN6grq7qRD89sCfZjTTHXKfZvSDIDOGlx5xKVND8TQF Dl4PEtyF9oUJ5lVOfpr8QgCSFFRU1zrp5wKQ+s7FbAPdBpeoTm5T/ZecZneiR7Nbfv7F I9+nzXRu6ZVGg9zdDAkjK0R0iawMWcGGdMTscBQSsLwabBECm50sG9kWjWNRUxv2AQm8 taDoIZ9m6pX/zFdtTys7gfEc9jqGanh4+2X9usClCact3C6Qxj3SZIKaZ0mtbKyIxzL8 UkVXsUE81gHZw1pHOEhCZxqlZuUKN3YYPoNfH07gtNaG8RpU6Sq0sYESV7ClyvdQ0PI+ qinw== X-Gm-Message-State: ALoCoQlAE3XZzMbJ5cJubhjQaZAe57DN0NKPRSiOMoOWb6kvHMbx4aSjLPt9jKsCMhwXJOHq7sO7 X-Received: by 10.112.118.194 with SMTP id ko2mr27608051lbb.16.1436180337515; Mon, 06 Jul 2015 03:58:57 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.164 with SMTP id cz4ls694966lac.3.gmail; Mon, 06 Jul 2015 03:58:57 -0700 (PDT) X-Received: by 10.112.167.202 with SMTP id zq10mr47285532lbb.118.1436180337364; Mon, 06 Jul 2015 03:58:57 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id o1si14984185lbc.8.2015.07.06.03.58.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 03:58:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lagx9 with SMTP id x9so149746243lag.1 for ; Mon, 06 Jul 2015 03:58:57 -0700 (PDT) X-Received: by 10.112.131.98 with SMTP id ol2mr49438424lbb.56.1436180337262; Mon, 06 Jul 2015 03:58:57 -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 hn6csp1643480lbb; Mon, 6 Jul 2015 03:58:56 -0700 (PDT) X-Received: by 10.68.133.131 with SMTP id pc3mr103550589pbb.107.1436180335526; Mon, 06 Jul 2015 03:58:55 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id sl6si28474188pac.192.2015.07.06.03.58.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 03:58:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZC45Z-00072B-8K; Mon, 06 Jul 2015 10:57:29 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZC44r-00065n-4V for linux-arm-kernel@bombadil.infradead.org; Mon, 06 Jul 2015 10:56:45 +0000 Received: from mail-pd0-f178.google.com ([209.85.192.178]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZC44o-0005xw-Da for linux-arm-kernel@lists.infradead.org; Mon, 06 Jul 2015 10:56:43 +0000 Received: by pdbdz6 with SMTP id dz6so8919274pdb.0 for ; Mon, 06 Jul 2015 03:56:17 -0700 (PDT) X-Received: by 10.70.135.67 with SMTP id pq3mr10988159pdb.8.1436180177297; Mon, 06 Jul 2015 03:56:17 -0700 (PDT) Received: from localhost ([122.171.186.190]) by mx.google.com with ESMTPSA id js8sm17833048pbb.9.2015.07.06.03.56.15 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 06 Jul 2015 03:56:16 -0700 (PDT) From: Viresh Kumar To: linux-arm-kernel@lists.infradead.org, Daniel Lezcano , linux@arm.linux.org.uk, arnd.bergmann@linaro.org, olof@lixom.net Subject: [PATCH 10/18] ARM/mmp/time: Migrate to new 'set-state' interface Date: Mon, 6 Jul 2015 16:24:17 +0530 Message-Id: <70d153f4a34217ffa7cefd2b29000ee07618f2aa.1436178990.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150706_115642_600797_4B5B25FE X-CRM114-Status: GOOD ( 15.82 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on casper.infradead.org summary: Content analysis details: (-2.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.192.178 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.178 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Cc: linaro-kernel@lists.linaro.org, Eric Miao , Kevin Hilman , Viresh Kumar , Haojian Zhuang , arm@kernel.org, Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.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.49 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 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)