| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * ADC0831/ADC0832/ADC0834/ADC0838 8-bit ADC driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2016 Akinobu Mita <akinobu.mita@gmail.com> |
|---|
| 5 | 6 | * |
|---|
| 6 | | - * This file is subject to the terms and conditions of version 2 of |
|---|
| 7 | | - * the GNU General Public License. See the file COPYING in the main |
|---|
| 8 | | - * directory of this archive for more details. |
|---|
| 9 | | - * |
|---|
| 10 | | - * Datasheet: http://www.ti.com/lit/ds/symlink/adc0832-n.pdf |
|---|
| 7 | + * Datasheet: https://www.ti.com/lit/ds/symlink/adc0832-n.pdf |
|---|
| 11 | 8 | */ |
|---|
| 12 | 9 | |
|---|
| 13 | 10 | #include <linux/module.h> |
|---|
| 11 | +#include <linux/mod_devicetable.h> |
|---|
| 14 | 12 | #include <linux/spi/spi.h> |
|---|
| 15 | 13 | #include <linux/iio/iio.h> |
|---|
| 16 | 14 | #include <linux/regulator/consumer.h> |
|---|
| .. | .. |
|---|
| 253 | 251 | mutex_init(&adc->lock); |
|---|
| 254 | 252 | |
|---|
| 255 | 253 | indio_dev->name = spi_get_device_id(spi)->name; |
|---|
| 256 | | - indio_dev->dev.parent = &spi->dev; |
|---|
| 257 | | - indio_dev->dev.of_node = spi->dev.of_node; |
|---|
| 258 | 254 | indio_dev->info = &adc0832_info; |
|---|
| 259 | 255 | indio_dev->modes = INDIO_DIRECT_MODE; |
|---|
| 260 | 256 | |
|---|
| .. | .. |
|---|
| 323 | 319 | return 0; |
|---|
| 324 | 320 | } |
|---|
| 325 | 321 | |
|---|
| 326 | | -#ifdef CONFIG_OF |
|---|
| 327 | | - |
|---|
| 328 | 322 | static const struct of_device_id adc0832_dt_ids[] = { |
|---|
| 329 | 323 | { .compatible = "ti,adc0831", }, |
|---|
| 330 | 324 | { .compatible = "ti,adc0832", }, |
|---|
| .. | .. |
|---|
| 333 | 327 | {} |
|---|
| 334 | 328 | }; |
|---|
| 335 | 329 | MODULE_DEVICE_TABLE(of, adc0832_dt_ids); |
|---|
| 336 | | - |
|---|
| 337 | | -#endif |
|---|
| 338 | 330 | |
|---|
| 339 | 331 | static const struct spi_device_id adc0832_id[] = { |
|---|
| 340 | 332 | { "adc0831", adc0831 }, |
|---|
| .. | .. |
|---|
| 348 | 340 | static struct spi_driver adc0832_driver = { |
|---|
| 349 | 341 | .driver = { |
|---|
| 350 | 342 | .name = "adc0832", |
|---|
| 351 | | - .of_match_table = of_match_ptr(adc0832_dt_ids), |
|---|
| 343 | + .of_match_table = adc0832_dt_ids, |
|---|
| 352 | 344 | }, |
|---|
| 353 | 345 | .probe = adc0832_probe, |
|---|
| 354 | 346 | .remove = adc0832_remove, |
|---|