/* * PVT sensors-related limits and default values * @PVT_TEMP_MIN: Minimal temperature in millidegrees of Celsius. * @PVT_TEMP_MAX: Maximal temperature in millidegrees of Celsius. * @PVT_TEMP_CHS: Number of temperature hwmon channels. * @PVT_VOLT_MIN: Minimal voltage in mV. * @PVT_VOLT_MAX: Maximal voltage in mV. * @PVT_VOLT_CHS: Number of voltage hwmon channels. * @PVT_DATA_MIN: Minimal PVT raw data value. * @PVT_DATA_MAX: Maximal PVT raw data value. * @PVT_TRIM_MIN: Minimal temperature sensor trim value. * @PVT_TRIM_MAX: Maximal temperature sensor trim value. * @PVT_TRIM_DEF: Default temperature sensor trim value (set a proper value * when one is determined for Baikal-T1 SoC). * @PVT_TRIM_TEMP: Maximum temperature encoded by the trim factor. * @PVT_TRIM_STEP: Temperature stride corresponding to the trim value. * @PVT_TOUT_MIN: Minimal timeout between samples in nanoseconds. * @PVT_TOUT_DEF: Default data measurements timeout. In case if alarms are * activated the PVT IRQ is enabled to be raised after each * conversion in order to have the thresholds checked and the * converted value cached. Too frequent conversions may cause * the system CPU overload. Lets set the 50ms delay between * them by default to prevent this.
*/ #define PVT_TEMP_MIN -48380L #define PVT_TEMP_MAX 147438L #define PVT_TEMP_CHS 1 #define PVT_VOLT_MIN 620L #define PVT_VOLT_MAX 1168L #define PVT_VOLT_CHS 4 #define PVT_DATA_MIN 0 #define PVT_DATA_MAX (PVT_DATA_DATA_MASK >> PVT_DATA_DATA_FLD) #define PVT_TRIM_MIN 0 #define PVT_TRIM_MAX (PVT_CTRL_TRIM_MASK >> PVT_CTRL_TRIM_FLD) #define PVT_TRIM_TEMP 7130 #define PVT_TRIM_STEP (PVT_TRIM_TEMP / PVT_TRIM_MAX) #define PVT_TRIM_DEF 0 #define PVT_TOUT_MIN (NSEC_PER_SEC / 3000) #ifdefined(CONFIG_SENSORS_BT1_PVT_ALARMS) # define PVT_TOUT_DEF 60000 #else # define PVT_TOUT_DEF 0 #endif
/* * enum pvt_sensor_type - Baikal-T1 PVT sensor types (correspond to each PVT * sampling mode) * @PVT_SENSOR*: helpers to traverse the sensors in loops. * @PVT_TEMP: PVT Temperature sensor. * @PVT_VOLT: PVT Voltage sensor. * @PVT_LVT: PVT Low-Voltage threshold sensor. * @PVT_HVT: PVT High-Voltage threshold sensor. * @PVT_SVT: PVT Standard-Voltage threshold sensor.
*/ enum pvt_sensor_type {
PVT_SENSOR_FIRST,
PVT_TEMP = PVT_SENSOR_FIRST,
PVT_VOLT,
PVT_LVT,
PVT_HVT,
PVT_SVT,
PVT_SENSOR_LAST = PVT_SVT,
PVT_SENSORS_NUM
};
/* * struct pvt_cache - PVT sensors data cache * @data: data cache in raw format. * @thres_sts_lo: low threshold status saved on the previous data conversion. * @thres_sts_hi: high threshold status saved on the previous data conversion. * @data_seqlock: cached data seq-lock. * @conversion: data conversion completion.
*/ struct pvt_cache {
u32 data; #ifdefined(CONFIG_SENSORS_BT1_PVT_ALARMS)
seqlock_t data_seqlock;
u32 thres_sts_lo;
u32 thres_sts_hi; #else struct completion conversion; #endif
};
/* * struct pvt_hwmon - Baikal-T1 PVT private data * @dev: device structure of the PVT platform device. * @hwmon: hwmon device structure. * @regs: pointer to the Baikal-T1 PVT registers region. * @irq: PVT events IRQ number. * @clks: Array of the PVT clocks descriptor (APB/ref clocks). * @ref_clk: Pointer to the reference clocks descriptor. * @iface_mtx: Generic interface mutex (used to lock the alarm registers * when the alarms enabled, or the data conversion interface * if alarms are disabled). * @sensor: current PVT sensor the data conversion is being performed for. * @cache: data cache descriptor. * @timeout: conversion timeout cache.
*/ struct pvt_hwmon { struct device *dev; struct device *hwmon;
/* * struct pvt_poly_term - a term descriptor of the PVT data translation * polynomial * @deg: degree of the term. * @coef: multiplication factor of the term. * @divider: distributed divider per each degree. * @divider_leftover: divider leftover, which couldn't be redistributed.
*/ struct pvt_poly_term { unsignedint deg; long coef; long divider; long divider_leftover;
};
/* * struct pvt_poly - PVT data translation polynomial descriptor * @total_divider: total data divider. * @terms: polynomial terms up to a free one.
*/ struct pvt_poly { long total_divider; struct pvt_poly_term terms[];
};
#endif/* __HWMON_BT1_PVT_H__ */
Messung V0.5
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.