linux/drivers/iio/potentiometer/ad5110.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Analog Devices AD5110 digital potentiometer driver
 *
 * Copyright (C) 2021 Mugilraj Dhavachelvan <[email protected]>
 *
 * Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD5110_5112_5114.pdf
 */

#include <linux/bitfield.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/i2c.h>
#include <linux/module.h>

#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

/* AD5110 commands */
#define AD5110_EEPROM_WR
#define AD5110_RDAC_WR
#define AD5110_SHUTDOWN
#define AD5110_RESET
#define AD5110_RDAC_RD
#define AD5110_EEPROM_RD

/* AD5110_EEPROM_RD data */
#define AD5110_WIPER_POS
#define AD5110_RESISTOR_TOL

#define AD5110_WIPER_RESISTANCE

struct ad5110_cfg {};

enum ad5110_type {};

static const struct ad5110_cfg ad5110_cfg[] =;

struct ad5110_data {};

static const struct iio_chan_spec ad5110_channels[] =;

static int ad5110_read(struct ad5110_data *data, u8 cmd, int *val)
{}

static int ad5110_write(struct ad5110_data *data, u8 cmd, u8 val)
{}

static int ad5110_resistor_tol(struct ad5110_data *data, u8 cmd, int val)
{}

static ssize_t store_eeprom_show(struct device *dev,
				  struct device_attribute *attr,
				  char *buf)
{}

static ssize_t store_eeprom_store(struct device *dev,
				   struct device_attribute *attr,
				   const char *buf, size_t len)
{}

static IIO_DEVICE_ATTR_RW(store_eeprom, 0);

static struct attribute *ad5110_attributes[] =;

static const struct attribute_group ad5110_attribute_group =;

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

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

static const struct iio_info ad5110_info =;

#define AD5110_COMPATIBLE(of_compatible, cfg)

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

#define AD5110_ID_TABLE(_name, cfg)

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

static int ad5110_probe(struct i2c_client *client)
{}

static struct i2c_driver ad5110_driver =;
module_i2c_driver();

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