drivers/media/dvb-frontends/isl6405.c
Source file repositories/reference/linux-study-clean/drivers/media/dvb-frontends/isl6405.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/dvb-frontends/isl6405.c- Extension
.c- Size
- 3666 bytes
- Lines
- 149
- 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.
- 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/delay.hlinux/errno.hlinux/init.hlinux/kernel.hlinux/module.hlinux/string.hlinux/slab.hmedia/dvb_frontend.hisl6405.h
Detected Declarations
struct isl6405function isl6405_set_voltagefunction isl6405_enable_high_lnb_voltagefunction isl6405_releaseexport isl6405_attach
Annotated Snippet
struct isl6405 {
u8 config;
u8 override_or;
u8 override_and;
struct i2c_adapter *i2c;
u8 i2c_addr;
};
static int isl6405_set_voltage(struct dvb_frontend *fe,
enum fe_sec_voltage voltage)
{
struct isl6405 *isl6405 = (struct isl6405 *) fe->sec_priv;
struct i2c_msg msg = { .addr = isl6405->i2c_addr, .flags = 0,
.buf = &isl6405->config,
.len = sizeof(isl6405->config) };
if (isl6405->override_or & 0x80) {
isl6405->config &= ~(ISL6405_VSEL2 | ISL6405_EN2);
switch (voltage) {
case SEC_VOLTAGE_OFF:
break;
case SEC_VOLTAGE_13:
isl6405->config |= ISL6405_EN2;
break;
case SEC_VOLTAGE_18:
isl6405->config |= (ISL6405_EN2 | ISL6405_VSEL2);
break;
default:
return -EINVAL;
}
} else {
isl6405->config &= ~(ISL6405_VSEL1 | ISL6405_EN1);
switch (voltage) {
case SEC_VOLTAGE_OFF:
break;
case SEC_VOLTAGE_13:
isl6405->config |= ISL6405_EN1;
break;
case SEC_VOLTAGE_18:
isl6405->config |= (ISL6405_EN1 | ISL6405_VSEL1);
break;
default:
return -EINVAL;
}
}
isl6405->config |= isl6405->override_or;
isl6405->config &= isl6405->override_and;
return (i2c_transfer(isl6405->i2c, &msg, 1) == 1) ? 0 : -EIO;
}
static int isl6405_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg)
{
struct isl6405 *isl6405 = (struct isl6405 *) fe->sec_priv;
struct i2c_msg msg = { .addr = isl6405->i2c_addr, .flags = 0,
.buf = &isl6405->config,
.len = sizeof(isl6405->config) };
if (isl6405->override_or & 0x80) {
if (arg)
isl6405->config |= ISL6405_LLC2;
else
isl6405->config &= ~ISL6405_LLC2;
} else {
if (arg)
isl6405->config |= ISL6405_LLC1;
else
isl6405->config &= ~ISL6405_LLC1;
}
isl6405->config |= isl6405->override_or;
isl6405->config &= isl6405->override_and;
return (i2c_transfer(isl6405->i2c, &msg, 1) == 1) ? 0 : -EIO;
}
static void isl6405_release(struct dvb_frontend *fe)
{
/* power off */
isl6405_set_voltage(fe, SEC_VOLTAGE_OFF);
/* free */
kfree(fe->sec_priv);
fe->sec_priv = NULL;
}
struct dvb_frontend *isl6405_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c,
u8 i2c_addr, u8 override_set, u8 override_clear)
{
struct isl6405 *isl6405 = kmalloc_obj(struct isl6405);
if (!isl6405)
Annotation
- Immediate include surface: `linux/delay.h`, `linux/errno.h`, `linux/init.h`, `linux/kernel.h`, `linux/module.h`, `linux/string.h`, `linux/slab.h`, `media/dvb_frontend.h`.
- Detected declarations: `struct isl6405`, `function isl6405_set_voltage`, `function isl6405_enable_high_lnb_voltage`, `function isl6405_release`, `export isl6405_attach`.
- 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.