On Mon, Jul 20, 2020 at 9:49 PM Daniel Gutson <[email protected]> wrote:
> On Fri, Jul 17, 2020 at 12:39 PM Arnd Bergmann <[email protected]> wrote:
>>
>> My impression was that the state of the registers you read would
>> be the same if you read them multiple times, at least until you
>> reboot and the firmware has a chance to change them.
>
>
> That's not always the case, for example for the SMI count.
> Another example is WPD, a driver (such as the intel-spi for instance) can
> change its value if it is unlocked.
> But many others don't change so it might be a good idea to add another
> function to the API to register constant values.
Ok, if the value can change, then I suppose you can pass a pointer to the
'struct class_attribute' or 'struct file_operations' with the appropriate
'show' callbacks, this should be easier than creating another callback
abstraction.
For values that can not change, passing the value should be easier.
Arnd