All of lore.kernel.org
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier@osg.samsung.com>
To: linux-kernel@vger.kernel.org
Cc: devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Lee Jones <lee.jones@linaro.org>,
	Javier Martinez Canillas <javier@osg.samsung.com>
Subject: [PATCH v3 6/7] mfd: tps6105x: Add OF device ID table
Date: Sat,  1 Apr 2017 03:18:53 -0400	[thread overview]
Message-ID: <20170401071854.23198-7-javier@osg.samsung.com> (raw)
In-Reply-To: <20170401071854.23198-1-javier@osg.samsung.com>

The driver doesn't have a struct of_device_id table but supported devices
are registered via Device Trees. This is working on the assumption that a
I2C device registered via OF will always match a legacy I2C device ID and
that the MODALIAS reported will always be of the form i2c:<device>.

But this could change in the future so the correct approach is to have a
OF device ID table if the devices are registered via OF.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

---

Changes in v3:
- Add a vendor prefix to the compatible string (Rob Herring).

Changes in v2:
- Don't use of_match_ptr() to avoid build warning when CONFIG_OF is disabled.

 drivers/mfd/tps6105x.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mfd/tps6105x.c b/drivers/mfd/tps6105x.c
index baa12ea666fb..187848c93779 100644
--- a/drivers/mfd/tps6105x.c
+++ b/drivers/mfd/tps6105x.c
@@ -173,9 +173,17 @@ static const struct i2c_device_id tps6105x_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, tps6105x_id);
 
+static const struct of_device_id tps6105x_of_match[] = {
+	{ .compatible = "ti,tps61050" },
+	{ .compatible = "ti,tps61052" },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, tps6105x_of_match);
+
 static struct i2c_driver tps6105x_driver = {
 	.driver = {
 		.name	= "tps6105x",
+		.of_match_table = tps6105x_of_match,
 	},
 	.probe		= tps6105x_probe,
 	.remove		= tps6105x_remove,
-- 
2.9.3

  parent reply	other threads:[~2017-04-01  7:19 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-01  7:18 [PATCH v3 0/7] mfd: Add OF device table to I2C drivers that are missing it Javier Martinez Canillas
2017-04-01  7:18 ` Javier Martinez Canillas
2017-04-01  7:18 ` Javier Martinez Canillas
2017-04-01  7:18 ` [PATCH v3 1/7] mfd: Add Device Tree bindings document for retu/tahvo ASIC chips Javier Martinez Canillas
2017-04-03 11:13   ` Lee Jones
2017-04-03 11:13     ` Lee Jones
2017-04-03 15:40     ` Javier Martinez Canillas
2017-04-01  7:18 ` [PATCH v3 2/7] mfd: retu: Add OF device ID table Javier Martinez Canillas
2017-04-03 11:15   ` Lee Jones
2017-04-03 11:15     ` Lee Jones
2017-04-03 15:45     ` Javier Martinez Canillas
2017-04-03 22:20       ` Rob Herring
2017-04-03 22:24         ` Javier Martinez Canillas
2017-04-03 22:24           ` Javier Martinez Canillas
2017-04-03 22:53           ` Aaro Koskinen
2017-04-03 22:53             ` Aaro Koskinen
2017-04-03 22:58             ` Tony Lindgren
2017-04-03 23:00               ` Javier Martinez Canillas
2017-04-03 23:00                 ` Javier Martinez Canillas
2017-04-01  7:18 ` [PATCH v3 3/7] i2c: i2c-cbus-gpio: Add vendor prefix to retu node in example Javier Martinez Canillas
2017-04-01  7:18 ` [PATCH v3 4/7] ARM: dts: n8x0: Add vendor prefix to retu node Javier Martinez Canillas
2017-04-01  7:18   ` Javier Martinez Canillas
2017-04-01  7:18   ` Javier Martinez Canillas
2017-04-01  7:18 ` [PATCH v3 5/7] mfd: Add Device Tree bindings document for TI tps6105x chip Javier Martinez Canillas
2017-04-01  7:18   ` Javier Martinez Canillas
2017-04-03 11:15   ` Lee Jones
2017-04-03 11:15     ` Lee Jones
2017-04-03 15:47     ` Javier Martinez Canillas
2017-04-04  8:27       ` Lee Jones
2017-04-04 11:48         ` Javier Martinez Canillas
2017-04-04 11:48           ` Javier Martinez Canillas
2017-04-01  7:18 ` Javier Martinez Canillas [this message]
2017-04-01  7:18 ` [PATCH v3 7/7] ARM: ux500: Add vendor prefix to tps61052 node Javier Martinez Canillas
2017-04-01  7:18   ` Javier Martinez Canillas

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=20170401071854.23198-7-javier@osg.samsung.com \
    --to=javier@osg.samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.