linux/drivers/misc/ad525x_dpot.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * ad525x_dpot: Driver for the Analog Devices digital potentiometers
 * Copyright (c) 2009-2010 Analog Devices, Inc.
 * Author: Michael Hennerich <[email protected]>
 *
 * DEVID		#Wipers		#Positions	Resistor Options (kOhm)
 * AD5258		1		64		1, 10, 50, 100
 * AD5259		1		256		5, 10, 50, 100
 * AD5251		2		64		1, 10, 50, 100
 * AD5252		2		256		1, 10, 50, 100
 * AD5255		3		512		25, 250
 * AD5253		4		64		1, 10, 50, 100
 * AD5254		4		256		1, 10, 50, 100
 * AD5160		1		256		5, 10, 50, 100
 * AD5161		1		256		5, 10, 50, 100
 * AD5162		2		256		2.5, 10, 50, 100
 * AD5165		1		256		100
 * AD5200		1		256		10, 50
 * AD5201		1		33		10, 50
 * AD5203		4		64		10, 100
 * AD5204		4		256		10, 50, 100
 * AD5206		6		256		10, 50, 100
 * AD5207		2		256		10, 50, 100
 * AD5231		1		1024		10, 50, 100
 * AD5232		2		256		10, 50, 100
 * AD5233		4		64		10, 50, 100
 * AD5235		2		1024		25, 250
 * AD5260		1		256		20, 50, 200
 * AD5262		2		256		20, 50, 200
 * AD5263		4		256		20, 50, 200
 * AD5290		1		256		10, 50, 100
 * AD5291		1		256		20, 50, 100  (20-TP)
 * AD5292		1		1024		20, 50, 100  (20-TP)
 * AD5293		1		1024		20, 50, 100
 * AD7376		1		128		10, 50, 100, 1M
 * AD8400		1		256		1, 10, 50, 100
 * AD8402		2		256		1, 10, 50, 100
 * AD8403		4		256		1, 10, 50, 100
 * ADN2850		3		512		25, 250
 * AD5241		1		256		10, 100, 1M
 * AD5246		1		128		5, 10, 50, 100
 * AD5247		1		128		5, 10, 50, 100
 * AD5245		1		256		5, 10, 50, 100
 * AD5243		2		256		2.5, 10, 50, 100
 * AD5248		2		256		2.5, 10, 50, 100
 * AD5242		2		256		20, 50, 200
 * AD5280		1		256		20, 50, 200
 * AD5282		2		256		20, 50, 200
 * ADN2860		3		512		25, 250
 * AD5273		1		64		1, 10, 50, 100 (OTP)
 * AD5171		1		64		5, 10, 50, 100 (OTP)
 * AD5170		1		256		2.5, 10, 50, 100 (OTP)
 * AD5172		2		256		2.5, 10, 50, 100 (OTP)
 * AD5173		2		256		2.5, 10, 50, 100 (OTP)
 * AD5270		1		1024		20, 50, 100 (50-TP)
 * AD5271		1		256		20, 50, 100 (50-TP)
 * AD5272		1		1024		20, 50, 100 (50-TP)
 * AD5274		1		256		20, 50, 100 (50-TP)
 *
 * See Documentation/misc-devices/ad525x_dpot.rst for more info.
 *
 * derived from ad5258.c
 * Copyright (c) 2009 Cyber Switching, Inc.
 * Author: Chris Verges <[email protected]>
 *
 * derived from ad5252.c
 * Copyright (c) 2006-2011 Michael Hennerich <[email protected]>
 */

#include <linux/module.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/slab.h>

#include "ad525x_dpot.h"

/*
 * Client data (each client gets its own)
 */

struct dpot_data {};

static inline int dpot_read_d8(struct dpot_data *dpot)
{}

static inline int dpot_read_r8d8(struct dpot_data *dpot, u8 reg)
{}

static inline int dpot_read_r8d16(struct dpot_data *dpot, u8 reg)
{}

static inline int dpot_write_d8(struct dpot_data *dpot, u8 val)
{}

static inline int dpot_write_r8d8(struct dpot_data *dpot, u8 reg, u16 val)
{}

static inline int dpot_write_r8d16(struct dpot_data *dpot, u8 reg, u16 val)
{}

static s32 dpot_read_spi(struct dpot_data *dpot, u8 reg)
{}

static s32 dpot_read_i2c(struct dpot_data *dpot, u8 reg)
{}

static s32 dpot_read(struct dpot_data *dpot, u8 reg)
{}

static s32 dpot_write_spi(struct dpot_data *dpot, u8 reg, u16 value)
{}

static s32 dpot_write_i2c(struct dpot_data *dpot, u8 reg, u16 value)
{}

static s32 dpot_write(struct dpot_data *dpot, u8 reg, u16 value)
{}

/* sysfs functions */

static ssize_t sysfs_show_reg(struct device *dev,
			      struct device_attribute *attr,
			      char *buf, u32 reg)
{}

static ssize_t sysfs_set_reg(struct device *dev,
			     struct device_attribute *attr,
			     const char *buf, size_t count, u32 reg)
{}

static ssize_t sysfs_do_cmd(struct device *dev,
			    struct device_attribute *attr,
			    const char *buf, size_t count, u32 reg)
{}

/* ------------------------------------------------------------------------- */

#define DPOT_DEVICE_SHOW(_name, _reg)

#define DPOT_DEVICE_SET(_name, _reg)

#define DPOT_DEVICE_SHOW_SET(name, reg)

#define DPOT_DEVICE_SHOW_ONLY(name, reg)

DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_ONLY();
DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_SET();

DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_ONLY();
DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_SET();

DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_ONLY();
DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_SET();

DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_ONLY();
DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_SET();

DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_ONLY();
DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_SET();

DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_ONLY();
DPOT_DEVICE_SHOW_SET();
DPOT_DEVICE_SHOW_SET();

static const struct attribute *dpot_attrib_wipers[] =;

static const struct attribute *dpot_attrib_eeprom[] =;

static const struct attribute *dpot_attrib_otp[] =;

static const struct attribute *dpot_attrib_otp_en[] =;

static const struct attribute *dpot_attrib_tolerance[] =;

/* ------------------------------------------------------------------------- */

#define DPOT_DEVICE_DO_CMD(_name, _cmd)

DPOT_DEVICE_DO_CMD();
DPOT_DEVICE_DO_CMD();
DPOT_DEVICE_DO_CMD();
DPOT_DEVICE_DO_CMD();

static struct attribute *ad525x_attributes_commands[] =;

static const struct attribute_group ad525x_group_commands =;

static int ad_dpot_add_files(struct device *dev,
		unsigned int features, unsigned int rdac)
{}

static inline void ad_dpot_remove_files(struct device *dev,
		unsigned int features, unsigned int rdac)
{}

int ad_dpot_probe(struct device *dev,
		struct ad_dpot_bus_data *bdata, unsigned long devid,
			    const char *name)
{}
EXPORT_SYMBOL();

void ad_dpot_remove(struct device *dev)
{}
EXPORT_SYMBOL();


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