.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
---|
1 | 2 | /* |
---|
2 | 3 | * API bus driver for ADT7316/7/8 ADT7516/7/9 digital temperature |
---|
3 | 4 | * sensor, ADC and DAC |
---|
4 | 5 | * |
---|
5 | 6 | * Copyright 2010 Analog Devices Inc. |
---|
6 | | - * |
---|
7 | | - * Licensed under the GPL-2 or later. |
---|
8 | 7 | */ |
---|
9 | 8 | |
---|
10 | 9 | #include <linux/device.h> |
---|
.. | .. |
---|
27 | 26 | { |
---|
28 | 27 | struct spi_device *spi_dev = client; |
---|
29 | 28 | u8 cmd[2]; |
---|
30 | | - int ret = 0; |
---|
| 29 | + int ret; |
---|
31 | 30 | |
---|
32 | 31 | if (count > ADT7316_REG_MAX_ADDR) |
---|
33 | 32 | count = ADT7316_REG_MAX_ADDR; |
---|
.. | .. |
---|
56 | 55 | { |
---|
57 | 56 | struct spi_device *spi_dev = client; |
---|
58 | 57 | u8 buf[ADT7316_REG_MAX_ADDR + 2]; |
---|
59 | | - int i, ret = 0; |
---|
| 58 | + int i, ret; |
---|
60 | 59 | |
---|
61 | 60 | if (count > ADT7316_REG_MAX_ADDR) |
---|
62 | 61 | count = ADT7316_REG_MAX_ADDR; |
---|
.. | .. |
---|
94 | 93 | struct adt7316_bus bus = { |
---|
95 | 94 | .client = spi_dev, |
---|
96 | 95 | .irq = spi_dev->irq, |
---|
97 | | - .irq_flags = IRQF_TRIGGER_LOW, |
---|
98 | 96 | .read = adt7316_spi_read, |
---|
99 | 97 | .write = adt7316_spi_write, |
---|
100 | 98 | .multi_read = adt7316_spi_multi_read, |
---|
.. | .. |
---|
128 | 126 | |
---|
129 | 127 | MODULE_DEVICE_TABLE(spi, adt7316_spi_id); |
---|
130 | 128 | |
---|
| 129 | +static const struct of_device_id adt7316_of_spi_match[] = { |
---|
| 130 | + { .compatible = "adi,adt7316" }, |
---|
| 131 | + { .compatible = "adi,adt7317" }, |
---|
| 132 | + { .compatible = "adi,adt7318" }, |
---|
| 133 | + { .compatible = "adi,adt7516" }, |
---|
| 134 | + { .compatible = "adi,adt7517" }, |
---|
| 135 | + { .compatible = "adi,adt7519" }, |
---|
| 136 | + { } |
---|
| 137 | +}; |
---|
| 138 | + |
---|
| 139 | +MODULE_DEVICE_TABLE(of, adt7316_of_spi_match); |
---|
| 140 | + |
---|
131 | 141 | static struct spi_driver adt7316_driver = { |
---|
132 | 142 | .driver = { |
---|
133 | 143 | .name = "adt7316", |
---|
| 144 | + .of_match_table = adt7316_of_spi_match, |
---|
134 | 145 | .pm = ADT7316_PM_OPS, |
---|
135 | 146 | }, |
---|
136 | 147 | .probe = adt7316_spi_probe, |
---|