drivers/iio/dac/ad5686.h

Source file repositories/reference/linux-study-clean/drivers/iio/dac/ad5686.h

File Facts

System
Linux kernel
Corpus path
drivers/iio/dac/ad5686.h
Extension
.h
Size
3626 bytes
Lines
161
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 ad5686_chip_info {
	u16				int_vref_mv;
	unsigned int			num_channels;
	const struct iio_chan_spec	*channels;
	enum ad5686_regmap_type		regmap_type;
};

/**
 * struct ad5686_state - driver instance specific data
 * @spi:		spi_device
 * @chip_info:		chip model specific constants, available modes etc
 * @vref_mv:		actual reference voltage used
 * @pwr_down_mask:	power down mask
 * @pwr_down_mode:	current power down mode
 * @use_internal_vref:	set to true if the internal reference voltage is used
 * @lock		lock to protect the data buffer during regmap ops
 * @data:		spi transfer buffers
 */

struct ad5686_state {
	struct device			*dev;
	const struct ad5686_chip_info	*chip_info;
	unsigned short			vref_mv;
	unsigned int			pwr_down_mask;
	unsigned int			pwr_down_mode;
	ad5686_write_func		write;
	ad5686_read_func		read;
	bool				use_internal_vref;
	struct mutex			lock;

	/*
	 * DMA (thus cache coherency maintenance) may require the
	 * transfer buffers to live in their own cache lines.
	 */

	union {
		__be32 d32;
		__be16 d16;
		u8 d8[4];
	} data[3] __aligned(IIO_DMA_MINALIGN);
};


int ad5686_probe(struct device *dev,
		 enum ad5686_supported_device_ids chip_type,
		 const char *name, ad5686_write_func write,
		 ad5686_read_func read);


#endif /* __DRIVERS_IIO_DAC_AD5686_H__ */

Annotation

Implementation Notes