Re: [PATCH v4 2/2] rtc: max31335: add driver support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/2/23 09:57, Alexandre Belloni wrote:
[ ... ]
+static int max31335_read_offset(struct device *dev, long *offset)
+{
+	struct max31335_data *max31335 = dev_get_drvdata(dev);
+	u32 value;
+	int ret;
+
+	ret = regmap_read(max31335->regmap, MAX31335_AGING_OFFSET,
&value);
+	if (ret)
+		return ret;
+
+	*offset = value;

This is super dubious, what is the unit of MAX31335_AGING_OFFSET ?


There is not additional information on the AGING_OFFSET register (no
other offset registers).
I treated it as a raw value that user can write/read. Should I drop the
offset implementation?


The value exposed to userspace is in parts per billion. If you can't do
the conversion, then you have to drop it.


The max31334 datasheet says "Resolution = 0.477ppm". Again, the datasheet for
max31335 is not public, so it is impossible to say what the resolution is
for that chip, but I would assume that it is documented.

Guenter





[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux