From patchwork Thu Jun 18 10:54:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50021 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9240522905 for ; Thu, 18 Jun 2015 10:58:47 +0000 (UTC) Received: by wgbhy7 with SMTP id hy7sf19226836wgb.3 for ; Thu, 18 Jun 2015 03:58:46 -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=8WklkouNNNbS5QBiKtONUGeUvC1huoMqThva1c8jxmc=; b=c7JaSpftdOD+h7ieXk3YyZJpq6x0xHbPFUaT6eFAZSf5jMbsisB/Lsxz4VluIavuGb J/m6oHbosK9xQLkdYKgJffFt9sDWo7rG4b3hoeAiYK9Pu5qpwD11Jf75ozfukPWYok9G OYxjga195MJ+4s3+c71cG5BTFBY1Dxl/s2e48VyFAWeRf1LdiBZsid+awj/wuCckkOE2 6+OxdaFZSYO3Sb4YzwEEZlclRww7AHGkicd9EoaB6u2tM87zHj4jKOSpFvp9VFSxw5pD pKDat6cNDCbAs5RQnZyCAQzPZWddgQLdgAFobG97Yvg3O5djd4WjKRGpF5+QnPzoZA96 OBWg== X-Gm-Message-State: ALoCoQlPWy/W5tG7fVR2nFnvICBcoYb5xeXI1K7Hw6TEKWfHhwD/wdti8sZ6hekWpluMHsVKkZSh X-Received: by 10.180.83.72 with SMTP id o8mr34478366wiy.3.1434625126935; Thu, 18 Jun 2015 03:58:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.115.161 with SMTP id jp1ls410985lab.96.gmail; Thu, 18 Jun 2015 03:58:46 -0700 (PDT) X-Received: by 10.152.3.97 with SMTP id b1mr12595986lab.54.1434625126743; Thu, 18 Jun 2015 03:58:46 -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 qf8si6182792lbb.91.2015.06.18.03.58.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 03:58:46 -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 laka10 with SMTP id a10so51868968lak.0 for ; Thu, 18 Jun 2015 03:58:46 -0700 (PDT) X-Received: by 10.152.1.40 with SMTP id 8mr12715667laj.56.1434625126612; Thu, 18 Jun 2015 03:58:46 -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 hn6csp1095977lbb; Thu, 18 Jun 2015 03:58:45 -0700 (PDT) X-Received: by 10.70.38.33 with SMTP id d1mr19779511pdk.99.1434625124674; Thu, 18 Jun 2015 03:58:44 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dg11si10875633pac.81.2015.06.18.03.58.43; Thu, 18 Jun 2015 03:58:44 -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 S1755257AbbFRK6Y (ORCPT + 30 others); Thu, 18 Jun 2015 06:58:24 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:36299 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754955AbbFRK50 (ORCPT ); Thu, 18 Jun 2015 06:57:26 -0400 Received: by paceq1 with SMTP id eq1so34574692pac.3 for ; Thu, 18 Jun 2015 03:57:26 -0700 (PDT) X-Received: by 10.68.224.166 with SMTP id rd6mr20229272pbc.11.1434625046478; Thu, 18 Jun 2015 03:57:26 -0700 (PDT) Received: from localhost ([122.167.70.98]) by mx.google.com with ESMTPSA id nn6sm7673174pdb.79.2015.06.18.03.57.25 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Jun 2015 03:57:26 -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 , Tony Prisk Subject: [PATCH 40/41] clocksource: vt8500: Migrate to new 'set-state' interface Date: Thu, 18 Jun 2015 16:24:54 +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.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 vt8500 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: Tony Prisk Signed-off-by: Viresh Kumar --- drivers/clocksource/vt8500_timer.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/drivers/clocksource/vt8500_timer.c b/drivers/clocksource/vt8500_timer.c index 1098ed3b9b89..a92e94b40b5b 100644 --- a/drivers/clocksource/vt8500_timer.c +++ b/drivers/clocksource/vt8500_timer.c @@ -88,29 +88,20 @@ static int vt8500_timer_set_next_event(unsigned long cycles, return 0; } -static void vt8500_timer_set_mode(enum clock_event_mode mode, - struct clock_event_device *evt) +static int vt8500_shutdown(struct clock_event_device *evt) { - switch (mode) { - case CLOCK_EVT_MODE_RESUME: - case CLOCK_EVT_MODE_PERIODIC: - break; - case CLOCK_EVT_MODE_ONESHOT: - case CLOCK_EVT_MODE_UNUSED: - case CLOCK_EVT_MODE_SHUTDOWN: - writel(readl(regbase + TIMER_CTRL_VAL) | 1, - regbase + TIMER_CTRL_VAL); - writel(0, regbase + TIMER_IER_VAL); - break; - } + writel(readl(regbase + TIMER_CTRL_VAL) | 1, regbase + TIMER_CTRL_VAL); + writel(0, regbase + TIMER_IER_VAL); + return 0; } static struct clock_event_device clockevent = { - .name = "vt8500_timer", - .features = CLOCK_EVT_FEAT_ONESHOT, - .rating = 200, - .set_next_event = vt8500_timer_set_next_event, - .set_mode = vt8500_timer_set_mode, + .name = "vt8500_timer", + .features = CLOCK_EVT_FEAT_ONESHOT, + .rating = 200, + .set_next_event = vt8500_timer_set_next_event, + .set_state_shutdown = vt8500_shutdown, + .set_state_oneshot = vt8500_shutdown, }; static irqreturn_t vt8500_timer_interrupt(int irq, void *dev_id)