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 adt7410 (module and overlay) #5738

Merged
merged 1 commit into from
Nov 24, 2023
Merged

Add support for adt7410 (module and overlay) #5738

merged 1 commit into from
Nov 24, 2023

Conversation

aSmig
Copy link
Contributor

@aSmig aSmig commented Nov 23, 2023

The Analog Devices ADT7410 is a high precision temperature sensor with growing popularity. This PR seeks to add the module and overlay.

@aSmig aSmig changed the title adt7410 overlay Add support for adt7410 (module and overlay) Nov 23, 2023
@aSmig
Copy link
Contributor Author

aSmig commented Nov 23, 2023

File sizes are fairly small:
2.0K /boot/firmware/overlays/adt7410.dtbo
4.0K /lib/modules/6.1.61-v8+/kernel/drivers/hwmon/adt7410.ko.xz
4.0K /lib/modules/6.1.61-v8+/kernel/drivers/hwmon/adt7x10.ko.xz
10.0K total

@pelwell
Copy link
Contributor

pelwell commented Nov 23, 2023

This needs a few small changes:

  1. Without an entry in overlays/Makefile it won't be compiled and installed.
  2. Don't include CONFIG_SENSORS_ADT7X10=m to the defconfigs - it is implied by CONFIG_SENSORS_ADT7410=m.

Otherwise it looks good.

@aSmig
Copy link
Contributor Author

aSmig commented Nov 23, 2023

Thanks for the quick review! How is this? I appreciate the extra help.

@pelwell
Copy link
Contributor

pelwell commented Nov 23, 2023

Looks good. I'll let the build checks run, squash them down to two commits, and merge offline.

@pelwell
Copy link
Contributor

pelwell commented Nov 23, 2023

