| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * TI ADC108S102 SPI ADC driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2013-2015 Intel Corporation. |
|---|
| 5 | 6 | * Copyright (c) 2017 Siemens AG |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 8 | | - * under the terms and conditions of the GNU General Public License, |
|---|
| 9 | | - * version 2, as published by the Free Software Foundation. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
|---|
| 12 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 13 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 14 | | - * more details. |
|---|
| 15 | 7 | * |
|---|
| 16 | 8 | * This IIO device driver is designed to work with the following |
|---|
| 17 | 9 | * analog to digital converters from Texas Instruments: |
|---|
| .. | .. |
|---|
| 28 | 20 | #include <linux/iio/trigger_consumer.h> |
|---|
| 29 | 21 | #include <linux/interrupt.h> |
|---|
| 30 | 22 | #include <linux/module.h> |
|---|
| 23 | +#include <linux/mod_devicetable.h> |
|---|
| 31 | 24 | #include <linux/property.h> |
|---|
| 32 | 25 | #include <linux/regulator/consumer.h> |
|---|
| 33 | 26 | #include <linux/spi/spi.h> |
|---|
| .. | .. |
|---|
| 260 | 253 | st->spi = spi; |
|---|
| 261 | 254 | |
|---|
| 262 | 255 | indio_dev->name = spi->modalias; |
|---|
| 263 | | - indio_dev->dev.parent = &spi->dev; |
|---|
| 264 | 256 | indio_dev->modes = INDIO_DIRECT_MODE; |
|---|
| 265 | 257 | indio_dev->channels = adc108s102_channels; |
|---|
| 266 | 258 | indio_dev->num_channels = ARRAY_SIZE(adc108s102_channels); |
|---|
| .. | .. |
|---|
| 308 | 300 | return 0; |
|---|
| 309 | 301 | } |
|---|
| 310 | 302 | |
|---|
| 311 | | -#ifdef CONFIG_OF |
|---|
| 312 | 303 | static const struct of_device_id adc108s102_of_match[] = { |
|---|
| 313 | 304 | { .compatible = "ti,adc108s102" }, |
|---|
| 314 | 305 | { } |
|---|
| 315 | 306 | }; |
|---|
| 316 | 307 | MODULE_DEVICE_TABLE(of, adc108s102_of_match); |
|---|
| 317 | | -#endif |
|---|
| 318 | 308 | |
|---|
| 319 | 309 | #ifdef CONFIG_ACPI |
|---|
| 320 | 310 | static const struct acpi_device_id adc108s102_acpi_ids[] = { |
|---|
| .. | .. |
|---|
| 333 | 323 | static struct spi_driver adc108s102_driver = { |
|---|
| 334 | 324 | .driver = { |
|---|
| 335 | 325 | .name = "adc108s102", |
|---|
| 336 | | - .of_match_table = of_match_ptr(adc108s102_of_match), |
|---|
| 326 | + .of_match_table = adc108s102_of_match, |
|---|
| 337 | 327 | .acpi_match_table = ACPI_PTR(adc108s102_acpi_ids), |
|---|
| 338 | 328 | }, |
|---|
| 339 | 329 | .probe = adc108s102_probe, |
|---|