Kernel driver ltc4245

Supported chips:

Author: Ira W. Snyder <iws@ovro.caltech.edu>

Description

The LTC4245 controller allows a board to be safely inserted and removedfrom a live backplane in multiple supply systems such as CompactPCI andPCI Express.

Usage Notes

This driver does not probe for LTC4245 devices, due to the fact that someof the possible addresses are unfriendly to probing. You will have toinstantiate the devices explicitly.

Example: the following will load the driver for an LTC4245 at address 0x23on I2C bus #1:

$ modprobe ltc4245$ echo ltc4245 0x23 > /sys/bus/i2c/devices/i2c-1/new_device

Sysfs entries

The LTC4245 has built-in limits for over and under current warnings. Thismakes it very likely that the reference circuit will be used.

This driver uses the values in the datasheet to change the register valuesinto the values specified in the sysfs-interface document. The current readingsrely on the sense resistors listed in Table 2: “Sense Resistor Values”.

in1_input12v input voltage (mV)
in2_input5v input voltage (mV)
in3_input3v input voltage (mV)
in4_inputVee (-12v) input voltage (mV)
in1_min_alarm12v input undervoltage alarm
in2_min_alarm5v input undervoltage alarm
in3_min_alarm3v input undervoltage alarm
in4_min_alarmVee (-12v) input undervoltage alarm
curr1_input12v current (mA)
curr2_input5v current (mA)
curr3_input3v current (mA)
curr4_inputVee (-12v) current (mA)
curr1_max_alarm12v overcurrent alarm
curr2_max_alarm5v overcurrent alarm
curr3_max_alarm3v overcurrent alarm
curr4_max_alarmVee (-12v) overcurrent alarm
in5_input12v output voltage (mV)
in6_input5v output voltage (mV)
in7_input3v output voltage (mV)
in8_inputVee (-12v) output voltage (mV)
in5_min_alarm12v output undervoltage alarm
in6_min_alarm5v output undervoltage alarm
in7_min_alarm3v output undervoltage alarm
in8_min_alarmVee (-12v) output undervoltage alarm
in9_inputGPIO voltage data (see note 1)
in10_inputGPIO voltage data (see note 1)
in11_inputGPIO voltage data (see note 1)
power1_input12v power usage (mW)
power2_input5v power usage (mW)
power3_input3v power usage (mW)
power4_inputVee (-12v) power usage (mW)

Note 1

If you have NOT configured the driver to sample all GPIO pins as analogvoltages, then the in10_input and in11_input sysfs attributes will not becreated. The driver will sample the GPIO pin that is currently connected to theADC as an analog voltage, and report the value in in9_input.

If you have configured the driver to sample all GPIO pins as analog voltages,then they will be sampled in round-robin fashion. If userspace reads tooslowly, -EAGAIN will be returned when you read the sysfs attribute containingthe sensor reading.

The LTC4245 chip can be configured to sample all GPIO pins with two methods:

  1. platform data – see include/linux/platform_data/ltc4245.h
  2. OF device tree – add the “ltc4245,use-extra-gpios” property to each chip

The default mode of operation is to sample a single GPIO pin.