Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1709049ybc; Wed, 20 Nov 2019 02:55:20 -0800 (PST) X-Google-Smtp-Source: APXvYqyRsz0IuDooDmkBelAKhVKLNdg+J7oSGgy+TTjXcYSoxpGc/Oo3Wzf5bIZi04SCmhrKXHsi X-Received: by 2002:a17:906:1354:: with SMTP id x20mr4689595ejb.131.1574247319941; Wed, 20 Nov 2019 02:55:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574247319; cv=none; d=google.com; s=arc-20160816; b=bnORCsVHCr3Hq8X5Fz7yVbLxXFVC1uqJhh23r5kz39GqgGpFmV3vK5y5ko4vi2ZLPu G1k1ccf3jTYPHOd6J9IU3uGmSTlKd2QxHmYJBgybGaN2GwfuV1hSkPRv8ppt27d13fa3 8ibut2lE5N6Yp3H5/TaP9V4bTztAIDuXjb8C3/WvFIHSA7pXhXwaKA9wNssZzBkYYjlc vksZKf+u2qWgol3tNzB9FKmaoR11JDH3a/dce6OkTcy+07kjkof2DaTxAPmIwstC5gEQ Jj808y9Hrm5IL6EZ2QbaA6KeGcp/sE1noWvQo/HEl8KgBdSY3Njwi94ZFGYRSpZD2jMK SIGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=LWWRhy/lpXdd9bV82IQuNm3MZLLMYYJ/OUP40MCCNdg=; b=mzkhMVmJkNWsOh8wxjonZDwgWR7+aDpItA8Iddad4Oq0MpwuulIbPkxMM4FFLf+1JJ Ifgi51S44WGNkRAiObJg1rhs0tuy+16VSVb3qfCje5igS0C9AuOLzCOZoO3K8UhCMrFy TKRR9Ntr7jhn8gZqJttKGAKCzr8CPZwfDOcF1lhdkr1BVSrVQZlqJLpiwjApbEsQX/n+ qzmIgVuv0LKdPKssVcov0+LNyq2+5JtPd1Igug6RaFn2n1HxT3lUuMraQsDn6v/HxY/7 i81iyW3p2lBIohjtZqAMsWPmVYPCLzK3lpMr83Y3U0fhHN+DrD7dfsgtubZYUAuyraVE qKeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kemnade.info header.s=20180802 header.b=I1H46Glz; 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 q24si15447251eju.127.2019.11.20.02.54.54; Wed, 20 Nov 2019 02:55:19 -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; dkim=fail header.i=@kemnade.info header.s=20180802 header.b=I1H46Glz; 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 S1727590AbfKTINr (ORCPT + 99 others); Wed, 20 Nov 2019 03:13:47 -0500 Received: from mail.andi.de1.cc ([85.214.55.253]:47884 "EHLO mail.andi.de1.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbfKTINq (ORCPT ); Wed, 20 Nov 2019 03:13:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20180802; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=LWWRhy/lpXdd9bV82IQuNm3MZLLMYYJ/OUP40MCCNdg=; b=I1H46GlzNLXpblyByzjT1hngZe CcPjWAUN1cbWjSTkDyCV26LegUD6TofHxCmFyMrA1sr+ptakpCwr7m6AiXiwTQHCpM4KJDodBfYpU x+105eQrWAaLedlMt3+osfqfAWmVajgv+twyofmSLm29i0Lzci1sikGyS1PJZl0EI7u0=; Received: from leintor.e.ffh.zone ([81.3.6.94] helo=localhost) by mail.andi.de1.cc with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iXL7O-0002z6-B7; Wed, 20 Nov 2019 09:13:42 +0100 Received: from [::1] (helo=localhost) by localhost with esmtp (Exim 4.89) (envelope-from ) id 1iXL7M-0001HN-8c; Wed, 20 Nov 2019 09:13:40 +0100 Date: Wed, 20 Nov 2019 09:13:39 +0100 From: Andreas Kemnade To: Pierre-Hugues Husson Cc: Lee Jones , a.zummo@towertech.it, alexandre.belloni@bootlin.com, linux-kernel , linux-rtc@vger.kernel.org, b.galvani@gmail.com, stefan@agner.ch, letux-kernel@openphoenux.org Subject: Re: [PATCH v2 2/5] mfd: rn5t618: add irq support Message-ID: <20191120091339.4de02ad0@kemnade.info> In-Reply-To: References: <20191031213835.11390-1-andreas@kemnade.info> <20191031213835.11390-3-andreas@kemnade.info> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; i686-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: -1.0 (-) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 20 Nov 2019 08:54:44 +0100 Pierre-Hugues Husson wrote: [...] > > > > +static int __maybe_unused rn5t618_i2c_suspend(struct device *dev) > > +{ > > + struct rn5t618 *priv = dev_get_drvdata(dev); > > + > > + if (priv->chip_irq) > > + disable_irq(priv->chip_irq); > > + > > + return 0; > > +} > > + > > +static int __maybe_unused rn5t618_i2c_resume(struct device *dev) > > +{ > > + struct rn5t618 *priv = dev_get_drvdata(dev); > > + > > + if (priv->chip_irq) > > + enable_irq(priv->chip_irq); > > + > > + return 0; > > +} > > For what it's worth, the boards I have (Archos 101 Oxygen and Pipo P9) > with rc5t619 use GPIO for power button. > So IRQ would need to be enabled in suspend for this to work. > Also, since you actually added alarm support, perhaps you want to > wake-up from suspend using alarm as well? > Already tested that, that works, because device_init_wakeup() is used. disable_irq() is needed because we cannot do i2c that early after resume. Other mfd drivers do thas as well and waking up works. Regards, Andreas