Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1765037ybc; Wed, 20 Nov 2019 03:50:02 -0800 (PST) X-Google-Smtp-Source: APXvYqw6LAVzjfaO2tMbd5TuyXD8vTjHCS/xrql+GHHo2rUFxQMz4qptsUKZ7/xwARFaTuwiSBa0 X-Received: by 2002:a17:906:600b:: with SMTP id o11mr4819942ejj.175.1574250602082; Wed, 20 Nov 2019 03:50:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574250602; cv=none; d=google.com; s=arc-20160816; b=UJi75dJjyE16hnHRSnk9kZQpwqgQsOqCiArPIPoQQODs9ehBvXckEvUmtoaPM3eamY SJ0hxpjZP8kVmxIz8+EUXF1G8RskUKNNWMZnrhuz8jU7q5vApY1Ky6v0S4zckyt8gfN4 Dp8r9EBkigQq9J3kLAfNNQagfcupdd6NgJ4mrPybCF+y+spcpKnSrR23t+sP56oxy7RR 6r4efy+k7zDfvLIZkO5BYFJuUkoM2vAmzc2rjA43H/feqmKuSDYkePdKVmcfkw1Sz0w9 TQxsW4kGkrNMB0ezwdazVX3lz83x6vwXTCB1HshDH+j22acUbr40Uhzs0EwcDCfavfOX vueQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:cc:from:date:content-transfer-encoding:mime-version :subject:to; bh=FSvjkxt/IJeNcgeCGnfleLc28A5StBb4yqaZdvsH9h0=; b=o0N+vWPny3iWctyFvKdYZOsF9Yoq+iibQKwbORxTxnl5keP6nTPxAfPND5ev3M8V77 exg4oxQ/ZybEJD34adnQ4vQtlTK66Q6SUK7kjNh1ciheAXNI+PjNKPUclUiADpuW82qK dzBwx3BEb5YO+J4pzuhbh5Qy3p/HtMEP9PxbpPOOvzN9XQrVYp0VSaq3qP3I6ENa97a1 CIFGQJFj4vTGjN/sNwTgdUjNLbUXMJ7rzFP4bj1Ckhn20uqH1rbjkJVA43zdJYWwYvMI hB5o/Mtl/wW/Y/jlBpD4lIIm/i4l+Vrc/qh/XGsGokHrbg2IiHbzwb6M0Hu6Tzuni7Ps x4Cw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si15548010ejy.365.2019.11.20.03.49.36; Wed, 20 Nov 2019 03:50:02 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728665AbfKTKjI (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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...