.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * ADAU1977/ADAU1978/ADAU1979 driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright 2014 Analog Devices Inc. |
---|
5 | 6 | * Author: Lars-Peter Clausen <lars@metafoo.de> |
---|
6 | | - * |
---|
7 | | - * Licensed under the GPL-2. |
---|
8 | 7 | */ |
---|
9 | 8 | |
---|
10 | 9 | #include <linux/mod_devicetable.h> |
---|
11 | 10 | #include <linux/module.h> |
---|
12 | 11 | #include <linux/regmap.h> |
---|
| 12 | +#include <linux/of.h> |
---|
| 13 | +#include <linux/of_device.h> |
---|
13 | 14 | #include <linux/spi/spi.h> |
---|
14 | 15 | #include <sound/soc.h> |
---|
15 | 16 | |
---|
.. | .. |
---|
54 | 55 | }; |
---|
55 | 56 | MODULE_DEVICE_TABLE(spi, adau1977_spi_ids); |
---|
56 | 57 | |
---|
| 58 | +static const struct of_device_id adau1977_spi_of_match[] = { |
---|
| 59 | + { .compatible = "adi,adau1977" }, |
---|
| 60 | + { .compatible = "adi,adau1978" }, |
---|
| 61 | + { .compatible = "adi,adau1979" }, |
---|
| 62 | + { }, |
---|
| 63 | +}; |
---|
| 64 | +MODULE_DEVICE_TABLE(of, adau1977_spi_of_match); |
---|
| 65 | + |
---|
57 | 66 | static struct spi_driver adau1977_spi_driver = { |
---|
58 | 67 | .driver = { |
---|
59 | 68 | .name = "adau1977", |
---|
| 69 | + .of_match_table = of_match_ptr(adau1977_spi_of_match), |
---|
60 | 70 | }, |
---|
61 | 71 | .probe = adau1977_spi_probe, |
---|
62 | 72 | .id_table = adau1977_spi_ids, |
---|