public inbox for linux-sound@vger.kernel.org
 help / color / mirror / Atom feed
From: Yauhen Kharuzhy <jekhor@gmail.com>
To: Oder Chiou <oder_chiou@realtek.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	Hans de Goede <hansg@kernel.org>,
	Yauhen Kharuzhy <jekhor@gmail.com>
Subject: [PATCH 2/7] ASoC: rt5677: Allow it to be defined as an I2C board
Date: Wed, 11 Feb 2026 02:18:34 +0200	[thread overview]
Message-ID: <20260211002255.4090440-3-jekhor@gmail.com> (raw)
In-Reply-To: <20260211002255.4090440-1-jekhor@gmail.com>

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>
---
 sound/soc/codecs/rt5677.c | 10 ++++++++--
 1 file 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,
 };
-- 
2.51.0


  parent reply	other threads:[~2026-02-11  0:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11  0:18 ASoC rt5677: Prepare to support Lenovo Yoga Book tablets Yauhen Kharuzhy
2026-02-11  0:18 ` [PATCH 1/7] ASoC: rt5677: Add 10EC5677 ACPI ID as supported Yauhen Kharuzhy
2026-02-25 19:06   ` Mark Brown
2026-02-11  0:18 ` Yauhen Kharuzhy [this message]
2026-02-11  0:18 ` [PATCH 3/7] ASoC: rt5677: Fix typo in the header file Yauhen Kharuzhy
2026-02-11  0:18 ` [PATCH 4/7] ASoC: rt5677: Report error if the ID register cannot be read Yauhen Kharuzhy
2026-02-11  0:18 ` [PATCH 5/7] ASoC: rt5677: Set up ACPI GPIO pins mapping table Yauhen Kharuzhy
2026-02-11  0:18 ` [PATCH 6/7] ASoC: rt5677: Reset the codec during probing Yauhen Kharuzhy
2026-02-11  0:18 ` [PATCH 7/7] ASoC: rt5677-spi: Add SPI device ID matching table Yauhen Kharuzhy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260211002255.4090440-3-jekhor@gmail.com \
    --to=jekhor@gmail.com \
    --cc=broonie@kernel.org \
    --cc=hansg@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=oder_chiou@realtek.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox