summaryrefslogtreecommitdiffstats
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2016-11-07 12:47:37 +0000
committerWolfram Sang <wsa@the-dreams.de>2016-11-17 16:07:26 +0100
commitcabcf4f6be658b2d4bea26dee89d08fdf67d6811 (patch)
treeb67ee5e3f6f1d69df477231a283ca1c560476b69 /include/linux/i2c.h
parent811073b11b83c4da78413ecdb24c5adf3e5631ae (diff)
downloadlinux-cabcf4f6be658b2d4bea26dee89d08fdf67d6811.tar.gz
linux-cabcf4f6be658b2d4bea26dee89d08fdf67d6811.tar.xz
i2c: Add the ability to match device to compatible string without an of_node
A great deal of I2C devices are currently matched via DT node name, and as such the compatible naming convention of '<vendor>,<device>' has gone somewhat awry - some nodes don't supply one, some supply an arbitrary string and others the correct device name with an arbitrary vendor prefix. In an effort to correct this problem we have to supply a mechanism to match a device by compatible string AND by simple device name. This function strips off the '<vendor>,' part of a supplied compatible string and attempts to match without it. It is also used for sysfs, where a user can choose to instantiate a device on an i2c bus using the sysfs interface by providing a string and address to match and communicate with the device on the bus. Presently this string is only matched against the old i2c device id style strings, even in the presence of full device tree compatible strings with vendor prefixes. Providing a vendor-prefixed string to the sysfs interface will not match against the device tree of_match_device() calls as there is no device tree node to parse from the sysfs interface. This function can match both vendor prefixed and stripped compatible strings on the sysfs interface. Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Kieran Bingham <kieran@bingham.xyz> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'include/linux/i2c.h')
0 files changed, 0 insertions, 0 deletions