Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp276436yba; Wed, 3 Apr 2019 08:32:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsc+RYF3wKJKC7mOyXkNiGIftirMRDpOINJ2SOb48CyrxFy1NwYH42MrjZ6qDSf2NK9sQL X-Received: by 2002:a17:902:a513:: with SMTP id s19mr530259plq.97.1554305561991; Wed, 03 Apr 2019 08:32:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554305561; cv=none; d=google.com; s=arc-20160816; b=CwWm5i2SJmOp2N94jFtf+QxpK4mbmUYfLNrWdAAYXhw9FkO4HjKUb7ek8sgZH1NYa/ U/tjmXDhEzLqLhFq6n7K6NX1gXeLXI/gFaVm4SaH7UTRIEDFSoHp+6q+ueXje+UbyRiq uSbZLWz2bxkjsU7xfwLfcE5Ge4D3U6RYtGStftSOVBw6R58SMwopexnnSXkC43nXkDO4 33FDc80kKnntkOnrn89QQwhQJ6O2l/IspwjAltVdt6Qi0Ad1LbSjzXJjZLoe7gWzPs9T IL33fep3+J0fz0/wmUQOFEvCFWUP77yl/5ivWYxYWVssRlVEI6UBphBqXCW0n96KZrx/ RNoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=eCyMI/dIr29E//7MJQwvWCOa5ncyAuaIvUkQKoe+/IY=; b=Emf8YdFQY2eyAoaTeQOeyu9m90Cu+riQhH6LD2bgqtNkT3ttNMhdhnpjp/l0EYUliF O33AeZWKWrCE2Y+XAnf2gfLvFu7aXko/fmG5IX5SpLn7WO6ZWrInVRqH2ffRuDYH8JMm AzLWOWNudp5bqv8SKLo0hRQDvnYceleLJ++ph5Iga68b10+tzFnQ8lhisdO5g/Wjgb9m 4aeqNuxMu2+/OlM6aaPdAxYM1ZWlTgmh9N7qN9p/gi4qzOEoISRVLTO/Hayy9PIja7If OkHhF+TxxvUjpYvUkDy0vZP94ndQdZtTe+GZjo7NctU2rSVmzXzjz8I5oB+4nd2Ee58k m4nA== ARC-Authentication-Results: i=1; mx.google.com; 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 b8si13640623pgq.424.2019.04.03.08.32.26; Wed, 03 Apr 2019 08:32:41 -0700 (PDT) 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; 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 S1726372AbfDCPbr (ORCPT + 99 others); Wed, 3 Apr 2019 11:31:47 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:34327 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbfDCPbr (ORCPT ); Wed, 3 Apr 2019 11:31:47 -0400 X-Originating-IP: 109.213.83.19 Received: from localhost (alyon-652-1-60-19.w109-213.abo.wanadoo.fr [109.213.83.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 368601C0004; Wed, 3 Apr 2019 15:31:44 +0000 (UTC) Date: Wed, 3 Apr 2019 17:31:43 +0200 From: Alexandre Belloni To: Flavio Suligoi Cc: Alessandro Zummo , Rob Herring , Mark Rutland , "linux-rtc@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 2/2] rtc: pcf2127: add battery-low INTn generation Message-ID: <20190403153143.GQ22216@piout.net> References: <1554303165-24813-1-git-send-email-f.suligoi@asem.it> <1554303165-24813-2-git-send-email-f.suligoi@asem.it> <20190403150824.GO22216@piout.net> <452a4cf1410a41c8b6f767ac6258482e@asem.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <452a4cf1410a41c8b6f767ac6258482e@asem.it> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/04/2019 15:14:24+0000, Flavio Suligoi wrote: > Hi Alexandre, > > > On 03/04/2019 16:52:45+0200, Flavio Suligoi wrote: > > > The pcf2127 has an automatic battery-low detection function. > > > > > > In case of battery-low event, an interrupt generation through > > > the pin INTn (active low) can be enabled, setting the flag BLIE > > > in the register Control_3. > > > > > > This function is activated by the "battery-low-hw-alarm" DT property. > > > > > > Example of use for an NXP i.MX7D board: > > > > > > &i2c3 { > > > clock-frequency = <100000>; > > > pinctrl-names = "default"; > > > pinctrl-0 = <&pinctrl_i2c3>; > > > status = "okay"; > > > > > > pcf2127@51 { > > > compatible = "nxp,pcf2127"; > > > reg = <0x51>; > > > battery-low-hw-alarm; > > > status = "okay"; > > > }; > > > }; > > > > > > > So I'm curious, how do you then use that signal? I have a (not yet sent) > > series adding alarm support for the pcf2127. The issue having BLIE is > > that then this will prevent the alarm to work properly. > > > > So my guess is that you have nINT connected to an LED or something that > > the user can see? > > > > I'm working on our custom embedded board with an NXP i.MX7D, > developed here, in Asem (www.asem.it). > The nINT pin is connected to a GPIO of the MX7 and then > used by an applicative sw, to generate an alarm for the user. > Then, you should probably not enable BLIE because this will cause issues with the alarm functionnality.. It is certainly enough to use RTC_VL_READ periodically. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com