Re: [PATCH 3/3] i2c: expose adapter probe and remove probed functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/16/2016 04:03 PM, Wolfram Sang wrote:

The intended use of these functions is for LEGO MINDSTORMS sensors. These
are hot-plugable I2C devices. When a sensor is connected, i2c_adapter_probe()
is called to automatically configure the sensor. When the sensor is
disconnected, i2c_adapter_remove_probed() is called to remove the
automatically configured device.

How do you detect the hot-plug events?


There are "port" drivers that do this. An I2C adapter is assigned to each port via device-tree or platform data struct.

Port driver code if you are interested:
- https://github.com/ev3dev/lego-linux-drivers/blob/master/ev3/legoev3_ports_in.c - https://github.com/ev3dev/lego-linux-drivers/blob/master/evb/evb_ports_in.c

In particular, here is where we call the new i2c_adapter_probe() function: https://github.com/ev3dev/lego-linux-drivers/blob/master/evb/evb_ports_in.c#L543



--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux