i2c_new_device and device tree

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i2c_new_device and device tree

2,132 Views
andreatessadri
Contributor I

I am making a device driver for a TI Deserializer/Serializer chip to remotize the I2C bus (via high speed serial link) connected to a iMX6q processor. The result will be that whenever the serial link is in place, some I2C devices will be reachable from the local I2C bus connected to the deserializer chip. When the link is down such devices have to be destroyed and reconfigured when the link will come up again.

What I am currently doing is:

1) to add an entry in the device tree for each I2C remote device

2) in the "connect" function of the deserializer driver I will call i2c_new_device for each remote device that have to be created (same as imx6qdl.dtsi)

My concern is that I would like to prevent the device probing from the device tree, in order to wait that the deserializer driver will create remote I2C devices and it will invoke the related drivers.

What is happening now is that:

1) if the deserializer driver is able to create a remote I2C device before that this device would be probed from the device tree I2C scan, the related driver invoked won't be able to access to device tree node for this I2C device

2) if the device tree I2C scan will try to probe for the I2C remote device it will prevent the deserializer driver from creating the device via i2c_new_device (error address busy)

So, is there any way to specify in the device tree that an I2C device shouldn't be probed automatically ? And again, how to get access to I2C device node in the device tree for a new probed device that has been created via i2c_new_device ?

Thank you in advance

Andrew

Italy

0 Kudos
1 Reply

928 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi Andrew,

I am not an expert in Linux, but do you think that maybe setting an udev rule for the devices can help?

As far as I understand the device tree helps just as description of hardware and devices that cannot be "enumarated" in your system dinamycally.

Maybe there is a way to implement it that way.

Regards,

Alejandro

0 Kudos