linux/drivers/iio/adc/sun20i-gpadc-iio.c

// SPDX-License-Identifier: GPL-2.0
/*
 * GPADC driver for sunxi platforms (D1, T113-S3 and R329)
 * Copyright (c) 2023 Maksim Kiselev <[email protected]>
 */

#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/reset.h>

#include <linux/iio/iio.h>

#define SUN20I_GPADC_DRIVER_NAME

/* Register map definition */
#define SUN20I_GPADC_SR
#define SUN20I_GPADC_CTRL
#define SUN20I_GPADC_CS_EN
#define SUN20I_GPADC_FIFO_INTC
#define SUN20I_GPADC_FIFO_INTS
#define SUN20I_GPADC_FIFO_DATA
#define SUN20I_GPADC_CB_DATA
#define SUN20I_GPADC_DATAL_INTC
#define SUN20I_GPADC_DATAH_INTC
#define SUN20I_GPADC_DATA_INTC
#define SUN20I_GPADC_DATAL_INTS
#define SUN20I_GPADC_DATAH_INTS
#define SUN20I_GPADC_DATA_INTS
#define SUN20I_GPADC_CH_CMP_DATA(x)
#define SUN20I_GPADC_CH_DATA(x)

#define SUN20I_GPADC_CTRL_ADC_AUTOCALI_EN_MASK
#define SUN20I_GPADC_CTRL_WORK_MODE_MASK
#define SUN20I_GPADC_CTRL_ADC_EN_MASK
#define SUN20I_GPADC_CS_EN_ADC_CH(x)
#define SUN20I_GPADC_DATA_INTC_CH_DATA_IRQ_EN(x)

#define SUN20I_GPADC_WORK_MODE_SINGLE

struct sun20i_gpadc_iio {};

static int sun20i_gpadc_adc_read(struct sun20i_gpadc_iio *info,
				 struct iio_chan_spec const *chan, int *val)
{}

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

static irqreturn_t sun20i_gpadc_irq_handler(int irq, void *data)
{}

static const struct iio_info sun20i_gpadc_iio_info =;

static void sun20i_gpadc_reset_assert(void *data)
{}

static int sun20i_gpadc_alloc_channels(struct iio_dev *indio_dev,
				       struct device *dev)
{}

static int sun20i_gpadc_probe(struct platform_device *pdev)
{}

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

static struct platform_driver sun20i_gpadc_driver =;
module_platform_driver();

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