From patchwork Thu Jun 18 10:54:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50041 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 ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A713822903 for ; Thu, 18 Jun 2015 11:07:46 +0000 (UTC) Received: by lbcak1 with SMTP id ak1sf19703016lbc.2 for ; Thu, 18 Jun 2015 04:07:45 -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=1//nM3LWAf5oNzttpR3t2oA4zcE+8LNW/DRLc8QTZMg=; b=I7HoPoUzKgKie3Iy9k/zJoJu5coXPFuqFAeyDrPp+DJl3sbktJjbMjS7FnbKOuqh1+ 7lZ5Z6FQjuI0F+XVTlk0L+f/ruEffCpoRj1e7WqaJHxqZG2iA56wEY8GSjCW1taSw4OH wUcwHDh8afW1ySjjOcQv79mpEILFM/YjNkfh9aiwh/VO2hXpD8lksjVOcfHVKZ4pVakI qEaQmXDdfkE1zAuUj7AGeY97rcAwaH08FXpioEEcjsc6zSATJgkGSD52jwUPZ3iOp0JK Kf8S/4VPefe4xNa5S72aLUpAL0hfqQ6AaFl/CQsUNvJp6dDoBS1isJYr0SRYimhyeXiT cqKQ== X-Gm-Message-State: ALoCoQmObebCG6XrEKZWdtpsr8MW4lvjI7FOMTc++SRKvO7K60naTzaqVPXY2hbw1EhRONw9a8/3 X-Received: by 10.112.14.101 with SMTP id o5mr9741996lbc.3.1434625665634; Thu, 18 Jun 2015 04:07:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.34 with SMTP id n2ls419930laj.15.gmail; Thu, 18 Jun 2015 04:07:45 -0700 (PDT) X-Received: by 10.152.3.33 with SMTP id 1mr12436054laz.109.1434625665441; Thu, 18 Jun 2015 04:07:45 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id h10si6184351laa.130.2015.06.18.04.07.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 04:07:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by labbc20 with SMTP id bc20so51970960lab.1 for ; Thu, 18 Jun 2015 04:07:45 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr12814648lbc.32.1434625665312; Thu, 18 Jun 2015 04:07:45 -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 hn6csp1101615lbb; Thu, 18 Jun 2015 04:07:44 -0700 (PDT) X-Received: by 10.68.167.197 with SMTP id zq5mr20289082pbb.85.1434625663670; Thu, 18 Jun 2015 04:07:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v16si10851456pbs.166.2015.06.18.04.07.42; Thu, 18 Jun 2015 04:07:43 -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 S1755089AbbFRLHd (ORCPT + 30 others); Thu, 18 Jun 2015 07:07:33 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:33925 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932135AbbFRKzg (ORCPT ); Thu, 18 Jun 2015 06:55:36 -0400 Received: by pdbki1 with SMTP id ki1so64225670pdb.1 for ; Thu, 18 Jun 2015 03:55:36 -0700 (PDT) X-Received: by 10.68.224.72 with SMTP id ra8mr20130860pbc.29.1434624936437; Thu, 18 Jun 2015 03:55:36 -0700 (PDT) Received: from localhost ([122.167.70.98]) by mx.google.com with ESMTPSA id md8sm7688858pdb.35.2015.06.18.03.55.35 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Jun 2015 03:55:35 -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 , Carlo Caione Subject: [PATCH 09/41] clocksource: meson6: Migrate to new 'set-state' interface Date: Thu, 18 Jun 2015 16:24:23 +0530 Message-Id: <31c070cb211232dbe5f03f7afa62ac27d65481ba.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.45 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 meson6 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: Carlo Caione Signed-off-by: Viresh Kumar --- drivers/clocksource/meson6_timer.c | 50 ++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/drivers/clocksource/meson6_timer.c b/drivers/clocksource/meson6_timer.c index 5c15cba41dca..1fa22c4d2d49 100644 --- a/drivers/clocksource/meson6_timer.c +++ b/drivers/clocksource/meson6_timer.c @@ -67,25 +67,25 @@ static void meson6_clkevt_time_start(unsigned char timer, bool periodic) writel(val | TIMER_ENABLE_BIT(timer), timer_base + TIMER_ISA_MUX); } -static void meson6_clkevt_mode(enum clock_event_mode mode, - struct clock_event_device *clk) +static int meson6_shutdown(struct clock_event_device *evt) { - switch (mode) { - case CLOCK_EVT_MODE_PERIODIC: - meson6_clkevt_time_stop(CED_ID); - meson6_clkevt_time_setup(CED_ID, USEC_PER_SEC/HZ - 1); - meson6_clkevt_time_start(CED_ID, true); - break; - case CLOCK_EVT_MODE_ONESHOT: - meson6_clkevt_time_stop(CED_ID); - meson6_clkevt_time_start(CED_ID, false); - break; - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - default: - meson6_clkevt_time_stop(CED_ID); - break; - } + meson6_clkevt_time_stop(CED_ID); + return 0; +} + +static int meson6_set_oneshot(struct clock_event_device *evt) +{ + meson6_clkevt_time_stop(CED_ID); + meson6_clkevt_time_start(CED_ID, false); + return 0; +} + +static int meson6_set_periodic(struct clock_event_device *evt) +{ + meson6_clkevt_time_stop(CED_ID); + meson6_clkevt_time_setup(CED_ID, USEC_PER_SEC / HZ - 1); + meson6_clkevt_time_start(CED_ID, true); + return 0; } static int meson6_clkevt_next_event(unsigned long evt, @@ -99,11 +99,15 @@ static int meson6_clkevt_next_event(unsigned long evt, } static struct clock_event_device meson6_clockevent = { - .name = "meson6_tick", - .rating = 400, - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, - .set_mode = meson6_clkevt_mode, - .set_next_event = meson6_clkevt_next_event, + .name = "meson6_tick", + .rating = 400, + .features = CLOCK_EVT_FEAT_PERIODIC | + CLOCK_EVT_FEAT_ONESHOT, + .set_state_shutdown = meson6_shutdown, + .set_state_periodic = meson6_set_periodic, + .set_state_oneshot = meson6_set_oneshot, + .tick_resume = meson6_shutdown, + .set_next_event = meson6_clkevt_next_event, }; static irqreturn_t meson6_timer_interrupt(int irq, void *dev_id)