Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/
Other
11.03k
stars
4.96k
forks
source link
dtoverlay=ADS1115 does not support loading multiple devices at different i2c addresses #4213
Describe the bug
The overlay works properly for a single device, but the device supports multiple addresses so the overlay needs to support using multiple devices at different addresses concurrently.
To reproduce
instantiate the overlay 2x in the /boot/config.txt. only changing the dtparam=addr=0x48 between the 2 devices
Expected behaviour
Both devices should be loaded as separate devices and detectable using i2cdetect -y 1 command
Actual behaviour
Only the last instance of the dtoverlay=ads1115 is actually used, so I have devices at 0x48 and 0x49. When I check the i2c bus scan, I can only see the 0x49 device loaded.
System
Copy and paste the results of the raspinfo command in to this section. Alternatively, copy and paste a pastebin link, or add answers to the following questions:
Which model of Raspberry Pi?
4b/4G
Which OS and version (cat /etc/rpi-issue)?
root@openrepeater-bd16:~# cat /etc/rpi-issue
Raspberry Pi reference 2019-07-10
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 175dfb027ffabd4b8d5080097af0e51ed9a4a56c, stage2
Which firmware version (vcgencmd version)?
root@openrepeater-bd16:~# vcgencmd version
Jul 9 2019 14:37:58
Copyright (c) 2012 Broadcom
version d2b1b7fb01475cb3914b2086299e32d724e832f1 (clean) (release) (start)
Which kernel version (uname -a)?
root@openrepeater-bd16:~# uname -a
Linux openrepeater-bd16 4.19.57-v7l+ #1244 SMP Thu Jul 4 18:48:07 BST 2019 armv7l GNU/Linux
Logs
If applicable, add the relevant output from dmesg or similar.
root@openrepeater-bd16:~# dmesg | grep ads1
[ 6.913652] ads1015 1-0049: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
Describe the bug The overlay works properly for a single device, but the device supports multiple addresses so the overlay needs to support using multiple devices at different addresses concurrently.
To reproduce instantiate the overlay 2x in the /boot/config.txt. only changing the dtparam=addr=0x48 between the 2 devices
dtoverlay=ads1115 dtparam=addr=0x48 dtparam=cha_enable dtparam=cha_cfg=4 dtparam=cha_datarate=7 dtparam=cha_gain=1 dtparam=chb_enable dtparam=chb_cfg=5 dtparam=chb_datarate=7 dtparam=chb_gain=1 dtparam=chc_enable dtparam=chc_cfg=6 dtparam=chc_datarate=7 dtparam=chc_gain=1 dtparam=chd_enable dtparam=chd_cfg=7 dtparam=chd_datarate=7 dtparam=chd_gain=1
dtoverlay=ads1115 dtparam=addr=0x49 dtparam=cha_enable dtparam=cha_cfg=4 dtparam=cha_datarate=7 dtparam=cha_gain=1 dtparam=chb_enable dtparam=chb_cfg=5 dtparam=chb_datarate=7 dtparam=chb_gain=1 dtparam=chc_enable dtparam=chc_cfg=6 dtparam=chc_datarate=7 dtparam=chc_gain=1 dtparam=chd_enable dtparam=chd_cfg=7 dtparam=chd_datarate=7 dtparam=chd_gain=1
Expected behaviour Both devices should be loaded as separate devices and detectable using i2cdetect -y 1 command
Actual behaviour Only the last instance of the dtoverlay=ads1115 is actually used, so I have devices at 0x48 and 0x49. When I check the i2c bus scan, I can only see the 0x49 device loaded.
System Copy and paste the results of the raspinfo command in to this section. Alternatively, copy and paste a pastebin link, or add answers to the following questions:
Which model of Raspberry Pi? 4b/4G
Which OS and version (
cat /etc/rpi-issue
)? root@openrepeater-bd16:~# cat /etc/rpi-issue Raspberry Pi reference 2019-07-10 Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 175dfb027ffabd4b8d5080097af0e51ed9a4a56c, stage2Which firmware version (
vcgencmd version
)? root@openrepeater-bd16:~# vcgencmd version Jul 9 2019 14:37:58 Copyright (c) 2012 Broadcom version d2b1b7fb01475cb3914b2086299e32d724e832f1 (clean) (release) (start)Which kernel version (
uname -a
)?root@openrepeater-bd16:~# uname -a Linux openrepeater-bd16 4.19.57-v7l+ #1244 SMP Thu Jul 4 18:48:07 BST 2019 armv7l GNU/Linux
Logs If applicable, add the relevant output from
dmesg
or similar.root@openrepeater-bd16:~# dmesg | grep ads1 [ 6.913652] ads1015 1-0049: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
Additional context https://cdn-shop.adafruit.com/datasheets/ads1115.pdf, Page 14 shows the available address options simple source to get breakout boards if needed: https://www.adafruit.com/product/1085