Boss lady
Boss lady
DIIDevHeads IoT Integration Server
Created by Boss lady on 7/8/2024 in #code-review
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
struct i2c_client *client;
struct i2c_adapter *adapter = i2c_get_adapter(1);
struct i2c_board_info info;
strlcpy(info.type, "i2c-dac", I2C_NAME_SIZE);
strlcpy(info.name, "My DAC", I2C_NAME_SIZE);
client = i2c_new_device(adapter, &info);
i2c_put_adapter(adapter);
struct i2c_client *client;
struct i2c_adapter *adapter = i2c_get_adapter(1);
struct i2c_board_info info;
strlcpy(info.type, "i2c-dac", I2C_NAME_SIZE);
strlcpy(info.name, "My DAC", I2C_NAME_SIZE);
client = i2c_new_device(adapter, &info);
i2c_put_adapter(adapter);
4 replies