blob: 02fe19bc3428c03c6002418c5503989719101681 [file] [log] [blame]
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03001Kernel driver max197
2====================
Vivien Didelot6c1fe722012-08-30 21:42:57 -04003
4Author:
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03005
Vivien Didelot6c1fe722012-08-30 21:42:57 -04006 * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
7
8Supported chips:
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -03009
Vivien Didelot6c1fe722012-08-30 21:42:57 -040010 * Maxim MAX197
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030011
Vivien Didelot6c1fe722012-08-30 21:42:57 -040012 Prefix: 'max197'
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030013
Vivien Didelot6c1fe722012-08-30 21:42:57 -040014 Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX197.pdf
15
16 * Maxim MAX199
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030017
Vivien Didelot6c1fe722012-08-30 21:42:57 -040018 Prefix: 'max199'
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030019
Vivien Didelot6c1fe722012-08-30 21:42:57 -040020 Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX199.pdf
21
22Description
23-----------
24
25The A/D converters MAX197, and MAX199 are both 8-Channel, Multi-Range, 5V,
2612-Bit DAS with 8+4 Bus Interface and Fault Protection.
27
28The available ranges for the MAX197 are {0,-5V} to 5V, and {0,-10V} to 10V,
29while they are {0,-2V} to 2V, and {0,-4V} to 4V on the MAX199.
30
31Platform data
32-------------
33
34The MAX197 platform data (defined in linux/platform_data/max197.h) should be
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030035filled with a pointer to a conversion function, defined like::
Vivien Didelot6c1fe722012-08-30 21:42:57 -040036
37 int convert(u8 ctrl);
38
39ctrl is the control byte to write to start a new conversion.
40On success, the function must return the 12-bit raw value read from the chip,
41or a negative error code otherwise.
42
43Control byte format:
44
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030045======= ========== ============================================
Vivien Didelot6c1fe722012-08-30 21:42:57 -040046Bit Name Description
477,6 PD1,PD0 Clock and Power-Down modes
485 ACQMOD Internal or External Controlled Acquisition
494 RNG Full-scale voltage magnitude at the input
503 BIP Unipolar or Bipolar conversion mode
512,1,0 A2,A1,A0 Channel
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030052======= ========== ============================================
Vivien Didelot6c1fe722012-08-30 21:42:57 -040053
54Sysfs interface
55---------------
56
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030057 ============== ==============================================================
58 in[0-7]_input The conversion value for the corresponding channel.
59 RO
Vivien Didelot6c1fe722012-08-30 21:42:57 -040060
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030061 in[0-7]_min The lower limit (in mV) for the corresponding channel.
62 For the MAX197, it will be adjusted to -10000, -5000, or 0.
63 For the MAX199, it will be adjusted to -4000, -2000, or 0.
64 RW
Vivien Didelot6c1fe722012-08-30 21:42:57 -040065
Mauro Carvalho Chehabb04f2f72019-04-17 06:46:28 -030066 in[0-7]_max The higher limit (in mV) for the corresponding channel.
67 For the MAX197, it will be adjusted to 0, 5000, or 10000.
68 For the MAX199, it will be adjusted to 0, 2000, or 4000.
69 RW
70 ============== ==============================================================