forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iio: adc: max1027: Introduce 12-bit devices support
Maxim's max12xx series is very similar to the max10xx series, with the difference of the measurements depth which is upgraded from 10 to 12 bits per channel. Everything else looks the same. Signed-off-by: Miquel Raynal <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
- Loading branch information
1 parent
7af5257
commit ae47d00
Showing
2 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,12 +63,18 @@ enum max1027_id { | |
max1027, | ||
max1029, | ||
max1031, | ||
max1227, | ||
max1229, | ||
max1231, | ||
}; | ||
|
||
static const struct spi_device_id max1027_id[] = { | ||
{"max1027", max1027}, | ||
{"max1029", max1029}, | ||
{"max1031", max1031}, | ||
{"max1227", max1227}, | ||
{"max1229", max1229}, | ||
{"max1231", max1231}, | ||
{} | ||
}; | ||
MODULE_DEVICE_TABLE(spi, max1027_id); | ||
|
@@ -78,6 +84,9 @@ static const struct of_device_id max1027_adc_dt_ids[] = { | |
{ .compatible = "maxim,max1027" }, | ||
{ .compatible = "maxim,max1029" }, | ||
{ .compatible = "maxim,max1031" }, | ||
{ .compatible = "maxim,max1227" }, | ||
{ .compatible = "maxim,max1229" }, | ||
{ .compatible = "maxim,max1231" }, | ||
{}, | ||
}; | ||
MODULE_DEVICE_TABLE(of, max1027_adc_dt_ids); | ||
|
@@ -153,6 +162,18 @@ static const struct iio_chan_spec max1031_channels[] = { | |
MAX1X31_CHANNELS(10), | ||
}; | ||
|
||
static const struct iio_chan_spec max1227_channels[] = { | ||
MAX1X27_CHANNELS(12), | ||
}; | ||
|
||
static const struct iio_chan_spec max1229_channels[] = { | ||
MAX1X29_CHANNELS(12), | ||
}; | ||
|
||
static const struct iio_chan_spec max1231_channels[] = { | ||
MAX1X31_CHANNELS(12), | ||
}; | ||
|
||
static const unsigned long max1027_available_scan_masks[] = { | ||
0x000001ff, | ||
0x00000000, | ||
|
@@ -190,6 +211,21 @@ static const struct max1027_chip_info max1027_chip_info_tbl[] = { | |
.num_channels = ARRAY_SIZE(max1031_channels), | ||
.available_scan_masks = max1031_available_scan_masks, | ||
}, | ||
[max1227] = { | ||
.channels = max1227_channels, | ||
.num_channels = ARRAY_SIZE(max1227_channels), | ||
.available_scan_masks = max1027_available_scan_masks, | ||
}, | ||
[max1229] = { | ||
.channels = max1229_channels, | ||
.num_channels = ARRAY_SIZE(max1229_channels), | ||
.available_scan_masks = max1029_available_scan_masks, | ||
}, | ||
[max1231] = { | ||
.channels = max1231_channels, | ||
.num_channels = ARRAY_SIZE(max1231_channels), | ||
.available_scan_masks = max1031_available_scan_masks, | ||
}, | ||
}; | ||
|
||
struct max1027_state { | ||
|
@@ -486,5 +522,5 @@ static struct spi_driver max1027_driver = { | |
module_spi_driver(max1027_driver); | ||
|
||
MODULE_AUTHOR("Philippe Reynes <[email protected]>"); | ||
MODULE_DESCRIPTION("MAX1027/MAX1029/MAX1031 ADC"); | ||
MODULE_DESCRIPTION("MAX1X27/MAX1X29/MAX1X31 ADC"); | ||
MODULE_LICENSE("GPL v2"); |