drivers/base/regmap/regmap-fsi.c
Source file repositories/reference/linux-study-clean/drivers/base/regmap/regmap-fsi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/base/regmap/regmap-fsi.c- Extension
.c- Size
- 4937 bytes
- Lines
- 232
- Domain
- Driver Families
- Bucket
- drivers/base
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/fsi.hlinux/module.hlinux/regmap.hinternal.h
Detected Declarations
function regmap_fsi32_reg_readfunction regmap_fsi32_reg_writefunction regmap_fsi32le_reg_readfunction regmap_fsi32le_reg_writefunction regmap_fsi16_reg_readfunction regmap_fsi16_reg_writefunction regmap_fsi16le_reg_readfunction regmap_fsi16le_reg_writefunction regmap_fsi8_reg_readfunction regmap_fsi8_reg_writeexport __regmap_init_fsiexport __devm_regmap_init_fsi
Annotated Snippet
switch (config->val_bits) {
case 8:
bus = ®map_fsi8;
break;
case 16:
switch (regmap_get_val_endian(&fsi_dev->dev, NULL, config)) {
case REGMAP_ENDIAN_LITTLE:
#ifdef __LITTLE_ENDIAN
case REGMAP_ENDIAN_NATIVE:
#endif
bus = ®map_fsi16le;
break;
case REGMAP_ENDIAN_DEFAULT:
case REGMAP_ENDIAN_BIG:
#ifdef __BIG_ENDIAN
case REGMAP_ENDIAN_NATIVE:
#endif
bus = ®map_fsi16;
break;
default:
break;
}
break;
case 32:
switch (regmap_get_val_endian(&fsi_dev->dev, NULL, config)) {
case REGMAP_ENDIAN_LITTLE:
#ifdef __LITTLE_ENDIAN
case REGMAP_ENDIAN_NATIVE:
#endif
bus = ®map_fsi32le;
break;
case REGMAP_ENDIAN_DEFAULT:
case REGMAP_ENDIAN_BIG:
#ifdef __BIG_ENDIAN
case REGMAP_ENDIAN_NATIVE:
#endif
bus = ®map_fsi32;
break;
default:
break;
}
break;
}
}
return bus ?: ERR_PTR(-EOPNOTSUPP);
}
struct regmap *__regmap_init_fsi(struct fsi_device *fsi_dev, const struct regmap_config *config,
struct lock_class_key *lock_key, const char *lock_name)
{
const struct regmap_bus *bus = regmap_get_fsi_bus(fsi_dev, config);
if (IS_ERR(bus))
return ERR_CAST(bus);
return __regmap_init(&fsi_dev->dev, bus, fsi_dev->slave, config, lock_key, lock_name);
}
EXPORT_SYMBOL_GPL(__regmap_init_fsi);
struct regmap *__devm_regmap_init_fsi(struct fsi_device *fsi_dev,
const struct regmap_config *config,
struct lock_class_key *lock_key, const char *lock_name)
{
const struct regmap_bus *bus = regmap_get_fsi_bus(fsi_dev, config);
if (IS_ERR(bus))
return ERR_CAST(bus);
return __devm_regmap_init(&fsi_dev->dev, bus, fsi_dev->slave, config, lock_key, lock_name);
}
EXPORT_SYMBOL_GPL(__devm_regmap_init_fsi);
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/fsi.h`, `linux/module.h`, `linux/regmap.h`, `internal.h`.
- Detected declarations: `function regmap_fsi32_reg_read`, `function regmap_fsi32_reg_write`, `function regmap_fsi32le_reg_read`, `function regmap_fsi32le_reg_write`, `function regmap_fsi16_reg_read`, `function regmap_fsi16_reg_write`, `function regmap_fsi16le_reg_read`, `function regmap_fsi16le_reg_write`, `function regmap_fsi8_reg_read`, `function regmap_fsi8_reg_write`.
- Atlas domain: Driver Families / drivers/base.
- 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.