From: Pawe? Chmiel Date: Fri, 7 Dec 2018 13:58:09 +0000 (-0200) Subject: media: si470x-i2c: Add device tree support X-Git-Tag: v5.4-rc1~1453^2~235 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=95f9db59d856010e5c28813263fbdd7d70159f77;p=platform%2Fkernel%2Flinux-rpi.git media: si470x-i2c: Add device tree support This commit enables device tree support adding simple of_match table. Signed-off-by: Pawe? Chmiel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/radio/si470x/radio-si470x-i2c.c b/drivers/media/radio/si470x/radio-si470x-i2c.c index 9751ea1..250828d 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