linux/drivers/iio/adc/cc10001_adc.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2014-2015 Imagination Technologies Ltd.
 */

#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>

#include <linux/iio/buffer.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/trigger.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>

/* Registers */
#define CC10001_ADC_CONFIG
#define CC10001_ADC_START_CONV
#define CC10001_ADC_MODE_SINGLE_CONV

#define CC10001_ADC_DDATA_OUT
#define CC10001_ADC_EOC
#define CC10001_ADC_EOC_SET

#define CC10001_ADC_CHSEL_SAMPLED
#define CC10001_ADC_POWER_DOWN
#define CC10001_ADC_POWER_DOWN_SET

#define CC10001_ADC_DEBUG
#define CC10001_ADC_DATA_COUNT

#define CC10001_ADC_DATA_MASK
#define CC10001_ADC_NUM_CHANNELS
#define CC10001_ADC_CH_MASK

#define CC10001_INVALID_SAMPLED
#define CC10001_MAX_POLL_COUNT

/*
 * As per device specification, wait six clock cycles after power-up to
 * activate START. Since adding two more clock cycles delay does not
 * impact the performance too much, we are adding two additional cycles delay
 * intentionally here.
 */
#define CC10001_WAIT_CYCLES

struct cc10001_adc_device {};

static inline void cc10001_adc_write_reg(struct cc10001_adc_device *adc_dev,
					 u32 reg, u32 val)
{}

static inline u32 cc10001_adc_read_reg(struct cc10001_adc_device *adc_dev,
				       u32 reg)
{}

static void cc10001_adc_power_up(struct cc10001_adc_device *adc_dev)
{}

static void cc10001_adc_power_down(struct cc10001_adc_device *adc_dev)
{}

static void cc10001_adc_start(struct cc10001_adc_device *adc_dev,
			      unsigned int channel)
{}

static u16 cc10001_adc_poll_done(struct iio_dev *indio_dev,
				 unsigned int channel,
				 unsigned int delay)
{}

static irqreturn_t cc10001_adc_trigger_h(int irq, void *p)
{}

static u16 cc10001_adc_read_raw_voltage(struct iio_dev *indio_dev,
					struct iio_chan_spec const *chan)
{}

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

static int cc10001_update_scan_mode(struct iio_dev *indio_dev,
				    const unsigned long *scan_mask)
{}

static const struct iio_info cc10001_adc_info =;

static int cc10001_adc_channel_init(struct iio_dev *indio_dev,
				    unsigned long channel_map)
{}

static void cc10001_reg_disable(void *priv)
{}

static void cc10001_pd_cb(void *priv)
{}

static int cc10001_adc_probe(struct platform_device *pdev)
{}

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

static struct platform_driver cc10001_adc_driver =;
module_platform_driver();

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