CVSROOT:        /cvs
Module name:    src
Changes by:     v...@cvs.openbsd.org    2022/02/09 00:58:24

Modified files:
        share/man/man9 : iic.9 
        sys/dev/i2c    : i2c.c i2cvar.h 

Log message:
Add iic_is_compatible() for matching I2C devices

When using device trees, the ia_name field of struct i2c_attach_args
points to the first string of the device node's "compatible" array.
However, in many cases it would be preferable to use the last, most
general "compatible" entry as a device matching criterion.

Enable more flexible device matching by permitting ia_name to point to
the raw "compatible" data which is a concatenation of NUL-terminated
strings. I2C bus code will supply the data and set ia_name and
ia_namelen. I2C device drivers will use iic_is_compatible() to check
matches. This method is also backwards compatible with the old, direct
use of ia_name.

Prompted by a related patch from kettenis@.

OK kettenis@

Reply via email to