linux/drivers/iio/adc/ltc2309.c

// SPDX-License-Identifier: GPL-2.0
/*
 * The LTC2309 is an 8-Channel, 12-Bit SAR ADC with an I2C Interface.
 *
 * Datasheet:
 * https://www.analog.com/media/en/technical-documentation/data-sheets/2309fd.pdf
 *
 * Copyright (c) 2023, Liam Beguin <[email protected]>
 */
#include <linux/bitfield.h>
#include <linux/i2c.h>
#include <linux/iio/iio.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/regulator/consumer.h>

#define LTC2309_ADC_RESOLUTION
#define LTC2309_INTERNAL_REF_MV

#define LTC2309_DIN_CH_MASK
#define LTC2309_DIN_SDN
#define LTC2309_DIN_OSN
#define LTC2309_DIN_S1
#define LTC2309_DIN_S0
#define LTC2309_DIN_UNI
#define LTC2309_DIN_SLEEP

/**
 * struct ltc2309 - internal device data structure
 * @dev:	Device reference
 * @client:	I2C reference
 * @lock:	Lock to serialize data access
 * @vref_mv:	Internal voltage reference
 */
struct ltc2309 {};

/* Order matches expected channel address, See datasheet Table 1. */
enum ltc2309_channels {};

#define LTC2309_CHAN(_chan, _addr)

#define LTC2309_DIFF_CHAN(_chan, _chan2, _addr)

static const struct iio_chan_spec ltc2309_channels[] =;

static int ltc2309_read_raw_channel(struct ltc2309 *ltc2309,
				    unsigned long address, int *val)
{}

static int ltc2309_read_raw(struct iio_dev *indio_dev,
			    struct iio_chan_spec const *chan, int *val,
			    int *val2, long mask)
{}

static const struct iio_info ltc2309_info =;

static int ltc2309_probe(struct i2c_client *client)
{}

static const struct of_device_id ltc2309_of_match[] =;
MODULE_DEVICE_TABLE(of, ltc2309_of_match);

static const struct i2c_device_id ltc2309_id[] =;
MODULE_DEVICE_TABLE(i2c, ltc2309_id);

static struct i2c_driver ltc2309_driver =;
module_i2c_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();