[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8267ad09-26dc-7581-567e-7286f4d7435e@os.amperecomputing.com>
Date: Thu, 8 Apr 2021 19:02:09 +0700
From: Quan Nguyen <quan@...amperecomputing.com>
To: Guenter Roeck <linux@...ck-us.net>, Joel Stanley <joel@....id.au>,
Andrew Jeffery <andrew@...id.au>,
Jean Delvare <jdelvare@...e.com>,
Rob Herring <robh+dt@...nel.org>,
Lee Jones <lee.jones@...aro.org>,
Jonathan Corbet <corbet@....net>, linux-hwmon@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, linux-aspeed@...ts.ozlabs.org,
openbmc@...ts.ozlabs.org
Cc: Open Source Submission <patches@...erecomputing.com>,
Phong Vo <phong@...amperecomputing.com>,
"Thang Q . Nguyen" <thang@...amperecomputing.com>
Subject: Re: [PATCH v2 3/4] hwmon: smpro: Add Ampere's Altra smpro-hwmon
driver
On 07/04/2021 19:11, Guenter Roeck wrote:
> On 4/7/21 12:41 AM, Quan Nguyen wrote:
> [ ... ]
>>>
>>> But then why don't you just use reg_ext to store SOC_VR_HOT_THRESHOLD_REG
>>> or MEM_HOT_THRESHOLD_REG ? It is already available, after all, and with it
>>> the code could be simplified to
>>>
>>> ret = regmap_read(hwmon->regmap, temperature[channel].reg_ext, &value);
>>> if (ret)
>>> return ret;
>>>
>> Thank you for the comment.
>>
>> Will change code follow this suggestion, will include in next version
>>
>>> I don't have a datasheet, but I do wonder what is in bit 9..15. Any idea ?
>>> Main question is if there is a sign bit, as theoretic as it may be.
>>>
>> The original intention was to use this as 9-bit 2-complement value follow LM75, but the fact is that the operation temperature is 0-125 C degree, so we simply use it as-is.
>>
>
> The operational temperature is not the question here. The question is if the
> chip _reports_ a sign. If it does, it should be handled, even if it is outside
> the operational range. The reported range is relevant here, not the operational
> range. After all, the chip won't really blow apart at -1 degrees C.
>
I think I've got it, will handle the sign bit in next version.
-Quan
Powered by blists - more mailing lists