linux/drivers/iio/adc/spear_adc.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * ST SPEAr ADC driver
 *
 * Copyright 2012 Stefan Roese <[email protected]>
 */

#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/completion.h>

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

/* SPEAR registers definitions */
#define SPEAR600_ADC_SCAN_RATE_LO(x)
#define SPEAR600_ADC_SCAN_RATE_HI(x)
#define SPEAR_ADC_CLK_LOW(x)
#define SPEAR_ADC_CLK_HIGH(x)

/* Bit definitions for SPEAR_ADC_STATUS */
#define SPEAR_ADC_STATUS_START_CONVERSION
#define SPEAR_ADC_STATUS_CHANNEL_NUM(x)
#define SPEAR_ADC_STATUS_ADC_ENABLE
#define SPEAR_ADC_STATUS_AVG_SAMPLE(x)
#define SPEAR_ADC_STATUS_VREF_INTERNAL

#define SPEAR_ADC_DATA_MASK
#define SPEAR_ADC_DATA_BITS

#define SPEAR_ADC_MOD_NAME

#define SPEAR_ADC_CHANNEL_NUM

#define SPEAR_ADC_CLK_MIN
#define SPEAR_ADC_CLK_MAX

struct adc_regs_spear3xx {};

struct chan_data {};

struct adc_regs_spear6xx {};

struct spear_adc_state {};

/*
 * Functions to access some SPEAr ADC register. Abstracted into
 * static inline functions, because of different register offsets
 * on different SoC variants (SPEAr300 vs SPEAr600 etc).
 */
static void spear_adc_set_status(struct spear_adc_state *st, u32 val)
{}

static void spear_adc_set_clk(struct spear_adc_state *st, u32 val)
{}

static void spear_adc_set_ctrl(struct spear_adc_state *st, int n,
			       u32 val)
{}

static u32 spear_adc_get_average(struct spear_adc_state *st)
{}

static void spear_adc_set_scanrate(struct spear_adc_state *st, u32 rate)
{}

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

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

#define SPEAR_ADC_CHAN(idx)

static const struct iio_chan_spec spear_adc_iio_channels[] =;

static irqreturn_t spear_adc_isr(int irq, void *dev_id)
{}

static int spear_adc_configure(struct spear_adc_state *st)
{}

static const struct iio_info spear_adc_info =;

static int spear_adc_probe(struct platform_device *pdev)
{}

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

static struct platform_driver spear_adc_driver =;

module_platform_driver();

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