[alsa-devel] [PATCH 1/2] ALSA: ASoC: add DT bindings for cs4270

Stephen Warren swarren at wwwdotorg.org
Wed Jul 25 00:00:37 CEST 2012


On 07/24/2012 02:30 PM, Timur Tabi wrote:
> Daniel Mack wrote:
>> How do you instanciate it then? Somehow the DT core must know which
>> device to probe for a node, right?
> 
> drivers/of/of_i2c.c
> 
> It scans the device tree looking for I2C devices and registers them.

The I2C code matches the compatible values from the device tree against
two tables in the kernel. First, the of_match_table that this patch
adds, and then if there's no match it falls back to the I2C device ID
table, and matches that against the DT compatible value with the vendor
prefix stripped off.

So while the second method does work as a fall-back, in the past I've
received guidance (I think from Grant Likely) that we should still add
the of_match_table to drivers in order to be explicit.


More information about the Alsa-devel mailing list