From patchwork Thu Jul 16 11:26:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51164 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0770A22A28 for ; Thu, 16 Jul 2015 11:29:49 +0000 (UTC) Received: by laef2 with SMTP id f2sf18037292lae.0 for ; Thu, 16 Jul 2015 04:29:48 -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=1S1y2ICHxzBOJmCdLTNIkH+qUoIwGuhP8f3h+uP0HNI=; b=QzByB1WtBCzEZ9J/aNxbQlUBGcKKo9vJYwDQZhKUjGFXjuWwSmfvv70YHKWXB1DpSm r2h73iF3e1/fTOou9Gf4k33ezY1nAhwZ4dhsTQqzp4gywJ++vy3+zIY51hvrypxkIyZS VygESJr4nSTRcOf87dyK7lxq2b9OwZtsutNFdN+Dl2tVOp1Wy3JVkoPjn/bwPPjKejPI Ym35kUENIbf/KtmQpYYIEFWZLaPirnhKmCccL47eeyIRBOu63epI+ykwq6XztlVSNVfu UUi45XtY1fFJWpc+vBnEE29Pa/FS5c9Bx48csrq3gnzAOEUhVXDgwfL3BXSqt0Cnr2vM tSqw== X-Gm-Message-State: ALoCoQlYP3+HTBTsfG7IZ3967TPAsB/NjFLnf7/+5i99wCsdm5RoeyX7w5Q+OjtkI95sR7HM7/8b X-Received: by 10.112.160.39 with SMTP id xh7mr4626991lbb.22.1437046187976; Thu, 16 Jul 2015 04:29:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.99 with SMTP id p3ls294761laj.57.gmail; Thu, 16 Jul 2015 04:29:47 -0700 (PDT) X-Received: by 10.112.63.137 with SMTP id g9mr8900250lbs.121.1437046187607; Thu, 16 Jul 2015 04:29:47 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id l5si6700253lbt.73.2015.07.16.04.29.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 04:29:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lahh5 with SMTP id h5so41593938lah.2 for ; Thu, 16 Jul 2015 04:29:47 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr8672655lac.41.1437046187471; Thu, 16 Jul 2015 04:29:47 -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 hn6csp192305lbb; Thu, 16 Jul 2015 04:29:46 -0700 (PDT) X-Received: by 10.68.200.69 with SMTP id jq5mr17644407pbc.111.1437046185413; Thu, 16 Jul 2015 04:29:45 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ot9si12591142pab.79.2015.07.16.04.29.44; Thu, 16 Jul 2015 04:29: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 S1755454AbbGPL3T (ORCPT + 27 others); Thu, 16 Jul 2015 07:29:19 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:34936 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752199AbbGPL3N (ORCPT ); Thu, 16 Jul 2015 07:29:13 -0400 Received: by pactm7 with SMTP id tm7so41787772pac.2 for ; Thu, 16 Jul 2015 04:29:12 -0700 (PDT) X-Received: by 10.66.141.137 with SMTP id ro9mr17418478pab.152.1437046152750; Thu, 16 Jul 2015 04:29:12 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id bx8sm7701606pab.38.2015.07.16.04.29.11 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Jul 2015 04:29:12 -0700 (PDT) From: Viresh Kumar To: Thomas Gleixner , Daniel Lezcano Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Viresh Kumar , Guan Xuetao Subject: [PATCH 20/23] unicore/time: Migrate to new 'set-state' interface Date: Thu, 16 Jul 2015 16:56:32 +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.50 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 unicore 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 for PERIODIC or RESUME modes and so their callbacks aren't implemented. Cc: Guan Xuetao Signed-off-by: Viresh Kumar --- arch/unicore32/kernel/time.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/arch/unicore32/kernel/time.c b/arch/unicore32/kernel/time.c index d3824b2ff644..ac4c5449bb88 100644 --- a/arch/unicore32/kernel/time.c +++ b/arch/unicore32/kernel/time.c @@ -46,29 +46,20 @@ puv3_osmr0_set_next_event(unsigned long delta, struct clock_event_device *c) return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0; } -static void -puv3_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c) +static int puv3_osmr0_shutdown(struct clock_event_device *evt) { - switch (mode) { - case CLOCK_EVT_MODE_ONESHOT: - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - writel(readl(OST_OIER) & ~OST_OIER_E0, OST_OIER); - writel(readl(OST_OSSR) & ~OST_OSSR_M0, OST_OSSR); - break; - - case CLOCK_EVT_MODE_RESUME: - case CLOCK_EVT_MODE_PERIODIC: - break; - } + writel(readl(OST_OIER) & ~OST_OIER_E0, OST_OIER); + writel(readl(OST_OSSR) & ~OST_OSSR_M0, OST_OSSR); + return 0; } static struct clock_event_device ckevt_puv3_osmr0 = { - .name = "osmr0", - .features = CLOCK_EVT_FEAT_ONESHOT, - .rating = 200, - .set_next_event = puv3_osmr0_set_next_event, - .set_mode = puv3_osmr0_set_mode, + .name = "osmr0", + .features = CLOCK_EVT_FEAT_ONESHOT, + .rating = 200, + .set_next_event = puv3_osmr0_set_next_event, + .set_state_shutdown = puv3_osmr0_shutdown, + .set_state_oneshot = puv3_osmr0_shutdown, }; static cycle_t puv3_read_oscr(struct clocksource *cs)