linux/drivers/iio/dac/ds4424.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Maxim Integrated
 * 7-bit, Multi-Channel Sink/Source Current DAC Driver
 * Copyright (C) 2017 Maxim Integrated
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/regulator/consumer.h>
#include <linux/err.h>
#include <linux/delay.h>
#include <linux/iio/iio.h>
#include <linux/iio/driver.h>
#include <linux/iio/machine.h>
#include <linux/iio/consumer.h>

#define DS4422_MAX_DAC_CHANNELS
#define DS4424_MAX_DAC_CHANNELS

#define DS4424_DAC_ADDR(chan)
#define DS4424_SOURCE_I
#define DS4424_SINK_I

#define DS4424_CHANNEL(chan)

/*
 * DS4424 DAC control register 8 bits
 * [7]		0: to sink; 1: to source
 * [6:0]	steps to sink/source
 * bit[7] looks like a sign bit, but the value of the register is
 * not a two's complement code considering the bit[6:0] is a absolute
 * distance from the zero point.
 */
ds4424_raw_data;

enum ds4424_device_ids {};

struct ds4424_data {};

static const struct iio_chan_spec ds4424_channels[] =;

static int ds4424_get_value(struct iio_dev *indio_dev,
			     int *val, int channel)
{}

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

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

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

static int ds4424_verify_chip(struct iio_dev *indio_dev)
{}

static int ds4424_suspend(struct device *dev)
{}

static int ds4424_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(ds4424_pm_ops, ds4424_suspend, ds4424_resume);

static const struct iio_info ds4424_info =;

static int ds4424_probe(struct i2c_client *client)
{}

static void ds4424_remove(struct i2c_client *client)
{}

static const struct i2c_device_id ds4424_id[] =;

MODULE_DEVICE_TABLE(i2c, ds4424_id);

static const struct of_device_id ds4424_of_match[] =;

MODULE_DEVICE_TABLE(of, ds4424_of_match);

static struct i2c_driver ds4424_driver =;
module_i2c_driver();

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