drivers/media/dvb-frontends/mn88443x.c
Source file repositories/reference/linux-study-clean/drivers/media/dvb-frontends/mn88443x.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/dvb-frontends/mn88443x.c- Extension
.c- Size
- 25670 bytes
- Lines
- 812
- 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
linux/bitfield.hlinux/clk.hlinux/delay.hlinux/gpio/consumer.hlinux/of.hlinux/regmap.hlinux/int_log.hmn88443x.h
Detected Declarations
struct mn88443x_specstruct mn88443x_privfunction mn88443x_cmn_power_onfunction mn88443x_cmn_power_offfunction mn88443x_s_sleepfunction mn88443x_s_wakefunction mn88443x_s_tunefunction mn88443x_s_read_statusfunction mn88443x_t_sleepfunction mn88443x_t_wakefunction mn88443x_t_is_valid_clkfunction mn88443x_t_set_freqfunction mn88443x_t_tunefunction mn88443x_t_read_statusfunction mn88443x_sleepfunction mn88443x_set_frontendfunction mn88443x_get_tune_settingsfunction mn88443x_read_statusfunction mn88443x_probefunction mn88443x_remove
Annotated Snippet
struct mn88443x_spec {
bool primary;
};
struct mn88443x_priv {
const struct mn88443x_spec *spec;
struct dvb_frontend fe;
struct clk *mclk;
struct gpio_desc *reset_gpio;
u32 clk_freq;
u32 if_freq;
/* Common */
bool use_clkbuf;
/* ISDB-S */
struct i2c_client *client_s;
struct regmap *regmap_s;
/* ISDB-T */
struct i2c_client *client_t;
struct regmap *regmap_t;
};
static int mn88443x_cmn_power_on(struct mn88443x_priv *chip)
{
struct device *dev = &chip->client_s->dev;
struct regmap *r_t = chip->regmap_t;
int ret;
ret = clk_prepare_enable(chip->mclk);
if (ret) {
dev_err(dev, "Failed to prepare and enable mclk: %d\n",
ret);
return ret;
}
gpiod_set_value_cansleep(chip->reset_gpio, 1);
usleep_range(100, 1000);
gpiod_set_value_cansleep(chip->reset_gpio, 0);
if (chip->spec->primary) {
regmap_write(r_t, OUTCSET, OUTCSET_CHDRV_8MA);
regmap_write(r_t, PLDWSET, PLDWSET_NORMAL);
regmap_write(r_t, HIZSET1, 0x80);
regmap_write(r_t, HIZSET2, 0xe0);
} else {
regmap_write(r_t, HIZSET3, 0x8f);
}
return 0;
}
static void mn88443x_cmn_power_off(struct mn88443x_priv *chip)
{
gpiod_set_value_cansleep(chip->reset_gpio, 1);
clk_disable_unprepare(chip->mclk);
}
static void mn88443x_s_sleep(struct mn88443x_priv *chip)
{
struct regmap *r_t = chip->regmap_t;
regmap_update_bits(r_t, PWDSET, PWDSET_PSKPD_MASK,
PWDSET_PSKPD_DOWN);
}
static void mn88443x_s_wake(struct mn88443x_priv *chip)
{
struct regmap *r_t = chip->regmap_t;
regmap_update_bits(r_t, PWDSET, PWDSET_PSKPD_MASK, 0);
}
static void mn88443x_s_tune(struct mn88443x_priv *chip,
struct dtv_frontend_properties *c)
{
struct regmap *r_s = chip->regmap_s;
regmap_write(r_s, ATSIDU_S, c->stream_id >> 8);
regmap_write(r_s, ATSIDL_S, c->stream_id);
regmap_write(r_s, TSSET_S, 0);
}
static int mn88443x_s_read_status(struct mn88443x_priv *chip,
struct dtv_frontend_properties *c,
enum fe_status *status)
{
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/clk.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/of.h`, `linux/regmap.h`, `linux/int_log.h`, `mn88443x.h`.
- Detected declarations: `struct mn88443x_spec`, `struct mn88443x_priv`, `function mn88443x_cmn_power_on`, `function mn88443x_cmn_power_off`, `function mn88443x_s_sleep`, `function mn88443x_s_wake`, `function mn88443x_s_tune`, `function mn88443x_s_read_status`, `function mn88443x_t_sleep`, `function mn88443x_t_wake`.
- 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.