2

I'm trying to communicate with a device over I2C from my BeagleBone Black, and I'm a bit curious as to the device tree's interpretation of I2C. I see that there are a couple of device nodes within the actual I2C bus node itself, and these are visible in userspace under /sys/class/i2c-adapter/i2c-x/. But I can't seem to be able to view the status, or query the device like I would be able to with a GPIO device in /sys/class/gpio.

I can use SMBus to communicate with the I2C device within a C++ program, but I'm curious as to why some of these built-in devices (like the PMIC) have their own nodes. Is it for kernel driver reasons?

  • No idea how it works on the BeagleBone Black, but in general, you need the adapter entries for i2cdetect/i2cdump/i2cset/i2cget etc., and some kernel modules like eeprom also make client nodes. As there's no reliable way to detect an i2c client, the kernel can't automatically produce client nodes for each client. – dirkt Jan 24 '18 at 19:35
  • I see. After posting the question I went back through some other device's device trees and what seems to be the defining factor between a device that is a 'default' node on the bus and just a random node is whether or not there is a driver for that device. – T. Wallis Jan 24 '18 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.