From patchwork Thu Jun 18 10:54:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50028 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DCAD0228CC for ; Thu, 18 Jun 2015 11:02:15 +0000 (UTC) Received: by wguu7 with SMTP id u7sf4253794wgu.0 for ; Thu, 18 Jun 2015 04:02:15 -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=FOF1jN2TfZI27eJGQ8rDYJGNxjFPeeZ1uHcds3i640E=; b=f6qi7QLU6P1bZMUSuGCJdI7RjpkkoiZQ5eNFVggITWrWx3phKWDki7BHTugWk0MYhf +OGM1mN0nBLGp06dpvNYABpE4FFfDvJhTOB2pYg4e2rXQcBSjbJiMUCG9dwd1bCncDXM Bt3GoqJAzOB3m4hRPY3aSf7g0C5fba4b0M45OA7Xx5pBmMI3ARLwyUlCeRBfxYQW+0du heB9CKwxrG01q5zas7UumDCaGtElZXhYgOFx8l231q7gwOz+K2OU6wFij1MeZKocEnfb m4BYuLMOpv+1kjF984+qp9whDzdWvabeIfc1vSMLKrHKz6apdTKxczvdvyAHm9m7PDZt 4rTg== X-Gm-Message-State: ALoCoQmUGRzGHNkLEWfnMjbbIphaMrcSubDAdkuFctH9xV4Yj9FfqpAs0mIf5yo7HWakxFs9YdTA X-Received: by 10.180.89.231 with SMTP id br7mr12775270wib.0.1434625335177; Thu, 18 Jun 2015 04:02:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.7 with SMTP id bc7ls271126lab.74.gmail; Thu, 18 Jun 2015 04:02:15 -0700 (PDT) X-Received: by 10.112.162.38 with SMTP id xx6mr12492694lbb.110.1434625334989; Thu, 18 Jun 2015 04:02:14 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id k11si6190818lbz.74.2015.06.18.04.02.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 04:02:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by labbc20 with SMTP id bc20so51884815lab.1 for ; Thu, 18 Jun 2015 04:02:14 -0700 (PDT) X-Received: by 10.112.55.207 with SMTP id u15mr12446536lbp.88.1434625334772; Thu, 18 Jun 2015 04:02:14 -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 hn6csp1098093lbb; Thu, 18 Jun 2015 04:02:13 -0700 (PDT) X-Received: by 10.66.65.138 with SMTP id x10mr5944331pas.97.1434625333019; Thu, 18 Jun 2015 04:02:13 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ot7si10848380pac.203.2015.06.18.04.02.12; Thu, 18 Jun 2015 04:02:13 -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 S1755555AbbFRLCF (ORCPT + 30 others); Thu, 18 Jun 2015 07:02:05 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:33927 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754683AbbFRK45 (ORCPT ); Thu, 18 Jun 2015 06:56:57 -0400 Received: by pdbki1 with SMTP id ki1so64247302pdb.1 for ; Thu, 18 Jun 2015 03:56:57 -0700 (PDT) X-Received: by 10.70.133.230 with SMTP id pf6mr7465069pdb.56.1434625017406; Thu, 18 Jun 2015 03:56:57 -0700 (PDT) Received: from localhost ([122.167.70.98]) by mx.google.com with ESMTPSA id i1sm7701629pdm.19.2015.06.18.03.56.56 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Jun 2015 03:56:56 -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 , Baruch Siach Subject: [PATCH 32/41] clocksource: digicolor: Migrate to new 'set-state' interface Date: Thu, 18 Jun 2015 16:24:46 +0530 Message-Id: <6809c28328450f138517daa6c22f97f283f3fd01.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.52 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 digicolor 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: Baruch Siach Signed-off-by: Viresh Kumar --- drivers/clocksource/timer-digicolor.c | 41 +++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/drivers/clocksource/timer-digicolor.c b/drivers/clocksource/timer-digicolor.c index 7f8388cfa810..e73947f0f86d 100644 --- a/drivers/clocksource/timer-digicolor.c +++ b/drivers/clocksource/timer-digicolor.c @@ -87,27 +87,27 @@ static inline void dc_timer_set_count(struct clock_event_device *ce, writel(count, dt->base + COUNT(dt->timer_id)); } -static void digicolor_clkevt_mode(enum clock_event_mode mode, - struct clock_event_device *ce) +static int digicolor_clkevt_shutdown(struct clock_event_device *ce) +{ + dc_timer_disable(ce); + return 0; +} + +static int digicolor_clkevt_set_oneshot(struct clock_event_device *ce) +{ + dc_timer_disable(ce); + dc_timer_enable(ce, CONTROL_MODE_ONESHOT); + return 0; +} + +static int digicolor_clkevt_set_periodic(struct clock_event_device *ce) { struct digicolor_timer *dt = dc_timer(ce); - switch (mode) { - case CLOCK_EVT_MODE_PERIODIC: - dc_timer_disable(ce); - dc_timer_set_count(ce, dt->ticks_per_jiffy); - dc_timer_enable(ce, CONTROL_MODE_PERIODIC); - break; - case CLOCK_EVT_MODE_ONESHOT: - dc_timer_disable(ce); - dc_timer_enable(ce, CONTROL_MODE_ONESHOT); - break; - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - default: - dc_timer_disable(ce); - break; - } + dc_timer_disable(ce); + dc_timer_set_count(ce, dt->ticks_per_jiffy); + dc_timer_enable(ce, CONTROL_MODE_PERIODIC); + return 0; } static int digicolor_clkevt_next_event(unsigned long evt, @@ -125,7 +125,10 @@ static struct digicolor_timer dc_timer_dev = { .name = "digicolor_tick", .rating = 340, .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, - .set_mode = digicolor_clkevt_mode, + .set_state_shutdown = digicolor_clkevt_shutdown, + .set_state_periodic = digicolor_clkevt_set_periodic, + .set_state_oneshot = digicolor_clkevt_set_oneshot, + .tick_resume = digicolor_clkevt_shutdown, .set_next_event = digicolor_clkevt_next_event, }, .timer_id = TIMER_C,