* Functional enhancement of max31827
@ 2023-07-28 6:49 Daniel Matyas
2023-07-29 14:25 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Matyas @ 2023-07-28 6:49 UTC (permalink / raw)
To: linux-hwmon
Dear hwmon community,
I developed the driver for the max31827 temperature sensor, but when
doing so I omitted some functionalities of the chip, namely: PEC Error,
Fault Queue, Comp/Int, Alarm Polarity, Resolution, Timeout and PEC
Enable. I did not implement these, because there are no predefined
attributes in the linux kernel which have similar meaning to these
funcionalities.
I recently got a request from the client to implement these
functionalities. I want to use SENSOR_DEVICE_ATTR to implement these. I
did some reading and saw that using debufs is also a possibility.
I would be really greatful, if you could provide me with some advices.
Should I proceed with device attributes defined by me? Should I use
debufs? Maybe there is another and better way...
Thank you in advance for your response!
Kind regards,
Daniel
Link to driver: https://github.com/torvalds/linux/blob/master/drivers/hwmon/max31827.c
Link to datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/MAX31827-MAX31829.pdf#page=13&zoom=220,-9,487
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Functional enhancement of max31827
2023-07-28 6:49 Functional enhancement of max31827 Daniel Matyas
@ 2023-07-29 14:25 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2023-07-29 14:25 UTC (permalink / raw)
To: Daniel Matyas, linux-hwmon
On 7/27/23 23:49, Daniel Matyas wrote:
> Dear hwmon community,
>
> I developed the driver for the max31827 temperature sensor, but when
> doing so I omitted some functionalities of the chip, namely: PEC Error,
> Fault Queue, Comp/Int, Alarm Polarity, Resolution, Timeout and PEC
> Enable. I did not implement these, because there are no predefined
> attributes in the linux kernel which have similar meaning to these
> funcionalities.
>
> I recently got a request from the client to implement these
> functionalities. I want to use SENSOR_DEVICE_ATTR to implement these. I
> did some reading and saw that using debufs is also a possibility.
>
> I would be really greatful, if you could provide me with some advices.
> Should I proceed with device attributes defined by me? Should I use
> debufs? Maybe there is another and better way...
>
pec related attributes should be attached to the i2c interface. Other
drivers already do that; look for pec_{show,store}. The same is true
for timeout.
Comp/Int and Alarm polarity are system properties which should be set
via devicetree.
For others I am not sure. Fault Queue also smells like a system property
since normally one would only modify it if a given system requires it
(for example because the sensors are noisy). The same is true for sensor
resolution, though that one is closest for considering a sysfs attribute.
For most sensors, the resolution is closely related to conversion time
and can be handled with that attribute. I think that isn't the case here,
and there are numerous chips where the resolution is configurable, so it
may make sense to consider a sysfs attribute.
Guenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-29 14:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-28 6:49 Functional enhancement of max31827 Daniel Matyas
2023-07-29 14:25 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox