0001 Kernel driver max197
0002 ====================
0003
0004 Author:
0005
0006 * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
0007
0008 Supported chips:
0009
0010 * Maxim MAX197
0011
0012 Prefix: 'max197'
0013
0014 Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX197.pdf
0015
0016 * Maxim MAX199
0017
0018 Prefix: 'max199'
0019
0020 Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX199.pdf
0021
0022 Description
0023 -----------
0024
0025 The A/D converters MAX197, and MAX199 are both 8-Channel, Multi-Range, 5V,
0026 12-Bit DAS with 8+4 Bus Interface and Fault Protection.
0027
0028 The available ranges for the MAX197 are {0,-5V} to 5V, and {0,-10V} to 10V,
0029 while they are {0,-2V} to 2V, and {0,-4V} to 4V on the MAX199.
0030
0031 Platform data
0032 -------------
0033
0034 The MAX197 platform data (defined in linux/platform_data/max197.h) should be
0035 filled with a pointer to a conversion function, defined like::
0036
0037 int convert(u8 ctrl);
0038
0039 ctrl is the control byte to write to start a new conversion.
0040 On success, the function must return the 12-bit raw value read from the chip,
0041 or a negative error code otherwise.
0042
0043 Control byte format:
0044
0045 ======= ========== ============================================
0046 Bit Name Description
0047 7,6 PD1,PD0 Clock and Power-Down modes
0048 5 ACQMOD Internal or External Controlled Acquisition
0049 4 RNG Full-scale voltage magnitude at the input
0050 3 BIP Unipolar or Bipolar conversion mode
0051 2,1,0 A2,A1,A0 Channel
0052 ======= ========== ============================================
0053
0054 Sysfs interface
0055 ---------------
0056
0057 ============== ==============================================================
0058 in[0-7]_input The conversion value for the corresponding channel.
0059 RO
0060
0061 in[0-7]_min The lower limit (in mV) for the corresponding channel.
0062 For the MAX197, it will be adjusted to -10000, -5000, or 0.
0063 For the MAX199, it will be adjusted to -4000, -2000, or 0.
0064 RW
0065
0066 in[0-7]_max The higher limit (in mV) for the corresponding channel.
0067 For the MAX197, it will be adjusted to 0, 5000, or 10000.
0068 For the MAX199, it will be adjusted to 0, 2000, or 4000.
0069 RW
0070 ============== ==============================================================