1*7ebd8b66SMauro Carvalho ChehabKernel driver max197 2*7ebd8b66SMauro Carvalho Chehab==================== 3*7ebd8b66SMauro Carvalho Chehab 4*7ebd8b66SMauro Carvalho ChehabAuthor: 5*7ebd8b66SMauro Carvalho Chehab 6*7ebd8b66SMauro Carvalho Chehab * Vivien Didelot <vivien.didelot@savoirfairelinux.com> 7*7ebd8b66SMauro Carvalho Chehab 8*7ebd8b66SMauro Carvalho ChehabSupported chips: 9*7ebd8b66SMauro Carvalho Chehab 10*7ebd8b66SMauro Carvalho Chehab * Maxim MAX197 11*7ebd8b66SMauro Carvalho Chehab 12*7ebd8b66SMauro Carvalho Chehab Prefix: 'max197' 13*7ebd8b66SMauro Carvalho Chehab 14*7ebd8b66SMauro Carvalho Chehab Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX197.pdf 15*7ebd8b66SMauro Carvalho Chehab 16*7ebd8b66SMauro Carvalho Chehab * Maxim MAX199 17*7ebd8b66SMauro Carvalho Chehab 18*7ebd8b66SMauro Carvalho Chehab Prefix: 'max199' 19*7ebd8b66SMauro Carvalho Chehab 20*7ebd8b66SMauro Carvalho Chehab Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX199.pdf 21*7ebd8b66SMauro Carvalho Chehab 22*7ebd8b66SMauro Carvalho ChehabDescription 23*7ebd8b66SMauro Carvalho Chehab----------- 24*7ebd8b66SMauro Carvalho Chehab 25*7ebd8b66SMauro Carvalho ChehabThe A/D converters MAX197, and MAX199 are both 8-Channel, Multi-Range, 5V, 26*7ebd8b66SMauro Carvalho Chehab12-Bit DAS with 8+4 Bus Interface and Fault Protection. 27*7ebd8b66SMauro Carvalho Chehab 28*7ebd8b66SMauro Carvalho ChehabThe available ranges for the MAX197 are {0,-5V} to 5V, and {0,-10V} to 10V, 29*7ebd8b66SMauro Carvalho Chehabwhile they are {0,-2V} to 2V, and {0,-4V} to 4V on the MAX199. 30*7ebd8b66SMauro Carvalho Chehab 31*7ebd8b66SMauro Carvalho ChehabPlatform data 32*7ebd8b66SMauro Carvalho Chehab------------- 33*7ebd8b66SMauro Carvalho Chehab 34*7ebd8b66SMauro Carvalho ChehabThe MAX197 platform data (defined in linux/platform_data/max197.h) should be 35*7ebd8b66SMauro Carvalho Chehabfilled with a pointer to a conversion function, defined like:: 36*7ebd8b66SMauro Carvalho Chehab 37*7ebd8b66SMauro Carvalho Chehab int convert(u8 ctrl); 38*7ebd8b66SMauro Carvalho Chehab 39*7ebd8b66SMauro Carvalho Chehabctrl is the control byte to write to start a new conversion. 40*7ebd8b66SMauro Carvalho ChehabOn success, the function must return the 12-bit raw value read from the chip, 41*7ebd8b66SMauro Carvalho Chehabor a negative error code otherwise. 42*7ebd8b66SMauro Carvalho Chehab 43*7ebd8b66SMauro Carvalho ChehabControl byte format: 44*7ebd8b66SMauro Carvalho Chehab 45*7ebd8b66SMauro Carvalho Chehab======= ========== ============================================ 46*7ebd8b66SMauro Carvalho ChehabBit Name Description 47*7ebd8b66SMauro Carvalho Chehab7,6 PD1,PD0 Clock and Power-Down modes 48*7ebd8b66SMauro Carvalho Chehab5 ACQMOD Internal or External Controlled Acquisition 49*7ebd8b66SMauro Carvalho Chehab4 RNG Full-scale voltage magnitude at the input 50*7ebd8b66SMauro Carvalho Chehab3 BIP Unipolar or Bipolar conversion mode 51*7ebd8b66SMauro Carvalho Chehab2,1,0 A2,A1,A0 Channel 52*7ebd8b66SMauro Carvalho Chehab======= ========== ============================================ 53*7ebd8b66SMauro Carvalho Chehab 54*7ebd8b66SMauro Carvalho ChehabSysfs interface 55*7ebd8b66SMauro Carvalho Chehab--------------- 56*7ebd8b66SMauro Carvalho Chehab 57*7ebd8b66SMauro Carvalho Chehab ============== ============================================================== 58*7ebd8b66SMauro Carvalho Chehab in[0-7]_input The conversion value for the corresponding channel. 59*7ebd8b66SMauro Carvalho Chehab RO 60*7ebd8b66SMauro Carvalho Chehab 61*7ebd8b66SMauro Carvalho Chehab in[0-7]_min The lower limit (in mV) for the corresponding channel. 62*7ebd8b66SMauro Carvalho Chehab For the MAX197, it will be adjusted to -10000, -5000, or 0. 63*7ebd8b66SMauro Carvalho Chehab For the MAX199, it will be adjusted to -4000, -2000, or 0. 64*7ebd8b66SMauro Carvalho Chehab RW 65*7ebd8b66SMauro Carvalho Chehab 66*7ebd8b66SMauro Carvalho Chehab in[0-7]_max The higher limit (in mV) for the corresponding channel. 67*7ebd8b66SMauro Carvalho Chehab For the MAX197, it will be adjusted to 0, 5000, or 10000. 68*7ebd8b66SMauro Carvalho Chehab For the MAX199, it will be adjusted to 0, 2000, or 4000. 69*7ebd8b66SMauro Carvalho Chehab RW 70*7ebd8b66SMauro Carvalho Chehab ============== ============================================================== 71