linux/drivers/iio/adc/mt6370-adc.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2022 Richtek Technology Corp.
 *
 * Author: ChiaEn Wu <[email protected]>
 */

#include <linux/bits.h>
#include <linux/bitfield.h>
#include <linux/iio/iio.h>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/sysfs.h>
#include <linux/units.h>

#include <dt-bindings/iio/adc/mediatek,mt6370_adc.h>

#define MT6370_REG_DEV_INFO
#define MT6370_REG_CHG_CTRL3
#define MT6370_REG_CHG_CTRL7
#define MT6370_REG_CHG_ADC
#define MT6370_REG_ADC_DATA_H

#define MT6370_ADC_START_MASK
#define MT6370_ADC_IN_SEL_MASK
#define MT6370_AICR_ICHG_MASK
#define MT6370_VENID_MASK

#define MT6370_AICR_100_mA
#define MT6370_AICR_150_mA
#define MT6370_AICR_200_mA
#define MT6370_AICR_250_mA
#define MT6370_AICR_300_mA
#define MT6370_AICR_350_mA

#define MT6370_ICHG_100_mA
#define MT6370_ICHG_200_mA
#define MT6370_ICHG_300_mA
#define MT6370_ICHG_400_mA
#define MT6370_ICHG_500_mA
#define MT6370_ICHG_600_mA
#define MT6370_ICHG_700_mA
#define MT6370_ICHG_800_mA

#define ADC_CONV_TIME_MS
#define ADC_CONV_POLLING_TIME_US

#define MT6370_VID_RT5081
#define MT6370_VID_RT5081A
#define MT6370_VID_MT6370

struct mt6370_adc_data {};

static int mt6370_adc_read_channel(struct mt6370_adc_data *priv, int chan,
				   unsigned long addr, int *val)
{}

static int mt6370_adc_get_ibus_scale(struct mt6370_adc_data *priv)
{}

static int mt6370_adc_get_ibat_scale(struct mt6370_adc_data *priv)
{}

static int mt6370_adc_read_scale(struct mt6370_adc_data *priv,
				 int chan, int *val1, int *val2)
{}

static int mt6370_adc_read_offset(struct mt6370_adc_data *priv,
				  int chan, int *val)
{}

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

static const char * const mt6370_channel_labels[MT6370_CHAN_MAX] =;

static int mt6370_adc_read_label(struct iio_dev *iio_dev,
				 struct iio_chan_spec const *chan, char *label)
{}

static const struct iio_info mt6370_adc_iio_info =;

#define MT6370_ADC_CHAN(_idx, _type, _addr, _extra_info)

static const struct iio_chan_spec mt6370_adc_channels[] =;

static int mt6370_get_vendor_info(struct mt6370_adc_data *priv)
{}

static int mt6370_adc_probe(struct platform_device *pdev)
{}

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

static struct platform_driver mt6370_adc_driver =;
module_platform_driver();

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