UPSTREAM: ASoC: rt5616: add an of_match table
authorJacob Chen <jacob2.chen@rock-chips.com>
Fri, 15 Jul 2016 01:43:06 +0000 (09:43 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 18 Jul 2016 03:53:30 +0000 (11:53 +0800)
Add a device tree match table. This serves to make the driver's support
of device tree more explicit.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Bug: 25923642
Patchset: rt5616 audio

(cherry picked from broonie/sound.git#for-next e17ff2de826f8c2153cf23c8bbd9097219a84fa9)
Signed-off-by: Kees Cook <keescook@chromium.org>
Change-Id: I7ee1967a3cdf9583942c0d75b5e4d0125d31cd0c
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
sound/soc/codecs/rt5616.c

index 0e9414abab65254e9ec03201bbddda56f19bcaa7..7bb56dddff8e4f9c2f0ae4a01a49cdb88e7cd5d4 100644 (file)
@@ -1287,6 +1287,14 @@ static const struct i2c_device_id rt5616_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, rt5616_i2c_id);
 
+#if defined(CONFIG_OF)
+static const struct of_device_id rt5616_of_match[] = {
+       { .compatible = "realtek,rt5616", },
+       {},
+};
+MODULE_DEVICE_TABLE(of, rt5616_of_match);
+#endif
+
 static int rt5616_i2c_probe(struct i2c_client *i2c,
                    const struct i2c_device_id *id)
 {
@@ -1359,6 +1367,7 @@ static void rt5616_i2c_shutdown(struct i2c_client *client)
 static struct i2c_driver rt5616_i2c_driver = {
        .driver = {
                .name = "rt5616",
+               .of_match_table = of_match_ptr(rt5616_of_match),
        },
        .probe = rt5616_i2c_probe,
        .remove = rt5616_i2c_remove,