#include <linux/bits.h>
#include <linux/cleanup.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/types.h>
#include <linux/iio/iio.h>
#include <linux/mfd/mt6397/core.h>
#include <dt-bindings/iio/adc/mediatek,mt6357-auxadc.h>
#include <dt-bindings/iio/adc/mediatek,mt6358-auxadc.h>
#include <dt-bindings/iio/adc/mediatek,mt6359-auxadc.h>
#define AUXADC_AVG_TIME_US …
#define AUXADC_POLL_DELAY_US …
#define AUXADC_TIMEOUT_US …
#define AUXADC_VOLT_FULL …
#define IMP_STOP_DELAY_US …
#define IMP_POLL_DELAY_US …
#define PMIC_RG_RESET_VAL …
#define PMIC_AUXADC_RDY_BIT …
#define MT6357_IMP_ADC_NUM …
#define MT6358_IMP_ADC_NUM …
#define MT6358_DCM_CK_SW_EN …
#define MT6358_IMP0_CLEAR …
#define MT6358_IMP0_IRQ_RDY …
#define MT6358_IMP1_AUTOREPEAT_EN …
#define MT6359_IMP0_CONV_EN …
#define MT6359_IMP1_IRQ_RDY …
enum mtk_pmic_auxadc_regs { … };
enum mtk_pmic_auxadc_channels { … };
struct mt6359_auxadc { … };
struct mtk_pmic_auxadc_chan { … };
struct mtk_pmic_auxadc_info { … };
#define MTK_PMIC_ADC_CHAN(_ch_idx, _req_idx, _req_bit, _samples, _rnum, _rdiv) …
#define MTK_PMIC_IIO_CHAN(_model, _name, _ch_idx, _adc_idx, _nbits, _ch_type) …
static const struct iio_chan_spec mt6357_auxadc_channels[] = …;
static const struct mtk_pmic_auxadc_chan mt6357_auxadc_ch_desc[] = …;
static const u16 mt6357_auxadc_regs[] = …;
static const struct iio_chan_spec mt6358_auxadc_channels[] = …;
static const struct mtk_pmic_auxadc_chan mt6358_auxadc_ch_desc[] = …;
static const u16 mt6358_auxadc_regs[] = …;
static const struct iio_chan_spec mt6359_auxadc_channels[] = …;
static const struct mtk_pmic_auxadc_chan mt6359_auxadc_ch_desc[] = …;
static const u16 mt6359_auxadc_regs[] = …;
static void mt6358_stop_imp_conv(struct mt6359_auxadc *adc_dev)
{ … }
static int mt6358_start_imp_conv(struct mt6359_auxadc *adc_dev)
{ … }
static int mt6358_read_imp(struct mt6359_auxadc *adc_dev, int *vbat, int *ibat)
{ … }
static int mt6359_read_imp(struct mt6359_auxadc *adc_dev, int *vbat, int *ibat)
{ … }
static const struct mtk_pmic_auxadc_info mt6357_chip_info = …;
static const struct mtk_pmic_auxadc_info mt6358_chip_info = …;
static const struct mtk_pmic_auxadc_info mt6359_chip_info = …;
static void mt6359_auxadc_reset(struct mt6359_auxadc *adc_dev)
{ … }
static int mt6359_auxadc_read_adc(struct mt6359_auxadc *adc_dev,
const struct iio_chan_spec *chan, int *out)
{ … }
static int mt6359_auxadc_read_label(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan, char *label)
{ … }
static int mt6359_auxadc_read_raw(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
int *val, int *val2, long mask)
{ … }
static const struct iio_info mt6359_auxadc_iio_info = …;
static int mt6359_auxadc_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id mt6359_auxadc_of_match[] = …;
MODULE_DEVICE_TABLE(of, mt6359_auxadc_of_match);
static struct platform_driver mt6359_auxadc_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;