summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYauhen Kharuzhy <jekhor@gmail.com>2026-02-11 03:18:34 +0300
committerMark Brown <broonie@kernel.org>2026-02-23 02:52:09 +0300
commit9f56f0bd2e49876ceeaf9036887fe9b50dfa6b6b (patch)
tree77d58aba902eb6c0397d563d8457c6fb41374d8d
parentf43aed8dfecb10e95b8235d002990739ebe72c5e (diff)
downloadlinux-9f56f0bd2e49876ceeaf9036887fe9b50dfa6b6b.tar.xz
ASoC: rt5677: Allow it to be defined as an I2C board
Some devices (e.g., Lenovo Yoga Book YB1-X90) define the codec as i2c_board, so add an I2C ID table to support this. Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com> Link: https://patch.msgid.link/20260211002255.4090440-3-jekhor@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/rt5677.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index ccbd32cf8298..6628c7ca5a8a 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -5209,6 +5209,12 @@ static const struct acpi_device_id rt5677_acpi_match[] = {
};
MODULE_DEVICE_TABLE(acpi, rt5677_acpi_match);
+static const struct i2c_device_id rt5677_i2c_id[] = {
+ { "rt5677", RT5677 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, rt5677_i2c_id);
+
static void rt5677_read_device_properties(struct rt5677_priv *rt5677,
struct device *dev)
{
@@ -5532,7 +5538,6 @@ static int rt5677_init_irq(struct i2c_client *i2c)
static int rt5677_i2c_probe(struct i2c_client *i2c)
{
- struct device *dev = &i2c->dev;
struct rt5677_priv *rt5677;
int ret;
unsigned int val;
@@ -5547,7 +5552,7 @@ static int rt5677_i2c_probe(struct i2c_client *i2c)
INIT_DELAYED_WORK(&rt5677->dsp_work, rt5677_dsp_work);
i2c_set_clientdata(i2c, rt5677);
- rt5677->type = (enum rt5677_type)(uintptr_t)device_get_match_data(dev);
+ rt5677->type = (enum rt5677_type)(uintptr_t)i2c_get_match_data(i2c);
if (rt5677->type == 0)
return -EINVAL;
@@ -5666,6 +5671,7 @@ static struct i2c_driver rt5677_i2c_driver = {
.of_match_table = rt5677_of_match,
.acpi_match_table = rt5677_acpi_match,
},
+ .id_table = rt5677_i2c_id,
.probe = rt5677_i2c_probe,
.remove = rt5677_i2c_remove,
};