| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * AD7746 capacitive sensor driver supporting AD7745, AD7746 and AD7747 |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright 2011 Analog Devices Inc. |
|---|
| 5 | | - * |
|---|
| 6 | | - * Licensed under the GPL-2. |
|---|
| 7 | 6 | */ |
|---|
| 8 | 7 | |
|---|
| 9 | 8 | #include <linux/delay.h> |
|---|
| .. | .. |
|---|
| 694 | 693 | chip->client = client; |
|---|
| 695 | 694 | chip->capdac_set = -1; |
|---|
| 696 | 695 | |
|---|
| 697 | | - /* Establish that the iio_dev is a child of the i2c device */ |
|---|
| 698 | 696 | indio_dev->name = id->name; |
|---|
| 699 | | - indio_dev->dev.parent = &client->dev; |
|---|
| 700 | 697 | indio_dev->info = &ad7746_info; |
|---|
| 701 | 698 | indio_dev->channels = ad7746_channels; |
|---|
| 702 | 699 | if (id->driver_data == 7746) |
|---|
| .. | .. |
|---|
| 748 | 745 | |
|---|
| 749 | 746 | MODULE_DEVICE_TABLE(i2c, ad7746_id); |
|---|
| 750 | 747 | |
|---|
| 748 | +static const struct of_device_id ad7746_of_match[] = { |
|---|
| 749 | + { .compatible = "adi,ad7745" }, |
|---|
| 750 | + { .compatible = "adi,ad7746" }, |
|---|
| 751 | + { .compatible = "adi,ad7747" }, |
|---|
| 752 | + { }, |
|---|
| 753 | +}; |
|---|
| 754 | + |
|---|
| 755 | +MODULE_DEVICE_TABLE(of, ad7746_of_match); |
|---|
| 756 | + |
|---|
| 751 | 757 | static struct i2c_driver ad7746_driver = { |
|---|
| 752 | 758 | .driver = { |
|---|
| 753 | 759 | .name = KBUILD_MODNAME, |
|---|
| 760 | + .of_match_table = ad7746_of_match, |
|---|
| 754 | 761 | }, |
|---|
| 755 | 762 | .probe = ad7746_probe, |
|---|
| 756 | 763 | .id_table = ad7746_id, |
|---|
| 757 | 764 | }; |
|---|
| 758 | 765 | module_i2c_driver(ad7746_driver); |
|---|
| 759 | 766 | |
|---|
| 760 | | -MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
|---|
| 767 | +MODULE_AUTHOR("Michael Hennerich <michael.hennerich@analog.com>"); |
|---|
| 761 | 768 | MODULE_DESCRIPTION("Analog Devices AD7746/5/7 capacitive sensor driver"); |
|---|
| 762 | 769 | MODULE_LICENSE("GPL v2"); |
|---|