Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) Kernel driver ltc2945
^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 LTC2945
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8)     Prefix: 'ltc2945'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)     Addresses scanned: -
^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) 	https://www.analog.com/media/en/technical-documentation/data-sheets/2945fb.pdf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) Author: Guenter Roeck <linux@roeck-us.net>
^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 LTC2945  is a rail-to-rail system monitor that measures current, voltage,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) and power consumption.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) Usage Notes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) This driver does not probe for LTC2945 devices, since there is no register
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) which can be safely used to identify the chip. You will have to instantiate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) the devices explicitly.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) Example: the following will load the driver for an LTC2945 at address 0x10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) on I2C bus #1::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 	$ modprobe ltc2945
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 	$ echo ltc2945 0x10 > /sys/bus/i2c/devices/i2c-1/new_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) Sysfs entries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) -------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) Voltage readings provided by this driver are reported as obtained from the ADC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) registers. If a set of voltage divider resistors is installed, calculate the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) real voltage by multiplying the reported value with (R1+R2)/R2, where R1 is the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) value of the divider resistor against the measured voltage and R2 is the value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) of the divider resistor against Ground.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) Current reading provided by this driver is reported as obtained from the ADC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) Current Sense register. The reported value assumes that a 1 mOhm sense resistor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) is installed. If a different sense resistor is installed, calculate the real
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) current by dividing the reported value by the sense resistor value in mOhm.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) ======================= ========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) in1_input		VIN voltage (mV). Voltage is measured either at
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 			SENSE+ or VDD pin depending on chip configuration.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) in1_min			Undervoltage threshold
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) in1_max			Overvoltage threshold
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) in1_lowest		Lowest measured voltage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) in1_highest		Highest measured voltage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) in1_reset_history	Write 1 to reset in1 history
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) in1_min_alarm		Undervoltage alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) in1_max_alarm		Overvoltage alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) in2_input		ADIN voltage (mV)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) in2_min			Undervoltage threshold
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) in2_max			Overvoltage threshold
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) in2_lowest		Lowest measured voltage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) in2_highest		Highest measured voltage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) in2_reset_history	Write 1 to reset in2 history
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) in2_min_alarm		Undervoltage alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) in2_max_alarm		Overvoltage alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) curr1_input		SENSE current (mA)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) curr1_min		Undercurrent threshold
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) curr1_max		Overcurrent threshold
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) curr1_lowest		Lowest measured current
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) curr1_highest		Highest measured current
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) curr1_reset_history	Write 1 to reset curr1 history
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) curr1_min_alarm		Undercurrent alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) curr1_max_alarm		Overcurrent alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) power1_input		Power (in uW). Power is calculated based on SENSE+/VDD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) 			voltage or ADIN voltage depending on chip configuration.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) power1_min		Low lower threshold
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) power1_max		High power threshold
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) power1_input_lowest	Historical minimum power use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) power1_input_highest	Historical maximum power use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) power1_reset_history	Write 1 to reset power1 history
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) power1_min_alarm	Low power alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) power1_max_alarm	High power alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) ======================= ========================================================