drivers/regulator/ti-abb-regulator.c
Source file repositories/reference/linux-study-clean/drivers/regulator/ti-abb-regulator.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/regulator/ti-abb-regulator.c- Extension
.c- Size
- 24288 bytes
- Lines
- 885
- Domain
- Driver Families
- Bucket
- drivers/regulator
- 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/clk.hlinux/delay.hlinux/err.hlinux/io.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/regulator/driver.hlinux/regulator/machine.hlinux/regulator/of_regulator.h
Detected Declarations
struct ti_abb_infostruct ti_abb_regstruct ti_abbfunction ti_abb_rmwfunction ti_abb_check_txdonefunction ti_abb_clear_txdonefunction ti_abb_wait_txdonefunction ti_abb_clear_all_txdonefunction ti_abb_program_ldovbbfunction ti_abb_set_oppfunction ti_abb_set_voltage_selfunction ti_abb_get_voltage_selfunction ti_abb_init_timingsfunction ti_abb_init_tablefunction ti_abb_probe
Annotated Snippet
struct ti_abb_info {
u32 opp_sel;
u32 vset;
};
/**
* struct ti_abb_reg - Register description for ABB block
* @setup_off: setup register offset from base
* @control_off: control register offset from base
* @sr2_wtcnt_value_mask: setup register- sr2_wtcnt_value mask
* @fbb_sel_mask: setup register- FBB sel mask
* @rbb_sel_mask: setup register- RBB sel mask
* @sr2_en_mask: setup register- enable mask
* @opp_change_mask: control register - mask to trigger LDOVBB change
* @opp_sel_mask: control register - mask for mode to operate
*/
struct ti_abb_reg {
u32 setup_off;
u32 control_off;
/* Setup register fields */
u32 sr2_wtcnt_value_mask;
u32 fbb_sel_mask;
u32 rbb_sel_mask;
u32 sr2_en_mask;
/* Control register fields */
u32 opp_change_mask;
u32 opp_sel_mask;
};
/**
* struct ti_abb - ABB instance data
* @rdesc: regulator descriptor
* @clk: clock(usually sysclk) supplying ABB block
* @base: base address of ABB block
* @setup_reg: setup register of ABB block
* @control_reg: control register of ABB block
* @int_base: interrupt register base address
* @efuse_base: (optional) efuse base address for ABB modes
* @ldo_base: (optional) LDOVBB vset override base address
* @regs: pointer to struct ti_abb_reg for ABB block
* @txdone_mask: mask on int_base for tranxdone interrupt
* @ldovbb_override_mask: mask to ldo_base for overriding default LDO VBB
* vset with value from efuse
* @ldovbb_vset_mask: mask to ldo_base for providing the VSET override
* @info: array to per voltage ABB configuration
* @current_info_idx: current index to info
* @settling_time: SoC specific settling time for LDO VBB
*/
struct ti_abb {
struct regulator_desc rdesc;
struct clk *clk;
void __iomem *base;
void __iomem *setup_reg;
void __iomem *control_reg;
void __iomem *int_base;
void __iomem *efuse_base;
void __iomem *ldo_base;
const struct ti_abb_reg *regs;
u32 txdone_mask;
u32 ldovbb_override_mask;
u32 ldovbb_vset_mask;
struct ti_abb_info *info;
int current_info_idx;
u32 settling_time;
};
/**
* ti_abb_rmw() - handy wrapper to set specific register bits
* @mask: mask for register field
* @value: value shifted to mask location and written
* @reg: register address
*
* Return: final register value (may be unused)
*/
static inline u32 ti_abb_rmw(u32 mask, u32 value, void __iomem *reg)
{
u32 val;
val = readl(reg);
val &= ~mask;
val |= (value << __ffs(mask)) & mask;
writel(val, reg);
return val;
}
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/err.h`, `linux/io.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/regulator/driver.h`.
- Detected declarations: `struct ti_abb_info`, `struct ti_abb_reg`, `struct ti_abb`, `function ti_abb_rmw`, `function ti_abb_check_txdone`, `function ti_abb_clear_txdone`, `function ti_abb_wait_txdone`, `function ti_abb_clear_all_txdone`, `function ti_abb_program_ldovbb`, `function ti_abb_set_opp`.
- Atlas domain: Driver Families / drivers/regulator.
- 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.