Message ID | 20200211191201.1049902-8-david@ixit.cz (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | iio: light: AL3010 introduction | expand |
On Tue, 11 Feb 2020 20:12:01 +0100 David Heidelberg <david@ixit.cz> wrote: > - allow autoloading when build as module and defined inside DT > > Signed-off-by: David Heidelberg <david@ixit.cz> Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > v4 > - dropping of init.h header moved to previous patches > > drivers/iio/light/al3320a.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/iio/light/al3320a.c b/drivers/iio/light/al3320a.c > index 49e73e24fff6..e7c4899a4313 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,
diff --git a/drivers/iio/light/al3320a.c b/drivers/iio/light/al3320a.c index 49e73e24fff6..e7c4899a4313 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,
- allow autoloading when build as module and defined inside DT Signed-off-by: David Heidelberg <david@ixit.cz> --- v4 - dropping of init.h header moved to previous patches drivers/iio/light/al3320a.c | 8 ++++++++ 1 file changed, 8 insertions(+)