drivers/iio/adc/qcom-vadc-common.c
Source file repositories/reference/linux-study-clean/drivers/iio/adc/qcom-vadc-common.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/iio/adc/qcom-vadc-common.c- Extension
.c- Size
- 18667 bytes
- Lines
- 773
- Domain
- Driver Families
- Bucket
- drivers/iio
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bug.hlinux/kernel.hlinux/bitops.hlinux/fixp-arith.hlinux/iio/adc/qcom-vadc-common.hlinux/math64.hlinux/log2.hlinux/err.hlinux/module.hlinux/units.h
Detected Declarations
struct vadc_map_ptfunction qcom_vadc_map_voltage_tempfunction qcom_vadc_map_temp_voltagefunction qcom_vadc_scale_calibfunction qcom_vadc_scale_voltfunction qcom_vadc_scale_thermfunction qcom_vadc_scale_die_tempfunction qcom_vadc_scale_chg_tempfunction qcom_vadc_scale_voltage_codefunction qcom_vadc_scale_code_voltage_factorfunction qcom_vadc7_scale_hw_calib_thermfunction qcom_vadc_scale_hw_calib_voltfunction qcom_vadc_scale_hw_calib_thermfunction qcom_vadc_scale_hw_calib_die_tempfunction qcom_vadc7_scale_hw_calib_die_tempfunction qcom_vadc_scale_hw_smb_tempfunction qcom_vadc_scale_hw_chg5_tempfunction qcom_vadc_scalefunction qcom_adc_tm5_temp_volt_scalefunction qcom_adc_tm5_gen2_temp_res_scalefunction qcom_adc5_hw_scalefunction qcom_adc5_prescaling_from_dtfunction qcom_adc5_hw_settle_time_from_dtfunction qcom_adc5_avg_samples_from_dtfunction qcom_adc5_decimation_from_dtfunction qcom_vadc_decimation_from_dtexport qcom_vadc_scaleexport qcom_adc_tm5_temp_volt_scaleexport qcom_adc_tm5_gen2_temp_res_scaleexport qcom_adc5_hw_scaleexport qcom_adc5_prescaling_from_dtexport qcom_adc5_hw_settle_time_from_dtexport qcom_adc5_avg_samples_from_dtexport qcom_adc5_decimation_from_dtexport qcom_vadc_decimation_from_dt
Annotated Snippet
struct vadc_map_pt {
s32 x;
s32 y;
};
/* Voltage to temperature */
static const struct vadc_map_pt adcmap_100k_104ef_104fb[] = {
{1758, -40000 },
{1742, -35000 },
{1719, -30000 },
{1691, -25000 },
{1654, -20000 },
{1608, -15000 },
{1551, -10000 },
{1483, -5000 },
{1404, 0 },
{1315, 5000 },
{1218, 10000 },
{1114, 15000 },
{1007, 20000 },
{900, 25000 },
{795, 30000 },
{696, 35000 },
{605, 40000 },
{522, 45000 },
{448, 50000 },
{383, 55000 },
{327, 60000 },
{278, 65000 },
{237, 70000 },
{202, 75000 },
{172, 80000 },
{146, 85000 },
{125, 90000 },
{107, 95000 },
{92, 100000 },
{79, 105000 },
{68, 110000 },
{59, 115000 },
{51, 120000 },
{44, 125000 }
};
/*
* Voltage to temperature table for 100k pull up for NTCG104EF104 with
* 1.875V reference.
*/
static const struct vadc_map_pt adcmap_100k_104ef_104fb_1875_vref[] = {
{ 1831, -40000 },
{ 1814, -35000 },
{ 1791, -30000 },
{ 1761, -25000 },
{ 1723, -20000 },
{ 1675, -15000 },
{ 1616, -10000 },
{ 1545, -5000 },
{ 1463, 0 },
{ 1370, 5000 },
{ 1268, 10000 },
{ 1160, 15000 },
{ 1049, 20000 },
{ 937, 25000 },
{ 828, 30000 },
{ 726, 35000 },
{ 630, 40000 },
{ 544, 45000 },
{ 467, 50000 },
{ 399, 55000 },
{ 340, 60000 },
{ 290, 65000 },
{ 247, 70000 },
{ 209, 75000 },
{ 179, 80000 },
{ 153, 85000 },
{ 130, 90000 },
{ 112, 95000 },
{ 96, 100000 },
{ 82, 105000 },
{ 71, 110000 },
{ 62, 115000 },
{ 53, 120000 },
{ 46, 125000 },
};
static const struct vadc_map_pt adcmap7_die_temp[] = {
{ 857300, 160000 },
{ 820100, 140000 },
{ 782500, 120000 },
{ 744600, 100000 },
{ 706400, 80000 },
Annotation
- Immediate include surface: `linux/bug.h`, `linux/kernel.h`, `linux/bitops.h`, `linux/fixp-arith.h`, `linux/iio/adc/qcom-vadc-common.h`, `linux/math64.h`, `linux/log2.h`, `linux/err.h`.
- Detected declarations: `struct vadc_map_pt`, `function qcom_vadc_map_voltage_temp`, `function qcom_vadc_map_temp_voltage`, `function qcom_vadc_scale_calib`, `function qcom_vadc_scale_volt`, `function qcom_vadc_scale_therm`, `function qcom_vadc_scale_die_temp`, `function qcom_vadc_scale_chg_temp`, `function qcom_vadc_scale_voltage_code`, `function qcom_vadc_scale_code_voltage_factor`.
- Atlas domain: Driver Families / drivers/iio.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.