mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] media: dw9719: Add of_match table
@ 2025-02-08 11:13 André Apitzsch via B4 Relay
  2025-02-09 14:20 ` Sakari Ailus
  0 siblings, 1 reply; 3+ messages in thread
From: André Apitzsch via B4 Relay @ 2025-02-08 11:13 UTC (permalink / raw)
  To: Daniel Scally, Sakari Ailus, Mauro Carvalho Chehab
  Cc: ~postmarketos/upstreaming, phone-devel, linux-media,
	linux-kernel, André Apitzsch

From: André Apitzsch <git@apitzsch.eu>

Add of_match table for "dongwoon,dw9719" and "dongwoon,dw9761"
compatible string. This fixes automatic driver loading when using a
device-tree, and if built as a module like major linux distributions do.

Signed-off-by: André Apitzsch <git@apitzsch.eu>
---
This patch depends on https://lore.kernel.org/linux-media/20241105203658.29737-1-hdegoede@redhat.com/
---
 drivers/media/i2c/dw9719.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/media/i2c/dw9719.c b/drivers/media/i2c/dw9719.c
index 032fbcb981f20f4e93202415e62f67379897a048..6c76212d4c698462a9128d26ef95f0eccb243c7c 100644
--- a/drivers/media/i2c/dw9719.c
+++ b/drivers/media/i2c/dw9719.c
@@ -360,6 +360,13 @@ static const struct i2c_device_id dw9719_id_table[] = {
 };
 MODULE_DEVICE_TABLE(i2c, dw9719_id_table);
 
+static const struct of_device_id dw9719_of_table[] = {
+	{ .compatible = "dongwoon,dw9719" },
+	{ .compatible = "dongwoon,dw9761" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, dw9719_of_table);
+
 static DEFINE_RUNTIME_DEV_PM_OPS(dw9719_pm_ops, dw9719_suspend, dw9719_resume,
 				 NULL);
 
@@ -367,6 +374,7 @@ static struct i2c_driver dw9719_i2c_driver = {
 	.driver = {
 		.name = "dw9719",
 		.pm = pm_sleep_ptr(&dw9719_pm_ops),
+		.of_match_table = of_match_ptr(dw9719_of_table),
 	},
 	.probe = dw9719_probe,
 	.remove = dw9719_remove,

---
base-commit: 8f6629c004b193d23612641c3607e785819e97ab
change-id: 20250206-dw9761dts-cdcc0c714b1a
prerequisite-message-id: 20241105203658.29737-1-hdegoede@redhat.com:v1
prerequisite-patch-id: b0a57666bd20b97291583c3052065dc314a37e79

Best regards,
-- 
André Apitzsch <git@apitzsch.eu>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] media: dw9719: Add of_match table
  2025-02-08 11:13 [PATCH v2] media: dw9719: Add of_match table André Apitzsch via B4 Relay
@ 2025-02-09 14:20 ` Sakari Ailus
  2025-02-09 21:01   ` André Apitzsch
  0 siblings, 1 reply; 3+ messages in thread
From: Sakari Ailus @ 2025-02-09 14:20 UTC (permalink / raw)
  To: git
  Cc: Daniel Scally, Sakari Ailus, Mauro Carvalho Chehab,
	~postmarketos/upstreaming, phone-devel, linux-media,
	linux-kernel

Hi André,

On Sat, Feb 08, 2025 at 12:13:49PM +0100, André Apitzsch via B4 Relay wrote:
> From: André Apitzsch <git@apitzsch.eu>
> 
> Add of_match table for "dongwoon,dw9719" and "dongwoon,dw9761"
> compatible string. This fixes automatic driver loading when using a
> device-tree, and if built as a module like major linux distributions do.
> 
> Signed-off-by: André Apitzsch <git@apitzsch.eu>

How about the DT bindings?

The configuration should be documented, too. See e.g. for an example
Documentation/devicetree/bindings/media/i2c/dongwoon,dw9768.yaml .

-- 
Regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] media: dw9719: Add of_match table
  2025-02-09 14:20 ` Sakari Ailus
@ 2025-02-09 21:01   ` André Apitzsch
  0 siblings, 0 replies; 3+ messages in thread
From: André Apitzsch @ 2025-02-09 21:01 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Daniel Scally, Sakari Ailus, Mauro Carvalho Chehab,
	~postmarketos/upstreaming, phone-devel, linux-media,
	linux-kernel

Hi,

Am Sonntag, dem 09.02.2025 um 14:20 +0000 schrieb Sakari Ailus:
> Hi André,
> 
> On Sat, Feb 08, 2025 at 12:13:49PM +0100, André Apitzsch via B4 Relay
> wrote:
> > From: André Apitzsch <git@apitzsch.eu>
> > 
> > Add of_match table for "dongwoon,dw9719" and "dongwoon,dw9761"
> > compatible string. This fixes automatic driver loading when using a
> > device-tree, and if built as a module like major linux
> > distributions do.
> > 
> > Signed-off-by: André Apitzsch <git@apitzsch.eu>
> 
> How about the DT bindings?
> 
> The configuration should be documented, too. See e.g. for an example
> Documentation/devicetree/bindings/media/i2c/dongwoon,dw9768.yaml .
> 

I was hoping, I could add it, when using the binding in a device tree.
I'll prepare a new version that also has a DT bindings patch.

Regards,
André

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-09 21:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-08 11:13 [PATCH v2] media: dw9719: Add of_match table André Apitzsch via B4 Relay
2025-02-09 14:20 ` Sakari Ailus
2025-02-09 21:01   ` André Apitzsch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®