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 suport for TI INA238 power monitor #6629

Merged
merged 2 commits into from
Jan 26, 2025

Conversation

jsarrett
Copy link
Contributor

This commit adds support for the TI INA238 power monitor IC via I2C. It also builds the driver as a module by default.

I needed it on a custom CM4 board, and it would be much nicer if it were in-tree for the future.

@jsarrett
Copy link
Contributor Author

according to https://docs.kernel.org/devicetree/bindings/dts-coding-style.html Device tree files should be indented with Kernel style (i.e. spaces) why is checkpatch review complaining about that?

@pelwell
Copy link
Contributor

pelwell commented Jan 24, 2025

As long as indentation is consistent - single TABs, or either 4 or 8 spaces - we'll accept it. However, your overlay switches from TABs to spaces in places. Other than that, my problems with the overlay are:

  1. I think it belongs in the i2c-sensor overlay. There you can benefit from the existing boiler plate for bus selection (which is about to change anyway).
  2. It's not documented. As part of i2c-sensor you won't need to document all the i2c bus selection parameters.

@jsarrett
Copy link
Contributor Author

jsarrett commented Jan 24, 2025 via email

@pelwell
Copy link
Contributor

pelwell commented Jan 24, 2025

Two commits - one for DTS, one for the defconfigs - in one PR is best.

@jsarrett
Copy link
Contributor Author

Two commits - one for DTS, one for the defconfigs - in one PR is best.

Done! LMK if you want more/different changes. I've got another sensor to make a PR for as well, so the more I know how you guys want things the easier that will be.

@pelwell
Copy link
Contributor

pelwell commented Jan 25, 2025

The overlay check in the auto-builds is complaining that you've not described your additions in the overlays README: https://github.com/raspberrypi/linux/actions/runs/12961018541/job/36157211009?pr=6629#step:4:575

This patch adds the ina238 device tree parameters to the i2c-sensors
overlay.  The ina238 driver needs 2 configuration parameters, shut_resistor
and ti,shunt-gain in addition to it's address, so they are added as well.
@pelwell pelwell merged commit 3b98637 into raspberrypi:rpi-6.6.y Jan 26, 2025
11 of 12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Jan 27, 2025
See: raspberrypi/linux#6629

kernel: add shtc3 to i2c-sensors
See: raspberrypi/linux#6633

kernel: drivers: media: pci: Update Hailo accelerator device driver to v4.20
See: raspberrypi/linux#6628
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Jan 27, 2025
See: raspberrypi/linux#6629

kernel: add shtc3 to i2c-sensors
See: raspberrypi/linux#6633

kernel: drivers: media: pci: Update Hailo accelerator device driver to v4.20
See: raspberrypi/linux#6628
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