How can I resolve the "Failed to acquire I2C client" error in my kernel space I2C DAC implementation
@Middleware & OS
How can I use the I2C bus(DAC) in kernel space, I have verified that the I2C adapter and address in kernel space, I expected to get a
Successfully acquired i2c client
message in my log but still getting the error Failed to acquire I2C client
Here's my code
3 Replies
Hi @Boss lady , make sure that the I2C adapter
index 1
is correct and that it corresponds to the correct I2C bus on your hardware. You can check this in the /sys/class/i2c-adapter
directory.@Boss lady check the value returned from the
i2c_get_adapter
of its correctly obtained, if it returns Null then there's issue with the adapterThanks @RED HAT I checked /sys/class/i2c-adapter and confirmed that index 1 is correct. I also enabled logging and saw that i2c_get_adapter is returning a valid pointer. The problem seems to be with i2c_new_device.