Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp852647rwd; Tue, 13 Jun 2023 00:57:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7GBPzU76O8+SyKcR+GVSKMw4w4XIVtopYLlQNYg0tVX1srrPuvun3UxhOl6pu2BFViO0dO X-Received: by 2002:a17:903:41c8:b0:1b3:d759:d2e1 with SMTP id u8-20020a17090341c800b001b3d759d2e1mr3192190ple.5.1686643064793; Tue, 13 Jun 2023 00:57:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686643064; cv=none; d=google.com; s=arc-20160816; b=0eoZjIGug/78UwRKh6FHP0b/deoTSs7X/NSPhlNIouhbbfErudmE6JZ5cYmM07omBY NsCbmpf4UX6BjqWmnyFc4dJ8PaWJFuLqNd7RWzklAFBTHaSIQHw0m8l+r7Wo737JXtYw jXbW0DQgwzDCJH/UPWbhGMLZHPwy7eXkWW+AFCwnrL8AdgaHKSJNuyoQS5Tg/ytDT6iE DkWVNYRxy/qtyUW0F5lun3iQVIafAGspSb0d2ntdnhwoDYw5+GrmTcYCnYD5jb1rEzTp SxT1bGKbKTusPo+tllch0BnOwGFHXEpz9nzpA6oTUsFCcT2cFmslmTMrx5P7JyfHS0YP bKLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=vgyeJguriMnbfi6ZGlMYcKZf5qXmQ+PSixMOFCnWr5o=; b=gVyAu3g0CVuWS5Zc+4wh9jlDXoIxt/HppM5rGFkXQOI2x3E1QlbE60PQrr08XlJz3W oJ2M+wcX+5kj6P+0AbPlZQLfhV/cJolpDXQXa/wzzQz7sOpaHCRwZNOxazhkM9PumBdi o8wM//TeyktwH0kGRpZ1TWzv7HxiT7PJPSGIJy7ix5ji86scPRci8G8o+tmxXBy48D/w NN8Hk/0FxraZ+v1LaVdR9UUgU6mXSdxkVI/70K8vl1bLoPDmarLvd1sZskaau7C5XTlO R3Fq5EkPQIkjgti8QfbQ+NyLiV5rmGT84QoBq15tCvScmp3GVUnR7GtqcLqWmYaURTNC U6Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=b45BvBaH; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b12-20020a170902d50c00b001b3d4af4457si2575348plg.248.2023.06.13.00.57.33; Tue, 13 Jun 2023 00:57:44 -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=@rasmusvillemoes.dk header.s=google header.b=b45BvBaH; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240050AbjFMHxN (ORCPT + 99 others); Tue, 13 Jun 2023 03:53:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240499AbjFMHxI (ORCPT ); Tue, 13 Jun 2023 03:53:08 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8482E13E for ; Tue, 13 Jun 2023 00:53:06 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f63006b4e3so6334941e87.1 for ; Tue, 13 Jun 2023 00:53:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; t=1686642785; x=1689234785; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=vgyeJguriMnbfi6ZGlMYcKZf5qXmQ+PSixMOFCnWr5o=; b=b45BvBaHfVrHpwlCQG0xJEFZLSXZmuinIWauD4liAPwvqwlxtST+/46UW3d68Bmw5H nxpyN+K1CqzlUo8bbuFkuwbRvKOQwnzM7SfeCC4t66etVTpCQPlFhICoKujGsnzOipJy JcHaePank2UOcvUNi4Mks+EOERkqv7E1NNmbU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686642785; x=1689234785; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vgyeJguriMnbfi6ZGlMYcKZf5qXmQ+PSixMOFCnWr5o=; b=L26nITVcM57X62cKASdRiw1s0bIU3wdMaa8jiPA4xdMckJYlNJAjOW5kQzJMu+6vUO H5MdwI/6DU3RxDvslKkySKxpY9VdGTtU0eLyQ9NTC24F03xHuWKQCuqJbQN5SBbFaoJQ sN0+Byv8iqCsnZbNPI26ehxSb8l9qauuBpRS/b5Z8rof4nSUHrXAmkGP0+0qQMFeR9wd FCpWgpTgJ0uVDxRC/v/UtgEofRC+N3xJ4VXXkBgcnpkDNHrXh5iiU1LZPBhqPd4j9enr GzSyasMgg256zfJrCEsgkfYSoTVoAd32vNilk2XLqq8fDvoSF85Be7eQycTOsaxPimNL Adfg== X-Gm-Message-State: AC+VfDyH5VguYg9zFxFdz9h4D7W+9ow5gbshIKCujmz4CahLP39mmlsf 9lVXXcBLygGn+omCNN0EgDz2vQ== X-Received: by 2002:a19:6445:0:b0:4f3:9868:bee4 with SMTP id b5-20020a196445000000b004f39868bee4mr5611190lfj.32.1686642784801; Tue, 13 Jun 2023 00:53:04 -0700 (PDT) Received: from [172.16.11.116] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id e15-20020ac2546f000000b004db0d26adb4sm1712054lfn.182.2023.06.13.00.53.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Jun 2023 00:53:04 -0700 (PDT) Message-ID: Date: Tue, 13 Jun 2023 09:53:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 5/8] rtc: isl12022: implement RTC_VL_READ and RTC_VL_CLR ioctls Content-Language: en-US, da To: Alexandre Belloni , Andy Shevchenko Cc: Alessandro Zummo , devicetree@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230612113059.247275-1-linux@rasmusvillemoes.dk> <20230612113059.247275-6-linux@rasmusvillemoes.dk> <202306121610404abc8cbc@mail.local> From: Rasmus Villemoes In-Reply-To: <202306121610404abc8cbc@mail.local> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, 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 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. Rasmus