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_SANE_2 autolearn=no 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 6E797C43215 for ; Wed, 20 Nov 2019 08:13:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4676D219FA for ; Wed, 20 Nov 2019 08:13:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kemnade.info header.i=@kemnade.info header.b="I1H46Glz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727696AbfKTINr (ORCPT ); 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 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