drivers/media/i2c/max2175.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/max2175.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/max2175.c- Extension
.c- Size
- 38545 bytes
- Lines
- 1442
- Domain
- Driver Families
- Bucket
- drivers/media
- 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.
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clk.hlinux/delay.hlinux/errno.hlinux/i2c.hlinux/kernel.hlinux/math64.hlinux/max2175.hlinux/module.hlinux/of.hlinux/regmap.hlinux/slab.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmax2175.h
Detected Declarations
struct max2175_rxmodestruct max2175_reg_mapstruct max2175function max2175_get_bitvalfunction max2175_readfunction max2175_writefunction max2175_read_bitsfunction max2175_write_bitsfunction max2175_write_bitfunction max2175_poll_timeoutfunction max2175_poll_csm_readyfunction max2175_band_from_freqfunction max2175_i2s_enablefunction max2175_set_filter_coeffsfunction max2175_load_fmeu_1p2function max2175_load_dab_1p2function max2175_load_fmna_1p0function max2175_load_fmna_2p0function max2175_set_bbfilterfunction max2175_set_csm_modefunction max2175_csm_actionfunction max2175_set_lo_freqfunction max2175_round_closestfunction max2175_set_nco_freqfunction max2175_set_rf_freq_non_am_bandsfunction max2175_set_rf_freqfunction max2175_tune_rf_freqfunction max2175_set_hslsfunction max2175_set_eu_rx_modefunction max2175_set_na_rx_modefunction max2175_set_rx_modefunction max2175_rx_mode_from_freqfunction max2175_freq_rx_mode_validfunction max2175_load_adc_presetsfunction max2175_init_power_managerfunction max2175_recalibrate_adcfunction max2175_read_romfunction max2175_load_from_romfunction max2175_load_full_fm_eu_1p0function max2175_load_full_fm_na_1p0function max2175_core_initfunction max2175_s_ctrl_rx_modefunction max2175_s_ctrlfunction max2175_get_lna_gainfunction max2175_g_volatile_ctrlfunction max2175_set_freq_and_modefunction max2175_s_frequencyfunction max2175_g_frequency
Annotated Snippet
struct max2175_rxmode {
enum max2175_band band; /* Associated band */
u32 freq; /* Default freq in Hz */
u8 i2s_word_size; /* Bit value */
};
/* Register map to define preset values */
struct max2175_reg_map {
u8 idx; /* Register index */
u8 val; /* Register value */
};
static const struct max2175_rxmode eu_rx_modes[] = {
/* EU modes */
[MAX2175_EU_FM_1_2] = { MAX2175_BAND_FM, 98256000, 1 },
[MAX2175_DAB_1_2] = { MAX2175_BAND_VHF, 182640000, 0 },
};
static const struct max2175_rxmode na_rx_modes[] = {
/* NA modes */
[MAX2175_NA_FM_1_0] = { MAX2175_BAND_FM, 98255520, 1 },
[MAX2175_NA_FM_2_0] = { MAX2175_BAND_FM, 98255520, 6 },
};
/*
* Preset values:
* Based on Maxim MAX2175 Register Table revision: 130p10
*/
static const u8 full_fm_eu_1p0[] = {
0x15, 0x04, 0xb8, 0xe3, 0x35, 0x18, 0x7c, 0x00,
0x00, 0x7d, 0x40, 0x08, 0x70, 0x7a, 0x88, 0x91,
0x61, 0x61, 0x61, 0x61, 0x5a, 0x0f, 0x34, 0x1c,
0x14, 0x88, 0x33, 0x02, 0x00, 0x09, 0x00, 0x65,
0x9f, 0x2b, 0x80, 0x00, 0x95, 0x05, 0x2c, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
0x4a, 0x08, 0xa8, 0x0e, 0x0e, 0x2f, 0x7e, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0x5e, 0xa9,
0xae, 0xbb, 0x57, 0x18, 0x3b, 0x03, 0x3b, 0x64,
0x40, 0x60, 0x00, 0x2a, 0xbf, 0x3f, 0xff, 0x9f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00,
0xff, 0xfc, 0xef, 0x1c, 0x40, 0x00, 0x00, 0x02,
0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x40, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00,
0x00, 0x47, 0x00, 0x00, 0x11, 0x3f, 0x22, 0x00,
0xf1, 0x00, 0x41, 0x03, 0xb0, 0x00, 0x00, 0x00,
0x1b,
};
static const u8 full_fm_na_1p0[] = {
0x13, 0x08, 0x8d, 0xc0, 0x35, 0x18, 0x7d, 0x3f,
0x7d, 0x75, 0x40, 0x08, 0x70, 0x7a, 0x88, 0x91,
0x61, 0x61, 0x61, 0x61, 0x5c, 0x0f, 0x34, 0x1c,
0x14, 0x88, 0x33, 0x02, 0x00, 0x01, 0x00, 0x65,
0x9f, 0x2b, 0x80, 0x00, 0x95, 0x05, 0x2c, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
0x4a, 0x08, 0xa8, 0x0e, 0x0e, 0xaf, 0x7e, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0x5e, 0xa9,
0xae, 0xbb, 0x57, 0x18, 0x3b, 0x03, 0x3b, 0x64,
0x40, 0x60, 0x00, 0x2a, 0xbf, 0x3f, 0xff, 0x9f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00,
0xff, 0xfc, 0xef, 0x1c, 0x40, 0x00, 0x00, 0x02,
0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x40, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00,
0x00, 0x35, 0x00, 0x00, 0x11, 0x3f, 0x22, 0x00,
0xf1, 0x00, 0x41, 0x03, 0xb0, 0x00, 0x00, 0x00,
0x1b,
};
/* DAB1.2 settings */
static const struct max2175_reg_map dab12_map[] = {
{ 0x01, 0x13 }, { 0x02, 0x0d }, { 0x03, 0x15 }, { 0x04, 0x55 },
{ 0x05, 0x0a }, { 0x06, 0xa0 }, { 0x07, 0x40 }, { 0x08, 0x00 },
{ 0x09, 0x00 }, { 0x0a, 0x7d }, { 0x0b, 0x4a }, { 0x0c, 0x28 },
{ 0x0e, 0x43 }, { 0x0f, 0xb5 }, { 0x10, 0x31 }, { 0x11, 0x9e },
{ 0x12, 0x68 }, { 0x13, 0x9e }, { 0x14, 0x68 }, { 0x15, 0x58 },
{ 0x16, 0x2f }, { 0x17, 0x3f }, { 0x18, 0x40 }, { 0x1a, 0x88 },
{ 0x1b, 0xaa }, { 0x1c, 0x9a }, { 0x1d, 0x00 }, { 0x1e, 0x00 },
{ 0x23, 0x80 }, { 0x24, 0x00 }, { 0x25, 0x00 }, { 0x26, 0x00 },
{ 0x27, 0x00 }, { 0x32, 0x08 }, { 0x33, 0xf8 }, { 0x36, 0x2d },
{ 0x37, 0x7e }, { 0x55, 0xaf }, { 0x56, 0x3f }, { 0x57, 0xf8 },
{ 0x58, 0x99 }, { 0x76, 0x00 }, { 0x77, 0x00 }, { 0x78, 0x02 },
{ 0x79, 0x40 }, { 0x82, 0x00 }, { 0x83, 0x00 }, { 0x85, 0x00 },
{ 0x86, 0x20 },
};
/* EU FM 1.2 settings */
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/errno.h`, `linux/i2c.h`, `linux/kernel.h`, `linux/math64.h`, `linux/max2175.h`, `linux/module.h`.
- Detected declarations: `struct max2175_rxmode`, `struct max2175_reg_map`, `struct max2175`, `function max2175_get_bitval`, `function max2175_read`, `function max2175_write`, `function max2175_read_bits`, `function max2175_write_bits`, `function max2175_write_bit`, `function max2175_poll_timeout`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source 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.