Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp940260rwd; Tue, 13 Jun 2023 02:28:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ49HhveFmZ5QxV+IOC7QMoKCO5m8NIc0y9CIG3zBfop/d1njvb7fQJuoRsrjsj4D/MhpXpI X-Received: by 2002:a05:6a20:3c86:b0:10b:f980:18d3 with SMTP id b6-20020a056a203c8600b0010bf98018d3mr13008011pzj.1.1686648537750; Tue, 13 Jun 2023 02:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686648537; cv=none; d=google.com; s=arc-20160816; b=UJvIr0eb1jB4h/rBTuCBfZJBMFrkZgRzmxDyKVxlFsOclAakxF9Ocdhq/VqAeuxBXN M0EBxQ393LL2jeVTztXJ9W65cx6WZp1dGvsHFAVTyhIHiV4kznLzl0QBpgOfIZgmwO/0 AFCP7nCikHwkCUjWwuhUmpTYFVX1Nj1cbZ3/Vkhw2mspZl1QjkQdLRU7AWrP2IiJLISl +DHtFKJAcJTKE+KqOBs/vcKgdcfyP3jZf8YlHB8qfGHMpZ1l4bYxVe2s7gk7RNTSoZzi +jKPFfZqQui7A8g/yNnrxK2v22XtNbh9jL+YN4j2rWMhl9g7ZUcHW+0dIBc5h7rjBkhe 59kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IfOv7/EV35Molg1/s6J6mIgsThkcvsrNOtCmAlFGMPY=; b=fEtcvVelzIsZSGk62RbHwR6wSp9N19AoldFx9xcEYuN6QoIPGzLj3wJCJSB7rDtAY7 Ir44M22TLOCnmfWkjhk0jPbpo9z8Y3omCqz+DJgzlS1WLxvQwsAJuYIs6pUuy0bFi8XW zITfhXLIhtV6KyirQVuQVd6gE2Psnk1h7I2afjmMHPp77ExzrsdvQWytcrFirAme+dot zeBfZCGH9SZSXa2LOAvCzzaGvZHYVMkHUZgJZ+DMG9pmlzknj5PGfFZcSpiYqXd5QSN/ 4UkwVIxsQdLRD0fuLdmiidPNYsRFKCcToP7WZYqzivNALJu7mg/vnub6st5J97d3KMg4 wf0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=lD0FxXFs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t68-20020a625f47000000b0065e445224e2si8247605pfb.342.2023.06.13.02.28.46; Tue, 13 Jun 2023 02:28:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=lD0FxXFs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239277AbjFMJA0 (ORCPT + 99 others); Tue, 13 Jun 2023 05:00:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239359AbjFMJAY (ORCPT ); Tue, 13 Jun 2023 05:00:24 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B691BA; Tue, 13 Jun 2023 02:00:22 -0700 (PDT) X-GND-Sasl: alexandre.belloni@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1686646821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IfOv7/EV35Molg1/s6J6mIgsThkcvsrNOtCmAlFGMPY=; b=lD0FxXFsd1w8xrvQIJn5rtZHl3FQr7DkHE4vzxbtfWU/4zIx5EJL+t1kFH4Eqm4Evd9Nnr 70gMt/T011gpdAhWldpLaYKyXczoAXcexULsD9laCCEqWbguGT/NvImQBPMvWvY2QbkG6h ovaigvzwBRF/MiIkSou1Br+cvXvSW1Om982GjIJ2S4iZxhxJ6O2hnYO64k4+npNLIJOSCm hKZKPJRxPdaA/GLZ4PhL9mjjefnBpgiBuOvQvN3KK4ph4+mYiUHaCLNFBkYVtchC6A4SQE ZWiNufyxpKP/nK8efLiXc5OXVHCuojuk9/vFeMTBwK6a3cAZ9Q47GOVjxwzVqg== X-GND-Sasl: alexandre.belloni@bootlin.com X-GND-Sasl: alexandre.belloni@bootlin.com X-GND-Sasl: alexandre.belloni@bootlin.com X-GND-Sasl: alexandre.belloni@bootlin.com X-GND-Sasl: alexandre.belloni@bootlin.com X-GND-Sasl: alexandre.belloni@bootlin.com X-GND-Sasl: alexandre.belloni@bootlin.com X-GND-Sasl: alexandre.belloni@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 76026E0016; Tue, 13 Jun 2023 09:00:20 +0000 (UTC) Date: Tue, 13 Jun 2023 11:00:20 +0200 From: Alexandre Belloni To: Rasmus Villemoes Cc: Andy Shevchenko , Alessandro Zummo , devicetree@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/8] rtc: isl12022: implement RTC_VL_READ and RTC_VL_CLR ioctls Message-ID: <20230613090020b5405b61@mail.local> References: <20230612113059.247275-1-linux@rasmusvillemoes.dk> <20230612113059.247275-6-linux@rasmusvillemoes.dk> <202306121610404abc8cbc@mail.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/06/2023 09:53:03+0200, Rasmus Villemoes wrote: > On 12/06/2023 18.10, Alexandre Belloni wrote: > > On 12/06/2023 18:48:49+0300, Andy Shevchenko wrote: > >> On Mon, Jun 12, 2023 at 01:30:55PM +0200, Rasmus Villemoes wrote: > >>> Hook up support for reading the values of the SR_LBAT85 and SR_LBAT75 > >>> bits. Translate the former to "battery low", and the latter to > >>> "battery empty or not-present". > >> > >> ... > >> > >>> +static int isl12022_read_sr(struct regmap *regmap) > >>> +{ > >>> + int ret; > >>> + u32 val; > >>> + > >>> + ret = regmap_read(regmap, ISL12022_REG_SR, &val); > >>> + if (ret < 0) > >>> + return ret; > >>> + return val; > >> > >> Wondering if the bit 31 is in use with this register (note, I haven't checked > >> the register width nor datasheet). > >> > > > > register width is in the driver: > > > > static const struct regmap_config regmap_config = { > > .reg_bits = 8, > > .val_bits = 8, > > .use_single_write = true, > > }; > > Yeah. > > But I only factored that out because I wanted to read the SR also in the > isl12022_set_trip_levels() to emit the warning at boot time, but when > that goes away, there's no longer any reason to not just fold this back > into the ioctl() handler. That would be to clear a not self clearable battery low (but not empty) flag or a backup voltage switch flag. > > Rasmus > -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com