-
Notifications
You must be signed in to change notification settings - Fork 845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for MAX31875 #2600
Add support for MAX31875 #2600
Conversation
be420aa
to
9f5d6a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First round of review from me...
adi,comp-int: | ||
description: | ||
If present interrupt mode is used. If not present comparator mode is used | ||
(default). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe adi,interrupt-enable? But this also brings the question? Don't we need interrupts
to be set if IRQ mode is enabled? If so, you could use that standard property to know if IRQs are used or not...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I based this on an existing dt property: adi,comp-int
What this controls is the behavior of a STATUS BIT of the device: whether it will be de-asserted via an I2C read or when going below the hysteresis value. This is documented here.
Maybe, I can just modify the description to better reflect this behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I see... interrupt mode is misleading :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change the description into
If present, the Overtemperature Status bit operates in interrupt mode. If
not present, it operates in comparator mode (default).
Add documentation for devicetree bindings for max31875 Signed-off-by: John Erasmus Mari Geronimo <[email protected]>
9f5d6a3
to
3be0c10
Compare
MAX31875 Low-Power I2C Temperature Sensor Signed-off-by: John Erasmus Mari Geronimo <[email protected]>
Add entry for the MAX31875 driver. Signed-off-by: John Erasmus Mari Geronimo <[email protected]>
3be0c10
to
b9625f9
Compare
V2
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more inputs from me
&dev_attr_temp1_resolution.attr, | ||
NULL | ||
}; | ||
ATTRIBUTE_GROUPS(max31875); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends, if the mismatches in the register addresses are not that much and the differences overall you can always have a chip_info dedicated struct with the differences. Then no need for conditionals. As a reference look at this:
https://elixir.bootlin.com/linux/v6.11.3/source/drivers/iio/imu/adis16475.c#L900
And see how many devices we support in there. Anyways, up to you... but keep in mind the very same question might pop up upstream... Another thing to have in mind are the DT bindings. Even if you end up with a different driver, you should see if the bindings for the other device could be used for this one (adding the new compatible to the old file and taking care of all differences)
/** | ||
* In the extended format, the MSB is increased from 64C to 128C. | ||
*/ | ||
s32 temp = (sign_extend32(raw, 15) * (long)MILLI) >> (extend_fmt ? 7 : 8); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need the cast to long? I think what you need to reason is that if the multiplication can actually lead to 64bits? If so, you need a cast to s64...
PR Description
PR Type
PR Checklist