linux_dsm_epyc7002/include/linux/platform_data/ad7266.h
Linus Walleij 5750ebab14 iio: ad7266: Convert to use GPIO descriptors
The AD7266 have no in-tree users making use of the platform
data mechanism to pass address GPIO lines when not using
a fixed address, so we can easily convert this to use
GPIO descriptors instead of the platform data integers
currently passed.

Lowercase the labels "ad0".."ad2" as this will make a better
fit for platform descriptions like device tree that prefer
lowercase names such as "ad0-gpios" rather than "AD0-gpios".

Board files and other static users of this device can pass
the same GPIO descriptors using machine descriptor
tables if need be.

Cc: Alison Schofield <amsfield22@gmail.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-12-15 11:42:16 +00:00

51 lines
1.3 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* AD7266/65 SPI ADC driver
*
* Copyright 2012 Analog Devices Inc.
*/
#ifndef __IIO_ADC_AD7266_H__
#define __IIO_ADC_AD7266_H__
/**
* enum ad7266_range - AD7266 reference voltage range
* @AD7266_RANGE_VREF: Device is configured for input range 0V - VREF
* (RANGE pin set to low)
* @AD7266_RANGE_2VREF: Device is configured for input range 0V - 2VREF
* (RANGE pin set to high)
*/
enum ad7266_range {
AD7266_RANGE_VREF,
AD7266_RANGE_2VREF,
};
/**
* enum ad7266_mode - AD7266 sample mode
* @AD7266_MODE_DIFF: Device is configured for full differential mode
* (SGL/DIFF pin set to low, AD0 pin set to low)
* @AD7266_MODE_PSEUDO_DIFF: Device is configured for pseudo differential mode
* (SGL/DIFF pin set to low, AD0 pin set to high)
* @AD7266_MODE_SINGLE_ENDED: Device is configured for single-ended mode
* (SGL/DIFF pin set to high)
*/
enum ad7266_mode {
AD7266_MODE_DIFF,
AD7266_MODE_PSEUDO_DIFF,
AD7266_MODE_SINGLE_ENDED,
};
/**
* struct ad7266_platform_data - Platform data for the AD7266 driver
* @range: Reference voltage range the device is configured for
* @mode: Sample mode the device is configured for
* @fixed_addr: Whether the address pins are hard-wired
*/
struct ad7266_platform_data {
enum ad7266_range range;
enum ad7266_mode mode;
bool fixed_addr;
};
#endif