linux/drivers/iio/potentiometer/ds1803.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Maxim Integrated DS1803 and similar digital potentiometer driver
 * Copyright (c) 2016 Slawomir Stepien
 * Copyright (c) 2022 Jagath Jog J
 *
 * Datasheet: https://datasheets.maximintegrated.com/en/ds/DS1803.pdf
 * Datasheet: https://datasheets.maximintegrated.com/en/ds/DS3502.pdf
 *
 * DEVID	#Wipers	#Positions	Resistor Opts (kOhm)	i2c address
 * ds1803	2	256		10, 50, 100		0101xxx
 * ds3502	1	128		10			01010xx
 */

#include <linux/err.h>
#include <linux/export.h>
#include <linux/i2c.h>
#include <linux/iio/iio.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/property.h>

#define DS1803_WIPER_0
#define DS1803_WIPER_1
#define DS3502_WR_IVR

enum ds1803_type {};

struct ds1803_cfg {};

struct ds1803_data {};

#define DS1803_CHANNEL(ch, addr)

static const struct iio_chan_spec ds1803_channels[] =;

static const struct iio_chan_spec ds3502_channels[] =;

static int ds1803_read(struct iio_dev *indio_dev,
		       struct iio_chan_spec const *chan,
		       int *val)
{}

static int ds3502_read(struct iio_dev *indio_dev,
		       struct iio_chan_spec const *chan,
		       int *val)
{}

static const struct ds1803_cfg ds1803_cfg[] =;

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

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

static int ds1803_read_avail(struct iio_dev *indio_dev,
			     struct iio_chan_spec const *chan,
			     const int **vals, int *type,
			     int *length, long mask)
{}

static const struct iio_info ds1803_info =;

static int ds1803_probe(struct i2c_client *client)
{}

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

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

static struct i2c_driver ds1803_driver =;

module_i2c_driver();

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