|
@@ -1,10 +1,11 @@
|
|
/*
|
|
/*
|
|
* Copyright (C) 2014 Angelo Compagnucci <angelo.compagnucci@gmail.com>
|
|
* Copyright (C) 2014 Angelo Compagnucci <angelo.compagnucci@gmail.com>
|
|
*
|
|
*
|
|
- * Driver for Texas Instruments' ADC128S052 and ADC122S021 ADC chip.
|
|
|
|
|
|
+ * Driver for Texas Instruments' ADC128S052, ADC122S021 and ADC124S021 ADC chip.
|
|
* Datasheets can be found here:
|
|
* Datasheets can be found here:
|
|
* http://www.ti.com/lit/ds/symlink/adc128s052.pdf
|
|
* http://www.ti.com/lit/ds/symlink/adc128s052.pdf
|
|
* http://www.ti.com/lit/ds/symlink/adc122s021.pdf
|
|
* http://www.ti.com/lit/ds/symlink/adc122s021.pdf
|
|
|
|
+ * http://www.ti.com/lit/ds/symlink/adc124s021.pdf
|
|
*
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
@@ -114,9 +115,17 @@ static const struct iio_chan_spec adc122s021_channels[] = {
|
|
ADC128_VOLTAGE_CHANNEL(1),
|
|
ADC128_VOLTAGE_CHANNEL(1),
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+static const struct iio_chan_spec adc124s021_channels[] = {
|
|
|
|
+ ADC128_VOLTAGE_CHANNEL(0),
|
|
|
|
+ ADC128_VOLTAGE_CHANNEL(1),
|
|
|
|
+ ADC128_VOLTAGE_CHANNEL(2),
|
|
|
|
+ ADC128_VOLTAGE_CHANNEL(3),
|
|
|
|
+};
|
|
|
|
+
|
|
static const struct adc128_configuration adc128_config[] = {
|
|
static const struct adc128_configuration adc128_config[] = {
|
|
{ adc128s052_channels, ARRAY_SIZE(adc128s052_channels) },
|
|
{ adc128s052_channels, ARRAY_SIZE(adc128s052_channels) },
|
|
{ adc122s021_channels, ARRAY_SIZE(adc122s021_channels) },
|
|
{ adc122s021_channels, ARRAY_SIZE(adc122s021_channels) },
|
|
|
|
+ { adc124s021_channels, ARRAY_SIZE(adc124s021_channels) },
|
|
};
|
|
};
|
|
|
|
|
|
static const struct iio_info adc128_info = {
|
|
static const struct iio_info adc128_info = {
|
|
@@ -177,6 +186,7 @@ static int adc128_remove(struct spi_device *spi)
|
|
static const struct of_device_id adc128_of_match[] = {
|
|
static const struct of_device_id adc128_of_match[] = {
|
|
{ .compatible = "ti,adc128s052", },
|
|
{ .compatible = "ti,adc128s052", },
|
|
{ .compatible = "ti,adc122s021", },
|
|
{ .compatible = "ti,adc122s021", },
|
|
|
|
+ { .compatible = "ti,adc124s021", },
|
|
{ /* sentinel */ },
|
|
{ /* sentinel */ },
|
|
};
|
|
};
|
|
MODULE_DEVICE_TABLE(of, adc128_of_match);
|
|
MODULE_DEVICE_TABLE(of, adc128_of_match);
|
|
@@ -184,6 +194,7 @@ MODULE_DEVICE_TABLE(of, adc128_of_match);
|
|
static const struct spi_device_id adc128_id[] = {
|
|
static const struct spi_device_id adc128_id[] = {
|
|
{ "adc128s052", 0}, /* index into adc128_config */
|
|
{ "adc128s052", 0}, /* index into adc128_config */
|
|
{ "adc122s021", 1},
|
|
{ "adc122s021", 1},
|
|
|
|
+ { "adc124s021", 2},
|
|
{ }
|
|
{ }
|
|
};
|
|
};
|
|
MODULE_DEVICE_TABLE(spi, adc128_id);
|
|
MODULE_DEVICE_TABLE(spi, adc128_id);
|