drivers/media/tuners/e4000.c
Source file repositories/reference/linux-study-clean/drivers/media/tuners/e4000.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/tuners/e4000.c- Extension
.c- Size
- 17799 bytes
- Lines
- 742
- 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.
- 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
e4000_priv.h
Detected Declarations
function Copyrightfunction e4000_sleepfunction e4000_set_paramsfunction e4000_standbyfunction e4000_g_tunerfunction e4000_s_tunerfunction e4000_g_frequencyfunction e4000_s_frequencyfunction e4000_enum_freq_bandsfunction e4000_set_lna_gainfunction e4000_set_mixer_gainfunction e4000_set_if_gainfunction e4000_pll_lockfunction e4000_g_volatile_ctrlfunction e4000_s_ctrlfunction e4000_dvb_set_paramsfunction e4000_dvb_initfunction e4000_dvb_sleepfunction e4000_dvb_get_if_frequencyfunction e4000_probefunction e4000_remove
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Elonics E4000 silicon tuner driver
*
* Copyright (C) 2012 Antti Palosaari <crope@iki.fi>
*/
#include "e4000_priv.h"
static int e4000_init(struct e4000_dev *dev)
{
struct i2c_client *client = dev->client;
int ret;
dev_dbg(&client->dev, "\n");
/* reset */
ret = regmap_write(dev->regmap, 0x00, 0x01);
if (ret)
goto err;
/* disable output clock */
ret = regmap_write(dev->regmap, 0x06, 0x00);
if (ret)
goto err;
ret = regmap_write(dev->regmap, 0x7a, 0x96);
if (ret)
goto err;
/* configure gains */
ret = regmap_bulk_write(dev->regmap, 0x7e, "\x01\xfe", 2);
if (ret)
goto err;
ret = regmap_write(dev->regmap, 0x82, 0x00);
if (ret)
goto err;
ret = regmap_write(dev->regmap, 0x24, 0x05);
if (ret)
goto err;
ret = regmap_bulk_write(dev->regmap, 0x87, "\x20\x01", 2);
if (ret)
goto err;
ret = regmap_bulk_write(dev->regmap, 0x9f, "\x7f\x07", 2);
if (ret)
goto err;
/* DC offset control */
ret = regmap_write(dev->regmap, 0x2d, 0x1f);
if (ret)
goto err;
ret = regmap_bulk_write(dev->regmap, 0x70, "\x01\x01", 2);
if (ret)
goto err;
/* gain control */
ret = regmap_write(dev->regmap, 0x1a, 0x17);
if (ret)
goto err;
ret = regmap_write(dev->regmap, 0x1f, 0x1a);
if (ret)
goto err;
dev->active = true;
return 0;
err:
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
static int e4000_sleep(struct e4000_dev *dev)
{
struct i2c_client *client = dev->client;
int ret;
dev_dbg(&client->dev, "\n");
dev->active = false;
ret = regmap_write(dev->regmap, 0x00, 0x00);
if (ret)
goto err;
Annotation
- Immediate include surface: `e4000_priv.h`.
- Detected declarations: `function Copyright`, `function e4000_sleep`, `function e4000_set_params`, `function e4000_standby`, `function e4000_g_tuner`, `function e4000_s_tuner`, `function e4000_g_frequency`, `function e4000_s_frequency`, `function e4000_enum_freq_bands`, `function e4000_set_lna_gain`.
- 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.