drivers/media/radio/tea575x.c
Source file repositories/reference/linux-study-clean/drivers/media/radio/tea575x.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/radio/tea575x.c- Extension
.c- Size
- 14458 bytes
- Lines
- 578
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/module.hlinux/init.hlinux/slab.hlinux/sched.hasm/io.hmedia/v4l2-device.hmedia/v4l2-dev.hmedia/v4l2-fh.hmedia/v4l2-ioctl.hmedia/v4l2-event.hmedia/drv-intf/tea575x.h
Detected Declarations
function snd_tea575x_writefunction snd_tea575x_readfunction snd_tea575x_val_to_freqfunction snd_tea575x_get_freqfunction snd_tea575x_set_freqfunction vidioc_querycapfunction snd_tea575x_enum_freq_bandsfunction vidioc_enum_freq_bandsfunction snd_tea575x_g_tunerfunction vidioc_g_tunerfunction vidioc_s_tunerfunction vidioc_g_frequencyfunction vidioc_s_frequencyfunction snd_tea575x_s_hw_freq_seekfunction vidioc_s_hw_freq_seekfunction tea575x_s_ctrlfunction snd_tea575x_hw_initfunction snd_tea575x_initfunction snd_tea575x_exitexport snd_tea575x_set_freqexport snd_tea575x_enum_freq_bandsexport snd_tea575x_g_tunerexport snd_tea575x_s_hw_freq_seekexport snd_tea575x_hw_initexport snd_tea575x_initexport snd_tea575x_exit
Annotated Snippet
if (tea->has_am) {
index = BAND_AM;
break;
}
fallthrough;
default:
return -EINVAL;
}
*band = bands[index];
if (!tea->cannot_read_data)
band->capability |= V4L2_TUNER_CAP_HWSEEK_BOUNDED;
return 0;
}
EXPORT_SYMBOL(snd_tea575x_enum_freq_bands);
static int vidioc_enum_freq_bands(struct file *file, void *priv,
struct v4l2_frequency_band *band)
{
struct snd_tea575x *tea = video_drvdata(file);
return snd_tea575x_enum_freq_bands(tea, band);
}
int snd_tea575x_g_tuner(struct snd_tea575x *tea, struct v4l2_tuner *v)
{
struct v4l2_frequency_band band_fm = { 0, };
if (v->index > 0)
return -EINVAL;
snd_tea575x_read(tea);
snd_tea575x_enum_freq_bands(tea, &band_fm);
memset(v, 0, sizeof(*v));
strscpy(v->name, tea->has_am ? "FM/AM" : "FM", sizeof(v->name));
v->type = V4L2_TUNER_RADIO;
v->capability = band_fm.capability;
v->rangelow = tea->has_am ? bands[BAND_AM].rangelow : band_fm.rangelow;
v->rangehigh = band_fm.rangehigh;
v->rxsubchans = tea->stereo ? V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO;
v->audmode = (tea->val & TEA575X_BIT_MONO) ?
V4L2_TUNER_MODE_MONO : V4L2_TUNER_MODE_STEREO;
v->signal = tea->tuned ? 0xffff : 0;
return 0;
}
EXPORT_SYMBOL(snd_tea575x_g_tuner);
static int vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
{
struct snd_tea575x *tea = video_drvdata(file);
return snd_tea575x_g_tuner(tea, v);
}
static int vidioc_s_tuner(struct file *file, void *priv,
const struct v4l2_tuner *v)
{
struct snd_tea575x *tea = video_drvdata(file);
u32 orig_val = tea->val;
if (v->index)
return -EINVAL;
tea->val &= ~TEA575X_BIT_MONO;
if (v->audmode == V4L2_TUNER_MODE_MONO)
tea->val |= TEA575X_BIT_MONO;
/* Only apply changes if currently tuning FM */
if (tea->band != BAND_AM && tea->val != orig_val)
snd_tea575x_set_freq(tea);
return 0;
}
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct snd_tea575x *tea = video_drvdata(file);
if (f->tuner != 0)
return -EINVAL;
f->type = V4L2_TUNER_RADIO;
f->frequency = tea->freq;
return 0;
}
static int vidioc_s_frequency(struct file *file, void *priv,
const struct v4l2_frequency *f)
{
Annotation
- Immediate include surface: `linux/delay.h`, `linux/module.h`, `linux/init.h`, `linux/slab.h`, `linux/sched.h`, `asm/io.h`, `media/v4l2-device.h`, `media/v4l2-dev.h`.
- Detected declarations: `function snd_tea575x_write`, `function snd_tea575x_read`, `function snd_tea575x_val_to_freq`, `function snd_tea575x_get_freq`, `function snd_tea575x_set_freq`, `function vidioc_querycap`, `function snd_tea575x_enum_freq_bands`, `function vidioc_enum_freq_bands`, `function snd_tea575x_g_tuner`, `function vidioc_g_tuner`.
- 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.