Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4011577ybg; Tue, 29 Oct 2019 00:24:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwftkAIqf0q1NY1RHvbu78nNneusN9iMMiB6aoWLw/zKYcj6lGuPPXKlQY/2kpddbFlpSmq X-Received: by 2002:a50:f74b:: with SMTP id j11mr5957202edn.71.1572333890799; Tue, 29 Oct 2019 00:24:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572333890; cv=none; d=google.com; s=arc-20160816; b=WEULKbv33vU37sDLBIlqzaJ3BhTlk30q0u09vCsGnxP+zkgN49DJda3RHP2HJE5BWC NaPPPX9XkjN0ncXTH6b0iVoufpyeN75Roqtphcll1Ur4c8D5EuUB9vDJfYGlvjp5pb5g EAXIEtd+9N5wE0rymxkbjJdLZmgankCf1sfkzBj3R9kLym9BYF6h2sdvWTo5VscU9ra3 LunVf10oew0HwDhslcfWjeyZqQAxw6wQYh/T0BZ04LauNSlgXmU7rbV99A30NZ1a6Lup bjCTG1oNPqq0CB9TrQ4brqmuGJ+f+kYvsjW7ABvYOE3YPPHxoSbIym1CzZXi78MABuXl wUfQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=8w3+F/NRSYuWbxpxqVHy506WX7nChC3gJ2i3v/zu854=; b=QPgm3Y0bJXmDDZmDFBmKQvmi3Nn5rkNDdUzSHdgqD7RMgincZyt+piH1ewt+C6QdSD 4orLq4GgzfaodyZAil0vcDXf9Cc7vl9wf5Ak02WjA8AtZB4AmEeT3YtPODsO1HyqeoTK YsShMbUTTAsMK/q6gDvIjN9sZRLGejYaUhoYQjcZTQ/XQPlSQL7UD2kAYjZgebx0l5xr QZqXOFe6sJcPFuQaeD3DLC4pdxm2pMLKHyP6JdfV53870YNvTxodZZA5y/YzCJgnr7ww Ka39qEc94c0SUIECpNo5RP8P9XzK3NtYBnlhqpqF6z+b69WcYLtAe1ZcM4MF1Mam+YzK AjSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=G1vRPXC7; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21si9052742edd.204.2019.10.29.00.24.27; Tue, 29 Oct 2019 00:24:50 -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=@gmail.com header.s=20161025 header.b=G1vRPXC7; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730394AbfJ2ESJ (ORCPT + 99 others); Tue, 29 Oct 2019 00:18:09 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:34330 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725830AbfJ2ESJ (ORCPT ); Tue, 29 Oct 2019 00:18:09 -0400 Received: by mail-pf1-f194.google.com with SMTP id b128so8592106pfa.1; Mon, 28 Oct 2019 21:18:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=8w3+F/NRSYuWbxpxqVHy506WX7nChC3gJ2i3v/zu854=; b=G1vRPXC7mR/Hj3dOxKE0LnRjqCjOasSMLljE/JM3jCD1T+ALipbaQynyQs/p98r9WA RqeXtRuN3icbtDgKVriE585SkM8cwktgDfVMKt1WfURjxYPONABim6t/JLtyuscTIL+m yHTz5xJJrAxUWhdzfR8Kr2AwNgXPzT6aXxLff+Nz4CLFv6VGh0dFjTcZDg1aTI5Qvxax 79HMixohdwwOXdf5ajRdU7zaRFRxup8Y7twrnKPYjGuD9lidXEMJdPcgQOejYTvJULsJ afsFo0dOnkGbPvSOKXoigUHzybOe8IjEisgQgV6ifxbbRlNoVl5Umzs17pgtPrlvg8rS KHQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=8w3+F/NRSYuWbxpxqVHy506WX7nChC3gJ2i3v/zu854=; b=nH2c6iKhczcE8xocT8VFkzBntAIBGvxI8/TzkAUmPPPWYrZasoJC5fEEbT08avmbou yvrhC1HTPwPprHXd4BRgggbw/ZWI4WGo33Ls46CTZ01cwOoIdsG7soWNMCweRAnBoRD4 kSvQzAT7G/+nxmpx5+yYdYs52n4WkTh9Z4OfRhac6uA+Q1rxbRs5uO9bEaZS7saf5Do9 pFIxUj6/xmND/tmrWuMJBLalVV70KtZ4iIXJAYhRZGxsbLTJrDj3JzHSOHc1Q/s8ipO+ tbb418qoVo349Y0xLShXD/01JLTrx18zep3VvuCbXt+dKJ25CoigpJlBSTnVxbtnj6SP UC3Q== X-Gm-Message-State: APjAAAUpR5eyNB+wih4Had+leTs6Z4eK/tNq1+ilj4Il5d9MbMcUzi5N 735NyIfjQu/4mH8KUVIAyA0= X-Received: by 2002:a63:4d0d:: with SMTP id a13mr20138350pgb.451.1572322688343; Mon, 28 Oct 2019 21:18:08 -0700 (PDT) Received: from dtor-ws ([2620:15c:202:201:3adc:b08c:7acc:b325]) by smtp.gmail.com with ESMTPSA id f17sm14072917pgd.8.2019.10.28.21.18.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 21:18:06 -0700 (PDT) Date: Mon, 28 Oct 2019 21:18:04 -0700 From: Dmitry Torokhov To: linux-sunxi@googlegroups.com, Hans de Goede , Maxime Ripard , Chen-Yu Tsai , "open list:SUN4I LOW RES ADC ATTACHED TABLET KEYS DRIVER" , "moderated list:ARM/Allwinner sunXi SoC support" , open list Subject: Re: [linux-sunxi] Re: [PATCH] input: sun4i-lradc-keys: Add wakup support Message-ID: <20191029041804.GF57214@dtor-ws> References: <20191028221502.3503543-1-megous@megous.com> <20191028233828.GA57214@dtor-ws> <20191028235626.5afvszxtppsieywi@core.my.home> <20191029001250.GB57214@dtor-ws> <20191029014559.gif3ay7anq24un2i@core.my.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191029014559.gif3ay7anq24un2i@core.my.home> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 29, 2019 at 02:45:59AM +0100, Ondřej Jirman wrote: > On Mon, Oct 28, 2019 at 05:12:50PM -0700, Dmitry Torokhov wrote: > > On Tue, Oct 29, 2019 at 12:56:26AM +0100, Ondřej Jirman wrote: > > > On Mon, Oct 28, 2019 at 04:38:28PM -0700, Dmitry Torokhov wrote: > > > > > + > > > > > + error = dev_pm_set_wake_irq(dev, irq); > > > > > + if (error) { > > > > > + dev_err(dev, "Could not set wake IRQ\n"); > > > > > + return error; > > > > > + } > > > > > + > > > > > > > > I wonder if we could teach platform driver core to handle this for us. > > > > > > Not sure, some drivers do enable/disable wake_irq by hand in suspend/resume > > > callbacks, so it would probably need to be opt-in somehow. I guess calling the > > > function like this is one way to make it opt-in. > > > > > > The other way may be by passing a flag somewhere, like to > > > request_threaded_irq. Did you have something more concrete in mind? > > > > I think it is perfectly fine to continue using enable_irq_wake and > > disable_irq_wake from the driver while marking irq as being wake irq > > form the core. > > I see, it looks like irq_set_irq_wake will track the calls via wake_depth > > https://elixir.bootlin.com/linux/latest/source/kernel/irq/manage.c#L714 > > But all irqs are not necessarily wake irqs, no? So it still may need to be > opt-in somehow. I thought we'd do that for IRQ named "wakeirq" or the very first IRQ if there is no named IRQ, and when we have the "wakeup-source" property, similarly to what we do in I2C bus. Thanks. -- Dmitry