phone-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "André Apitzsch via B4 Relay" <devnull+git.apitzsch.eu@kernel.org>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	 Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	devicetree@vger.kernel.org,
	 Sakari Ailus <sakari.ailus@linux.intel.com>,
	 Daniel Scally <djrscally@gmail.com>
Cc: ~postmarketos/upstreaming@lists.sr.ht,
	phone-devel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, "Val Packett" <val@packett.cool>,
	"André Apitzsch" <git@apitzsch.eu>
Subject: [PATCH 3/7] media: i2c: dw9719: Add driver_data matching
Date: Sun, 17 Aug 2025 19:09:22 +0200	[thread overview]
Message-ID: <20250817-dw9719-v1-3-426f46c69a5a@apitzsch.eu> (raw)
In-Reply-To: <20250817-dw9719-v1-0-426f46c69a5a@apitzsch.eu>

From: Val Packett <val@packett.cool>

In preparation for adding models with different register sets, start
assigning the model based on the i2c match data.

Signed-off-by: Val Packett <val@packett.cool>
Signed-off-by: André Apitzsch <git@apitzsch.eu>
---
 drivers/media/i2c/dw9719.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/dw9719.c b/drivers/media/i2c/dw9719.c
index 5ed0042fce18acd9e6ce9f6cf6c6982e36fed275..7ce66eaede5a2a1ba9c4c30c0efc5fafcca339a0 100644
--- a/drivers/media/i2c/dw9719.c
+++ b/drivers/media/i2c/dw9719.c
@@ -282,6 +282,8 @@ static int dw9719_probe(struct i2c_client *client)
 	if (!dw9719)
 		return -ENOMEM;
 
+	dw9719->model = (enum dw9719_model)i2c_get_match_data(client);
+
 	dw9719->regmap = devm_cci_regmap_init_i2c(client, 8);
 	if (IS_ERR(dw9719->regmap))
 		return PTR_ERR(dw9719->regmap);
@@ -361,8 +363,8 @@ static void dw9719_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id dw9719_id_table[] = {
-	{ "dw9719" },
-	{ "dw9761" },
+	{ "dw9719", .driver_data = DW9719 },
+	{ "dw9761", .driver_data = DW9761 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, dw9719_id_table);

-- 
2.50.1



  parent reply	other threads:[~2025-08-17 17:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-17 17:09 [PATCH 0/7] media: i2c: dw9719: add DT compatible and DW9718S support André Apitzsch via B4 Relay
2025-08-17 17:09 ` [PATCH 1/7] dt-bindings: media: i2c: Add DW9718S, DW9719 and DW9761 VCM André Apitzsch via B4 Relay
2025-08-20 21:56   ` Rob Herring
2025-08-26 11:57     ` André Apitzsch
2025-08-17 17:09 ` [PATCH 2/7] media: i2c: dw9719: Deprecate dongwoon,vcm-freq André Apitzsch via B4 Relay
2025-08-17 17:09 ` André Apitzsch via B4 Relay [this message]
2025-08-17 20:28   ` [PATCH 3/7] media: i2c: dw9719: Add driver_data matching kernel test robot
2025-08-18  7:38   ` Sakari Ailus
2025-08-17 17:09 ` [PATCH 4/7] media: i2c: dw9719: Add DW9718S support André Apitzsch via B4 Relay
2025-08-17 17:09 ` [PATCH 5/7] media: i2c: dw9719: Update PM last busy time upon close André Apitzsch via B4 Relay
2025-08-18  7:37   ` Sakari Ailus
2025-08-17 17:09 ` [PATCH 6/7] media: i2c: dw9719: Add an of_match_table André Apitzsch via B4 Relay
2025-08-17 17:09 ` [PATCH 7/7] media: i2c: dw9719: Fix power on/off sequence André Apitzsch via B4 Relay
2025-08-18  7:44   ` Sakari Ailus

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=20250817-dw9719-v1-3-426f46c69a5a@apitzsch.eu \
    --to=devnull+git.apitzsch.eu@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=djrscally@gmail.com \
    --cc=git@apitzsch.eu \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=phone-devel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=val@packett.cool \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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;
as well as URLs for NNTP newsgroup(s).