drivers/iio/adc/stm32-dfsdm.h

Source file repositories/reference/linux-study-clean/drivers/iio/adc/stm32-dfsdm.h

File Facts

System
Linux kernel
Corpus path
drivers/iio/adc/stm32-dfsdm.h
Extension
.h
Size
14590 bytes
Lines
349
Domain
Driver Families
Bucket
drivers/iio
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct stm32_dfsdm_filter_osr {
	unsigned int iosr;
	unsigned int fosr;
	unsigned int rshift;
	unsigned int lshift;
	u64 res;
	u32 bits;
	s32 max;
};

/**
 * struct stm32_dfsdm_filter - structure relative to stm32 FDSDM filter
 * @ford: filter order
 * @flo: filter oversampling data table indexed by fast mode flag
 * @sync_mode: filter synchronized with filter 0
 * @fast: filter fast mode
 */
struct stm32_dfsdm_filter {
	enum stm32_dfsdm_sinc_order ford;
	struct stm32_dfsdm_filter_osr flo[2];
	unsigned int sync_mode;
	unsigned int fast;
};

/**
 * struct stm32_dfsdm_channel - structure relative to stm32 FDSDM channel
 * @id: id of the channel
 * @type: interface type linked to stm32_dfsdm_chan_type
 * @src: interface type linked to stm32_dfsdm_chan_src
 * @alt_si: alternative serial input interface
 */
struct stm32_dfsdm_channel {
	unsigned int id;
	unsigned int type;
	unsigned int src;
	unsigned int alt_si;
};

/**
 * struct stm32_dfsdm - stm32 FDSDM driver common data (for all instances)
 * @base:	control registers base cpu addr
 * @phys_base:	DFSDM IP register physical address
 * @regmap:	regmap for register read/write
 * @fl_list:	filter resources list
 * @num_fls:	number of filter resources available
 * @ch_list:	channel resources list
 * @num_chs:	number of channel resources available
 * @spi_master_freq: SPI clock out frequency
 */
struct stm32_dfsdm {
	void __iomem	*base;
	phys_addr_t	phys_base;
	struct regmap *regmap;
	struct stm32_dfsdm_filter *fl_list;
	unsigned int num_fls;
	struct stm32_dfsdm_channel *ch_list;
	unsigned int num_chs;
	unsigned int spi_master_freq;
};

/* DFSDM channel serial spi clock source */
enum stm32_dfsdm_spi_clk_src {
	DFSDM_CHANNEL_SPI_CLOCK_EXTERNAL,
	DFSDM_CHANNEL_SPI_CLOCK_INTERNAL,
	DFSDM_CHANNEL_SPI_CLOCK_INTERNAL_DIV2_FALLING,
	DFSDM_CHANNEL_SPI_CLOCK_INTERNAL_DIV2_RISING
};

int stm32_dfsdm_start_dfsdm(struct stm32_dfsdm *dfsdm);
int stm32_dfsdm_stop_dfsdm(struct stm32_dfsdm *dfsdm);

#endif

Annotation

Implementation Notes