From patchwork Mon Aug 10 09:51:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 52178 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id EA49E2152A for ; Mon, 10 Aug 2015 09:59:45 +0000 (UTC) Received: by wilj18 with SMTP id j18sf36608016wil.0 for ; Mon, 10 Aug 2015 02:59: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:delivered-to:from:to:subject:date:message-id :in-reply-to:references:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:cc:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=RZcZiWNXketR5r6PJc1/kzYt8cNGhF2BDuoXeWgTs4k=; b=JgE7sNFoe6euaIGpoVvki61G8on1wFVL8Ihdu25eZctQUP+FnUddu7XfyZuERj6e5z Xb+he2HMJQ7jwBHEpGpf5Z0vQiWTRZaC+vWGIvfJpetZLPxLQret5cAWQO9R5eQq1oLQ RQpUI5nYvx+R3j7ICZaeUAn2w8omMerVcpPCXUbvtCRgSM7r2Y1A8ZvR5Dt9lJj/gmj8 B5qBzgM4lchLL1RD00NWoe/GXnmXtLgdrW6CjgCICQZVDWB3jonfIH5ZsbEPZmiIY+BZ ALoqfyk1sIeS+ZBT7TaTptbBuBaTxYbxEBworH8gdYsDv6vGGHDAPoHwF0RiBViru5ub r94Q== X-Gm-Message-State: ALoCoQnSIPP5q2EiuZUX3qu+HgtFqylv45Gddw1MMGBMfioWo1uw/koeZJujhRfpG988ELdSd9fX X-Received: by 10.112.139.137 with SMTP id qy9mr6006357lbb.17.1439200784989; Mon, 10 Aug 2015 02:59:44 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.80 with SMTP id v16ls189laz.62.gmail; Mon, 10 Aug 2015 02:59:44 -0700 (PDT) X-Received: by 10.112.164.4 with SMTP id ym4mr19807954lbb.7.1439200784697; Mon, 10 Aug 2015 02:59:44 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id m8si13720547lbs.149.2015.08.10.02.59.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 02:59:44 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbbsx3 with SMTP id sx3so8374747lbb.0 for ; Mon, 10 Aug 2015 02:59:44 -0700 (PDT) X-Received: by 10.152.36.102 with SMTP id p6mr19366213laj.19.1439200784559; Mon, 10 Aug 2015 02:59:44 -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.7.198 with SMTP id l6csp1829797lba; Mon, 10 Aug 2015 02:59:43 -0700 (PDT) X-Received: by 10.70.90.193 with SMTP id by1mr42756094pdb.80.1439200782597; Mon, 10 Aug 2015 02:59:42 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id lz4si4854281pab.96.2015.08.10.02.59.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 02:59:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZOjqc-0002II-3g; Mon, 10 Aug 2015 09:58:26 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZOjma-0005rb-Si for linux-arm-kernel@bombadil.infradead.org; Mon, 10 Aug 2015 09:54:17 +0000 Received: from mail-wi0-f171.google.com ([209.85.212.171]) by merlin.infradead.org with esmtps (Exim 4.85 #2 (Red Hat Linux)) id 1ZOjmY-0002qI-QP for linux-arm-kernel@lists.infradead.org; Mon, 10 Aug 2015 09:54:15 +0000 Received: by wicne3 with SMTP id ne3so128851031wic.1 for ; Mon, 10 Aug 2015 02:53:51 -0700 (PDT) X-Received: by 10.194.175.65 with SMTP id by1mr46722593wjc.152.1439200431714; Mon, 10 Aug 2015 02:53:51 -0700 (PDT) Received: from localhost.localdomain (sju31-1-78-210-255-2.fbx.proxad.net. [78.210.255.2]) by smtp.gmail.com with ESMTPSA id jr5sm28598154wjc.14.2015.08.10.02.53.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Aug 2015 02:53:51 -0700 (PDT) From: Daniel Lezcano To: mingo@kernel.org Subject: [PATCH 18/74] clockevents/drivers/meson6: Migrate to new 'set-state' interface Date: Mon, 10 Aug 2015 11:51:35 +0200 Message-Id: <1439200352-26767-18-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439200352-26767-1-git-send-email-daniel.lezcano@linaro.org> References: <55C87382.4070309@linaro.org> <1439200352-26767-1-git-send-email-daniel.lezcano@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150810_055414_968105_33AE96B4 X-CRM114-Status: GOOD ( 14.52 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.171 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.171 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Cc: Carlo Caione , Viresh Kumar , tglx@linutronix.de, linux-kernel@vger.kernel.org, "moderated list:ARM/Amlogic Meson..." MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.lezcano@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.179 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 From: Viresh Kumar 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 Signed-off-by: Daniel Lezcano Acked-by: Carlo Caione --- 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 5c15cba..1fa22c4 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)