On second thoughts (first thought, if I'm honest), as this is such a simple overlay for an I2C-attached sensor, I'd rather add it to the i2c-sensor overlay. There's a new commit that adds adt7410 as a parameter - does that work for you?

@aSmig
Copy link
Contributor Author

aSmig commented Nov 24, 2023

Putting this into i2c-sensor sounds very reasonable. Unfortunately I haven't been successful at testing this approach on my system.

$ sudo dtoverlay i2c-sensor adt7410 addr=0x4a
* Failed to apply overlay '0_i2c-sensor' (kernel)

The simpler adt7410.dtbo did load successfully. This is new territory for me so I'm not sure how to debug. I also tried loading i2c-sensors,adt7410,addr=0x4a via config.txt with no luck. I must be doing something wrong when compiling the i2c-sensor overlay, so here are my steps:

wget https://raw.githubusercontent.com/raspberrypi/linux/5f9c19e21de5ed2a57d5560698a4ce2440518f62/arch/arm/boot/dts/overlays/i2c-sensor-common.dtsi
cpp -nostdinc -I ~/linux/include -undef -x assembler-with-cpp i2c-sensor-common.dtsi i2c-sensor-common.dtsi.preprocessed
mv i2c-sensor-common.dtsi.preprocessed i2c-sensor-common.dtsi
cp ~/linux/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts .
dtc -O dtb i2c-sensor-common.dtsi -o i2c-sensor.dtbo
sudo cp i2c-sensor.dtbo /boot/overlays/

If you are confident that everything is fine and will just work with a complete kennel build, no need to help me troubleshoot my broken testing process. I'll trust you. Thanks again for your work!

@pelwell
Copy link
Contributor

pelwell commented Nov 24, 2023

There was an unwanted underscore in one of the labels, which then ended up being undefined. I've tested and pushed a modified version. Until recently the dtoverlay command (not the config.txt directive) would fail because it lacked support for the newer overlay features - that should all be fixed in the latest version - but I think the i2c-sensor overlay is sufficiently simple that it would work even with older installs.

@pelwell
Copy link
Contributor

pelwell commented Nov 24, 2023

By the way, I would have written your compilation step like this:

dtc -@ -Hepapr -I dts -O dtb -o i2c-sensor.dtbo i2c-sensor-overlay.dts

Some of the difference are cosmetic or nice-to-haves, but some of them (the -@, using the correct source file) are not.

@pelwell pelwell merged commit 77a01f7 into raspberrypi:rpi-6.1.y Nov 24, 2023
11 of 12 checks passed
@aSmig
Copy link
Contributor Author

aSmig commented Nov 25, 2023

This is great, thanks! Your updated i2c-sensor-common.dtsi is working on my system when compiled correctly, thanks for the tips. Don't we still need CONFIG_SENSORS_ADT7410=m added to the configs?

@pelwell
Copy link
Contributor

pelwell commented Nov 25, 2023

You're right - commit 057e09b added.

@aSmig
Copy link
Contributor Author

aSmig commented Nov 26, 2023

Perfect. Thank you so much!

@aSmig aSmig deleted the adt7410-overlay branch November 26, 2023 01:26
pelwell pushed a commit that referenced this pull request Nov 27, 2023
pelwell pushed a commit that referenced this pull request Nov 27, 2023
pelwell pushed a commit that referenced this pull request Nov 28, 2023
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Nov 28, 2023
See: raspberrypi/linux#5742

kernel: drm/vc4: vec: Add the margin properties to the connector
See: raspberrypi/linux#5745

kernel: drm: panel: jdi-lt070me05000: Add prepare_upstream_first flag
See: raspberrypi/linux#5569

kernel: Add support for adt7410 (module and overlay)
See: raspberrypi/linux#5738

kernel: drivers: media: cfe: Find the source pads on the sensor entity
See: raspberrypi/linux#5744

kernel: dtoverlays: Add option for cam0 to camera-mux-Nport overlays
See: raspberrypi/linux#5752

kernel: ASoC: dwc: Permit sample rates up to 384kHz
See: raspberrypi/linux#5751
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Nov 28, 2023
See: raspberrypi/linux#5742

kernel: drm/vc4: vec: Add the margin properties to the connector
See: raspberrypi/linux#5745

kernel: drm: panel: jdi-lt070me05000: Add prepare_upstream_first flag
See: raspberrypi/linux#5569

kernel: Add support for adt7410 (module and overlay)
See: raspberrypi/linux#5738

kernel: drivers: media: cfe: Find the source pads on the sensor entity
See: raspberrypi/linux#5744

kernel: dtoverlays: Add option for cam0 to camera-mux-Nport overlays
See: raspberrypi/linux#5752

kernel: ASoC: dwc: Permit sample rates up to 384kHz
See: raspberrypi/linux#5751
popcornmix pushed a commit that referenced this pull request Nov 28, 2023
popcornmix pushed a commit that referenced this pull request Nov 29, 2023
popcornmix pushed a commit that referenced this pull request Nov 29, 2023
popcornmix pushed a commit that referenced this pull request Dec 5, 2023
popcornmix pushed a commit that referenced this pull request Dec 5, 2023
popcornmix pushed a commit that referenced this pull request Dec 5, 2023
popcornmix pushed a commit that referenced this pull request Dec 8, 2023
popcornmix pushed a commit that referenced this pull request Dec 11, 2023
popcornmix pushed a commit that referenced this pull request Dec 11, 2023
popcornmix pushed a commit that referenced this pull request Dec 14, 2023
popcornmix pushed a commit that referenced this pull request Jan 11, 2024
popcornmix pushed a commit that referenced this pull request Jan 17, 2024
popcornmix pushed a commit that referenced this pull request Jan 17, 2024
popcornmix pushed a commit that referenced this pull request Jan 22, 2024
popcornmix pushed a commit that referenced this pull request Jan 22, 2024
popcornmix pushed a commit that referenced this pull request Jan 29, 2024
popcornmix pushed a commit that referenced this pull request Jan 30, 2024
popcornmix pushed a commit that referenced this pull request Feb 6, 2024
popcornmix pushed a commit that referenced this pull request Feb 6, 2024
popcornmix pushed a commit that referenced this pull request Feb 19, 2024
popcornmix pushed a commit that referenced this pull request Feb 19, 2024
popcornmix pushed a commit that referenced this pull request Feb 23, 2024
popcornmix pushed a commit that referenced this pull request Feb 23, 2024
popcornmix pushed a commit that referenced this pull request Mar 5, 2024
popcornmix pushed a commit that referenced this pull request Mar 5, 2024
popcornmix pushed a commit that referenced this pull request Mar 11, 2024
popcornmix pushed a commit that referenced this pull request Mar 19, 2024
popcornmix pushed a commit that referenced this pull request Mar 27, 2024
pelwell pushed a commit that referenced this pull request Apr 5, 2024
popcornmix pushed a commit that referenced this pull request Apr 5, 2024
rajeshkumarwr pushed a commit to rajeshkumarwr/linux-yocto that referenced this pull request Jul 9, 2024
rajeshkumarwr pushed a commit to rajeshkumarwr/linux-yocto that referenced this pull request Jul 10, 2024
rajeshkumarwr pushed a commit to rajeshkumarwr/linux-yocto that referenced this pull request Jul 18, 2024
rajeshkumarwr pushed a commit to rajeshkumarwr/linux-yocto that referenced this pull request Jul 20, 2024
commit d4573bf8ff30cf2c10fe1fa6a5b18bc9375f7a17 from
https://github.com/raspberrypi/linux.git rpi-6.6.y

See raspberrypi/linux#5738

Signed-off-by: Phil Elwell <[email protected]>
Signed-off-by: Rajeshkumar Ramasamy <[email protected]>
rajeshkumarwr pushed a commit to rajeshkumarwr/linux-yocto that referenced this pull request Jul 21, 2024
commit d4573bf8ff30cf2c10fe1fa6a5b18bc9375f7a17 from
https://github.com/raspberrypi/linux.git rpi-6.6.y

See raspberrypi/linux#5738

Signed-off-by: Phil Elwell <[email protected]>
Signed-off-by: Rajeshkumar Ramasamy <[email protected]>
rajeshkumarwr pushed a commit to rajeshkumarwr/linux-yocto that referenced this pull request Jul 21, 2024
commit d4573bf8ff30cf2c10fe1fa6a5b18bc9375f7a17 from
https://github.com/raspberrypi/linux.git rpi-6.6.y

See raspberrypi/linux#5738

Signed-off-by: Phil Elwell <[email protected]>
Signed-off-by: Rajeshkumar Ramasamy <[email protected]>
rajeshkumarwr pushed a commit to rajeshkumarwr/linux-yocto that referenced this pull request Aug 8, 2024
commit d4573bf8ff30cf2c10fe1fa6a5b18bc9375f7a17 from
https://github.com/raspberrypi/linux.git rpi-6.6.y

See raspberrypi/linux#5738

Signed-off-by: Phil Elwell <[email protected]>
Signed-off-by: Rajeshkumar Ramasamy <[email protected]>
rajeshkumarwr pushed a commit to rajeshkumarwr/linux-yocto that referenced this pull request Aug 9, 2024
commit d4573bf8ff30cf2c10fe1fa6a5b18bc9375f7a17 from
https://github.com/raspberrypi/linux.git rpi-6.6.y

See raspberrypi/linux#5738

Signed-off-by: Phil Elwell <[email protected]>
Signed-off-by: Rajeshkumar Ramasamy <[email protected]>
rajeshkumarwr pushed a commit to rajeshkumarwr/linux-yocto that referenced this pull request Aug 10, 2024
commit d4573bf8ff30cf2c10fe1fa6a5b18bc9375f7a17 from
https://github.com/raspberrypi/linux.git rpi-6.6.y

See raspberrypi/linux#5738

Signed-off-by: Phil Elwell <[email protected]>
Signed-off-by: Rajeshkumar Ramasamy <[email protected]>
rajeshkumarwr pushed a commit to rajeshkumarwr/linux-yocto that referenced this pull request Aug 10, 2024
commit d4573bf8ff30cf2c10fe1fa6a5b18bc9375f7a17 from
https://github.com/raspberrypi/linux.git rpi-6.6.y

See raspberrypi/linux#5738

Signed-off-by: Phil Elwell <[email protected]>
Signed-off-by: Rajeshkumar Ramasamy <[email protected]>
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