drivers/spi/spi-fsl-dspi.c
Source file repositories/reference/linux-study-clean/drivers/spi/spi-fsl-dspi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/spi/spi-fsl-dspi.c- Extension
.c- Size
- 44499 bytes
- Lines
- 1740
- Domain
- Driver Families
- Bucket
- drivers/spi
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/dmaengine.hlinux/dma-mapping.hlinux/interrupt.hlinux/kernel.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/pinctrl/consumer.hlinux/regmap.hlinux/spi/spi.hlinux/spi/spi-fsl-dspi.h
Detected Declarations
struct chip_datastruct fsl_dspi_devtype_datastruct fsl_dspi_dmastruct fsl_dspienum dspi_trans_modefunction is_s32g_dspifunction dspi_native_host_to_devfunction dspi_native_dev_to_hostfunction dspi_8on32_host_to_devfunction dspi_8on32_dev_to_hostfunction dspi_8on16_host_to_devfunction dspi_8on16_dev_to_hostfunction dspi_16on32_host_to_devfunction dspi_16on32_dev_to_hostfunction registerfunction dspi_push_rxfunction dspi_fifo_errorfunction dspi_pop_tx_pushrfunction dspi_dma_max_datawordsfunction dspi_dma_transfer_sizefunction dspi_tx_dma_callbackfunction dspi_rx_dma_callbackfunction dspi_next_xfer_dma_submitfunction dspi_dma_xferfunction dspi_request_dmafunction dspi_release_dmafunction dspi_dma_xferfunction dspi_request_dmafunction dspi_release_dmafunction ns_delay_scalefunction dspi_pushr_cmd_writefunction dspi_pushr_txdata_writefunction dspi_xspi_fifo_writefunction dspi_popr_readfunction dspi_fifo_readfunction dspi_setup_accelfunction dspi_fifo_writefunction dspi_rxtxfunction dspi_pollfunction dspi_interruptfunction dspi_assert_csfunction dspi_deassert_csfunction dspi_transfer_one_messagefunction list_for_each_entryfunction dspi_set_mtffunction dspi_setupfunction dspi_cleanupfunction dspi_init
Annotated Snippet
struct chip_data {
u32 ctar_val;
};
enum dspi_trans_mode {
DSPI_XSPI_MODE,
DSPI_DMA_MODE,
};
struct fsl_dspi_devtype_data {
enum dspi_trans_mode trans_mode;
u8 max_clock_factor;
int fifo_size;
const struct regmap_config *regmap;
};
enum {
LS1021A,
LS1012A,
LS1028A,
LS1043A,
LS1046A,
LS2080A,
LS2085A,
LX2160A,
MCF5441X,
VF610,
S32G,
S32G_TARGET,
};
static const struct regmap_range dspi_yes_ranges[] = {
regmap_reg_range(SPI_MCR, SPI_MCR),
regmap_reg_range(SPI_TCR, SPI_CTAR(3)),
regmap_reg_range(SPI_SR, SPI_TXFR3),
regmap_reg_range(SPI_RXFR0, SPI_RXFR3),
regmap_reg_range(SPI_CTARE(0), SPI_CTARE(3)),
regmap_reg_range(SPI_SREX, SPI_SREX),
};
static const struct regmap_range s32g_dspi_yes_ranges[] = {
regmap_reg_range(SPI_MCR, SPI_MCR),
regmap_reg_range(SPI_TCR, SPI_CTAR(5)),
regmap_reg_range(SPI_SR, SPI_TXFR4),
regmap_reg_range(SPI_RXFR0, SPI_RXFR4),
regmap_reg_range(SPI_CTARE(0), SPI_CTARE(5)),
regmap_reg_range(SPI_SREX, SPI_SREX),
};
static const struct regmap_access_table dspi_access_table = {
.yes_ranges = dspi_yes_ranges,
.n_yes_ranges = ARRAY_SIZE(dspi_yes_ranges),
};
static const struct regmap_access_table s32g_dspi_access_table = {
.yes_ranges = s32g_dspi_yes_ranges,
.n_yes_ranges = ARRAY_SIZE(s32g_dspi_yes_ranges),
};
static const struct regmap_range dspi_volatile_ranges[] = {
regmap_reg_range(SPI_MCR, SPI_TCR),
regmap_reg_range(SPI_SR, SPI_SR),
regmap_reg_range(SPI_PUSHR, SPI_RXFR4),
regmap_reg_range(SPI_SREX, SPI_SREX),
};
static const struct regmap_access_table dspi_volatile_table = {
.yes_ranges = dspi_volatile_ranges,
.n_yes_ranges = ARRAY_SIZE(dspi_volatile_ranges),
};
enum {
DSPI_REGMAP,
S32G_DSPI_REGMAP,
DSPI_XSPI_REGMAP,
S32G_DSPI_XSPI_REGMAP,
DSPI_PUSHR,
};
static const struct regmap_config dspi_regmap_config[] = {
[DSPI_REGMAP] = {
.reg_bits = 32,
.val_bits = 32,
.reg_stride = 4,
.max_register = SPI_RXFR3,
.volatile_table = &dspi_volatile_table,
.rd_table = &dspi_access_table,
.wr_table = &dspi_access_table,
},
[S32G_DSPI_REGMAP] = {
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/dmaengine.h`, `linux/dma-mapping.h`, `linux/interrupt.h`, `linux/kernel.h`, `linux/module.h`, `linux/of.h`.
- Detected declarations: `struct chip_data`, `struct fsl_dspi_devtype_data`, `struct fsl_dspi_dma`, `struct fsl_dspi`, `enum dspi_trans_mode`, `function is_s32g_dspi`, `function dspi_native_host_to_dev`, `function dspi_native_dev_to_host`, `function dspi_8on32_host_to_dev`, `function dspi_8on32_dev_to_host`.
- Atlas domain: Driver Families / drivers/spi.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.