Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6116514imm; Mon, 27 Aug 2018 09:58:12 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaZHFuU5Vr39Yh173+XJenRUWSyKyMDNnGAJ0fg8x0ghELC9xxt0dlvdQZ3oKCkSnsw05kX X-Received: by 2002:a17:902:9a48:: with SMTP id x8-v6mr13977256plv.72.1535389092213; Mon, 27 Aug 2018 09:58:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535389092; cv=none; d=google.com; s=arc-20160816; b=MiTYwGp8I+8QDOPxeNjOZdGLGDkGH4wnl6qqPALgI3tks4mer+QO0tNzpHOvRaCBUX pIyQJr3Ma51kV+kAf6cMNppJKvLkQ+ywUzt6MLweWBH3OeWcuihu7T45WLG6+TObkZWn XboMp/KyO761yC3HxBWiiAXRbVlei/M0e3P7SxeWcDM5nEdhE0l+xOdGXFVDM+5g7zAd DAZeoaBEcyOR3ObxYGQhnM2NYYNHO8TOVzFZElZdzrl9xxaB6i69INjl7DgCN++TIhlI nzzJyJ9XYrBXcQ9Fr1vSXac/LSo5aY7ZgD5cL5n5QyibBmRrgX3QuUb99BNPoGVn+83C iwTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=swShwai1QiHOIy40fDw2A7rwJVKsHxpyXt9OkssIOTU=; b=d979jlPnxuKWJJwPGXCohJaKBGP7NYcT8RHkS5b7MMwi9DSmE/nVyagLMktNdVZ/Mz 5PupKdJMyL7PbyB+EzYwhaZ1xvEdoepdqAmE6vw6+XHHzsv+aMoKCFYQa3xox+DsnqlI lRYDTcQSo+mmqnYRBWTRbCyE67XAGjyjjPuXGQtovvBPYxSgZjRQiYNpinQAQ/P3sQU2 SyAR9eIoT8aJ0p2WchE/vEgu8zyELrE3lhmwL5RdZjulDPxsjhuff/40IoYwcN1hdEn0 6FSj0fViNklc4IrdZ8Eu7hTxW/Ks2NRLIByiw1aZijBR8QjGi2Ubh35jjqYR/gyJUPlG VjxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=lVazhHuK; dkim=pass header.i=@codeaurora.org header.s=default header.b="Q0k/PlI4"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 15-v6si15106291pld.157.2018.08.27.09.57.55; Mon, 27 Aug 2018 09:58:12 -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=@codeaurora.org header.s=default header.b=lVazhHuK; dkim=pass header.i=@codeaurora.org header.s=default header.b="Q0k/PlI4"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727340AbeH0UoM (ORCPT + 99 others); Mon, 27 Aug 2018 16:44:12 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:40672 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726994AbeH0UoL (ORCPT ); Mon, 27 Aug 2018 16:44:11 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C7DC7606DD; Mon, 27 Aug 2018 16:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1535389006; bh=8NyyRTX0SX7D0UuHcHWq80gYnbGevPxQyCdSMXAbQp8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lVazhHuKiysfCc760/2rJJ5yrJpG41mFW/3y5Ix2lgCjvcqwzbqAa9nhiTMJnIoMn hCKaRcnZFnsPTgbGnfpMgUhL057psMv9PTdqf+LyyzWJPR3HzRjHU2QPt8vBM4ebdE CSdcNOOF298r/+yO3NNi010W3RcctSa/26oyJRy0= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 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 9E62760271; Mon, 27 Aug 2018 16:56:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1535389005; bh=8NyyRTX0SX7D0UuHcHWq80gYnbGevPxQyCdSMXAbQp8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Q0k/PlI4TOsazhVLLxI7jIBp4/cQ0J8AvnANPm89Pnw7sGKu88fJIFxhcV9cribdp Ye7kG1PwyfbqgglSCgxhuIs5iS1ULRhCfWaHu0iVzTL7y+xNb31djW4le7GRXIOTpX AF9h7GGYk8AyvybiLQkoWaG2xIim1HzhA860YK8U= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9E62760271 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: Mon, 27 Aug 2018 10:56:44 -0600 From: Lina Iyer To: Linus Walleij Cc: Hans Verkuil , Hans Verkuil , Marc Zyngier , Bjorn Andersson , Stephen Boyd , evgreen@chromium.org, rplsssn@codeaurora.org, "linux-kernel@vger.kernel.org" , linux-arm-msm@vger.kernel.org, Rajendra Nayak , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Andy Gross , Doug Anderson Subject: Re: [PATCH v2 1/5] drivers: pinctrl: qcom: add wakeup capability to GPIO Message-ID: <20180827165644.GR5081@codeaurora.org> References: <20180817163849.30750-1-ilina@codeaurora.org> <20180817163849.30750-2-ilina@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 26 2018 at 08:33 -0600, Linus Walleij wrote: >On Fri, Aug 17, 2018 at 6:39 PM Lina Iyer wrote: > >> QCOM SoC's that have Power Domain Controller (PDC) chip in the always-on >> domain can wakeup the SoC, when interrupts and GPIOs are routed to the >> its interrupt controller. Only select GPIOs that are deemed wakeup >> capable are routed to specific PDC pins. During low power state, the >> pinmux interrupt controller may be non-functional but the PDC would be. >> The PDC can detect the wakeup GPIO is triggered and bring the TLMM to an >> operational state. >> >> Interrupts that are level triggered will be detected at the TLMM when >> the controller becomes operational. Edge interrupts however need to be >> replayed again. >> >> Request the corresponding PDC IRQ, when the GPIO is requested as an IRQ, >> but keep it disabled. During suspend, we can enable the PDC IRQ instead >> of the GPIO IRQ, which may or not be detected. >> >> Signed-off-by: Lina Iyer >> --- >> Changes in v1: >> - Trigger GPIO in h/w from PDC IRQ handler >> - Avoid big tables for GPIO-PDC map, pick from DT instead >> - Use handler_data > >Just for the record this is an impressive and much needed patch >set, no other SoC developer has yet taken on the task of making this >work so I very much appreciate that Qualcomm show the way. > >> +static int msm_gpio_pdc_pin_request(struct irq_data *d) >> +static int msm_gpio_pdc_pin_release(struct irq_data *d) >> +static int msm_gpio_irq_reqres(struct irq_data *d) >> +{ >(...) >> + if (gpiochip_lock_as_irq(gc, irqd_to_hwirq(d))) { >(...) >> +static void msm_gpio_irq_relres(struct irq_data *d) >> +{ >> + gpiochip_unlock_as_irq(gc, irqd_to_hwirq(d)); >> +} > >FYI Hans Verkuil is working on a patch set that moves the >lock/unlock as IRQ call to the irqchip request() and release() >functions so we can switch a GPIO irqchip line from IRQ >mode to say output at runtime without too much trouble. >(CEC needs this.) > Thanks, I will look into Hans's RFCv2. But what would help me would be to avoid creating the IRQ for the GPIO itself (I have the latent IRQ), if I could just return that instead in gpio_to_irq(), it might be easier. I understand ->to_irq() is supposed to be a translate function only, I can avoid the dance of enabling and diabling the PDC IRQ on suspend and resume. -- Lina >I suspect that will make your work easier? > >Hans can you include Lina in the loop for your patches >so she can take that into accoun because I think we might >need that as a base for this. > >Yours, >Linus Walleij