drivers/media/tuners/tda8290.c
Source file repositories/reference/linux-study-clean/drivers/media/tuners/tda8290.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/tuners/tda8290.c- Extension
.c- Size
- 24639 bytes
- Lines
- 874
- 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.htuner-i2c.htda8290.htda827x.htda18271.h
Detected Declarations
struct tda8290_privfunction tda8290_i2c_bridgefunction tda8295_i2c_bridgefunction set_audiofunction tda8290_set_paramsfunction tda8295_powerfunction tda8295_set_easy_modefunction tda8295_set_video_stdfunction tda8295_agc1_outfunction tda8295_agc2_outfunction tda8295_has_signalfunction tda8295_set_paramsfunction tda8290_has_signalfunction tda8290_standbyfunction tda8295_standbyfunction tda8290_init_iffunction tda8295_init_iffunction tda8290_init_tunerfunction tda829x_releasefunction tda829x_find_tunerfunction tda8290_probefunction tda8295_probefunction tda829x_probeexport tda829x_attachexport tda829x_probe
Annotated Snippet
struct tda8290_priv {
struct tuner_i2c_props i2c_props;
unsigned char tda8290_easy_mode;
unsigned char tda827x_addr;
unsigned char ver;
#define TDA8290 1
#define TDA8295 2
#define TDA8275 4
#define TDA8275A 8
#define TDA18271 16
struct tda827x_config cfg;
struct tda18271_std_map *tda18271_std_map;
};
/*---------------------------------------------------------------------*/
static int tda8290_i2c_bridge(struct dvb_frontend *fe, int close)
{
struct tda8290_priv *priv = fe->analog_demod_priv;
static unsigned char enable[2] = { 0x21, 0xC0 };
static unsigned char disable[2] = { 0x21, 0x00 };
unsigned char *msg;
if (close) {
msg = enable;
tuner_i2c_xfer_send(&priv->i2c_props, msg, 2);
/* let the bridge stabilize */
msleep(20);
} else {
msg = disable;
tuner_i2c_xfer_send(&priv->i2c_props, msg, 2);
}
return 0;
}
static int tda8295_i2c_bridge(struct dvb_frontend *fe, int close)
{
struct tda8290_priv *priv = fe->analog_demod_priv;
static unsigned char enable[2] = { 0x45, 0xc1 };
static unsigned char disable[2] = { 0x46, 0x00 };
static unsigned char buf[3] = { 0x45, 0x01, 0x00 };
unsigned char *msg;
if (close) {
msg = enable;
tuner_i2c_xfer_send(&priv->i2c_props, msg, 2);
/* let the bridge stabilize */
msleep(20);
} else {
msg = disable;
tuner_i2c_xfer_send_recv(&priv->i2c_props, msg, 1, &msg[1], 1);
buf[2] = msg[1];
buf[2] &= ~0x04;
tuner_i2c_xfer_send(&priv->i2c_props, buf, 3);
msleep(5);
msg[1] |= 0x04;
tuner_i2c_xfer_send(&priv->i2c_props, msg, 2);
}
return 0;
}
/*---------------------------------------------------------------------*/
static void set_audio(struct dvb_frontend *fe,
struct analog_parameters *params)
{
struct tda8290_priv *priv = fe->analog_demod_priv;
char* mode;
if (params->std & V4L2_STD_MN) {
priv->tda8290_easy_mode = 0x01;
mode = "MN";
} else if (params->std & V4L2_STD_B) {
priv->tda8290_easy_mode = 0x02;
mode = "B";
} else if (params->std & V4L2_STD_GH) {
priv->tda8290_easy_mode = 0x04;
mode = "GH";
} else if (params->std & V4L2_STD_PAL_I) {
priv->tda8290_easy_mode = 0x08;
Annotation
- Immediate include surface: `linux/i2c.h`, `linux/slab.h`, `linux/delay.h`, `linux/videodev2.h`, `tuner-i2c.h`, `tda8290.h`, `tda827x.h`, `tda18271.h`.
- Detected declarations: `struct tda8290_priv`, `function tda8290_i2c_bridge`, `function tda8295_i2c_bridge`, `function set_audio`, `function tda8290_set_params`, `function tda8295_power`, `function tda8295_set_easy_mode`, `function tda8295_set_video_std`, `function tda8295_agc1_out`, `function tda8295_agc2_out`.
- 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.