aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2011-05-18 09:42:10 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-05-19 19:14:59 -0400
commit586d15255dd529be94253b2d4bbb9f40ef680c1a (patch)
tree703b113faabd14cedc390d9599ecd16c54d446fe /drivers
parentbb20d65dbc014e6770bac57940c493753d3d542e (diff)
staging:iio:max1363 add new 2 channels parts form maxim, 11644-7
V2: IIO_CHAN macro usage update. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/iio/adc/Kconfig4
-rw-r--r--drivers/staging/iio/adc/max1363_core.c57
2 files changed, 58 insertions, 3 deletions
diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig
index 0a19cee97b41..617af938ccc7 100644
--- a/drivers/staging/iio/adc/Kconfig
+++ b/drivers/staging/iio/adc/Kconfig
@@ -15,8 +15,8 @@ config MAX1363
15 max1139, max1236, max1237, max11238, max1239, max11600, max11601, 15 max1139, max1236, max1237, max11238, max1239, max11600, max11601,
16 max11602, max11603, max11604, max11605, max11606, max11607, 16 max11602, max11603, max11604, max11605, max11606, max11607,
17 max11608, max11609, max11610, max11611, max11612, max11613, 17 max11608, max11609, max11610, max11611, max11612, max11613,
18 max11614, max11615, max11616, max11617) Provides direct access 18 max11614, max11615, max11616, max11617, max11644, max11645,
19 via sysfs. 19 max11646, max11647) Provides direct access via sysfs.
20 20
21config MAX1363_RING_BUFFER 21config MAX1363_RING_BUFFER
22 bool "MAXIM max1363: use ring buffer" 22 bool "MAXIM max1363: use ring buffer"
diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
index 20c6aae427f6..0c80abb7e753 100644
--- a/drivers/staging/iio/adc/max1363_core.c
+++ b/drivers/staging/iio/adc/max1363_core.c
@@ -417,6 +417,21 @@ static struct iio_chan_spec max11602_channels[] = MAX1363_8X_CHANS(8);
417static struct iio_chan_spec max11608_channels[] = MAX1363_8X_CHANS(10); 417static struct iio_chan_spec max11608_channels[] = MAX1363_8X_CHANS(10);
418static struct iio_chan_spec max11614_channels[] = MAX1363_8X_CHANS(12); 418static struct iio_chan_spec max11614_channels[] = MAX1363_8X_CHANS(12);
419 419
420static const enum max1363_modes max11644_mode_list[] = {
421 _s0, _s1, s0to1, d0m1, d1m0,
422};
423
424#define MAX1363_2X_CHANS(bits) { \
425 MAX1363_CHAN_U(0, _s0, 0, bits), \
426 MAX1363_CHAN_U(1, _s1, 1, bits), \
427 MAX1363_CHAN_B(0, 1, d0m1, 2, bits), \
428 MAX1363_CHAN_B(1, 0, d1m0, 3, bits), \
429 IIO_CHAN_SOFT_TIMESTAMP(4) \
430 }
431
432static struct iio_chan_spec max11646_channels[] = MAX1363_2X_CHANS(10);
433static struct iio_chan_spec max11644_channels[] = MAX1363_2X_CHANS(12);
434
420enum { max1361, 435enum { max1361,
421 max1362, 436 max1362,
422 max1363, 437 max1363,
@@ -451,6 +466,10 @@ enum { max1361,
451 max11615, 466 max11615,
452 max11616, 467 max11616,
453 max11617, 468 max11617,
469 max11644,
470 max11645,
471 max11646,
472 max11647
454}; 473};
455 474
456/* max1363 and max1368 tested - rest from data sheet */ 475/* max1363 and max1368 tested - rest from data sheet */
@@ -764,7 +783,43 @@ static const struct max1363_chip_info max1363_chip_info_tbl[] = {
764 .default_mode = s0to11, 783 .default_mode = s0to11,
765 .channels = max1238_channels, 784 .channels = max1238_channels,
766 .num_channels = ARRAY_SIZE(max1238_channels), 785 .num_channels = ARRAY_SIZE(max1238_channels),
767 } 786 },
787 [max11644] = {
788 .bits = 12,
789 .int_vref_mv = 2048,
790 .mode_list = max11644_mode_list,
791 .num_modes = ARRAY_SIZE(max11644_mode_list),
792 .default_mode = s0to1,
793 .channels = max11644_channels,
794 .num_channels = ARRAY_SIZE(max11644_channels),
795 },
796 [max11645] = {
797 .bits = 12,
798 .int_vref_mv = 4096,
799 .mode_list = max11644_mode_list,
800 .num_modes = ARRAY_SIZE(max11644_mode_list),
801 .default_mode = s0to1,
802 .channels = max11644_channels,
803 .num_channels = ARRAY_SIZE(max11644_channels),
804 },
805 [max11646] = {
806 .bits = 10,
807 .int_vref_mv = 2048,
808 .mode_list = max11644_mode_list,
809 .num_modes = ARRAY_SIZE(max11644_mode_list),
810 .default_mode = s0to1,
811 .channels = max11644_channels,
812 .num_channels = ARRAY_SIZE(max11646_channels),
813 },
814 [max11647] = {
815 .bits = 10,
816 .int_vref_mv = 4096,
817 .mode_list = max11644_mode_list,
818 .num_modes = ARRAY_SIZE(max11644_mode_list),
819 .default_mode = s0to1,
820 .channels = max11644_channels,
821 .num_channels = ARRAY_SIZE(max11646_channels),
822 },
768}; 823};
769 824
770static const int max1363_monitor_speeds[] = { 133000, 665000, 33300, 16600, 825static const int max1363_monitor_speeds[] = { 133000, 665000, 33300, 16600,