lkml.org 
[lkml]   [2023]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 1/2] rtc: add pcf85053a
From
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.

> +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

\
 
 \ /
  Last update: 2023-11-20 13:47    [W:0.073 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site