^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) Kernel driver ltc4245
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) =====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) Supported chips:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Linear Technology LTC4245
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) Prefix: 'ltc4245'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Addresses scanned: 0x20-0x3f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) Datasheet:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) http://www.linear.com/pc/downloadDocument.do?navId=H0,C1,C1003,C1006,C1140,P19392,D13517
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) Author: Ira W. Snyder <iws@ovro.caltech.edu>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) The LTC4245 controller allows a board to be safely inserted and removed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) from a live backplane in multiple supply systems such as CompactPCI and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) PCI Express.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) Usage Notes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) This driver does not probe for LTC4245 devices, due to the fact that some
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) of the possible addresses are unfriendly to probing. You will have to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) instantiate the devices explicitly.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) Example: the following will load the driver for an LTC4245 at address 0x23
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) on I2C bus #1::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) $ modprobe ltc4245
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) $ echo ltc4245 0x23 > /sys/bus/i2c/devices/i2c-1/new_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) Sysfs entries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) -------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) The LTC4245 has built-in limits for over and under current warnings. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) makes it very likely that the reference circuit will be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) This driver uses the values in the datasheet to change the register values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) into the values specified in the sysfs-interface document. The current readings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) rely on the sense resistors listed in Table 2: "Sense Resistor Values".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) ======================= =======================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) in1_input 12v input voltage (mV)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) in2_input 5v input voltage (mV)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) in3_input 3v input voltage (mV)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) in4_input Vee (-12v) input voltage (mV)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) in1_min_alarm 12v input undervoltage alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) in2_min_alarm 5v input undervoltage alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) in3_min_alarm 3v input undervoltage alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) in4_min_alarm Vee (-12v) input undervoltage alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) curr1_input 12v current (mA)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) curr2_input 5v current (mA)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) curr3_input 3v current (mA)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) curr4_input Vee (-12v) current (mA)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) curr1_max_alarm 12v overcurrent alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) curr2_max_alarm 5v overcurrent alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) curr3_max_alarm 3v overcurrent alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) curr4_max_alarm Vee (-12v) overcurrent alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) in5_input 12v output voltage (mV)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) in6_input 5v output voltage (mV)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) in7_input 3v output voltage (mV)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) in8_input Vee (-12v) output voltage (mV)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) in5_min_alarm 12v output undervoltage alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) in6_min_alarm 5v output undervoltage alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) in7_min_alarm 3v output undervoltage alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) in8_min_alarm Vee (-12v) output undervoltage alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) in9_input GPIO voltage data (see note 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) in10_input GPIO voltage data (see note 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) in11_input GPIO voltage data (see note 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) power1_input 12v power usage (mW)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) power2_input 5v power usage (mW)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) power3_input 3v power usage (mW)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) power4_input Vee (-12v) power usage (mW)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) ======================= =======================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) Note 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) ------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) If you have NOT configured the driver to sample all GPIO pins as analog
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) voltages, then the in10_input and in11_input sysfs attributes will not be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) created. The driver will sample the GPIO pin that is currently connected to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) ADC as an analog voltage, and report the value in in9_input.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) If you have configured the driver to sample all GPIO pins as analog voltages,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) then they will be sampled in round-robin fashion. If userspace reads too
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) slowly, -EAGAIN will be returned when you read the sysfs attribute containing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) the sensor reading.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) The LTC4245 chip can be configured to sample all GPIO pins with two methods:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 1) platform data -- see include/linux/platform_data/ltc4245.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 2) OF device tree -- add the "ltc4245,use-extra-gpios" property to each chip
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) The default mode of operation is to sample a single GPIO pin.