From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42281C432C0 for ; Wed, 20 Nov 2019 10:39:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 156A822429 for ; Wed, 20 Nov 2019 10:39:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574246349; bh=BSDOj43SEYbDyUSUSjA2IR8NwRrZQF67FoMribeMRkk=; h=To:Subject:Date:From:Cc:In-Reply-To:References:List-ID:From; b=XM/4NbItOZCnOYxbhUjgizcQItXIBSq5h62CXrnyboCCibUvcMeqn7jZ5hG+99Vyw H8xFeCBfQT41M6Wk7ftVYAV4MVFKbClIGsIQcgle0ptRsIVW2cX2Wr/7Be6AEO5vkC 4EVVFqVZMv9DfZGm+P8aT74bSDPD5Pecg5nDswWo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728599AbfKTKjI (ORCPT ); Wed, 20 Nov 2019 05:39:08 -0500 Received: from inca-roads.misterjones.org ([213.251.177.50]:39717 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728497AbfKTKjI (ORCPT ); Wed, 20 Nov 2019 05:39:08 -0500 Received: from www-data by cheepnis.misterjones.org with local (Exim 4.80) (envelope-from ) id 1iXNNz-0001Zl-U1; Wed, 20 Nov 2019 11:38:59 +0100 To: Yash Shah Subject: Re: [PATCH v2 1/5] genirq: introduce =?UTF-8?Q?irq=5Fdomain=5Ftra?= =?UTF-8?Q?nslate=5Fonecell?= X-PHP-Originating-Script: 0:main.inc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 20 Nov 2019 10:38:59 +0000 From: Marc Zyngier Cc: , , , , , "Paul Walmsley ( Sifive)" , , , , , , Sagar Kadam , , , , , Sachin Ghadi In-Reply-To: <1574233128-28114-2-git-send-email-yash.shah@sifive.com> References: <1574233128-28114-1-git-send-email-yash.shah@sifive.com> <1574233128-28114-2-git-send-email-yash.shah@sifive.com> Message-ID: <5ec51559d8b4cd3b8e80943788b52926@www.loen.fr> X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/0.7.2 X-SA-Exim-Connect-IP: X-SA-Exim-Rcpt-To: yash.shah@sifive.com, linus.walleij@linaro.org, bgolaszewski@baylibre.com, robh+dt@kernel.org, mark.rutland@arm.com, palmer@dabbelt.com, paul.walmsley@sifive.com, aou@eecs.berkeley.edu, tglx@linutronix.de, jason@lakedaemon.net, bmeng.cn@gmail.com, atish.patra@wdc.com, sagar.kadam@sifive.com, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, sachin.ghadi@sifive.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On 2019-11-20 06:59, Yash Shah wrote: > Add a new function irq_domain_translate_onecell() that is to be used > as > the translate function in struct irq_domain_ops for the v2 IRQ API. > > Signed-off-by: Yash Shah > --- > include/linux/irqdomain.h | 5 +++++ > kernel/irq/irqdomain.c | 20 ++++++++++++++++++++ > 2 files changed, 25 insertions(+) > > diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h > index 583e7ab..cad9eb8 100644 > --- a/include/linux/irqdomain.h > +++ b/include/linux/irqdomain.h > @@ -426,6 +426,11 @@ int irq_domain_translate_twocell(struct > irq_domain *d, > unsigned long *out_hwirq, > unsigned int *out_type); > > +int irq_domain_translate_onecell(struct irq_domain *d, > + struct irq_fwspec *fwspec, > + unsigned long *out_hwirq, > + unsigned int *out_type); > + > /* IPI functions */ > int irq_reserve_ipi(struct irq_domain *domain, const struct cpumask > *dest); > int irq_destroy_ipi(unsigned int irq, const struct cpumask *dest); > diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c > index 132672b..6972a48 100644 > --- a/kernel/irq/irqdomain.c > +++ b/kernel/irq/irqdomain.c > @@ -987,6 +987,26 @@ const struct irq_domain_ops > irq_domain_simple_ops = { > EXPORT_SYMBOL_GPL(irq_domain_simple_ops); > > /** > + * irq_domain_translate_onecell() - Generic translate for direct one > cell > + * bindings > + * > + * Device Tree IRQ specifier translation function which works with > one cell nit: the whole point of the 'new' translate function is that they are firmware-agnostic. Just drop the DT reference here. > + * bindings where the cell values map directly to the hwirq number. > + */ > +int irq_domain_translate_onecell(struct irq_domain *d, > + struct irq_fwspec *fwspec, > + unsigned long *out_hwirq, > + unsigned int *out_type) > +{ > + if (WARN_ON(fwspec->param_count < 1)) > + return -EINVAL; > + *out_hwirq = fwspec->param[0]; > + *out_type = IRQ_TYPE_NONE; > + return 0; > +} > +EXPORT_SYMBOL_GPL(irq_domain_translate_onecell); > + > +/** > * irq_domain_translate_twocell() - Generic translate for direct two > cell > * bindings > * Can you please also update (potentially in a separate patch) the potential users of this? I mentioned the nvic driver last time... Thanks, M. -- Jazz is not dead. It just smells funny... From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE518C432C0 for ; Wed, 20 Nov 2019 10:39:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 871FB2243F for ; Wed, 20 Nov 2019 10:39:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pR1AyMgU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 871FB2243F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:From:Date: MIME-Version:Subject:To:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mWokpabRINsgJiub24UtyFv31ZfwdN1Er0kLVg7V8Jc=; b=pR1AyMgUclbsbPJcfVRGl2Lyn fZRiQ+AtmGX+J0D6oomCh32R1Q1b9sGCDA3yHKmY5hAObr4Wp1wmjc5to7Vwwp6FyFBQHLqZ1o5sa PQ1CBSARDBrFgVDPDGMkBhOy02oxalhgkNYrsljWd5F0o3im8mWVx4Dkm4iXx03IshFqE+tdG2BZc jE+rRrpR8zOxawbS4cJe8TxeVLEscXzFjaycUIng8KWWH8NnLM9KwCO5iH/NfCOH/wSYpT8T7u1Aw /IaBwoulB3NTpcGrogs94A2ulMQlBKKZhfbVgqcxCn2R+ZaGx4KCLkjd/Sa2lkgcbeVMj6e8KDm7a uaotSDxTQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXNO9-0001uT-4h; Wed, 20 Nov 2019 10:39:09 +0000 Received: from inca-roads.misterjones.org ([213.251.177.50]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXNO6-0001tx-5F for linux-riscv@lists.infradead.org; Wed, 20 Nov 2019 10:39:07 +0000 Received: from www-data by cheepnis.misterjones.org with local (Exim 4.80) (envelope-from ) id 1iXNNz-0001Zl-U1; Wed, 20 Nov 2019 11:38:59 +0100 To: Yash Shah Subject: Re: [PATCH v2 1/5] genirq: introduce =?UTF-8?Q?irq=5Fdomain=5Ftra?= =?UTF-8?Q?nslate=5Fonecell?= X-PHP-Originating-Script: 0:main.inc MIME-Version: 1.0 Date: Wed, 20 Nov 2019 10:38:59 +0000 From: Marc Zyngier In-Reply-To: <1574233128-28114-2-git-send-email-yash.shah@sifive.com> References: <1574233128-28114-1-git-send-email-yash.shah@sifive.com> <1574233128-28114-2-git-send-email-yash.shah@sifive.com> Message-ID: <5ec51559d8b4cd3b8e80943788b52926@www.loen.fr> X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/0.7.2 X-SA-Exim-Connect-IP: X-SA-Exim-Rcpt-To: yash.shah@sifive.com, linus.walleij@linaro.org, bgolaszewski@baylibre.com, robh+dt@kernel.org, mark.rutland@arm.com, palmer@dabbelt.com, paul.walmsley@sifive.com, aou@eecs.berkeley.edu, tglx@linutronix.de, jason@lakedaemon.net, bmeng.cn@gmail.com, atish.patra@wdc.com, sagar.kadam@sifive.com, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, sachin.ghadi@sifive.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191120_023906_344475_882B53A0 X-CRM114-Status: GOOD ( 13.95 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, aou@eecs.berkeley.edu, jason@lakedaemon.net, atish.patra@wdc.com, Sachin Ghadi , linus.walleij@linaro.org, linux-kernel@vger.kernel.org, bgolaszewski@baylibre.com, robh+dt@kernel.org, palmer@dabbelt.com, Sagar Kadam , linux-gpio@vger.kernel.org, "Paul Walmsley \( Sifive\)" , tglx@linutronix.de, bmeng.cn@gmail.com, linux-riscv@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org On 2019-11-20 06:59, Yash Shah wrote: > Add a new function irq_domain_translate_onecell() that is to be used > as > the translate function in struct irq_domain_ops for the v2 IRQ API. > > Signed-off-by: Yash Shah > --- > include/linux/irqdomain.h | 5 +++++ > kernel/irq/irqdomain.c | 20 ++++++++++++++++++++ > 2 files changed, 25 insertions(+) > > diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h > index 583e7ab..cad9eb8 100644 > --- a/include/linux/irqdomain.h > +++ b/include/linux/irqdomain.h > @@ -426,6 +426,11 @@ int irq_domain_translate_twocell(struct > irq_domain *d, > unsigned long *out_hwirq, > unsigned int *out_type); > > +int irq_domain_translate_onecell(struct irq_domain *d, > + struct irq_fwspec *fwspec, > + unsigned long *out_hwirq, > + unsigned int *out_type); > + > /* IPI functions */ > int irq_reserve_ipi(struct irq_domain *domain, const struct cpumask > *dest); > int irq_destroy_ipi(unsigned int irq, const struct cpumask *dest); > diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c > index 132672b..6972a48 100644 > --- a/kernel/irq/irqdomain.c > +++ b/kernel/irq/irqdomain.c > @@ -987,6 +987,26 @@ const struct irq_domain_ops > irq_domain_simple_ops = { > EXPORT_SYMBOL_GPL(irq_domain_simple_ops); > > /** > + * irq_domain_translate_onecell() - Generic translate for direct one > cell > + * bindings > + * > + * Device Tree IRQ specifier translation function which works with > one cell nit: the whole point of the 'new' translate function is that they are firmware-agnostic. Just drop the DT reference here. > + * bindings where the cell values map directly to the hwirq number. > + */ > +int irq_domain_translate_onecell(struct irq_domain *d, > + struct irq_fwspec *fwspec, > + unsigned long *out_hwirq, > + unsigned int *out_type) > +{ > + if (WARN_ON(fwspec->param_count < 1)) > + return -EINVAL; > + *out_hwirq = fwspec->param[0]; > + *out_type = IRQ_TYPE_NONE; > + return 0; > +} > +EXPORT_SYMBOL_GPL(irq_domain_translate_onecell); > + > +/** > * irq_domain_translate_twocell() - Generic translate for direct two > cell > * bindings > * Can you please also update (potentially in a separate patch) the potential users of this? I mentioned the nvic driver last time... Thanks, M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv