From: Armin Wolf <W_Armin@gmx.de>
To: Guenter Roeck <linux@roeck-us.net>, linux-hwmon@vger.kernel.org
Cc: "Hristo Venev" <hristo@venev.name>,
"René Rebe" <rene@exactcode.de>, "Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
"Radu Sabau" <radu.sabau@analog.com>
Subject: Re: [PATCH 2/3] hwmon: Add support for SPD5118 compliant temperature sensors
Date: Thu, 30 May 2024 19:41:00 +0200 [thread overview]
Message-ID: <78c58496-78b2-48a5-b5df-74545fd58dc3@gmx.de> (raw)
In-Reply-To: <b8aa563a-5ca1-4624-a1c7-25744f15cfa9@roeck-us.net>
Am 30.05.24 um 19:33 schrieb Guenter Roeck:
> On 5/30/24 10:03, Armin Wolf wrote:
>> Am 29.05.24 um 22:52 schrieb Guenter Roeck:
>>
> [ ... ]
>
>>> +
>>> +temp1_lcrit_alarm Temperature low critical alarm
>>> +temp1_min_alarm Temperature low alarm
>>> +temp1_max_alarm Temperature high alarm
>>> +temp1_crit_alarm Temperature critical alarm
>>
>> Maybe it would be a good idea to tell users that the alarm attributes
>> are sticky.
>>
>
> The driver auto-clears them after read, so they are only sticky in the
> sense
> that they will remain active until read. This is quite common for
> hardware
> monitoring devices. However, sure, I'll add a note.
>
> [ ... ]
>
>>> +static int spd5118_write_enable(struct regmap *regmap, u32 attr,
>>> long val)
>>> +{
>>> + if (val && val != 1)
>>> + return -EINVAL;
>>> +
>>> + return regmap_update_bits(regmap, SPD5118_REG_TEMP_CONFIG,
>>> + SPD5118_TS_DISABLE,
>>> + val ? 0 : SPD5118_TS_DISABLE);
>>
>> The spd5118 spec says that we have to wait 10ms after enabling the
>> sensors before
>> we start reading temperature values, maybe we need a delay + locking
>> here?
>>
>
> I don't think that would add much if any value but a lot of complexity
> for little gain. I find it acceptable that the sensor returns 0 for a
> few ms
> after enabling it. Pretty much all chips have the same problem, so I am
> really not concerned about it.
>
>>> +
>>> +static struct i2c_driver spd5118_driver = {
>>> + .class = I2C_CLASS_HWMON,
>>> + .driver = {
>>> + .name = "spd5118",
>>> + .of_match_table = spd5118_of_ids,
>>
>> The driver is missing suspend support, without it hibernation/S4
>> sleep will cause the
>> limit and config registers to be out of sync with the regmap cache.
>>
>
> Good point. Do you have a means to test this if I add suspend support ?
> I have not been able to figure out how to put my system into suspend.
>
> Thanks,
> Guenter
>
I think so, at least i can verify if S3 sleep works, but S4 sleep should work fine too.
Thanks,
Armin Wolf
next prev parent reply other threads:[~2024-05-30 17:41 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 20:52 [PATCH 0/3] hwmon: Add support for SPD5118 compliant temperature sensors Guenter Roeck
2024-05-29 20:52 ` [PATCH 1/3] dt-bindings: hwmon: jedec,spd5118: Add bindings Guenter Roeck
2024-05-29 20:52 ` [PATCH 2/3] hwmon: Add support for SPD5118 compliant temperature sensors Guenter Roeck
2024-05-30 8:08 ` Armin Wolf
2024-05-30 13:23 ` Guenter Roeck
2024-05-30 13:39 ` Guenter Roeck
2024-05-30 16:45 ` Armin Wolf
2024-05-30 16:51 ` Guenter Roeck
2024-05-30 17:06 ` Armin Wolf
2024-05-30 9:08 ` Thomas Weißschuh
2024-05-30 13:27 ` Guenter Roeck
2024-05-30 10:51 ` Thomas Weißschuh
2024-05-30 13:47 ` Guenter Roeck
2024-05-30 13:57 ` Thomas Weißschuh
2024-05-30 14:07 ` Guenter Roeck
2024-05-30 17:03 ` Armin Wolf
2024-05-30 17:33 ` Guenter Roeck
2024-05-30 17:41 ` Armin Wolf [this message]
2024-05-30 17:36 ` Guenter Roeck
2024-05-30 20:20 ` Thomas Weißschuh
2024-05-30 20:46 ` Guenter Roeck
2024-05-30 21:02 ` Thomas Weißschuh
2024-05-30 22:33 ` Guenter Roeck
2024-05-31 9:31 ` Wolfram Sang
2024-05-31 10:01 ` René Rebe
2024-05-31 10:37 ` Thomas Weißschuh
2024-05-31 13:14 ` Guenter Roeck
2024-05-31 13:20 ` René Rebe
2024-05-31 13:55 ` Guenter Roeck
2024-05-29 20:52 ` [RFT PATCH 3/3] hwmon: (spd5118) Add PEC support Guenter Roeck
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=78c58496-78b2-48a5-b5df-74545fd58dc3@gmx.de \
--to=w_armin@gmx.de \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hristo@venev.name \
--cc=krzk+dt@kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=radu.sabau@analog.com \
--cc=rene@exactcode.de \
--cc=robh@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox