* Creating a driver for MAX31827 temperature switch
@ 2023-04-02 21:31 Daniel Matyas
2023-04-02 23:42 ` Armin Wolf
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Daniel Matyas @ 2023-04-02 21:31 UTC (permalink / raw)
To: linux-iio; +Cc: linux-i2c, linux-hwmon
Dear Kernel community,
I am developing an IIO driver for a temperature switch, which communicates through I2C at Analog Devices Inc.
When implementing the event handling for the comparator mode of the device, I faced a problem: I don't know how to differentiate the underTemp event from the overTemp event. To understand better, I suggest you check out the device's data sheet for Address map (page 12), Configuration Register Definition (page 13) and OT/UT Status Bits and ALARM Pin Behavior (page 15) - https://www.analog.com/media/en/technical-documentation/data-sheets/MAX31827-MAX31829.pdf
I had the idea to make 2 channels with the exact same attributes, but with different indexes, so that I can store the overTemp related events on channel 0 and underTemp related events on channel 1. Even so, I don't really feel like this is the right solution. Can anyone give me some advice on this?
Also, I was suggested that I convert my driver from IIO to HWMON. Do you think that this is needed?
Yours faithfully,
Daniel Matyas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Creating a driver for MAX31827 temperature switch
2023-04-02 21:31 Creating a driver for MAX31827 temperature switch Daniel Matyas
@ 2023-04-02 23:42 ` Armin Wolf
2023-04-03 0:53 ` Guenter Roeck
2023-04-03 18:42 ` Jonathan Cameron
2 siblings, 0 replies; 4+ messages in thread
From: Armin Wolf @ 2023-04-02 23:42 UTC (permalink / raw)
To: Daniel Matyas, linux-iio; +Cc: linux-i2c, linux-hwmon
Am 02.04.23 um 23:31 schrieb Daniel Matyas:
> Dear Kernel community,
>
> I am developing an IIO driver for a temperature switch, which communicates through I2C at Analog Devices Inc.
>
> When implementing the event handling for the comparator mode of the device, I faced a problem: I don't know how to differentiate the underTemp event from the overTemp event. To understand better, I suggest you check out the device's data sheet for Address map (page 12), Configuration Register Definition (page 13) and OT/UT Status Bits and ALARM Pin Behavior (page 15) - https://www.analog.com/media/en/technical-documentation/data-sheets/MAX31827-MAX31829.pdf
>
> I had the idea to make 2 channels with the exact same attributes, but with different indexes, so that I can store the overTemp related events on channel 0 and underTemp related events on channel 1. Even so, I don't really feel like this is the right solution. Can anyone give me some advice on this?
>
> Also, I was suggested that I convert my driver from IIO to HWMON. Do you think that this is needed?
>
> Yours faithfully,
> Daniel Matyas
Hi,
regarding the question whether the driver should be a hwmon driver: i depends on the usage of the temperature sensor.
If its a low sample rate temperature sensor used to mainly monitor the temperature of the computer system itself, then
the driver should be a hwmon driver. The datasheet suggests that the sensor device is intended for monitoring computer systems,
so a hwmon driver would make sense (see https://www.kernel.org/doc/html/latest/driver-api/iio/intro.html).
Armin Wolf
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Creating a driver for MAX31827 temperature switch
2023-04-02 21:31 Creating a driver for MAX31827 temperature switch Daniel Matyas
2023-04-02 23:42 ` Armin Wolf
@ 2023-04-03 0:53 ` Guenter Roeck
2023-04-03 18:42 ` Jonathan Cameron
2 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2023-04-03 0:53 UTC (permalink / raw)
To: Daniel Matyas; +Cc: linux-iio, linux-i2c, linux-hwmon
On Mon, Apr 03, 2023 at 12:31:21AM +0300, Daniel Matyas wrote:
> Dear Kernel community,
>
> I am developing an IIO driver for a temperature switch, which communicates through I2C at Analog Devices Inc.
>
> When implementing the event handling for the comparator mode of the device, I faced a problem: I don't know how to differentiate the underTemp event from the overTemp event. To understand better, I suggest you check out the device's data sheet for Address map (page 12), Configuration Register Definition (page 13) and OT/UT Status Bits and ALARM Pin Behavior (page 15) - https://www.analog.com/media/en/technical-documentation/data-sheets/MAX31827-MAX31829.pdf
>
> I had the idea to make 2 channels with the exact same attributes, but with different indexes, so that I can store the overTemp related events on channel 0 and underTemp related events on channel 1. Even so, I don't really feel like this is the right solution. Can anyone give me some advice on this?
>
> Also, I was suggested that I convert my driver from IIO to HWMON. Do you think that this is needed?
>
This is a typical hardware monitoring chip, and the driver should be a
hardware monitoring driver.
Guenter
> Yours faithfully,
> Daniel Matyas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Creating a driver for MAX31827 temperature switch
2023-04-02 21:31 Creating a driver for MAX31827 temperature switch Daniel Matyas
2023-04-02 23:42 ` Armin Wolf
2023-04-03 0:53 ` Guenter Roeck
@ 2023-04-03 18:42 ` Jonathan Cameron
2 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2023-04-03 18:42 UTC (permalink / raw)
To: Daniel Matyas; +Cc: linux-iio, linux-i2c, linux-hwmon
On Mon, 3 Apr 2023 00:31:21 +0300
Daniel Matyas <daniel.matyas23@gmail.com> wrote:
> Dear Kernel community,
>
> I am developing an IIO driver for a temperature switch, which communicates through I2C at Analog Devices Inc.
>
> When implementing the event handling for the comparator mode of the device, I faced a problem: I don't know how to differentiate the underTemp event from the overTemp event. To understand better, I suggest you check out the device's data sheet for Address map (page 12), Configuration Register Definition (page 13) and OT/UT Status Bits and ALARM Pin Behavior (page 15) - https://www.analog.com/media/en/technical-documentation/data-sheets/MAX31827-MAX31829.pdf
>
> I had the idea to make 2 channels with the exact same attributes, but with different indexes, so that I can store the overTemp related events on channel 0 and underTemp related events on channel 1. Even so, I don't really feel like this is the right solution. Can anyone give me some advice on this?
If it's just a question of over and under temp, I'd imagine these map to two
different directions of IIO event. You can have one channel with RISING and FALLING
events on it.
e.g.
https://elixir.bootlin.com/linux/v6.2.9/source/drivers/iio/adc/max1363.c#L451
The place we run into IIO limitations is if you have two events in the same direction
(warn and critical for example) When that happens it is almost always a device
that fits better in hwmon anyway so we've never figured out how to enable this sort
of thing. Doesn't seem to apply here though.
>
> Also, I was suggested that I convert my driver from IIO to HWMON. Do you think that this is needed?
No obvious reason why this benefits from being in IIO so I'm agreeing with the others who have
replied that this looks more suited to hwmon.
Jonathan
>
> Yours faithfully,
> Daniel Matyas
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-04-03 18:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-02 21:31 Creating a driver for MAX31827 temperature switch Daniel Matyas
2023-04-02 23:42 ` Armin Wolf
2023-04-03 0:53 ` Guenter Roeck
2023-04-03 18:42 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox