drivers/gpu/drm/bridge/tda998x_drv.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/bridge/tda998x_drv.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/bridge/tda998x_drv.c- Extension
.c- Size
- 62800 bytes
- Lines
- 2082
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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
linux/gpio/consumer.hlinux/hdmi.hlinux/i2c.hlinux/module.hlinux/platform_data/tda9950.hlinux/irq.hsound/asoundef.hsound/hdmi-codec.hdrm/drm_atomic_helper.hdrm/drm_bridge.hdrm/drm_edid.hdrm/drm_of.hdrm/drm_print.hdrm/drm_probe_helper.hdrm/drm_simple_kms_helper.hmedia/cec-notifier.hdt-bindings/display/tda998x.h
Detected Declarations
struct tda998x_audio_routestruct tda998x_audio_settingsstruct tda998x_privfunction cec_writefunction cec_readfunction cec_enamodsfunction tda998x_cec_set_calibrationfunction tda998x_cec_calibrationfunction tda998x_cec_hook_initfunction tda998x_cec_hook_exitfunction tda998x_cec_hook_openfunction tda998x_cec_hook_releasefunction set_pagefunction reg_read_rangefunction reg_write_rangefunction reg_readfunction reg_writefunction reg_write16function reg_setfunction reg_clearfunction tda998x_resetfunction tda998x_connector_detectfunction tda998x_edid_delay_startfunction tda998x_edid_delay_waitfunction tda998x_detect_workfunction tda998x_irq_threadfunction tda998x_write_iffunction tda998x_write_aiffunction tda998x_write_avifunction tda998x_write_vsifunction tda998x_derive_routingfunction tda998x_get_adivfunction tda998x_derive_cts_nfunction tda998x_audio_mutefunction tda998x_configure_audiofunction tda998x_audio_hw_paramsfunction tda998x_audio_shutdownfunction tda998x_audio_mute_streamfunction tda998x_audio_get_eldfunction tda998x_audio_codec_initfunction tda998x_conn_detectfunction tda998x_connector_detectfunction read_edid_blockfunction tda998x_connector_get_modesfunction tda998x_connector_best_encoderfunction tda998x_connector_initfunction tda998x_bridge_attachfunction tda998x_bridge_detach
Annotated Snippet
struct tda998x_audio_route {
u8 ena_aclk;
u8 mux_ap;
u8 aip_clksel;
};
struct tda998x_audio_settings {
const struct tda998x_audio_route *route;
struct hdmi_audio_infoframe cea;
unsigned int sample_rate;
u8 status[5];
u8 ena_ap;
u8 i2s_format;
u8 cts_n;
};
struct tda998x_priv {
struct i2c_client *cec;
struct i2c_client *hdmi;
struct mutex mutex;
u16 rev;
u8 cec_addr;
u8 current_page;
bool is_on;
bool supports_infoframes;
bool sink_has_audio;
enum hdmi_quantization_range rgb_quant_range;
u8 vip_cntrl_0;
u8 vip_cntrl_1;
u8 vip_cntrl_2;
unsigned long tmds_clock;
struct tda998x_audio_settings audio;
struct platform_device *audio_pdev;
struct mutex audio_mutex;
struct mutex edid_mutex;
wait_queue_head_t wq_edid;
volatile int wq_edid_wait;
struct work_struct detect_work;
struct timer_list edid_delay_timer;
wait_queue_head_t edid_delay_waitq;
bool edid_delay_active;
struct drm_encoder encoder;
struct drm_bridge bridge;
struct drm_connector connector;
u8 audio_port_enable[AUDIO_ROUTE_NUM];
struct tda9950_glue cec_glue;
struct gpio_desc *calib;
struct cec_notifier *cec_notify;
};
#define conn_to_tda998x_priv(x) \
container_of(x, struct tda998x_priv, connector)
#define enc_to_tda998x_priv(x) \
container_of(x, struct tda998x_priv, encoder)
#define bridge_to_tda998x_priv(x) \
container_of(x, struct tda998x_priv, bridge)
/* The TDA9988 series of devices use a paged register scheme.. to simplify
* things we encode the page # in upper bits of the register #. To read/
* write a given register, we need to make sure CURPAGE register is set
* appropriately. Which implies reads/writes are not atomic. Fun!
*/
#define REG(page, addr) (((page) << 8) | (addr))
#define REG2ADDR(reg) ((reg) & 0xff)
#define REG2PAGE(reg) (((reg) >> 8) & 0xff)
#define REG_CURPAGE 0xff /* write */
/* Page 00h: General Control */
#define REG_VERSION_LSB REG(0x00, 0x00) /* read */
#define REG_MAIN_CNTRL0 REG(0x00, 0x01) /* read/write */
# define MAIN_CNTRL0_SR (1 << 0)
# define MAIN_CNTRL0_DECS (1 << 1)
# define MAIN_CNTRL0_DEHS (1 << 2)
# define MAIN_CNTRL0_CECS (1 << 3)
# define MAIN_CNTRL0_CEHS (1 << 4)
# define MAIN_CNTRL0_SCALER (1 << 7)
#define REG_VERSION_MSB REG(0x00, 0x02) /* read */
#define REG_SOFTRESET REG(0x00, 0x0a) /* write */
# define SOFTRESET_AUDIO (1 << 0)
# define SOFTRESET_I2C_MASTER (1 << 1)
#define REG_DDC_DISABLE REG(0x00, 0x0b) /* read/write */
#define REG_CCLK_ON REG(0x00, 0x0c) /* read/write */
Annotation
- Immediate include surface: `linux/gpio/consumer.h`, `linux/hdmi.h`, `linux/i2c.h`, `linux/module.h`, `linux/platform_data/tda9950.h`, `linux/irq.h`, `sound/asoundef.h`, `sound/hdmi-codec.h`.
- Detected declarations: `struct tda998x_audio_route`, `struct tda998x_audio_settings`, `struct tda998x_priv`, `function cec_write`, `function cec_read`, `function cec_enamods`, `function tda998x_cec_set_calibration`, `function tda998x_cec_calibration`, `function tda998x_cec_hook_init`, `function tda998x_cec_hook_exit`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.