drivers/media/pci/saa7134/saa7134-cards.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/saa7134/saa7134-cards.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/saa7134/saa7134-cards.c- Extension
.c- Size
- 213876 bytes
- Lines
- 8127
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
saa7134.hsaa7134-reg.hlinux/init.hlinux/module.hlinux/i2c.hlinux/i2c-algo-bit.hxc2028.hmedia/v4l2-common.hmedia/tveeprom.htea5767.htda18271.hxc5000.hs5h1411.h
Detected Declarations
function board_flyvideofunction saa7134_xc2028_callbackfunction saa7134_xc5000_callbackfunction saa7134_tda8290_827x_callbackfunction saa7134_tda18271_hvr11x0_toggle_agcfunction saa7134_kworld_sbtvd_toggle_agcfunction saa7134_kworld_pc150u_toggle_agcfunction saa7134_leadtek_hdtv200h_toggle_agcfunction saa7134_tda8290_18271_callbackfunction saa7134_tda8290_callbackfunction saa7134_tuner_callbackfunction hauppauge_eepromfunction saa7134_board_init1function saa7134_tuner_setupfunction saa7134_board_init2export saa7134_tuner_callback
Annotated Snippet
switch (dev->board) {
case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
case SAA7134_BOARD_AVERMEDIA_M103:
saa7134_set_gpio(dev, 23, 0);
msleep(10);
saa7134_set_gpio(dev, 23, 1);
break;
case SAA7134_BOARD_AVERMEDIA_A16D:
saa7134_set_gpio(dev, 21, 0);
msleep(10);
saa7134_set_gpio(dev, 21, 1);
break;
case SAA7134_BOARD_AVERMEDIA_A700_HYBRID:
saa7134_set_gpio(dev, 18, 0);
msleep(10);
saa7134_set_gpio(dev, 18, 1);
break;
case SAA7134_BOARD_VIDEOMATE_T750:
saa7134_set_gpio(dev, 20, 0);
msleep(10);
saa7134_set_gpio(dev, 20, 1);
break;
}
return 0;
}
return -EINVAL;
}
static int saa7134_xc5000_callback(struct saa7134_dev *dev,
int command, int arg)
{
switch (dev->board) {
case SAA7134_BOARD_BEHOLD_X7:
case SAA7134_BOARD_BEHOLD_H7:
case SAA7134_BOARD_BEHOLD_A7:
if (command == XC5000_TUNER_RESET) {
/* Down and UP pheripherial RESET pin for reset all chips */
saa_writeb(SAA7134_SPECIAL_MODE, 0x00);
msleep(10);
saa_writeb(SAA7134_SPECIAL_MODE, 0x01);
msleep(10);
}
break;
default:
saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x06e20000, 0x06e20000);
saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x06a20000, 0x06a20000);
saa_andorl(SAA7133_ANALOG_IO_SELECT >> 2, 0x02, 0x02);
saa_andorl(SAA7134_ANALOG_IN_CTRL1 >> 2, 0x81, 0x81);
saa_andorl(SAA7134_AUDIO_CLOCK0 >> 2, 0x03187de7, 0x03187de7);
saa_andorl(SAA7134_AUDIO_PLL_CTRL >> 2, 0x03, 0x03);
saa_andorl(SAA7134_AUDIO_CLOCKS_PER_FIELD0 >> 2,
0x0001e000, 0x0001e000);
break;
}
return 0;
}
static int saa7134_tda8290_827x_callback(struct saa7134_dev *dev,
int command, int arg)
{
u8 sync_control;
switch (command) {
case 0: /* switch LNA gain through GPIO 22*/
saa7134_set_gpio(dev, 22, arg) ;
break;
case 1: /* vsync output at GPIO22. 50 / 60Hz */
saa_andorb(SAA7134_VIDEO_PORT_CTRL3, 0x80, 0x80);
saa_andorb(SAA7134_VIDEO_PORT_CTRL6, 0x0f, 0x03);
if (arg == 1)
sync_control = 11;
else
sync_control = 17;
saa_writeb(SAA7134_VGATE_START, sync_control);
saa_writeb(SAA7134_VGATE_STOP, sync_control + 1);
saa_andorb(SAA7134_MISC_VGATE_MSB, 0x03, 0x00);
break;
default:
return -EINVAL;
}
return 0;
}
static inline int saa7134_tda18271_hvr11x0_toggle_agc(struct saa7134_dev *dev,
enum tda18271_mode mode)
{
/* toggle AGC switch through GPIO 26 */
switch (mode) {
case TDA18271_ANALOG:
Annotation
- Immediate include surface: `saa7134.h`, `saa7134-reg.h`, `linux/init.h`, `linux/module.h`, `linux/i2c.h`, `linux/i2c-algo-bit.h`, `xc2028.h`, `media/v4l2-common.h`.
- Detected declarations: `function board_flyvideo`, `function saa7134_xc2028_callback`, `function saa7134_xc5000_callback`, `function saa7134_tda8290_827x_callback`, `function saa7134_tda18271_hvr11x0_toggle_agc`, `function saa7134_kworld_sbtvd_toggle_agc`, `function saa7134_kworld_pc150u_toggle_agc`, `function saa7134_leadtek_hdtv200h_toggle_agc`, `function saa7134_tda8290_18271_callback`, `function saa7134_tda8290_callback`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: integration implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.