diff options
author | David Heidelberg <david@ixit.cz> | 2020-02-11 20:12:01 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2020-03-08 17:28:35 +0000 |
commit | 9c088c020d8181a0c8376444b740c99366eec04d (patch) | |
tree | 94964c004a628b3328805047ac0773b4a5534193 /drivers/iio | |
parent | 3a271275fa747bafc931ddd872e51d0f3cb15828 (diff) | |
download | linux-9c088c020d8181a0c8376444b740c99366eec04d.tar.gz linux-9c088c020d8181a0c8376444b740c99366eec04d.tar.bz2 linux-9c088c020d8181a0c8376444b740c99366eec04d.zip |
iio: light: al3320a allow module autoload and polish
- allow autoloading when build as module and defined inside DT
Signed-off-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/light/al3320a.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/iio/light/al3320a.c b/drivers/iio/light/al3320a.c index 8cec6841cefa..20ed0a73c390 100644 --- a/drivers/iio/light/al3320a.c +++ b/drivers/iio/light/al3320a.c @@ -15,6 +15,7 @@ #include <linux/bitfield.h> #include <linux/i2c.h> #include <linux/module.h> +#include <linux/of.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h> @@ -241,9 +242,16 @@ static const struct i2c_device_id al3320a_id[] = { }; MODULE_DEVICE_TABLE(i2c, al3320a_id); +static const struct of_device_id al3320a_of_match[] = { + { .compatible = "dynaimage,al3320a", }, + {}, +}; +MODULE_DEVICE_TABLE(of, al3320a_of_match); + static struct i2c_driver al3320a_driver = { .driver = { .name = AL3320A_DRV_NAME, + .of_match_table = al3320a_of_match, .pm = &al3320a_pm_ops, }, .probe = al3320a_probe, |