From patchwork Tue Mar 28 17:22:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lowe X-Patchwork-Id: 744474 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-wr0-x240.google.com (mail-wr0-x240.google.com [IPv6:2a00:1450:400c:c0c::240]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vsyPd1sBHz9s2x for ; Wed, 29 Mar 2017 04:22:12 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="BJyADIqg"; dkim-atps=neutral Received: by mail-wr0-x240.google.com with SMTP id z109sf25358878wrb.1 for ; Tue, 28 Mar 2017 10:22:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:cc:subject: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=cgyBmZEtJiiFDtlX+bH7B3piggPVXcoFxg7iU/0KwWk=; b=BJyADIqge6PCBzEO2hvpyl0TnlRBCRiLMgQUjNc4KjC6yWTZZzr1zMcvsS2NVmlVxx mEKb+R94FzEwbyfnbMi2SZ8X3C7Sihzv5X0Z/gv/PTnO63IE6r2YXp8Eorb/BVf6txr3 iq556wSDL2UOpzuZQYNyZYpK7q2eAXPqt3y9TRmFpCX7aRWOv71je7l1Wt92OBTmm4/k lNRRhlDd7V/2KLw1cqi8vqPcSbFCKF8ptNY8z4sgwQIXlUepzYWqvvtTEYE+vBT8Fe7A QSwzxSkrZd6bSYmSStCSw8SL+5jXoa6egShB4eiueaNvg+FVsm+4Bztuto0zej5TeulU uYFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:cc:subject: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=cgyBmZEtJiiFDtlX+bH7B3piggPVXcoFxg7iU/0KwWk=; b=NmQeTL0qXk/13I1PlKOTDp7aCn2lFp80odXq/IGq7SP3Lrcnzx12iy8odH+tLr1tY5 ecGNuWPPcdLh7/jBlvndZsXU1ijdGSpO37rxjYrherL/EaO383+7ikQWPdQpvJ9h13FK R8ErHpS+ob+rUnWC2k/OGd3VUj/cyaiAmQwndhHSAMIhDJNiLmfeutAANCHIzwAtnnZK Bd690LgVgyGx0WgY9HtlFtXe6u3/Gt+C2FSsCa8cFSl67o53zIT+SKNtKQhrFfiepyQX zAS12vaKJOZP9uMFdvCFsfjv3UE6jpAg3WseY1kGIvKd0vsd5LD1968SolD6apZr6C6L +eJA== Sender: rtc-linux@googlegroups.com X-Gm-Message-State: AFeK/H2lhdl9UHiNrJ8MFdwzGzQPr+YH9F5JqcYf9Q2DaCvLrEdKos8D11U5y6qiud0yIA== X-Received: by 10.46.0.161 with SMTP id e33mr70195lji.4.1490721729304; Tue, 28 Mar 2017 10:22:09 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.25.18.83 with SMTP id h80ls1362603lfi.13.gmail; Tue, 28 Mar 2017 10:22:08 -0700 (PDT) X-Received: by 10.46.8.18 with SMTP id 18mr695147lji.13.1490721728685; Tue, 28 Mar 2017 10:22:08 -0700 (PDT) Received: from know-smtprelay-omc-11.server.virginmedia.net (know-smtprelay-omc-11.server.virginmedia.net. [80.0.253.75]) by gmr-mx.google.com with ESMTP id i76si307323wmh.1.2017.03.28.10.22.08 for ; Tue, 28 Mar 2017 10:22:08 -0700 (PDT) Received-SPF: pass (google.com: domain of dave-lowe@ntlworld.com designates 80.0.253.75 as permitted sender) client-ip=80.0.253.75; Received: from pixelzero ([82.28.187.153]) by know-smtprelay-11-imp with bizsmtp id 1VN61v00G3K0dvW01VN8wK; Tue, 28 Mar 2017 18:22:08 +0100 X-Originating-IP: [82.28.187.153] X-Spam: 0 X-Authority: v=2.1 cv=WajxEBVX c=1 sm=1 tr=0 a=eeYL/Q5XoqB0RMOuN2w9jw==:117 a=eeYL/Q5XoqB0RMOuN2w9jw==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=iLZ2pjS14LQA:10 a=NLZqzBF-AAAA:8 a=MI78_MAYH-ffbklw-2MA:9 a=CjuIK1q_8ugA:10 a=wW_WBVUImv98JQXhvVPZ:22 Date: Tue, 28 Mar 2017 18:22:04 +0100 From: David Lowe To: rtc-linux Cc: Alexandre Belloni Subject: [rtc-linux] [Patch] rtc: rtc-ds1307: enable support for mcp794xx as a wakeup source without IRQ Message-ID: <20170328182204.4fda934e@pixelzero> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; arm-unknown-linux-gnueabihf) MIME-Version: 1.0 X-Original-Sender: dave-lowe@ntlworld.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of dave-lowe@ntlworld.com designates 80.0.253.75 as permitted sender) smtp.mailfrom=dave-lowe@ntlworld.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ntlworld.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: , This patch extends the fixes for ds1337, ds1339, ds3231 in 8bc2a40730ec to mcp794xx devices, so that those parts can similarly be used as a wakeup source without an IRQ to the processor. Tested on Raspberry Pi ZeroW with MCP79400. Signed-off-by: David Lowe --- a/drivers/rtc/rtc-ds1307.c 2017-03-28 16:16:38.158076224 +0100 +++ b/drivers/rtc/rtc-ds1307.c 2017-03-28 16:16:52.248431799 +0100 @@ -1487,7 +1487,8 @@ static int ds1307_probe(struct i2c_clien break; case mcp794xx: rtc_ops = &mcp794xx_rtc_ops; - if (ds1307->client->irq > 0 && chip->alarm) { + if (chip->alarm && (ds1307->client->irq > 0 || + ds1307_can_wakeup_device)) { irq_handler = mcp794xx_irq; want_irq = true; }