old-module-parameters 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. I2C device driver binding control from user-space
  2. =================================================
  3. Up to kernel 2.6.32, many i2c drivers used helper macros provided by
  4. <linux/i2c.h> which created standard module parameters to let the user
  5. control how the driver would probe i2c buses and attach to devices. These
  6. parameters were known as "probe" (to let the driver probe for an extra
  7. address), "force" (to forcibly attach the driver to a given device) and
  8. "ignore" (to prevent a driver from probing a given address).
  9. With the conversion of the i2c subsystem to the standard device driver
  10. binding model, it became clear that these per-module parameters were no
  11. longer needed, and that a centralized implementation was possible. The new,
  12. sysfs-based interface is described in the documentation file
  13. "instantiating-devices", section "Method 4: Instantiate from user-space".
  14. Below is a mapping from the old module parameters to the new interface.
  15. Attaching a driver to an I2C device
  16. -----------------------------------
  17. Old method (module parameters):
  18. # modprobe <driver> probe=1,0x2d
  19. # modprobe <driver> force=1,0x2d
  20. # modprobe <driver> force_<device>=1,0x2d
  21. New method (sysfs interface):
  22. # echo <device> 0x2d > /sys/bus/i2c/devices/i2c-1/new_device
  23. Preventing a driver from attaching to an I2C device
  24. ---------------------------------------------------
  25. Old method (module parameters):
  26. # modprobe <driver> ignore=1,0x2f
  27. New method (sysfs interface):
  28. # echo dummy 0x2f > /sys/bus/i2c/devices/i2c-1/new_device
  29. # modprobe <driver>
  30. Of course, it is important to instantiate the "dummy" device before loading
  31. the driver. The dummy device will be handled by i2c-core itself, preventing
  32. other drivers from binding to it later on. If there is a real device at the
  33. problematic address, and you want another driver to bind to it, then simply
  34. pass the name of the device in question instead of "dummy".