Skip to content

Commit

Permalink
media: ad5820: Add support for of-autoload
Browse files Browse the repository at this point in the history
Since kernel 4.16, i2c devices with DT compatible tag are modprobed
using their DT modalias.
Without this patch, if this driver is build as module it would never
be autoprobed.

There is no need to mask it with CONFIG_OF to allow ACPI loading, this
also builds find with CONFIG_OF=n.

Signed-off-by: Ricardo Ribalda Delgado <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
ribalda authored and mchehab committed Oct 24, 2019
1 parent c01674e commit 1c7ae4a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/media/i2c/ad5820.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,19 @@ static const struct i2c_device_id ad5820_id_table[] = {
};
MODULE_DEVICE_TABLE(i2c, ad5820_id_table);

static const struct of_device_id ad5820_of_table[] = {
{ .compatible = "adi,ad5820" },
{ }
};
MODULE_DEVICE_TABLE(of, ad5820_of_table);

static SIMPLE_DEV_PM_OPS(ad5820_pm, ad5820_suspend, ad5820_resume);

static struct i2c_driver ad5820_i2c_driver = {
.driver = {
.name = AD5820_NAME,
.pm = &ad5820_pm,
.of_match_table = ad5820_of_table,
},
.probe = ad5820_probe,
.remove = ad5820_remove,
Expand Down

0 comments on commit 1c7ae4a

Please sign in to comment.