From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chanwoo Choi Subject: Re: [PATCH v3 2/4] mfd: max8997: handle IRQs using regmap Date: Tue, 18 Mar 2014 18:52:37 +0900 Message-ID: <53281765.3080602@samsung.com> References: <1394703532-494-1-git-send-email-r.baldyga@samsung.com> <1394703532-494-3-git-send-email-r.baldyga@samsung.com> <53218C30.9000707@samsung.com> <5322BEDF.4080408@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-reply-to: <5322BEDF.4080408@samsung.com> Sender: linux-leds-owner@vger.kernel.org To: Robert Baldyga Cc: sameo@linux.intel.com, lee.jones@linaro.org, myungjoo.ham@samsung.com, dmitry.torokhov@gmail.com, cooloney@gmail.com, rpurdie@rpsys.net, dbaryshkov@gmail.com, dwmw2@infradead.org, lgirdwood@gmail.com, broonie@kernel.org, a.zummo@towertech.it, paul.gortmaker@windriver.com, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, rtc-linux@googlegroups.com, m.szyprowski@samsung.com, k.kozlowski@samsung.com List-Id: linux-input@vger.kernel.org On 03/14/2014 05:33 PM, Robert Baldyga wrote: > On 03/13/2014 11:45 AM, Chanwoo Choi wrote: >> Hi Robert, >> >> On 03/13/2014 06:38 PM, Robert Baldyga wrote: >>> This patch modifies mfd driver to use regmap for handling interrupts. >>> It allows to simplify irq handling process. This modifications needed >>> to make small changes in function drivers, which use interrupts. >>> >>> Signed-off-by: Robert Baldyga > > (...) > >>> @@ -468,8 +560,11 @@ static int max8997_suspend(struct device *dev) >>> struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); >>> struct max8997_dev *max8997 = i2c_get_clientdata(i2c); >>> >>> - if (device_may_wakeup(dev)) >>> - irq_set_irq_wake(max8997->irq, 1); >>> + if (device_may_wakeup(dev)) { >>> + enable_irq_wake(max8997->irq); >>> + disable_irq(max8997->irq); >> >> irq_set_irq_wake() is same as enable_irq_wake(). > > It's more intuitive name and makes code reading easier. > >> Why is it necessary for disable_irq(max8997->irq)? > > It's because we don't want to get interrupts before i2c controller will > be ready. So we disable irq in drivers suspend, and enable in resume. > > If some iqr will come before enable_irq() call, it will be noticed, and > IRQ_PENDING flag will be set. In this case irq will be handled > immediately after enable_irq() call. > > In previous version there was call of max8997_irq_resume() in resume > function, which caused forced interrupt handling, which has similar effect. > OK, For extcon part, Acked-by: Chanwoo Choi Thanks, Chanwoo Choi