drivers/mfd/ti-lmu.c
Source file repositories/reference/linux-study-clean/drivers/mfd/ti-lmu.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mfd/ti-lmu.c- Extension
.c- Size
- 5755 bytes
- Lines
- 232
- Domain
- Driver Families
- Bucket
- drivers/mfd
- 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/delay.hlinux/err.hlinux/gpio/consumer.hlinux/i2c.hlinux/kernel.hlinux/mfd/core.hlinux/mfd/ti-lmu.hlinux/mfd/ti-lmu-register.hlinux/module.hlinux/of.hlinux/slab.h
Detected Declarations
struct ti_lmu_datafunction ti_lmu_enable_hwfunction ti_lmu_disable_hwfunction ti_lmu_probe
Annotated Snippet
struct ti_lmu_data {
const struct mfd_cell *cells;
int num_cells;
unsigned int max_register;
};
static int ti_lmu_enable_hw(struct ti_lmu *lmu, enum ti_lmu_id id)
{
if (lmu->en_gpio)
gpiod_set_value(lmu->en_gpio, 1);
/* Delay about 1ms after HW enable pin control */
usleep_range(1000, 1500);
/* LM3631 has additional power up sequence - enable LCD_EN bit. */
if (id == LM3631) {
return regmap_update_bits(lmu->regmap, LM3631_REG_DEVCTRL,
LM3631_LCD_EN_MASK,
LM3631_LCD_EN_MASK);
}
return 0;
}
static void ti_lmu_disable_hw(void *data)
{
struct ti_lmu *lmu = data;
if (lmu->en_gpio)
gpiod_set_value(lmu->en_gpio, 0);
}
#define LM363X_REGULATOR(_id) \
{ \
.name = "lm363x-regulator", \
.id = _id, \
.of_compatible = "ti,lm363x-regulator", \
} \
static const struct mfd_cell lm3631_devices[] = {
LM363X_REGULATOR(LM3631_BOOST),
LM363X_REGULATOR(LM3631_LDO_CONT),
LM363X_REGULATOR(LM3631_LDO_OREF),
LM363X_REGULATOR(LM3631_LDO_POS),
LM363X_REGULATOR(LM3631_LDO_NEG),
{
.name = "ti-lmu-backlight",
.id = LM3631,
.of_compatible = "ti,lm3631-backlight",
},
};
static const struct mfd_cell lm3632_devices[] = {
LM363X_REGULATOR(LM3632_BOOST),
LM363X_REGULATOR(LM3632_LDO_POS),
LM363X_REGULATOR(LM3632_LDO_NEG),
{
.name = "ti-lmu-backlight",
.id = LM3632,
.of_compatible = "ti,lm3632-backlight",
},
};
static const struct mfd_cell lm3633_devices[] = {
{
.name = "ti-lmu-backlight",
.id = LM3633,
.of_compatible = "ti,lm3633-backlight",
},
{
.name = "lm3633-leds",
.of_compatible = "ti,lm3633-leds",
},
/* Monitoring driver for open/short circuit detection */
{
.name = "ti-lmu-fault-monitor",
.id = LM3633,
.of_compatible = "ti,lm3633-fault-monitor",
},
};
static const struct mfd_cell lm3695_devices[] = {
{
.name = "ti-lmu-backlight",
.id = LM3695,
.of_compatible = "ti,lm3695-backlight",
},
};
static const struct mfd_cell lm36274_devices[] = {
LM363X_REGULATOR(LM36274_BOOST),
Annotation
- Immediate include surface: `linux/delay.h`, `linux/err.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/kernel.h`, `linux/mfd/core.h`, `linux/mfd/ti-lmu.h`, `linux/mfd/ti-lmu-register.h`.
- Detected declarations: `struct ti_lmu_data`, `function ti_lmu_enable_hw`, `function ti_lmu_disable_hw`, `function ti_lmu_probe`.
- Atlas domain: Driver Families / drivers/mfd.
- 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.