From patchwork Wed Nov 6 06:02:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 178606 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp161175ilf; Tue, 5 Nov 2019 22:03:25 -0800 (PST) X-Google-Smtp-Source: APXvYqxFcT/2GwMt31xw78GN/NpdWE06R6lZ2bMLoJJreM996a+F+lATWk+g5OmbKJBeUmQo7aVb X-Received: by 2002:a17:906:a38d:: with SMTP id k13mr21014895ejz.213.1573020205489; Tue, 05 Nov 2019 22:03:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573020205; cv=none; d=google.com; s=arc-20160816; b=g8THPpNwRK5Bn1zWlx7XO0n3/YlAU+/13UzkcVZuHlto3kC8GJO4nh5RqJ6xqy7p7K D5lLqUJQAPo3KDQQA6SvWqZf3E8Dc1vs4z2S5a5ngplfGrwDQHwNiicL2DKJZAXKjFRu jVqXB74jtJN7GpOsnyPUhC84QbzIhhUMsbKHtyNBx2hoQEXyv/7zXIqXmOra/R69R10o lga+gbD1SBpX98RrvMS59/wjMDXRVmOT7n784eN9Od1I+WXyOZU5OYjli0KOOA59sJ8S lJu7o4PGK9/cKS4eIb9cukuF+aOpQcY2Srt+3v9iF/WH9DEUZt9j8gLYfUS5C5yTxxYq zhSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wigKnx55CwbHshgUiFaVzzGEeLAYy1kZhbF9mN3t1iQ=; b=0jwTFcOsqNYUznL/LXM5HlaLZhlv7Jxf16rOmRP+gxj0U5149IoBTINfd1CuhaPOCz HOYHnYSC3jHR2C0AFdwqPUCswj4xQd2Vw8GT8NntzuJIkLx1Mys9F26FjvNI4asQzdCN W2nm0qFKNkJowSoF2HcvZJJw3Dk1HzOpmwVCiqFm69OnMCTM3cNgbNSjaLnFRQWGKdJY iogs+EQEGLNvGpEJnL9HGIPQbU4Eaf4Mqu0bvr7Bf+sMjMJLfZ4sfvGbp7gs6/FPwDoN Nf6CliBexFFcq8nLyZGoGNvn9vYzWEZrH5ABcQEtGyXNwgcyPyy8DxrF4j+wIwSvfux4 I9/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=fSwNEiMf; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 cb6si5424768ejb.359.2019.11.05.22.03.25; Tue, 05 Nov 2019 22:03:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=fSwNEiMf; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731068AbfKFGDX (ORCPT + 8 others); Wed, 6 Nov 2019 01:03:23 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:44106 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725616AbfKFGDX (ORCPT ); Wed, 6 Nov 2019 01:03:23 -0500 Received: by mail-pf1-f194.google.com with SMTP id q26so18000842pfn.11; Tue, 05 Nov 2019 22:03:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wigKnx55CwbHshgUiFaVzzGEeLAYy1kZhbF9mN3t1iQ=; b=fSwNEiMfRyxD2QUPGH3qIOL5nKZap+JEIPRAGtKhA3RJzY9bg8Uuq7XUaoWms/U+J3 M1YNO82g7kQQPkUk6Cbblv0pPq5zTQ3bFnhoWz8p1OGz3UX+oa0BzgfgyLdAK0KMm/Re RUuI1408xJq+t32sZnOy4uwYUSHZ97zVG71FEQgomtA7ApGNz1RAFAORbumiBXhwv+E1 s6bZT6YjEtZ927HiDEya7hsToW40MDOTep8u4VXCgCb3c9LHOXo//4yfkiQoR+jw26QO yV8RuT05L7iM4XsLAZjLMQsGwRnnUJ5ilywOu5BiNEc8zozxBrO+TJrM3ymdz6kEfqUW GDNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wigKnx55CwbHshgUiFaVzzGEeLAYy1kZhbF9mN3t1iQ=; b=BxQivh38wysNRyG9C00d95vR65DmkKVI8BC20ZaFs0shZAYqvHDFJVzr0sjUf9lDU0 QFXhgMIFQAlxpGE2jFuXlUtoXWoKjw7x8rTh/bieV+c4o7tY9PQgbaWIggVTr7z980Bm UJgh6+ydZLL9z3zG14AwaMBiEJdYv9qjAU3mceXIH4WRpXZvRCOiI4TK5epqQQTMg/Ug sLN4L3nauM6nLr8NtqVedzd5BKcBHH7OuIQmb9kBnblMGdPJhMbnKzVXvwMHCuAondO5 17cWBw97mwM4oEquAR0u4p00+fMKNVuCCtrA5l9IVaMAwa/zA2zYnYw6eyOwz/kXUhzC 4vDw== X-Gm-Message-State: APjAAAVf9oTNPw7O5D6nWJanKLWYm/NzPjXMyz3MjE17hiQgfeihTKXn zesOsWd0W+jzid66UoAst0w= X-Received: by 2002:a65:5a06:: with SMTP id y6mr911719pgs.9.1573020202371; Tue, 05 Nov 2019 22:03:22 -0800 (PST) Received: from voyager.ibm.com ([36.255.48.244]) by smtp.gmail.com with ESMTPSA id u65sm23177676pfb.35.2019.11.05.22.03.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2019 22:03:21 -0800 (PST) From: Joel Stanley To: Daniel Lezcano , Rob Herring Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Linus Walleij , Andrew Jeffery Subject: [PATCH 2/4] clocksource: fttmr010: Set interrupt and shutdown Date: Wed, 6 Nov 2019 16:32:59 +1030 Message-Id: <20191106060301.17408-3-joel@jms.id.au> X-Mailer: git-send-email 2.24.0.rc1 In-Reply-To: <20191106060301.17408-1-joel@jms.id.au> References: <20191106060301.17408-1-joel@jms.id.au> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org In preparation for supporting the ast2600, pass the shutdown and interrupt functions to the common init callback. Signed-off-by: Joel Stanley --- drivers/clocksource/timer-fttmr010.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) -- 2.24.0.rc1 Reviewed-by: Linus Walleij diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/timer-fttmr010.c index c2d30eb9dc72..8a79025339d0 100644 --- a/drivers/clocksource/timer-fttmr010.c +++ b/drivers/clocksource/timer-fttmr010.c @@ -244,7 +244,10 @@ static irqreturn_t fttmr010_timer_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static int __init fttmr010_common_init(struct device_node *np, bool is_aspeed) +static int __init fttmr010_common_init(struct device_node *np, + bool is_aspeed, + int (*timer_shutdown)(struct clock_event_device *), + irq_handler_t handler) { struct fttmr010 *fttmr010; int irq; @@ -345,7 +348,7 @@ static int __init fttmr010_common_init(struct device_node *np, bool is_aspeed) fttmr010->tick_rate); } - fttmr010->timer_shutdown = fttmr010_timer_shutdown; + fttmr010->timer_shutdown = timer_shutdown; /* * Setup clockevent timer (interrupt-driven) on timer 1. @@ -354,7 +357,7 @@ static int __init fttmr010_common_init(struct device_node *np, bool is_aspeed) writel(0, fttmr010->base + TIMER1_LOAD); writel(0, fttmr010->base + TIMER1_MATCH1); writel(0, fttmr010->base + TIMER1_MATCH2); - ret = request_irq(irq, fttmr010_timer_interrupt, IRQF_TIMER, + ret = request_irq(irq, handler, IRQF_TIMER, "FTTMR010-TIMER1", &fttmr010->clkevt); if (ret) { pr_err("FTTMR010-TIMER1 no IRQ\n"); @@ -403,12 +406,16 @@ static int __init fttmr010_common_init(struct device_node *np, bool is_aspeed) static __init int aspeed_timer_init(struct device_node *np) { - return fttmr010_common_init(np, true); + return fttmr010_common_init(np, true, + fttmr010_timer_shutdown, + fttmr010_timer_interrupt); } static __init int fttmr010_timer_init(struct device_node *np) { - return fttmr010_common_init(np, false); + return fttmr010_common_init(np, false, + fttmr010_timer_shutdown, + fttmr010_timer_interrupt); } TIMER_OF_DECLARE(fttmr010, "faraday,fttmr010", fttmr010_timer_init);