Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1742858rdf; Sun, 5 Nov 2023 12:18:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGMox+dJ7pH6NU/QNspMGu6AyV9cuS3BB8gjns/9RVvAHCI30SOrYRn6usvQWHHVhUHvj/ X-Received: by 2002:a05:6a00:1883:b0:6bd:d884:df00 with SMTP id x3-20020a056a00188300b006bdd884df00mr31487239pfh.9.1699215506010; Sun, 05 Nov 2023 12:18:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699215505; cv=none; d=google.com; s=arc-20160816; b=xw+hy+va2AD80OkUF4VBxg7S/Ybi+kF/YI7LIF7u6Ca1tpiTTzGTV2m/cX/FjFXGlE D1cen2zVS/8ZY9hlGDYn2IRJ9RestRUXusI2W+Y/FLYNsfRmO8lbf1YWKTNusj6PlEog hQyfFwvE3zfSY0LunAnjiS0huuSwzMGL7cSS9hfMzQCDoqQnq6jp/D2vqJmsS3rU1kfT 1LxORDyE3iLAgsKnHV1rEhIZIM1ZsCI1sNSyzyw2LgobpMziOWiqFRC39xe/Qs/bPFi8 WQiI61NHAu6smtTQsVUfikWVADpIWhJdEcM8zmnEfzObQSeELjT7Tu+01rw40/ik5ewy zAxw== 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=26kAk0gW9ckyezT4ZcFfX/Pu/ff3bZhQ4ge1+jvDrh0=; fh=aYPRs0ru0w/g+3MbN5ugxd1SoLYx7SvhhxI9BLgANZ8=; b=U9HfMv2qw66dJAjXIDCtsxm6prnE10WrzBBlFAAQhpE8vgObPJ8XgnTXfpTJa9xZje KWp50Aw+Ri6KBFDP7TcTEumsy7DaRCAId5sj0rzXQQaS59yIb8fF734iUshAEhF0lP9V ofO5CEZVEhWuACW9TLyfJ8zV+Bq+vIV7elMmERjTLO/l7jBI0QIrVUGqQNf11ygMfmbm vJvuJfsaUtqbQXym7RPwg8T+a5ufWfW3oNQ8tsdUZD7sGPKFVAUlP/msQurlciKXTWtY dyTBDpPMCLeEwl6sbyMEcTpt8yVIgzInWQs/IFrG7g1g8f15jOMblNCW2ZPccboB1jTa DTYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@carlosaurelio.net header.s=default header.b=m3SVEuje; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id ei5-20020a056a0080c500b006c34753bcf6si5930153pfb.355.2023.11.05.12.18.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 12:18:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=fail header.i=@carlosaurelio.net header.s=default header.b=m3SVEuje; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E7D8A804596F; Sun, 5 Nov 2023 12:18:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229507AbjKEUSV (ORCPT + 99 others); Sun, 5 Nov 2023 15:18:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbjKEUSU (ORCPT ); Sun, 5 Nov 2023 15:18:20 -0500 Received: from h7.fbrelay.privateemail.com (h7.fbrelay.privateemail.com [162.0.218.230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FF2790; Sun, 5 Nov 2023 12:18:17 -0800 (PST) Received: from MTA-10-4.privateemail.com (mta-10.privateemail.com [198.54.118.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by h7.fbrelay.privateemail.com (Postfix) with ESMTPSA id E0B9B60562; Sun, 5 Nov 2023 15:18:14 -0500 (EST) Received: from mta-10.privateemail.com (localhost [127.0.0.1]) by mta-10.privateemail.com (Postfix) with ESMTP id A621C1800043; Sun, 5 Nov 2023 15:18:12 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=carlosaurelio.net; s=default; t=1699215492; bh=nDKjE4aaqyE3xa9fbGG91EUJMOtqQ87wXRuhYIwaqPk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=m3SVEuje25C99xcE6LwEpwJUmcjT5JckDxNCzwm74K+F7t7jKSrZZU76pOXNE98MG WMDowxHEefrhpfic+tEAwCmhMORQAqUYWtKeh9BNgvmuexKFIpcjjKutFatw0tUC3X yTMCHQPKwujH7rjrD937q1kuhznqZcE9xXISXT4ZBt0pGn70SAkvUnRCxD/1DDXvDi /COVldnIHAajR9H7YEagTbPdAGPiFQHKKu6QJaNUg58htBTzIYhu8O8cwwXDyZWMjd NHDwgPadMhwHNyE29ApEfzA7vLg9Lo+pX3jbKHXmr4ZC5y1tV0f6gyeLLph7Zkn+28 TVKWCh+p347CQ== Received: from arch-bow (unknown [187.11.35.108]) by mta-10.privateemail.com (Postfix) with ESMTPA; Sun, 5 Nov 2023 15:17:57 -0500 (EST) Date: Sun, 5 Nov 2023 17:17:55 -0300 From: Carlos Menin To: Guenter Roeck Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Alessandro Zummo , Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jean Delvare , Sergio Prado , menin@carlosaurelio.net Subject: Re: [PATCH v2 1/2] rtc: add pcf85053a Message-ID: References: <20231103125106.78220-1-menin@carlosaurelio.net> <5451ac26-c498-4af5-b3fa-fe2265433ccc@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5451ac26-c498-4af5-b3fa-fe2265433ccc@roeck-us.net> X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 05 Nov 2023 12:18:25 -0800 (PST) On Fri, Nov 03, 2023 at 07:09:27AM -0700, Guenter Roeck wrote: > On 11/3/23 05:51, Carlos Menin wrote: > > Add support for NXP's PCF85053A RTC chip. > > > > Signed-off-by: Carlos Menin > > Reviewed-by: Sergio Prado > > --- > > [ ... ] > > > +static int pcf85053a_bvl_to_mv(unsigned int bvl) > > +{ > > + long mv_table[] = { > > + 1700, > > + 1900, > > + 2100, > > + 2300, > > + 2500, > > + 2700, > > + 2900, > > + 3100, > > How are those numbers determined ? The datasheet gives voltage ranges. > I'd have assumed that the center of those ranges is chosen, but for the > most part it is the maximum, except for 2900 which is a bit above center > and 3100 for "> 3.0V". Not that I care too much, but it seems to me that > using the center voltage for each range would be more consistent. > I just used numbers that would result in the same step between levels (200 mV) at the same time they would fit in the ranges, but I agree that using the center of the ranges makes sense. In this case which values would you suggest for <= 1.7 and > 3.0 ? > > +static int pcf85053a_hwmon_register(struct device *dev, const char *name) > > +{ > > + struct pcf85053a *pcf85053a = dev_get_drvdata(dev); > > + struct device *hwmon_dev; > > + > > + hwmon_dev = devm_hwmon_device_register_with_info(dev, name, pcf85053a, > > + &pcf85053a_hwmon_chip_info, > > + 0); > > This won't compile if CONFIG_HWMON=n or if CONFIG_RTC_DRV_PCF85053A=y and > CONFIG_HWMON=m. > > Guenter > I will add dependencies in the Kconfig file. Thanks for reviewing, Carlos