ASoC: codecs: aw88395: Add of_match_table

Message ID 20230711-topic-aw88395_of_tbl-v1-1-a05fdf5d0efa@linaro.org
State New
Headers
Series ASoC: codecs: aw88395: Add of_match_table |

Commit Message

Konrad Dybcio July 11, 2023, 7:06 p.m. UTC
  The i2c_match_id entry is not enough to get the device probing with DT.
Add an of match table in accordance with the bindings.

Fixes: 62fc25fbab5f ("ASoC: codecs: Add i2c and codec registration for aw88395 and their associated operation functions")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 sound/soc/codecs/aw88395/aw88395.c | 9 +++++++++
 1 file changed, 9 insertions(+)


---
base-commit: 8e4b7f2f3d6071665b1dfd70786229c8a5d6c256
change-id: 20230711-topic-aw88395_of_tbl-68b16c5860a5

Best regards,
  

Patch

diff --git a/sound/soc/codecs/aw88395/aw88395.c b/sound/soc/codecs/aw88395/aw88395.c
index 9dcd75dd799a..5ff01d3c31c8 100644
--- a/sound/soc/codecs/aw88395/aw88395.c
+++ b/sound/soc/codecs/aw88395/aw88395.c
@@ -566,9 +566,18 @@  static const struct i2c_device_id aw88395_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, aw88395_i2c_id);
 
+#ifdef CONFIG_OF
+static const struct of_device_id aw88395_of_match[] = {
+	{ .compatible = "awinic,aw88395" },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, aw88395_of_match);
+#endif
+
 static struct i2c_driver aw88395_i2c_driver = {
 	.driver = {
 		.name = AW88395_I2C_NAME,
+		.of_match_table = of_match_ptr(aw88395_of_match),
 	},
 	.probe = aw88395_i2c_probe,
 	.id_table = aw88395_i2c_id,