Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3161868pxa; Tue, 25 Aug 2020 13:12:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOCk09E5sN2p7ibhS/cnOPdICAeDcms8Zv0e2tyDyRqaNhk49CpBfGB0RCQeADN1QyHuHO X-Received: by 2002:a17:906:d8ab:: with SMTP id qc11mr3900259ejb.55.1598386340639; Tue, 25 Aug 2020 13:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598386340; cv=none; d=google.com; s=arc-20160816; b=bFlvwYzq4ROFijV61gmV6+YDwXci/gpOXyj71ZOGkeBHWkIARB1CElATGn8eMnp0g8 WUjizcMWmKBpGdjh6HJfqUMzdH20/y+nbJh94k+PwtzmjeZqnwL1rFchDV4qH3qFComL eicuQSFVwELAuKA15SBJ3lUtuA9ybQNSfHMg5nU5J43jgUrzwDgcv0LPP2si0jbkBCva IjIOimcNXhCyCEzPUcwA0LBR79eaehN/1aFKKb6oaa4uBFZnWDx7M06gq2LG+LrWpdUE Snp43V+zpsVRlMwSk2g3exu7q+zjig+a0mD50Pgpvzs1EEspkCtFW7Xz6WnrHBzB6GW3 L+Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=L+UtcDW42eXb8gWJ7+lZGIdQ9h6SZbNp0NRyN+cZNGI=; b=TPUGrDkATguN/t00gEvvYVjQgJizV1dSAfu7RP4K8ZHUD9D8oU7VFJzi+tlo7zjCk1 X8CY4obpVrqyMkD9HTqkTPmkWbD/IgYuF2+NYugDuhK/biPzJitHgrZWCpjUtDyOnciP jEITMGvhJtQe/uc+KkiOwqrAOotp2ovO+PlsHwYkqGON/VESgUoNvxHM5wP9uPgw+48C s/SvsKzUJKEQdH0f61pCW5SFF10EcgQ+cmVbYmqgIAOHS7n1VRBWs7fk8dxCeBEe29NO SPW5yHQgaOfRZc3FjuikBd3x5pRGK7QK9XX8an8i9+qRHIlNNRGMW+DhKlViZGMrZUm8 N6mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n5si2416ejc.171.2020.08.25.13.11.57; Tue, 25 Aug 2020 13:12:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726673AbgHYUI4 (ORCPT + 99 others); Tue, 25 Aug 2020 16:08:56 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:51645 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726619AbgHYUIz (ORCPT ); Tue, 25 Aug 2020 16:08:55 -0400 X-Originating-IP: 90.66.108.79 Received: from localhost (lfbn-lyo-1-1932-79.w90-66.abo.wanadoo.fr [90.66.108.79]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 04B8F20007; Tue, 25 Aug 2020 20:08:51 +0000 (UTC) Date: Tue, 25 Aug 2020 22:08:51 +0200 From: Alexandre Belloni To: Miguel Borges de Freitas Cc: Russell King - ARM Linux admin , Jon Nettleton , Rob Herring , a.zummo@towertech.it, Baruch Siach , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , NXP Linux Team , devicetree , linux-arm-kernel , Linux Kernel Mailing List Subject: Re: [PATCH v2 1/3] dt-bindings: rtc: pcf8523: add DSM pm option for battery switch-over Message-ID: <20200825200851.GI2389103@piout.net> References: <20200723195755.GV3428@piout.net> <20200727094553.GH1551@shell.armlinux.org.uk> <20200727144938.GC239143@piout.net> <20200727152439.GK1551@shell.armlinux.org.uk> <20200727154104.GE239143@piout.net> <20200727154335.GL1551@shell.armlinux.org.uk> <20200727161632.GF239143@piout.net> <20200727173051.GM1551@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/07/2020 22:13:42+0100, Miguel Borges de Freitas wrote: > Russell King - ARM Linux admin escreveu no dia > segunda, 27/07/2020 ?(s) 18:30: > > > > On Mon, Jul 27, 2020 at 06:16:32PM +0200, Alexandre Belloni wrote: > > > On 27/07/2020 17:55:50+0200, Jon Nettleton wrote: > > > > > So, can we please have that discussion, it is pertinent to this patch. > > > > > > > > > > > > > Thinking about this some more, I believe whether or not an IOCTL > > > > interface is in the works or needed is irrelevant. This patch > > > > describes the hardware and how it is designed and the topic of > > > > discussion is if we need a simple boolean state, or if we need > > > > something that could be used to support dynamic configuration in the > > > > future. I would rather make this decision now rather than keep > > > > tacking on boolean config options, or revisit a bunch of device-tree > > > > changes. > > For what it's worth I also tend to agree. > The patchset, regardless of the property name (that I admit might be > misleading), is intended at enforcing a mode that the RTC/driver > should use by default. This mode is strongly related to the hardware > definition/implementation and its capabilities. While I understand the > need for the IOCTL interface to solve issues exactly like the > aforementioned factory example, I fail to see how it can be of any > help to solve the problem at hand - as it won't likely configure the > driver to use a different default mode depending on the board. The > IOCTL interface might also allow the userspace to change this property > back to the default mode (000) and end up breaking the RTC operation, > but I guess that's the cost of configurability and, in the end, the > user's responsibility. > Any pointers on how to proceed are appreciated. > I would think the simpler way to proceed is to have a device specific property indicating that standard mode is not available. From the driver, you can then switch from standard to DSM when this property is present. I think it is difficult to come up with a generic property for that as most other RTCs with level/threshold switching have a fast edge detection feature that is usually enabled by default. So what they would require instead is a property indicating that the voltage is ramping down at a certain rate allowing to disable fast edge detection and saving a bit of power. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com