SysFs entries add device/delete device

From Linux i2c Wiki
Revision as of 12:58, 2 April 2009 by Michael Lawnick (Talk | contribs)

Jump to: navigation, search

When a client module is successfully loaded (built-in or on boot), there is currently no way to add a later plugged in H/W-client from user space. I have now done a patch (File:Git diff.txt) that adds the entries add_device and delete_device to /sys/class/i2c-adapter/i2c-<busNo>/ .

But it does not make me really happy:

The function i2c_new_device I used as recommended, only calls the client's probe function. If probing succeeds, the client gets instantiated. But the detect function of the client, that is responsible to check compatibility isn't called this way. That results in the situation that root is able to instantiate e.g. a atxp1 system voltage controller where a lm75 is plugged in :-(

Even root shouldn't be able to do that (at least without -f[ource] parameter).

I will now try to discuss this issue on linux-i2c list before posting this patch on the list.

Personal tools