* [PATCH] mfd: cros_ec: i2c: Add OF match table
@ 2015-08-25 5:48 Javier Martinez Canillas
2015-08-25 7:34 ` Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Javier Martinez Canillas @ 2015-08-25 5:48 UTC (permalink / raw)
To: Lee Jones; +Cc: Javier Martinez Canillas, linux-kernel, Samuel Ortiz
The Documentation/devicetree/bindings/mfd/cros-ec.txt DT binding doc lists
"google,cros-ec-i2c" as a compatible string but the corresponding driver
does not have an OF match table. Add the table to the driver so the I2C
core can do an OF style match.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/mfd/cros_ec_i2c.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/mfd/cros_ec_i2c.c b/drivers/mfd/cros_ec_i2c.c
index d06e4b46db80..56a466469664 100644
--- a/drivers/mfd/cros_ec_i2c.c
+++ b/drivers/mfd/cros_ec_i2c.c
@@ -344,6 +344,12 @@ static int cros_ec_i2c_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(cros_ec_i2c_pm_ops, cros_ec_i2c_suspend,
cros_ec_i2c_resume);
+static const struct of_device_id cros_ec_i2c_of_match[] = {
+ { .compatible = "google,cros-ec-i2c", },
+ { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, cros_ec_i2c_of_match);
+
static const struct i2c_device_id cros_ec_i2c_id[] = {
{ "cros-ec-i2c", 0 },
{ }
@@ -353,6 +359,7 @@ MODULE_DEVICE_TABLE(i2c, cros_ec_i2c_id);
static struct i2c_driver cros_ec_driver = {
.driver = {
.name = "cros-ec-i2c",
+ .of_match_table = of_match_ptr(cros_ec_i2c_of_match),
.pm = &cros_ec_i2c_pm_ops,
},
.probe = cros_ec_i2c_probe,
--
2.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mfd: cros_ec: i2c: Add OF match table
2015-08-25 5:48 [PATCH] mfd: cros_ec: i2c: Add OF match table Javier Martinez Canillas
@ 2015-08-25 7:34 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2015-08-25 7:34 UTC (permalink / raw)
To: Javier Martinez Canillas; +Cc: linux-kernel, Samuel Ortiz
On Tue, 25 Aug 2015, Javier Martinez Canillas wrote:
> The Documentation/devicetree/bindings/mfd/cros-ec.txt DT binding doc lists
> "google,cros-ec-i2c" as a compatible string but the corresponding driver
> does not have an OF match table. Add the table to the driver so the I2C
> core can do an OF style match.
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
>
> ---
>
> drivers/mfd/cros_ec_i2c.c | 7 +++++++
> 1 file changed, 7 insertions(+)
Applied, thanks.
> diff --git a/drivers/mfd/cros_ec_i2c.c b/drivers/mfd/cros_ec_i2c.c
> index d06e4b46db80..56a466469664 100644
> --- a/drivers/mfd/cros_ec_i2c.c
> +++ b/drivers/mfd/cros_ec_i2c.c
> @@ -344,6 +344,12 @@ static int cros_ec_i2c_resume(struct device *dev)
> static SIMPLE_DEV_PM_OPS(cros_ec_i2c_pm_ops, cros_ec_i2c_suspend,
> cros_ec_i2c_resume);
>
> +static const struct of_device_id cros_ec_i2c_of_match[] = {
> + { .compatible = "google,cros-ec-i2c", },
> + { /* sentinel */ },
> +};
> +MODULE_DEVICE_TABLE(of, cros_ec_i2c_of_match);
> +
> static const struct i2c_device_id cros_ec_i2c_id[] = {
> { "cros-ec-i2c", 0 },
> { }
> @@ -353,6 +359,7 @@ MODULE_DEVICE_TABLE(i2c, cros_ec_i2c_id);
> static struct i2c_driver cros_ec_driver = {
> .driver = {
> .name = "cros-ec-i2c",
> + .of_match_table = of_match_ptr(cros_ec_i2c_of_match),
> .pm = &cros_ec_i2c_pm_ops,
> },
> .probe = cros_ec_i2c_probe,
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-25 7:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-25 5:48 [PATCH] mfd: cros_ec: i2c: Add OF match table Javier Martinez Canillas
2015-08-25 7:34 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox