Commit 3c3969a0 authored by Jonathan Cameron's avatar Jonathan Cameron

iio:adc:ti-adc12138: Switch to generic firmware properties and drop of_match_ptr

This enables using the driver with other firmware types such
as ACPI via PRP0001.

Also part of a general attempt to move IIO drivers over to generic
properties to avoid opportunities for cut and paste.
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
parent 4efc1c61
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/property.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/iio/buffer.h> #include <linux/iio/buffer.h>
...@@ -430,7 +431,7 @@ static int adc12138_probe(struct spi_device *spi) ...@@ -430,7 +431,7 @@ static int adc12138_probe(struct spi_device *spi)
return -EINVAL; return -EINVAL;
} }
ret = of_property_read_u32(spi->dev.of_node, "ti,acquisition-time", ret = device_property_read_u32(&spi->dev, "ti,acquisition-time",
&adc->acquisition_time); &adc->acquisition_time);
if (ret) if (ret)
adc->acquisition_time = 10; adc->acquisition_time = 10;
...@@ -517,8 +518,6 @@ static int adc12138_remove(struct spi_device *spi) ...@@ -517,8 +518,6 @@ static int adc12138_remove(struct spi_device *spi)
return 0; return 0;
} }
#ifdef CONFIG_OF
static const struct of_device_id adc12138_dt_ids[] = { static const struct of_device_id adc12138_dt_ids[] = {
{ .compatible = "ti,adc12130", }, { .compatible = "ti,adc12130", },
{ .compatible = "ti,adc12132", }, { .compatible = "ti,adc12132", },
...@@ -527,8 +526,6 @@ static const struct of_device_id adc12138_dt_ids[] = { ...@@ -527,8 +526,6 @@ static const struct of_device_id adc12138_dt_ids[] = {
}; };
MODULE_DEVICE_TABLE(of, adc12138_dt_ids); MODULE_DEVICE_TABLE(of, adc12138_dt_ids);
#endif
static const struct spi_device_id adc12138_id[] = { static const struct spi_device_id adc12138_id[] = {
{ "adc12130", adc12130 }, { "adc12130", adc12130 },
{ "adc12132", adc12132 }, { "adc12132", adc12132 },
...@@ -540,7 +537,7 @@ MODULE_DEVICE_TABLE(spi, adc12138_id); ...@@ -540,7 +537,7 @@ MODULE_DEVICE_TABLE(spi, adc12138_id);
static struct spi_driver adc12138_driver = { static struct spi_driver adc12138_driver = {
.driver = { .driver = {
.name = "adc12138", .name = "adc12138",
.of_match_table = of_match_ptr(adc12138_dt_ids), .of_match_table = adc12138_dt_ids,
}, },
.probe = adc12138_probe, .probe = adc12138_probe,
.remove = adc12138_remove, .remove = adc12138_remove,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment