drivers/media/radio/si470x/radio-si470x.h
Source file repositories/reference/linux-study-clean/drivers/media/radio/si470x/radio-si470x.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/radio/si470x/radio-si470x.h- Extension
.h- Size
- 8275 bytes
- Lines
- 221
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/module.hlinux/init.hlinux/sched.hlinux/slab.hlinux/input.hlinux/videodev2.hlinux/mutex.hmedia/v4l2-common.hmedia/v4l2-ioctl.hmedia/v4l2-ctrls.hmedia/v4l2-event.hmedia/v4l2-device.hlinux/unaligned.h
Detected Declarations
struct si470x_device
Annotated Snippet
struct si470x_device {
struct v4l2_device v4l2_dev;
struct video_device videodev;
struct v4l2_ctrl_handler hdl;
int band;
/* Silabs internal registers (0..15) */
unsigned short registers[RADIO_REGISTER_NUM];
/* RDS receive buffer */
wait_queue_head_t read_queue;
struct mutex lock; /* buffer locking */
unsigned char *buffer; /* size is always multiple of three */
unsigned int buf_size;
unsigned int rd_index;
unsigned int wr_index;
struct completion completion;
bool status_rssi_auto_update; /* Does RSSI get updated automatic? */
/* si470x ops */
int (*get_register)(struct si470x_device *radio, int regnr);
int (*set_register)(struct si470x_device *radio, int regnr);
int (*fops_open)(struct file *file);
int (*fops_release)(struct file *file);
int (*vidioc_querycap)(struct file *file, void *priv,
struct v4l2_capability *capability);
#if IS_ENABLED(CONFIG_USB_SI470X)
/* reference to USB and video device */
struct usb_device *usbdev;
struct usb_interface *intf;
char *usb_buf;
/* Interrupt endpoint handling */
char *int_in_buffer;
struct usb_endpoint_descriptor *int_in_endpoint;
struct urb *int_in_urb;
int int_in_running;
/* scratch page */
unsigned char software_version;
unsigned char hardware_version;
#endif
#if IS_ENABLED(CONFIG_I2C_SI470X)
struct i2c_client *client;
struct gpio_desc *gpio_reset;
#endif
};
/**************************************************************************
* Firmware Versions
**************************************************************************/
#define RADIO_FW_VERSION 12
/**************************************************************************
* Frequency Multiplicator
**************************************************************************/
/*
* The frequency is set in units of 62.5 Hz when using V4L2_TUNER_CAP_LOW,
* 62.5 kHz otherwise.
* The tuner is able to have a channel spacing of 50, 100 or 200 kHz.
* tuner->capability is therefore set to V4L2_TUNER_CAP_LOW
* The FREQ_MUL is then: 1 MHz / 62.5 Hz = 16000
*/
#define FREQ_MUL (1000000 / 62.5)
/**************************************************************************
* Common Functions
**************************************************************************/
extern const struct video_device si470x_viddev_template;
extern const struct v4l2_ctrl_ops si470x_ctrl_ops;
int si470x_disconnect_check(struct si470x_device *radio);
int si470x_set_freq(struct si470x_device *radio, unsigned int freq);
int si470x_start(struct si470x_device *radio);
int si470x_stop(struct si470x_device *radio);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/init.h`, `linux/sched.h`, `linux/slab.h`, `linux/input.h`, `linux/videodev2.h`, `linux/mutex.h`.
- Detected declarations: `struct si470x_device`.
- 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.