brintos

brintos / linux-shallow public Read only

0
0
Text · 1.9 KiB · 13964f3 Raw
79 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only */2/*3 * AD5624R SPI DAC driver4 *5 * Copyright 2010-2011 Analog Devices Inc.6 */7#ifndef SPI_AD5624R_H_8#define SPI_AD5624R_H_9 10#define AD5624R_DAC_CHANNELS			411 12#define AD5624R_ADDR_DAC0			0x013#define AD5624R_ADDR_DAC1			0x114#define AD5624R_ADDR_DAC2			0x215#define AD5624R_ADDR_DAC3			0x316#define AD5624R_ADDR_ALL_DAC			0x717 18#define AD5624R_CMD_WRITE_INPUT_N		0x019#define AD5624R_CMD_UPDATE_DAC_N		0x120#define AD5624R_CMD_WRITE_INPUT_N_UPDATE_ALL	0x221#define AD5624R_CMD_WRITE_INPUT_N_UPDATE_N	0x322#define AD5624R_CMD_POWERDOWN_DAC		0x423#define AD5624R_CMD_RESET			0x524#define AD5624R_CMD_LDAC_SETUP			0x625#define AD5624R_CMD_INTERNAL_REFER_SETUP	0x726 27#define AD5624R_LDAC_PWRDN_NONE			0x028#define AD5624R_LDAC_PWRDN_1K			0x129#define AD5624R_LDAC_PWRDN_100K			0x230#define AD5624R_LDAC_PWRDN_3STATE		0x331 32/**33 * struct ad5624r_chip_info - chip specific information34 * @channels:		channel spec for the DAC35 * @int_vref_mv:	AD5620/40/60: the internal reference voltage36 */37 38struct ad5624r_chip_info {39	const struct iio_chan_spec	*channels;40	u16				int_vref_mv;41};42 43/**44 * struct ad5446_state - driver instance specific data45 * @indio_dev:		the industrial I/O device46 * @us:			spi_device47 * @chip_info:		chip model specific constants, available modes etc48 * @reg:		supply regulator49 * @vref_mv:		actual reference voltage used50 * @pwr_down_mask	power down mask51 * @pwr_down_mode	current power down mode52 */53 54struct ad5624r_state {55	struct spi_device		*us;56	const struct ad5624r_chip_info	*chip_info;57	struct regulator		*reg;58	unsigned short			vref_mv;59	unsigned			pwr_down_mask;60	unsigned			pwr_down_mode;61};62 63/**64 * ad5624r_supported_device_ids:65 * The AD5624/44/64 parts are available in different66 * fixed internal reference voltage options.67 */68 69enum ad5624r_supported_device_ids {70	ID_AD5624R3,71	ID_AD5644R3,72	ID_AD5664R3,73	ID_AD5624R5,74	ID_AD5644R5,75	ID_AD5664R5,76};77 78#endif /* SPI_AD5624R_H_ */79