drivers/thermal/ti-soc-thermal/ti-bandgap.h

Source file repositories/reference/linux-study-clean/drivers/thermal/ti-soc-thermal/ti-bandgap.h

File Facts

System
Linux kernel
Corpus path
drivers/thermal/ti-soc-thermal/ti-bandgap.h
Extension
.h
Size
14117 bytes
Lines
379
Domain
Driver Families
Bucket
drivers/thermal
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct temp_sensor_registers {
	u32	temp_sensor_ctrl;
	u32	bgap_tempsoff_mask;
	u32	bgap_soc_mask;
	u32	bgap_eocz_mask;
	u32	bgap_dtemp_mask;

	u32	bgap_mask_ctrl;
	u32	mask_hot_mask;
	u32	mask_cold_mask;
	u32	mask_counter_delay_mask;
	u32	mask_freeze_mask;

	u32	bgap_mode_ctrl;
	u32	mode_ctrl_mask;

	u32	bgap_counter;
	u32	counter_mask;

	u32	bgap_threshold;
	u32	threshold_thot_mask;
	u32	threshold_tcold_mask;

	u32	tshut_threshold;
	u32	tshut_hot_mask;
	u32	tshut_cold_mask;

	u32	bgap_status;
	u32	status_hot_mask;
	u32	status_cold_mask;

	u32	ctrl_dtemp_1;
	u32	ctrl_dtemp_2;
	u32	bgap_efuse;
};

/**
 * struct temp_sensor_data - The thresholds and limits for temperature sensors.
 * @tshut_hot: temperature to trigger a thermal reset (initial value)
 * @tshut_cold: temp to get the plat out of reset due to thermal (init val)
 * @t_hot: temperature to trigger a thermal alert (high initial value)
 * @t_cold: temperature to trigger a thermal alert (low initial value)
 * @min_freq: sensor minimum clock rate
 * @max_freq: sensor maximum clock rate
 *
 * This data structure will hold the required thresholds and temperature limits
 * for a specific temperature sensor, like shutdown temperature, alert
 * temperature, clock / rate used, ADC conversion limits and update intervals
 */
struct temp_sensor_data {
	u32	tshut_hot;
	u32	tshut_cold;
	u32	t_hot;
	u32	t_cold;
	u32	min_freq;
	u32	max_freq;
};

struct ti_bandgap_data;

/**
 * struct temp_sensor_regval - temperature sensor register values and priv data
 * @bg_mode_ctrl: temp sensor control register value
 * @bg_ctrl: bandgap ctrl register value
 * @bg_counter: bandgap counter value
 * @bg_threshold: bandgap threshold register value
 * @tshut_threshold: bandgap tshut register value
 * @data: private data
 *
 * Data structure to save and restore bandgap register set context. Only
 * required registers are shadowed, when needed.
 */
struct temp_sensor_regval {
	u32			bg_mode_ctrl;
	u32			bg_ctrl;
	u32			bg_counter;
	u32			bg_threshold;
	u32			tshut_threshold;
	void			*data;
};

/**
 * struct ti_bandgap - bandgap device structure
 * @dev: struct device pointer
 * @base: io memory base address
 * @conf: struct with bandgap configuration set (# sensors, conv_table, etc)
 * @regval: temperature sensor register values
 * @fclock: pointer to functional clock of temperature sensor
 * @div_clk: pointer to divider clock of temperature sensor fclk
 * @lock: spinlock for ti_bandgap structure

Annotation

Implementation Notes