All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carlos Menin <menin@carlosaurelio.net>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
	Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jean Delvare <jdelvare@suse.com>,
	Sergio Prado <sergio.prado@e-labworks.com>,
	menin@carlosaurelio.net
Subject: Re: [PATCH v2 1/2] rtc: add pcf85053a
Date: Sun, 5 Nov 2023 17:17:55 -0300	[thread overview]
Message-ID: <ZUf4czmwLEqKpM28@arch-bow> (raw)
In-Reply-To: <5451ac26-c498-4af5-b3fa-fe2265433ccc@roeck-us.net>

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 <menin@carlosaurelio.net>
> > Reviewed-by: Sergio Prado <sergio.prado@e-labworks.com>
> > ---
> 
> [ ... ]
> 
> > +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

  reply	other threads:[~2023-11-05 20:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-03 12:51 [PATCH v2 1/2] rtc: add pcf85053a Carlos Menin
2023-11-03 12:51 ` [PATCH v2 2/2] dt-bindings: " Carlos Menin
2023-11-05 13:39   ` Krzysztof Kozlowski
2023-11-03 14:09 ` [PATCH v2 1/2] " Guenter Roeck
2023-11-05 20:17   ` Carlos Menin [this message]
2023-11-05 22:31     ` Guenter Roeck
2023-11-03 14:28 ` Alexandre Belloni
2023-11-05 20:49   ` Carlos Menin
2023-11-17 22:21     ` Alexandre Belloni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZUf4czmwLEqKpM28@arch-bow \
    --to=menin@carlosaurelio.net \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=robh+dt@kernel.org \
    --cc=sergio.prado@e-labworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.