Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4401799yba; Wed, 17 Apr 2019 10:39:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXQ243TkihR730mTQdeyyT4OWPc4b/wSC06Q5ZYB91sTWcn0Zhir27mN0x0E0TFOgL2Ns3 X-Received: by 2002:a63:c23:: with SMTP id b35mr82599345pgl.298.1555522794517; Wed, 17 Apr 2019 10:39:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555522794; cv=none; d=google.com; s=arc-20160816; b=e9QUDqa+r6YTCidKxBxIgXF0yb7BZrwI7zh82p7lOY9EsfWZXRyDIDsKKzfkYeNid/ le/3UEBx69R31xqnu4HQUVfsmTTO6wHx9bnvW+bdI2q84yMwDD8e3hY2EvwwBL9pREWd WZ7It0oJaNdi+K/SkyXzc0AC/S3Zny91mgHC9SfaiqKL8RLvKi6qZkUHB7f/jWaNwGAx 21TZUnNPBofI7p1O92naAJyFIEQIBFzwz0sOnL0RRB1ooBKWMEpY5GhYsfeRlGSYx3K4 EmiTPH+XVGab64D4qn6HM0WB46FNaNvArOj2emM5m5Fqw4Et1Rk7fECDg9NCooxrNtIg S4KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NyMyLpFzUvqjrCI5PfsxatUNaANGE/GxQwSe6mOnjeE=; b=SSk4C1rfq5+UkEEFIK+H2qP2vatHW159q7hkoy7DHFDtLc6WMkahtqN3ZI9dBQA+so zEv6I7Sgl6lCDAyWcAF+xvh6TyWkQa50oG7wD2vRwWSN8ZDhGW+FbnwZxSs37A1aLuCE kjP5qHlHX3TTfs7IrXPPewDJ7gCPcjj7vYEmCm3ngD7lajLvA1fJ2hZrScdh8OFVVchr IQQMHgdd/72CdC3TcZd3DBvymRPuo4RJokW6sSeMkiWRb4QJNr6QUdaIwELjS/A7iuj2 SHU8HtRtz1fsbw26cA+TVLvYLHZOvAi46Y2eKjShd7CEaBQiYqR7i9n+6Ltou7Y4kBoB Q/xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WxK5Shjo; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a22si52280271pfc.217.2019.04.17.10.39.38; Wed, 17 Apr 2019 10:39:54 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=WxK5Shjo; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733088AbfDQRi0 (ORCPT + 99 others); Wed, 17 Apr 2019 13:38:26 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:44343 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729641AbfDQRiZ (ORCPT ); Wed, 17 Apr 2019 13:38:25 -0400 Received: by mail-qk1-f194.google.com with SMTP id y5so14842817qkc.11 for ; Wed, 17 Apr 2019 10:38:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NyMyLpFzUvqjrCI5PfsxatUNaANGE/GxQwSe6mOnjeE=; b=WxK5Shjo0AblZGGwkBXiJ/taEiCHHvZyVDSvM9GQ1YkoV5W0ChIZOTDTTIlkDXnfpV Wq1OuElEuDxMCdYDA1ohIRVAdjSIX6/gCIXB+1RYHkEoLF4ii2mv1QpwKh+Y/20ii3hf zqPR9tmCfkyRVEoHmIpy+aWN8ox4Sx8Oul+QZ/aam1wgIBYMz7xnvGndmqCfT9kbAYlf emzfVNz4saaDB6Z4DvI5m9TinzqkqAj1nly4lMZ2NjCxYVmU8a5538P5G9B+P/BytGG3 Y9FgC+TIvOvsvTBlphNK1YXp0EEXCMQ27saqbbaylq/zmYAMVtx11rZbcams1aS/uxfP TgXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NyMyLpFzUvqjrCI5PfsxatUNaANGE/GxQwSe6mOnjeE=; b=tRYIwU8oHw+47+AmSHuxxMxj9v4xKTmhzuaTtAdYtYAUFCDEZze/XwODpt5FSB1siS ea7+NA/qfS4snLqR1TD0uCnBqAVFWkSy8nEG7wbDn0BJfLYGIH6UwDZ7U+EggBbf2CbZ km67U1WslG4M++r83vMLjVIEJPhTup/v5CmJR/h8DGXami6vfAhhsYRs3DJY+bowK/YV iGs/oOB8af6A5FnTUb0k8rn1gk3n+a5oFZM12ttcGxCxtRF07NBxolTRRkXZjIvsFqcb nNG1oG/fg/gy1woi5NTJi28LPEpWe6tJTrv2PDSY4wqTT3c2NKxiEvDyH2ZTfZhLDrQ2 V7eg== X-Gm-Message-State: APjAAAVhny6uKtfP8vgd+M4Xge0nOa23jQ5kY1//iSrRpfBsdnkae+8X goqG5LKAn27m71cjsyXD+nejyGCFOetGdtrc2+0fqg== X-Received: by 2002:a05:620a:166b:: with SMTP id d11mr69408158qko.1.1555522704751; Wed, 17 Apr 2019 10:38:24 -0700 (PDT) MIME-Version: 1.0 References: <20190313211844.29416-1-ilina@codeaurora.org> <20190313211844.29416-8-ilina@codeaurora.org> <155266731117.20095.4543997300651173812@swboyd.mtv.corp.google.com> <20190417160813.GE16124@codeaurora.org> In-Reply-To: <20190417160813.GE16124@codeaurora.org> From: Linus Walleij Date: Wed, 17 Apr 2019 19:38:12 +0200 Message-ID: Subject: Re: [PATCH v4 07/10] drivers: pinctrl: msm: setup GPIO irqchip hierarchy To: Lina Iyer Cc: Stephen Boyd , Evan Green , Marc Zyngier , "linux-kernel@vger.kernel.org" , rplsssn@codeaurora.org, linux-arm-msm@vger.kernel.org, "thierry.reding@gmail.com" , Bjorn Andersson , Doug Anderson Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 17, 2019 at 6:08 PM Lina Iyer wrote: > I am thinking of something like this. Would there be any issue in > setting the type to IRQ_TYPE_SENSE_MASK instead of any one particular > type? > > ---8<----- > static int gpiochip_to_irq(struct gpio_chip *chip, unsigned offset) > { > #ifdef CONFIG_OF_GPIO > struct irq_fwspec fwspec; > > if (chip->of_node) { > fwspec.fwnode = of_node_to_fwnode(chip->of_node); > fwspec.param[0] = offset; > fwspec.param[1] = IRQ_TYPE_SENSE_MASK; > fwspec.param_count = 2; > return irq_create_fwspec_mapping(&fwspec); > } > #endif > > if (!gpiochip_irqchip_irq_valid(chip, offset)) > return -ENXIO; > > return irq_create_mapping(chip->irq.domain, offset); Isn't the real problem that irq_create_mapping() isn't already doing this for you? chip->irq.domain is created with irq_domain_add_simple() and after Thierrys patch with irq_domain_add_hierarchy(), so I think it is simply that the hierarchical irqdomain helper code needs to go deeper here. gpiolib needs struct irq_domain_ops for the hierarchical irqdomain which implements generic versions of .translate(), .alloc() and .free(). I am working on this... albeit slowly :/ Yours, Linus Walleij