Re: [PATCH 4/4] hwmon: (oxp-sensors) Cache state of PWM enable mode

From: Tobias Jakobi
Date: Thu Dec 26 2024 - 18:13:51 EST


On 12/26/24 22:05, Guenter Roeck wrote:
On Thu, Dec 26, 2024 at 06:00:19PM +0100, tjakobi@xxxxxxxxxxxxxxxxxxxxx wrote:
From: Tobias Jakobi <tjakobi@xxxxxxxxxxxxxxxxxxxxx>

The driver is in full control of the enable mode, so we
don't need to read it from HW every single time.


That is not a reason for adding that much additional code.
What is the problem that is being solved, and why is it worth that much
additional code ?
I don't think it's that much additional code, but anyway: Reading from EC is not exactly fast, and I want this value cached for another reason. It turns out that some devices use a different scaling for the PWM value depending on whether the PWM is controlled automatically by the EC, or manually through the driver. And I don't want to do an additional EC read to figure this out, if I can avoid it.

With best wishes,
Tobias


Plus, again, all those runtime feature checks in attribute handling
code are completely wrong.

Guenter