1*7ebd8b66SMauro Carvalho ChehabKernel driver ltc4245 2*7ebd8b66SMauro Carvalho Chehab===================== 3*7ebd8b66SMauro Carvalho Chehab 4*7ebd8b66SMauro Carvalho ChehabSupported chips: 5*7ebd8b66SMauro Carvalho Chehab 6*7ebd8b66SMauro Carvalho Chehab * Linear Technology LTC4245 7*7ebd8b66SMauro Carvalho Chehab 8*7ebd8b66SMauro Carvalho Chehab Prefix: 'ltc4245' 9*7ebd8b66SMauro Carvalho Chehab 10*7ebd8b66SMauro Carvalho Chehab Addresses scanned: 0x20-0x3f 11*7ebd8b66SMauro Carvalho Chehab 12*7ebd8b66SMauro Carvalho Chehab Datasheet: 13*7ebd8b66SMauro Carvalho Chehab 14*7ebd8b66SMauro Carvalho Chehab http://www.linear.com/pc/downloadDocument.do?navId=H0,C1,C1003,C1006,C1140,P19392,D13517 15*7ebd8b66SMauro Carvalho Chehab 16*7ebd8b66SMauro Carvalho ChehabAuthor: Ira W. Snyder <iws@ovro.caltech.edu> 17*7ebd8b66SMauro Carvalho Chehab 18*7ebd8b66SMauro Carvalho Chehab 19*7ebd8b66SMauro Carvalho ChehabDescription 20*7ebd8b66SMauro Carvalho Chehab----------- 21*7ebd8b66SMauro Carvalho Chehab 22*7ebd8b66SMauro Carvalho ChehabThe LTC4245 controller allows a board to be safely inserted and removed 23*7ebd8b66SMauro Carvalho Chehabfrom a live backplane in multiple supply systems such as CompactPCI and 24*7ebd8b66SMauro Carvalho ChehabPCI Express. 25*7ebd8b66SMauro Carvalho Chehab 26*7ebd8b66SMauro Carvalho Chehab 27*7ebd8b66SMauro Carvalho ChehabUsage Notes 28*7ebd8b66SMauro Carvalho Chehab----------- 29*7ebd8b66SMauro Carvalho Chehab 30*7ebd8b66SMauro Carvalho ChehabThis driver does not probe for LTC4245 devices, due to the fact that some 31*7ebd8b66SMauro Carvalho Chehabof the possible addresses are unfriendly to probing. You will have to 32*7ebd8b66SMauro Carvalho Chehabinstantiate the devices explicitly. 33*7ebd8b66SMauro Carvalho Chehab 34*7ebd8b66SMauro Carvalho ChehabExample: the following will load the driver for an LTC4245 at address 0x23 35*7ebd8b66SMauro Carvalho Chehabon I2C bus #1:: 36*7ebd8b66SMauro Carvalho Chehab 37*7ebd8b66SMauro Carvalho Chehab $ modprobe ltc4245 38*7ebd8b66SMauro Carvalho Chehab $ echo ltc4245 0x23 > /sys/bus/i2c/devices/i2c-1/new_device 39*7ebd8b66SMauro Carvalho Chehab 40*7ebd8b66SMauro Carvalho Chehab 41*7ebd8b66SMauro Carvalho ChehabSysfs entries 42*7ebd8b66SMauro Carvalho Chehab------------- 43*7ebd8b66SMauro Carvalho Chehab 44*7ebd8b66SMauro Carvalho ChehabThe LTC4245 has built-in limits for over and under current warnings. This 45*7ebd8b66SMauro Carvalho Chehabmakes it very likely that the reference circuit will be used. 46*7ebd8b66SMauro Carvalho Chehab 47*7ebd8b66SMauro Carvalho ChehabThis driver uses the values in the datasheet to change the register values 48*7ebd8b66SMauro Carvalho Chehabinto the values specified in the sysfs-interface document. The current readings 49*7ebd8b66SMauro Carvalho Chehabrely on the sense resistors listed in Table 2: "Sense Resistor Values". 50*7ebd8b66SMauro Carvalho Chehab 51*7ebd8b66SMauro Carvalho Chehab======================= ======================================================= 52*7ebd8b66SMauro Carvalho Chehabin1_input 12v input voltage (mV) 53*7ebd8b66SMauro Carvalho Chehabin2_input 5v input voltage (mV) 54*7ebd8b66SMauro Carvalho Chehabin3_input 3v input voltage (mV) 55*7ebd8b66SMauro Carvalho Chehabin4_input Vee (-12v) input voltage (mV) 56*7ebd8b66SMauro Carvalho Chehab 57*7ebd8b66SMauro Carvalho Chehabin1_min_alarm 12v input undervoltage alarm 58*7ebd8b66SMauro Carvalho Chehabin2_min_alarm 5v input undervoltage alarm 59*7ebd8b66SMauro Carvalho Chehabin3_min_alarm 3v input undervoltage alarm 60*7ebd8b66SMauro Carvalho Chehabin4_min_alarm Vee (-12v) input undervoltage alarm 61*7ebd8b66SMauro Carvalho Chehab 62*7ebd8b66SMauro Carvalho Chehabcurr1_input 12v current (mA) 63*7ebd8b66SMauro Carvalho Chehabcurr2_input 5v current (mA) 64*7ebd8b66SMauro Carvalho Chehabcurr3_input 3v current (mA) 65*7ebd8b66SMauro Carvalho Chehabcurr4_input Vee (-12v) current (mA) 66*7ebd8b66SMauro Carvalho Chehab 67*7ebd8b66SMauro Carvalho Chehabcurr1_max_alarm 12v overcurrent alarm 68*7ebd8b66SMauro Carvalho Chehabcurr2_max_alarm 5v overcurrent alarm 69*7ebd8b66SMauro Carvalho Chehabcurr3_max_alarm 3v overcurrent alarm 70*7ebd8b66SMauro Carvalho Chehabcurr4_max_alarm Vee (-12v) overcurrent alarm 71*7ebd8b66SMauro Carvalho Chehab 72*7ebd8b66SMauro Carvalho Chehabin5_input 12v output voltage (mV) 73*7ebd8b66SMauro Carvalho Chehabin6_input 5v output voltage (mV) 74*7ebd8b66SMauro Carvalho Chehabin7_input 3v output voltage (mV) 75*7ebd8b66SMauro Carvalho Chehabin8_input Vee (-12v) output voltage (mV) 76*7ebd8b66SMauro Carvalho Chehab 77*7ebd8b66SMauro Carvalho Chehabin5_min_alarm 12v output undervoltage alarm 78*7ebd8b66SMauro Carvalho Chehabin6_min_alarm 5v output undervoltage alarm 79*7ebd8b66SMauro Carvalho Chehabin7_min_alarm 3v output undervoltage alarm 80*7ebd8b66SMauro Carvalho Chehabin8_min_alarm Vee (-12v) output undervoltage alarm 81*7ebd8b66SMauro Carvalho Chehab 82*7ebd8b66SMauro Carvalho Chehabin9_input GPIO voltage data (see note 1) 83*7ebd8b66SMauro Carvalho Chehabin10_input GPIO voltage data (see note 1) 84*7ebd8b66SMauro Carvalho Chehabin11_input GPIO voltage data (see note 1) 85*7ebd8b66SMauro Carvalho Chehab 86*7ebd8b66SMauro Carvalho Chehabpower1_input 12v power usage (mW) 87*7ebd8b66SMauro Carvalho Chehabpower2_input 5v power usage (mW) 88*7ebd8b66SMauro Carvalho Chehabpower3_input 3v power usage (mW) 89*7ebd8b66SMauro Carvalho Chehabpower4_input Vee (-12v) power usage (mW) 90*7ebd8b66SMauro Carvalho Chehab======================= ======================================================= 91*7ebd8b66SMauro Carvalho Chehab 92*7ebd8b66SMauro Carvalho Chehab 93*7ebd8b66SMauro Carvalho ChehabNote 1 94*7ebd8b66SMauro Carvalho Chehab------ 95*7ebd8b66SMauro Carvalho Chehab 96*7ebd8b66SMauro Carvalho ChehabIf you have NOT configured the driver to sample all GPIO pins as analog 97*7ebd8b66SMauro Carvalho Chehabvoltages, then the in10_input and in11_input sysfs attributes will not be 98*7ebd8b66SMauro Carvalho Chehabcreated. The driver will sample the GPIO pin that is currently connected to the 99*7ebd8b66SMauro Carvalho ChehabADC as an analog voltage, and report the value in in9_input. 100*7ebd8b66SMauro Carvalho Chehab 101*7ebd8b66SMauro Carvalho ChehabIf you have configured the driver to sample all GPIO pins as analog voltages, 102*7ebd8b66SMauro Carvalho Chehabthen they will be sampled in round-robin fashion. If userspace reads too 103*7ebd8b66SMauro Carvalho Chehabslowly, -EAGAIN will be returned when you read the sysfs attribute containing 104*7ebd8b66SMauro Carvalho Chehabthe sensor reading. 105*7ebd8b66SMauro Carvalho Chehab 106*7ebd8b66SMauro Carvalho ChehabThe LTC4245 chip can be configured to sample all GPIO pins with two methods: 107*7ebd8b66SMauro Carvalho Chehab 108*7ebd8b66SMauro Carvalho Chehab1) platform data -- see include/linux/platform_data/ltc4245.h 109*7ebd8b66SMauro Carvalho Chehab2) OF device tree -- add the "ltc4245,use-extra-gpios" property to each chip 110*7ebd8b66SMauro Carvalho Chehab 111*7ebd8b66SMauro Carvalho ChehabThe default mode of operation is to sample a single GPIO pin. 112