2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 04:34:11 +08:00
linux-next/drivers/iio/dac/ad5624r.h
Thomas Gleixner fda8d26e61 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177
Based on 1 normalized pattern(s):

  licensed under the gpl 2

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 135 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Steve Winslow <swinslow@gmail.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190528170026.071193225@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30 11:29:19 -07:00

79 lines
1.9 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* AD5624R SPI DAC driver
*
* Copyright 2010-2011 Analog Devices Inc.
*/
#ifndef SPI_AD5624R_H_
#define SPI_AD5624R_H_
#define AD5624R_DAC_CHANNELS 4
#define AD5624R_ADDR_DAC0 0x0
#define AD5624R_ADDR_DAC1 0x1
#define AD5624R_ADDR_DAC2 0x2
#define AD5624R_ADDR_DAC3 0x3
#define AD5624R_ADDR_ALL_DAC 0x7
#define AD5624R_CMD_WRITE_INPUT_N 0x0
#define AD5624R_CMD_UPDATE_DAC_N 0x1
#define AD5624R_CMD_WRITE_INPUT_N_UPDATE_ALL 0x2
#define AD5624R_CMD_WRITE_INPUT_N_UPDATE_N 0x3
#define AD5624R_CMD_POWERDOWN_DAC 0x4
#define AD5624R_CMD_RESET 0x5
#define AD5624R_CMD_LDAC_SETUP 0x6
#define AD5624R_CMD_INTERNAL_REFER_SETUP 0x7
#define AD5624R_LDAC_PWRDN_NONE 0x0
#define AD5624R_LDAC_PWRDN_1K 0x1
#define AD5624R_LDAC_PWRDN_100K 0x2
#define AD5624R_LDAC_PWRDN_3STATE 0x3
/**
* struct ad5624r_chip_info - chip specific information
* @channels: channel spec for the DAC
* @int_vref_mv: AD5620/40/60: the internal reference voltage
*/
struct ad5624r_chip_info {
const struct iio_chan_spec *channels;
u16 int_vref_mv;
};
/**
* struct ad5446_state - driver instance specific data
* @indio_dev: the industrial I/O device
* @us: spi_device
* @chip_info: chip model specific constants, available modes etc
* @reg: supply regulator
* @vref_mv: actual reference voltage used
* @pwr_down_mask power down mask
* @pwr_down_mode current power down mode
*/
struct ad5624r_state {
struct spi_device *us;
const struct ad5624r_chip_info *chip_info;
struct regulator *reg;
unsigned short vref_mv;
unsigned pwr_down_mask;
unsigned pwr_down_mode;
};
/**
* ad5624r_supported_device_ids:
* The AD5624/44/64 parts are available in different
* fixed internal reference voltage options.
*/
enum ad5624r_supported_device_ids {
ID_AD5624R3,
ID_AD5644R3,
ID_AD5664R3,
ID_AD5624R5,
ID_AD5644R5,
ID_AD5664R5,
};
#endif /* SPI_AD5624R_H_ */