drivers/media/tuners/tea5761.c
Source file repositories/reference/linux-study-clean/drivers/media/tuners/tea5761.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/tuners/tea5761.c- Extension
.c- Size
- 8825 bytes
- Lines
- 342
- Domain
- Driver Families
- Bucket
- drivers/media
- 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.
- 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/i2c.hlinux/slab.hlinux/delay.hlinux/videodev2.hmedia/tuner.htuner-i2c.htea5761.h
Detected Declarations
struct tea5761_privfunction tea5761_status_dumpfunction __set_radio_freqfunction set_radio_freqfunction set_radio_sleepfunction tea5761_read_statusfunction tea5761_signalfunction tea5761_stereofunction tea5761_get_statusfunction tea5761_get_rf_strengthfunction tea5761_autodetectionfunction tea5761_releasefunction tea5761_get_frequencyexport tea5761_attachexport tea5761_autodetection
Annotated Snippet
struct tea5761_priv {
struct tuner_i2c_props i2c_props;
u32 frequency;
bool standby;
};
/*****************************************************************************/
/***************************
* TEA5761HN I2C registers *
***************************/
/* INTREG - Read: bytes 0 and 1 / Write: byte 0 */
/* first byte for reading */
#define TEA5761_INTREG_IFFLAG 0x10
#define TEA5761_INTREG_LEVFLAG 0x8
#define TEA5761_INTREG_FRRFLAG 0x2
#define TEA5761_INTREG_BLFLAG 0x1
/* second byte for reading / byte for writing */
#define TEA5761_INTREG_IFMSK 0x10
#define TEA5761_INTREG_LEVMSK 0x8
#define TEA5761_INTREG_FRMSK 0x2
#define TEA5761_INTREG_BLMSK 0x1
/* FRQSET - Read: bytes 2 and 3 / Write: byte 1 and 2 */
/* First byte */
#define TEA5761_FRQSET_SEARCH_UP 0x80 /* 1=Station search from bottom to up */
#define TEA5761_FRQSET_SEARCH_MODE 0x40 /* 1=Search mode */
/* Bits 0-5 for divider MSB */
/* Second byte */
/* Bits 0-7 for divider LSB */
/* TNCTRL - Read: bytes 4 and 5 / Write: Bytes 3 and 4 */
/* first byte */
#define TEA5761_TNCTRL_PUPD_0 0x40 /* Power UP/Power Down MSB */
#define TEA5761_TNCTRL_BLIM 0X20 /* 1= Japan Frequencies, 0= European frequencies */
#define TEA5761_TNCTRL_SWPM 0x10 /* 1= software port is FRRFLAG */
#define TEA5761_TNCTRL_IFCTC 0x08 /* 1= IF count time 15.02 ms, 0= IF count time 2.02 ms */
#define TEA5761_TNCTRL_AFM 0x04
#define TEA5761_TNCTRL_SMUTE 0x02 /* 1= Soft mute */
#define TEA5761_TNCTRL_SNC 0x01
/* second byte */
#define TEA5761_TNCTRL_MU 0x80 /* 1=Hard mute */
#define TEA5761_TNCTRL_SSL_1 0x40
#define TEA5761_TNCTRL_SSL_0 0x20
#define TEA5761_TNCTRL_HLSI 0x10
#define TEA5761_TNCTRL_MST 0x08 /* 1 = mono */
#define TEA5761_TNCTRL_SWP 0x04
#define TEA5761_TNCTRL_DTC 0x02 /* 1 = deemphasis 50 us, 0 = deemphasis 75 us */
#define TEA5761_TNCTRL_AHLSI 0x01
/* FRQCHECK - Read: bytes 6 and 7 */
/* First byte */
/* Bits 0-5 for divider MSB */
/* Second byte */
/* Bits 0-7 for divider LSB */
/* TUNCHECK - Read: bytes 8 and 9 */
/* First byte */
#define TEA5761_TUNCHECK_IF_MASK 0x7e /* IF count */
#define TEA5761_TUNCHECK_TUNTO 0x01
/* Second byte */
#define TEA5761_TUNCHECK_LEV_MASK 0xf0 /* Level Count */
#define TEA5761_TUNCHECK_LD 0x08
#define TEA5761_TUNCHECK_STEREO 0x04
/* TESTREG - Read: bytes 10 and 11 / Write: bytes 5 and 6 */
/* All zero = no test mode */
/* MANID - Read: bytes 12 and 13 */
/* First byte - should be 0x10 */
#define TEA5767_MANID_VERSION_MASK 0xf0 /* Version = 1 */
#define TEA5767_MANID_ID_MSB_MASK 0x0f /* Manufacurer ID - should be 0 */
Annotation
- Immediate include surface: `linux/i2c.h`, `linux/slab.h`, `linux/delay.h`, `linux/videodev2.h`, `media/tuner.h`, `tuner-i2c.h`, `tea5761.h`.
- Detected declarations: `struct tea5761_priv`, `function tea5761_status_dump`, `function __set_radio_freq`, `function set_radio_freq`, `function set_radio_sleep`, `function tea5761_read_status`, `function tea5761_signal`, `function tea5761_stereo`, `function tea5761_get_status`, `function tea5761_get_rf_strength`.
- Atlas domain: Driver Families / drivers/media.
- 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.