From patchwork Thu Jun 18 10:54:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50038 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CA46722903 for ; Thu, 18 Jun 2015 11:05:07 +0000 (UTC) Received: by laar3 with SMTP id r3sf7961082laa.1 for ; Thu, 18 Jun 2015 04:05:06 -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=V68yT3UMl3F1lYLBOqkgt9GEgVfXBGOBh4eWLSDw27c=; b=P9I6W9payANFKKegMtIX6s4kKyR/QITDrrXJlOjRFDc0sfwTOQes6qOILyu8/mnucA Ojcbb5SDXcXnuGzQUoSm5/8rO0JSmwBeLpMgxQWfqneutYIoeOudhc9NlbWLo1IvPjQ9 hRyo68uYmXGcvDagG+CczctDJlOXSsLYga4ftDOwDx0FVgvru7urcKRrdaGIu9Qve4jt 9vfKKHY6iUjSO+Ur1Ob87QK1wnGPoTC4m2uhJU5yjxcYh4XmcN9607B7eOVBzddZx50T 1NqOIYR7p+3wWN/Cmx4Zmh5Ru3bsfpqib4VISlgqZ7puobOL077p4/3WZ6OksqicRXVT 23vw== X-Gm-Message-State: ALoCoQnL5J5hFePeZ1bzy26wEtzgScpRGBhIh1FU1PgcFP+R98ReLcRSIi+Wc7RGzM5Cs2DrmQrs X-Received: by 10.112.9.100 with SMTP id y4mr9907582lba.20.1434625506798; Thu, 18 Jun 2015 04:05:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.103 with SMTP id r7ls373742lah.106.gmail; Thu, 18 Jun 2015 04:05:06 -0700 (PDT) X-Received: by 10.152.25.198 with SMTP id e6mr12322849lag.83.1434625506557; Thu, 18 Jun 2015 04:05:06 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id k5si6195942lag.54.2015.06.18.04.05.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 04:05:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbbvz5 with SMTP id vz5so1712628lbb.0 for ; Thu, 18 Jun 2015 04:05:06 -0700 (PDT) X-Received: by 10.112.126.101 with SMTP id mx5mr7198633lbb.35.1434625506136; Thu, 18 Jun 2015 04:05:06 -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 hn6csp1099890lbb; Thu, 18 Jun 2015 04:05:05 -0700 (PDT) X-Received: by 10.68.194.104 with SMTP id hv8mr20100699pbc.151.1434625504378; Thu, 18 Jun 2015 04:05:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si10877260pda.165.2015.06.18.04.05.03; Thu, 18 Jun 2015 04:05:04 -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 S932544AbbFRLE6 (ORCPT + 30 others); Thu, 18 Jun 2015 07:04:58 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:34748 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932304AbbFRK4B (ORCPT ); Thu, 18 Jun 2015 06:56:01 -0400 Received: by pabvl15 with SMTP id vl15so12915735pab.1 for ; Thu, 18 Jun 2015 03:56:00 -0700 (PDT) X-Received: by 10.70.128.13 with SMTP id nk13mr19823973pdb.21.1434624960768; Thu, 18 Jun 2015 03:56:00 -0700 (PDT) Received: from localhost ([122.167.70.98]) by mx.google.com with ESMTPSA id ks9sm7689917pdb.36.2015.06.18.03.55.59 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Jun 2015 03:56:00 -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 , Robert Jarzmik , Russell King Subject: [PATCH 16/41] clocksource: pxa: Migrate to new 'set-state' interface Date: Thu, 18 Jun 2015 16:24:30 +0530 Message-Id: <3aa5c1a740911258698769cbbb8f60ee02178848.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.217.173 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 pxa 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. Both oneshot and shutdown modes had exactly same code and so only a single callback is sufficient now, which will be called for both the modes. Cc: Robert Jarzmik Cc: Russell King Signed-off-by: Viresh Kumar --- drivers/clocksource/pxa_timer.c | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/drivers/clocksource/pxa_timer.c b/drivers/clocksource/pxa_timer.c index d9438af2bbd6..45b6a4999713 100644 --- a/drivers/clocksource/pxa_timer.c +++ b/drivers/clocksource/pxa_timer.c @@ -88,26 +88,12 @@ pxa_osmr0_set_next_event(unsigned long delta, struct clock_event_device *dev) return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0; } -static void -pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev) +static int pxa_osmr0_shutdown(struct clock_event_device *evt) { - switch (mode) { - case CLOCK_EVT_MODE_ONESHOT: - timer_writel(timer_readl(OIER) & ~OIER_E0, OIER); - timer_writel(OSSR_M0, OSSR); - break; - - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - /* initializing, released, or preparing for suspend */ - timer_writel(timer_readl(OIER) & ~OIER_E0, OIER); - timer_writel(OSSR_M0, OSSR); - break; - - case CLOCK_EVT_MODE_RESUME: - case CLOCK_EVT_MODE_PERIODIC: - break; - } + /* initializing, released, or preparing for suspend */ + timer_writel(timer_readl(OIER) & ~OIER_E0, OIER); + timer_writel(OSSR_M0, OSSR); + return 0; } #ifdef CONFIG_PM @@ -147,13 +133,14 @@ static void pxa_timer_resume(struct clock_event_device *cedev) #endif static struct clock_event_device ckevt_pxa_osmr0 = { - .name = "osmr0", - .features = CLOCK_EVT_FEAT_ONESHOT, - .rating = 200, - .set_next_event = pxa_osmr0_set_next_event, - .set_mode = pxa_osmr0_set_mode, - .suspend = pxa_timer_suspend, - .resume = pxa_timer_resume, + .name = "osmr0", + .features = CLOCK_EVT_FEAT_ONESHOT, + .rating = 200, + .set_next_event = pxa_osmr0_set_next_event, + .set_state_shutdown = pxa_osmr0_shutdown, + .set_state_oneshot = pxa_osmr0_shutdown, + .suspend = pxa_timer_suspend, + .resume = pxa_timer_resume, }; static struct irqaction pxa_ost0_irq = {