From patchwork Tue Apr 19 16:23:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 612217 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-qk0-x23a.google.com (mail-qk0-x23a.google.com [IPv6:2607:f8b0:400d:c09::23a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qq9Lw413Vz9s1h for ; Wed, 20 Apr 2016 02:24:07 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b=lJ2nuXve; dkim-atps=neutral Received: by mail-qk0-x23a.google.com with SMTP id k126sf6778109qke.1 for ; Tue, 19 Apr 2016 09:24:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=RCFse80ZsPEo4pZqeg96sD+0JdpHnUUXlS+y1TqPM1s=; b=lJ2nuXveKJ0SiCnMu2tA3q/6HWckLRdZqSo3x36pLtZ4/tbxeIEt1OSDJ8s8ixtQ1i r5IE9jkf4nXKK1h2ZGp0KjGBkAPPVHEw28tqipsDy9RnqKGNHumHk2xZ6MTxvXv/VyPP F69Fv/DTazAWGD0zbH3d6HJhc95OWswXsUrJe0czm46HFTvXJDK6REZAcw0pMEaqTAI4 qXtJwN0Ng/+KFZep55MfxwXCNQ/t0RQkzwtuIkcAFkCvo7rMXafNpeprhtVnh88DXRdR pBPQmn4xZfP/ZApXkwX5FCif63hI5Kqr+F3FGCVDo1C9G1De+JftwsxVeqImjtXfOMC3 Z56Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :mime-version:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=RCFse80ZsPEo4pZqeg96sD+0JdpHnUUXlS+y1TqPM1s=; b=HGwDdcnPzN5HKWXLx6px4QFkECXfNhwjKmqjYLxL0l3xI0KvzF+HUqZIn3ZyGXnl7L dJKFkziWL7JakpIK2Z1fVAXPlSdR7+IZxUXMhT5pPvP92OorkmSgv9pEWIxoPfkUPVp5 9OCoSXHRJ6zpsCBHi958tJvUvyim0kxUSRsBieDEC10i3Al+lDKCwGfDbp+B4asfN5A5 gE8F91GmkD5tBphGZX98lSzPxTGVO7qAXn6mUrPdG2RyMxH091nDuWyPEaXrGyh1ks9L 1gbmqzAy7jxmCT8pkolyRojjhDPjgq+Tq7KaHXNbvrZFYpZ68rE+HUv6s2SsSIuEbZji uDng== Sender: rtc-linux@googlegroups.com X-Gm-Message-State: AOPr4FWqiLHELQ2w9svSuhOfTopCSZW0f4qsHgXTZ2OEPvrZtCqej/VD0MNZeu0eCyEpKQ== X-Received: by 10.140.20.104 with SMTP id 95mr107983qgi.6.1461083044643; Tue, 19 Apr 2016 09:24:04 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.140.39.177 with SMTP id v46ls3690576qgv.21.gmail; Tue, 19 Apr 2016 09:24:04 -0700 (PDT) X-Received: by 10.140.166.8 with SMTP id m8mr2356236qhm.22.1461083044296; Tue, 19 Apr 2016 09:24:04 -0700 (PDT) Received: from bear.ext.ti.com (bear.ext.ti.com. [192.94.94.41]) by gmr-mx.google.com with ESMTPS id au10si205527igc.3.2016.04.19.09.24.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 19 Apr 2016 09:24:03 -0700 (PDT) Received-SPF: pass (google.com: domain of nm@ti.com designates 192.94.94.41 as permitted sender) client-ip=192.94.94.41; Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id u3JGO059026753; Tue, 19 Apr 2016 11:24:00 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id u3JGO05l007508; Tue, 19 Apr 2016 11:24:00 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Tue, 19 Apr 2016 11:24:00 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u3JGNxPI007721; Tue, 19 Apr 2016 11:24:00 -0500 From: Nishanth Menon To: Alexandre Belloni , Alessandro Zummo CC: , , , , Nishanth Menon , Michael Lange Subject: [rtc-linux] [PATCH] rtc: ds1307: Use irq when available for wakeup-source device Date: Tue, 19 Apr 2016 11:23:54 -0500 Message-ID: <1461083034-9227-1-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-Original-Sender: nm@ti.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of nm@ti.com designates 192.94.94.41 as permitted sender) smtp.mailfrom=nm@ti.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: rtc-linux@googlegroups.com X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , With commit 8bc2a40730ec ("rtc: ds1307: add support for the DT property 'wakeup-source'") we lost the ability for rtc irq functionality for devices that are actually hooked on a real IRQ line and have capability to wakeup as well. This is not an expected behavior. So, instead of just not requesting IRQ, skip the IRQ requirement only if interrupts are not defined for the device. Fixes: 8bc2a40730ec ("rtc: ds1307: add support for the DT property 'wakeup-source'") Reported-by: Tony Lindgren Cc: Michael Lange Cc: Alexandre Belloni Signed-off-by: Nishanth Menon --- drivers/rtc/rtc-ds1307.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index b2156ee5bae1..74cd5cd544ee 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c @@ -1531,7 +1531,7 @@ read_rtc: return PTR_ERR(ds1307->rtc); } - if (ds1307_can_wakeup_device) { + if (ds1307_can_wakeup_device && ds1307->client->irq <= 0) { /* Disable request for an IRQ */ want_irq = false; dev_info(&client->dev, "'wakeup-source' is set, request for an IRQ is disabled!\n");