From patchwork Fri Apr 12 07:36:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugaya Taichi X-Patchwork-Id: 162094 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp298585jan; Fri, 12 Apr 2019 00:37:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXOdLIcMa3dcQW+/+/61OqonlRf9UFinUEgrqJruAUC64zcp15R90RDf4MPF9B03LoVpME X-Received: by 2002:aa7:8609:: with SMTP id p9mr54753557pfn.166.1555054642241; Fri, 12 Apr 2019 00:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555054642; cv=none; d=google.com; s=arc-20160816; b=UQsD2iX57wxX3FrgAXXgElZHhXoF/aT7vNCBby7m2IzKmkQcB4dtTynKcTYmANUkG1 UNTJNGUWUx93xjD0Q6uXZt138KCQJTywV9nmw5mWe3g7OZNjiGy7eZx7alGyHjWdhH6q /Ypc9q962ioy3Hw8ROp/t2EZYQFmlKC6TSaI1A3pLfyCwlH6+67gSi0Z+z0wk+v4CmNJ 5OYpcw5N/NFkBuncM7A2COKMnAK7VJL3R7MBJh9zArYVYYeXBhN3YghIDsMoC/es1czn 5+V/DrE6TX0wMsyOpPH1WhIO051A2wFf7k0M8GdJ0BwiK0H4St6E0LbyNU9o2VuSv2hC n1Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=iiUDipOap5XzNFOSTN9Y2r2/JCc7CSCGLq0y/m8FpkQ=; b=hN7IEOXH9lEuULWZcrYZTOWBwid9za8EK6mUDy0yZ+mB1/5u9R4EEesnkaP5hdRK+L lR8WRuj1pePcCMQtRJKmYnunwpJTcGmCCi6yGICtaMh22gTlBh8+iPFYprkCvH0Hr9Mc 0ZPmcA+kcUYWoGw/TdBaCh595HC4mYbjFF2zlC13wAL/i90pbGKyM5y9FIv8aR5nngTa FnERbV7RIxup+FXO4nxI1dWZcJQ6x8NNsG6OrL8/WTfFSVW9m3vJCPBqJT6Q+8aSgmvd MfACn/pdwwhGT/NGoptLUh4/hkEmI1Vl5muoqyJ1OJLc2deFlFvvPnSDkW7mThOFLnsX dwTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g189si32391593pfb.289.2019.04.12.00.37.21; Fri, 12 Apr 2019 00:37:22 -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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727208AbfDLHhU (ORCPT + 31 others); Fri, 12 Apr 2019 03:37:20 -0400 Received: from mx.socionext.com ([202.248.49.38]:45667 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfDLHhU (ORCPT ); Fri, 12 Apr 2019 03:37:20 -0400 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 12 Apr 2019 16:37:18 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id B2336180C0E; Fri, 12 Apr 2019 16:37:18 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Fri, 12 Apr 2019 16:37:18 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id 4F6CA40372; Fri, 12 Apr 2019 16:37:18 +0900 (JST) Received: from M20VSDK.e01.socionext.com (unknown [10.213.118.34]) by yuzu.css.socionext.com (Postfix) with ESMTP id 3C501120499; Fri, 12 Apr 2019 16:37:18 +0900 (JST) From: Sugaya Taichi To: Daniel Lezcano , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Takao Orito , Kazuhiro Kasai , Shinji Kanematsu , Jassi Brar , Masami Hiramatsu , Sugaya Taichi Subject: [PATCH v2 2/3] clocksource/drivers/timer-milbeaut: Add shutdown function Date: Fri, 12 Apr 2019 16:36:50 +0900 Message-Id: <1555054611-23566-3-git-send-email-sugaya.taichi@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1555054611-23566-1-git-send-email-sugaya.taichi@socionext.com> References: <1555054611-23566-1-git-send-email-sugaya.taichi@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a shutdown operation to support shutdown timer. Signed-off-by: Sugaya Taichi --- drivers/clocksource/timer-milbeaut.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 1.9.1 diff --git a/drivers/clocksource/timer-milbeaut.c b/drivers/clocksource/timer-milbeaut.c index 9fd5d08..f478061 100644 --- a/drivers/clocksource/timer-milbeaut.c +++ b/drivers/clocksource/timer-milbeaut.c @@ -85,6 +85,15 @@ static int mlb_set_state_oneshot(struct clock_event_device *clk) return 0; } +static int mlb_set_state_shutdown(struct clock_event_device *clk) +{ + struct timer_of *to = to_timer_of(clk); + u32 val = MLB_TMR_TMCSR_CSL_DIV2; + + writel_relaxed(val, timer_of_base(to) + MLB_TMR_EVT_TMCSR_OFS); + return 0; +} + static int mlb_clkevt_next_event(unsigned long event, struct clock_event_device *clk) { @@ -125,6 +134,7 @@ static int mlb_config_clock_event(struct timer_of *to) .features = CLOCK_EVT_FEAT_DYNIRQ | CLOCK_EVT_FEAT_ONESHOT, .set_state_oneshot = mlb_set_state_oneshot, .set_state_periodic = mlb_set_state_periodic, + .set_state_shutdown = mlb_set_state_shutdown, .set_next_event = mlb_clkevt_next_event, },