Skip to content
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 #2635

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jemfgeronimo
Copy link

@jemfgeronimo jemfgeronimo commented Oct 27, 2024

PR Description

  • This adds support for the MAX31875 temperature sensor within the MAX31827 driver, along with corresponding device tree bindings.
  • Datasheet: MAX31875
  • Tested on RPI4 with MAX31875EVKIT

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly (if there is the case)

@jemfgeronimo jemfgeronimo changed the title Add support for MAX31875 Add support for MAX31875 v2 Oct 27, 2024
@jemfgeronimo jemfgeronimo marked this pull request as ready for review October 27, 2024 09:32
@jemfgeronimo jemfgeronimo changed the title Add support for MAX31875 v2 Add support for MAX31875 Oct 27, 2024
@jemfgeronimo jemfgeronimo mentioned this pull request Oct 28, 2024
6 tasks
@nunojsa
Copy link
Collaborator

nunojsa commented Oct 28, 2024

Why the new PR? Should we close #2600?

@jemfgeronimo
Copy link
Author

Why the new PR? Should we close #2600?

I've created this separate PR that introduces an alternative method to add driver support for the MAX31875. This involves using the existing MAX31827 driver to support the MAX31875.

Copy link
Collaborator

@nunojsa nunojsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think most of the complexity could go away with a chi_info struture where you have things like different register masks per device. Then accessing it in the code would be for example: st->info->cfg_reg.

Anyways, i think we can support this new device in the existing driver so I'll close the other PR


maintainers:
- Daniel Matyas <daniel.matyas@analog.com>
- John Erasmus Mari Geronimo <johnerasmusmari.geronimo@analog.com>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should mention this change in the commit message. You'll likely be asked why if we can have a fallback device for this one (one of the devices that the driver already supports). So you should also mention in the commit message why that is not possible.

Also speaking about the commit message, you're only stating the obvious there :). Give a small description of the HW.

Documentation/devicetree/bindings/hwmon/adi,max31827.yaml Outdated Show resolved Hide resolved
Documentation/devicetree/bindings/hwmon/adi,max31827.yaml Outdated Show resolved Hide resolved
drivers/hwmon/max31827.c Outdated Show resolved Hide resolved
drivers/hwmon/max31827.c Outdated Show resolved Hide resolved
drivers/hwmon/max31827.c Outdated Show resolved Hide resolved
drivers/hwmon/max31827.c Show resolved Hide resolved
drivers/hwmon/max31827.c Outdated Show resolved Hide resolved
…_info

Introduced chip_info structure to replace enum chips

Signed-off-by: John Erasmus Mari Geronimo <[email protected]>
Add max31875 to dt-bindings of max31827
MAX31875 is low-power I2C temperature sensor similar to MAX31827

Signed-off-by: John Erasmus Mari Geronimo <[email protected]>
@jemfgeronimo jemfgeronimo force-pushed the dev/max31875-v2 branch 2 times, most recently from 2995aed to 4b56b21 Compare November 13, 2024 03:45
Add support for MAX31875 Low-Power I2C Temperature Sensor in
MAX31827 driver

Signed-off-by: John Erasmus Mari Geronimo <[email protected]>
@jemfgeronimo
Copy link
Author

V2

  • dt-bindings: reverted enum of adi,fault-q
  • dt-bindings: dropped else branch in adi,fault-q
  • drivers: put error handling of fault queue values before its encoding
  • renamed max31827_chip_info to max31827_hwmon_chip_info
  • add chip_info structure to replace enum chips

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants