linux/drivers/iio/adc/ti-lmp92064.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Texas Instruments LMP92064 SPI ADC driver
 *
 * Copyright (c) 2022 Leonard Göhrs <[email protected]>, Pengutronix
 *
 * Based on linux/drivers/iio/adc/ti-tsc2046.c
 * Copyright (c) 2021 Oleksij Rempel <[email protected]>, Pengutronix
 */

#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/spi/spi.h>

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

#define TI_LMP92064_REG_CONFIG_A
#define TI_LMP92064_REG_CONFIG_B
#define TI_LMP92064_REG_CHIP_REV

#define TI_LMP92064_REG_MFR_ID1
#define TI_LMP92064_REG_MFR_ID2

#define TI_LMP92064_REG_REG_UPDATE
#define TI_LMP92064_REG_CONFIG_REG
#define TI_LMP92064_REG_STATUS

#define TI_LMP92064_REG_DATA_VOUT_LSB
#define TI_LMP92064_REG_DATA_VOUT_MSB
#define TI_LMP92064_REG_DATA_COUT_LSB
#define TI_LMP92064_REG_DATA_COUT_MSB

#define TI_LMP92064_VAL_CONFIG_A
#define TI_LMP92064_VAL_CONFIG_B
#define TI_LMP92064_VAL_STATUS_OK

/*
 * Channel number definitions for the two channels of the device
 * - IN Current (INC)
 * - IN Voltage (INV)
 */
#define TI_LMP92064_CHAN_INC
#define TI_LMP92064_CHAN_INV

static const struct regmap_range lmp92064_readable_reg_ranges[] =;

static const struct regmap_access_table lmp92064_readable_regs =;

static const struct regmap_range lmp92064_writable_reg_ranges[] =;

static const struct regmap_access_table lmp92064_writable_regs =;

static const struct regmap_config lmp92064_spi_regmap_config =;

struct lmp92064_adc_priv {};

static const struct iio_chan_spec lmp92064_adc_channels[] =;

static const unsigned long lmp92064_scan_masks[] =;

static int lmp92064_read_meas(struct lmp92064_adc_priv *priv, u16 *res)
{}

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

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

static int lmp92064_reset(struct lmp92064_adc_priv *priv,
			  struct gpio_desc *gpio_reset)
{}

static const struct iio_info lmp92064_adc_info =;

static int lmp92064_adc_probe(struct spi_device *spi)
{}

static const struct spi_device_id lmp92064_id_table[] =;
MODULE_DEVICE_TABLE(spi, lmp92064_id_table);

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

static struct spi_driver lmp92064_adc_driver =;
module_spi_driver();

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