Go to the source code of this file.
Classes | |
struct | lt3074_dev |
struct | lt3074_init_param |
struct | lt3074_status |
Functions | |
int | lt3074_init (struct lt3074_dev **dev, struct lt3074_init_param *init_param) |
Initialize the device structure. | |
int | lt3074_remove (struct lt3074_dev *dev) |
Free or remove device instance. | |
int | lt3074_send_byte (struct lt3074_dev *dev, uint32_t cmd) |
Send a PMBus command to the device. | |
int | lt3074_read_byte (struct lt3074_dev *dev, uint32_t cmd, uint8_t *data) |
Perform a raw PMBus read byte operation. | |
int | lt3074_write_byte (struct lt3074_dev *dev, uint32_t cmd, uint8_t value) |
Perform a raw PMBus write byte operation. | |
int | lt3074_read_word (struct lt3074_dev *dev, uint32_t cmd, uint16_t *word) |
Perform a raw PMBus read word operation. | |
int | lt3074_write_word (struct lt3074_dev *dev, uint32_t cmd, uint16_t word) |
Perform a raw PMBus write word operation. | |
int | lt3074_read_word_data (struct lt3074_dev *dev, uint32_t cmd, int *data) |
Perform a PMBus read word operation and converts to actual value. | |
int | lt3074_write_word_data (struct lt3074_dev *dev, uint32_t cmd, int data) |
Converts value to register data and do PMBus write word operation. | |
int | lt3074_read_block_data (struct lt3074_dev *dev, uint32_t cmd, uint8_t *data, size_t nbytes) |
Perform a PMBus read block operation. | |
int | lt3074_reg_read (struct lt3074_dev *dev, uint32_t reg, uint32_t *data) |
Generic register read wrapper. | |
int | lt3074_reg_write (struct lt3074_dev *dev, uint32_t reg, uint32_t val) |
Generic register write wrapper. | |
int | lt3074_read_value (struct lt3074_dev *dev, enum lt3074_value_type value_type, int *value) |
Read a value. | |
int | lt3074_read_status (struct lt3074_dev *dev, enum lt3074_status_type status_type, struct lt3074_status *status) |
Read statuses. | |
int | lt3074_vout_margin (struct lt3074_dev *dev, enum lt3074_margin margin_high, enum lt3074_margin margin_low) |
Set output voltage margin. | |
int | lt3074_set_limit (struct lt3074_dev *dev, enum lt3074_limit_type limit, int limit_val) |
Sets the limit value for a specific fault/warning limits. | |
int | lt3074_set_operation (struct lt3074_dev *dev, enum lt3074_operation_type operation) |
Set operation. | |
int | lt3074_clear_faults (struct lt3074_dev *dev) |
Clear status registers. | |
int | lt3074_set_enable_pin (struct lt3074_dev *dev, bool state) |
Enable/Disable the device using the EN pin. | |
int | lt3074_software_reset (struct lt3074_dev *dev) |
Perform a device software reset. | |
#define LT3074_ADDR_SIZE | ( | x | ) |
#define LT3074_BYTE 1 /* Byte */ |
#define LT3074_CAPABILITY (LT3074_R1B | 0x19) |
#define LT3074_CLEAR_FAULTS (LT3074_R0B | 0x03) |
#define LT3074_CMD | ( | x | ) |
#define LT3074_CRC_POLYNOMIAL 0x7 |
#define LT3074_IC_DEVICE_ID (LT3074_R6B | 0xAD) |
#define LT3074_IC_DEVICE_REV (LT3074_R2B | 0xAE) |
#define LT3074_IOUT_OC_FAULT_LIMIT (LT3074_R2B | 0x46) |
#define LT3074_IOUT_OC_FAULT_RESPONSE (LT3074_R1B | 0x47) |
#define LT3074_MARGIN_HIGH_MSK 0xF0 |
#define LT3074_MARGIN_LOW_MSK 0x0F |
#define LT3074_MFR_BIAS_OV_WARN_LIMIT (LT3074_R2B | 0xC7) |
#define LT3074_MFR_BIAS_UV_WARN_LIMIT (LT3074_R2B | 0xC8) |
#define LT3074_MFR_DEFAULT_CONFIG (LT3074_R1B | 0xF5) |
#define LT3074_MFR_IOUT_MIN_WARN_LIMIT (LT3074_R2B | 0xC9) |
#define LT3074_MFR_MARGIN (LT3074_R1B | 0xC4) |
#define LT3074_MFR_RAIL_ADDRESS (LT3074_R1B | 0xFA) |
#define LT3074_MFR_READ_VBIAS (LT3074_R2B | 0xC6) |
#define LT3074_MFR_RESET (LT3074_R0B | 0xFD) |
#define LT3074_MFR_SPECIAL_ID (LT3074_R2B | 0xE7) |
#define LT3074_ON_OFF_CONFIG (LT3074_R1B | 0x02) |
#define LT3074_OPERATION (LT3074_R1B | 0x01) |
#define LT3074_OPERATION_ACCESS_MSK (NO_OS_GENMASK(5,4) | NO_OS_BIT(7)) |
#define LT3074_OT_WARN_LIMIT (LT3074_R2B | 0x51) |
#define LT3074_PAGE (LT3074_R1B | 0x00) |
#define LT3074_R0B (LT3074_SEND_BYTE << 8) |
#define LT3074_R1B (LT3074_BYTE << 8) |
#define LT3074_R2B (LT3074_WORD << 8) |
#define LT3074_R6B (6 << 8) /* Block of size 6*/ |
#define LT3074_READ_IOUT (LT3074_R2B | 0x8C) |
#define LT3074_READ_TEMPERATURE_1 (LT3074_R2B | 0x8D) |
#define LT3074_READ_VIN (LT3074_R2B | 0x88) |
#define LT3074_READ_VOUT (LT3074_R2B | 0x8B) |
#define LT3074_REVISION (LT3074_R1B | 0x98) |
#define LT3074_SEND_BYTE 0 /* Send-only command */ |
#define LT3074_SIZE_MSK NO_OS_GENMASK(15,8) |
#define LT3074_SPECIAL_ID_VALUE 0x1C1D |
#define LT3074_STATUS_ALL_TYPE_MSK 0xFF |
#define LT3074_STATUS_BYTE (LT3074_R1B | 0x78) |
#define LT3074_STATUS_BYTE_TYPE_MSK 0x01 |
#define LT3074_STATUS_CML (LT3074_R1B | 0x7E) |
#define LT3074_STATUS_CML_TYPE_MSK 0x20 |
#define LT3074_STATUS_INPUT (LT3074_R1B | 0x7C) |
#define LT3074_STATUS_INPUT_TYPE_MSK 0x08 |
#define LT3074_STATUS_IOUT (LT3074_R1B | 0x7B) |
#define LT3074_STATUS_IOUT_TYPE_MSK 0x04 |
#define LT3074_STATUS_MFR_SPECIFIC (LT3074_R1B | 0x80) |
#define LT3074_STATUS_MFR_SPECIFIC_TYPE_MSK 0x40 |
#define LT3074_STATUS_TEMP_TYPE_MSK 0x10 |
#define LT3074_STATUS_TEMPERATURE (LT3074_R1B | 0x7D) |
#define LT3074_STATUS_VOUT (LT3074_R1B | 0x7A) |
#define LT3074_STATUS_VOUT_TYPE_MSK 0x02 |
#define LT3074_STATUS_WORD (LT3074_R2B | 0x79) |
#define LT3074_STATUS_WORD_TYPE_MSK 0x80 |
#define LT3074_VIN_OV_WARN_LIMIT (LT3074_R2B | 0x57) |
#define LT3074_VIN_UV_WARN_LIMIT (LT3074_R2B | 0x58) |
#define LT3074_VOUT_MODE (LT3074_R1B | 0x20) |
#define LT3074_VOUT_OV_WARN_LIMIT (LT3074_R2B | 0x42) |
#define LT3074_VOUT_UV_WARN_LIMIT (LT3074_R2B | 0x43) |
#define LT3074_WORD 2 /* Word */ |
#define LT3074_WRITE_PROTECT (LT3074_R1B | 0x10) |
enum lt3074_limit_type |
enum lt3074_margin |
enum lt3074_status_type |
enum lt3074_value_type |
int lt3074_clear_faults | ( | struct lt3074_dev * | dev | ) |
Clear status registers.
dev | - Device structure |
int lt3074_init | ( | struct lt3074_dev ** | device, |
struct lt3074_init_param * | init_param ) |
Initialize the device structure.
device | - Device structure |
init_param | - Initialization parameters |
int lt3074_read_block_data | ( | struct lt3074_dev * | dev, |
uint32_t | cmd, | ||
uint8_t * | data, | ||
size_t | nbytes ) |
Perform a PMBus read block operation.
dev | - Device structure |
cmd | - PMBus command |
data | - Address of the read block |
nbytes | - Size of the block in bytes |
int lt3074_read_byte | ( | struct lt3074_dev * | dev, |
uint32_t | cmd, | ||
uint8_t * | data ) |
Perform a raw PMBus read byte operation.
dev | - Device structure |
cmd | - PMBus command |
data | - Address of the byte read |
int lt3074_read_status | ( | struct lt3074_dev * | dev, |
enum lt3074_status_type | status_type, | ||
struct lt3074_status * | status ) |
Read statuses.
dev | - Device structure |
status_type | - Status type. Example values: LT3074_STATUS_BYTE_TYPE LT3074_STATUS_VOUT_TYPE LT3074_STATUS_IOUT_TYPE LT3074_STATUS_INPUT_TYPE LT3074_STATUS_CML_TYPE |
status | - Address of the status structure |
int lt3074_read_value | ( | struct lt3074_dev * | dev, |
enum lt3074_value_type | value_type, | ||
int * | value ) |
Read a value.
dev | - Device structure |
value_type | - Value type. Example values: LT3074_VIN LT3074_VOUT LT3074_IOUT LT3074_TEMP LT3074_VBIAS |
value | - Address of the read value |
int lt3074_read_word | ( | struct lt3074_dev * | dev, |
uint32_t | cmd, | ||
uint16_t * | word ) |
Perform a raw PMBus read word operation.
dev | - Device structure |
cmd | - PMBus command |
word | - Address of the read word |
int lt3074_read_word_data | ( | struct lt3074_dev * | dev, |
uint32_t | cmd, | ||
int * | data ) |
Perform a PMBus read word operation and converts to actual value.
dev | - Device structure |
cmd | - PMBus command |
data | - Address of data read |
int lt3074_reg_read | ( | struct lt3074_dev * | dev, |
uint32_t | reg, | ||
uint32_t * | data ) |
Generic register read wrapper.
dev | - Device structure |
reg | - PMBus regiser |
data | - Address of the read data |
int lt3074_reg_write | ( | struct lt3074_dev * | dev, |
uint32_t | reg, | ||
uint32_t | val ) |
Generic register write wrapper.
dev | - Device structure |
reg | - PMBus register |
val | - Value to write |
int lt3074_remove | ( | struct lt3074_dev * | dev | ) |
Free or remove device instance.
dev | - The device structure |
int lt3074_send_byte | ( | struct lt3074_dev * | dev, |
uint32_t | cmd ) |
Send a PMBus command to the device.
dev | - Device structure |
cmd | - PMBus command |
int lt3074_set_enable_pin | ( | struct lt3074_dev * | dev, |
bool | state ) |
Enable/Disable the device using the EN pin.
dev | - Device structure |
state | - Enable/Disable state. 0 for disable, 1 for enable. |
int lt3074_set_limit | ( | struct lt3074_dev * | dev, |
enum lt3074_limit_type | limit, | ||
int | limit_val ) |
Sets the limit value for a specific fault/warning limits.
dev | - Device structure |
limit | - The type of limit to set. |
limit_val | - The value to set for the specified limit type. |
int lt3074_set_operation | ( | struct lt3074_dev * | dev, |
enum lt3074_operation_type | operation ) |
Set operation.
dev | - Device structure |
operation | - Operation. Accepted values are: LT3074_OPERATION_OFF LT3074_OPERATION_ON LT3074_OPERATION_MARGIN_HIGH LT3074_OPERATION_MARGIN_LOW |
int lt3074_software_reset | ( | struct lt3074_dev * | dev | ) |
Perform a device software reset.
dev | - Device structure |
int lt3074_vout_margin | ( | struct lt3074_dev * | dev, |
enum lt3074_margin | margin_high, | ||
enum lt3074_margin | margin_low ) |
Set output voltage margin.
dev | - Device structure |
margin_high | - Upper margin |
margin_low | - Lower margin |
int lt3074_write_byte | ( | struct lt3074_dev * | dev, |
uint32_t | cmd, | ||
uint8_t | value ) |
Perform a raw PMBus write byte operation.
dev | - Device structure |
cmd | - PMBus command |
value | - Byte to be written |
int lt3074_write_word | ( | struct lt3074_dev * | dev, |
uint32_t | cmd, | ||
uint16_t | word ) |
Perform a raw PMBus write word operation.
dev | - Device structure |
cmd | - PMBus command |
word | - Word to write |
int lt3074_write_word_data | ( | struct lt3074_dev * | dev, |
uint32_t | cmd, | ||
int | data ) |
Converts value to register data and do PMBus write word operation.
dev | - Device structure |
cmd | - PMBus command |
data | - Value to write |