linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paweł Chmiel" <pawel.mikolaj.chmiel@gmail.com>
To: mchehab@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com
Cc: hverkuil@xs4all.nl, fischerdouglasc@gmail.com,
	keescook@chromium.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	"Paweł Chmiel" <pawel.mikolaj.chmiel@gmail.com>
Subject: [PATCH v2 1/4] si470x-i2c: Add device tree support
Date: Fri,  7 Dec 2018 14:58:09 +0100	[thread overview]
Message-ID: <20181207135812.12842-2-pawel.mikolaj.chmiel@gmail.com> (raw)
In-Reply-To: <20181207135812.12842-1-pawel.mikolaj.chmiel@gmail.com>

This commit enables device tree support adding simple of_match table.

Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
---
 drivers/media/radio/si470x/radio-si470x-i2c.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/media/radio/si470x/radio-si470x-i2c.c b/drivers/media/radio/si470x/radio-si470x-i2c.c
index 9751ea1d80be..250828ddb5fa 100644
--- a/drivers/media/radio/si470x/radio-si470x-i2c.c
+++ b/drivers/media/radio/si470x/radio-si470x-i2c.c
@@ -527,6 +527,13 @@ static int si470x_i2c_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(si470x_i2c_pm, si470x_i2c_suspend, si470x_i2c_resume);
 #endif
 
+#if IS_ENABLED(CONFIG_OF)
+static const struct of_device_id si470x_of_match[] = {
+	{ .compatible = "silabs,si470x" },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, si470x_of_match);
+#endif
 
 /*
  * si470x_i2c_driver - i2c driver interface
@@ -534,6 +541,7 @@ static SIMPLE_DEV_PM_OPS(si470x_i2c_pm, si470x_i2c_suspend, si470x_i2c_resume);
 static struct i2c_driver si470x_i2c_driver = {
 	.driver = {
 		.name		= "si470x",
+		.of_match_table = of_match_ptr(si470x_of_match),
 #ifdef CONFIG_PM_SLEEP
 		.pm		= &si470x_i2c_pm,
 #endif
-- 
2.17.1


  reply	other threads:[~2018-12-07 13:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-07 13:58 [PATCH v2 0/4] media: radio-si470x-i2c: Add device tree and reset gpio support Paweł Chmiel
2018-12-07 13:58 ` Paweł Chmiel [this message]
2018-12-07 13:58 ` [PATCH v2 2/4] si470x-i2c: Use managed resource helpers Paweł Chmiel
2018-12-07 13:58 ` [PATCH v2 3/4] si470x-i2c: Add optional reset-gpio support Paweł Chmiel
2018-12-07 13:58 ` [PATCH v2 4/4] media: dt-bindings: Add binding for si470x radio Paweł Chmiel
2018-12-18 16:13   ` Rob Herring

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=20181207135812.12842-2-pawel.mikolaj.chmiel@gmail.com \
    --to=pawel.mikolaj.chmiel@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fischerdouglasc@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mchehab@kernel.org \
    --cc=robh+dt@kernel.org \
    /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).