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=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_MUTT 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 8B7E3C004E6 for ; Thu, 27 Jun 2019 20:44:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F8C32075E for ; Thu, 27 Jun 2019 20:44:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="OaT98Ymw"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="X54MxjAh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726426AbfF0Uof (ORCPT ); Thu, 27 Jun 2019 16:44:35 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:44704 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726384AbfF0Uoe (ORCPT ); Thu, 27 Jun 2019 16:44:34 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 85AA66085C; Thu, 27 Jun 2019 20:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1561668273; bh=fqJngYFZovJRH4LMJ9rXXIBSC2Q0Q4+IE1S7MgXNT2o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OaT98YmwswqhoFLvu9AAkYbhBabxkEqrBa1LHx48b2kTEb8B2k/7AFB5jGrrHc67S 4yjpnpKOq6iSe/VPgWnABZVlIG0rfFpLFmtn35NzTuLGgfEZPu3Ol5s3kyXuFRhxaM q991sETK0apliQ7J977RqXAdzq08EGCDyXAq5Kvo= Received: from localhost (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ilina@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 73A396085C; Thu, 27 Jun 2019 20:44:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1561668272; bh=fqJngYFZovJRH4LMJ9rXXIBSC2Q0Q4+IE1S7MgXNT2o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X54MxjAhz2wrbSvg/wIVYblS4krMWyFR1F95IWCZUV44O9np7mvGW/0bSdpNVjFj+ /hLSy/wzJVuHkdqSMf9WS8+2Hj+w13qxo0AQ3f4d8BneNI5T4AqMykeLNSKO3+4x21 XRDk/bsNuclyJzCYcEEkHPnMUurA8J6ka0LCwFW0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 73A396085C Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=ilina@codeaurora.org Date: Thu, 27 Jun 2019 14:44:31 -0600 From: Lina Iyer To: Linus Walleij Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski , Thomas Gleixner , Marc Zyngier , Jon Hunter , Sowjanya Komatineni , Bitan Biswas , linux-tegra@vger.kernel.org, David Daney , Masahiro Yamada , Brian Masney , Thierry Reding Subject: Re: [PATCH 1/4 v1] gpio: Add support for hierarchical IRQ domains Message-ID: <20190627204431.GA24030@codeaurora.org> References: <20190624132531.6184-1-linus.walleij@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190624132531.6184-1-linus.walleij@linaro.org> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Mon, Jun 24 2019 at 07:29 -0600, Linus Walleij wrote: >+static const struct irq_domain_ops gpiochip_hierarchy_domain_ops = { >+ .activate = gpiochip_irq_domain_activate, >+ .deactivate = gpiochip_irq_domain_deactivate, >+ .translate = gpiochip_hierarchy_irq_domain_translate, >+ .alloc = gpiochip_hierarchy_irq_domain_alloc, >+ .free = irq_domain_free_irqs_common, >+}; >+ >+static int gpiochip_hierarchy_add_domain(struct gpio_chip *gc) >+{ >+ if (!gc->irq.parent_domain) { >+ chip_err(gc, "missing parent irqdomain\n"); >+ return -EINVAL; >+ } >+ >+ if (!gc->irq.parent_domain || >+ !gc->irq.child_to_parent_hwirq || >+ !gc->irq.fwnode) { >+ chip_err(gc, "missing irqdomain vital data\n"); >+ return -EINVAL; >+ } >+ >+ gc->irq.domain = irq_domain_create_hierarchy( >+ gc->irq.parent_domain, >+ IRQ_DOMAIN_FLAG_HIERARCHY, >+ gc->ngpio, >+ gc->irq.fwnode, >+ &gpiochip_hierarchy_domain_ops, This should probably be used only if gc->irq.domain_ops is not set. >+ gc); >+ >+ if (!gc->irq.domain) { >+ chip_err(gc, "failed to add hierarchical domain\n"); >+ return -EINVAL; >+ } >+ >+ gpiochip_set_hierarchical_irqchip(gc, gc->irq.chip); >+ >+ chip_info(gc, "set up hierarchical irqdomain\n"); >+ >+ return 0; >+} >+ Thanks, Lina