linux/include/linux/mfd/pcf50633/adc.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * adc.h  -- Driver for NXP PCF50633 ADC
 *
 * (C) 2006-2008 by Openmoko, Inc.
 * All rights reserved.
 */

#ifndef __LINUX_MFD_PCF50633_ADC_H
#define __LINUX_MFD_PCF50633_ADC_H

#include <linux/mfd/pcf50633/core.h>
#include <linux/platform_device.h>

/* ADC Registers */
#define PCF50633_REG_ADCC3
#define PCF50633_REG_ADCC2
#define PCF50633_REG_ADCC1
#define PCF50633_REG_ADCS1
#define PCF50633_REG_ADCS2
#define PCF50633_REG_ADCS3

#define PCF50633_ADCC1_ADCSTART
#define PCF50633_ADCC1_RES_8BIT
#define PCF50633_ADCC1_RES_10BIT
#define PCF50633_ADCC1_AVERAGE_NO
#define PCF50633_ADCC1_AVERAGE_4
#define PCF50633_ADCC1_AVERAGE_8
#define PCF50633_ADCC1_AVERAGE_16
#define PCF50633_ADCC1_MUX_BATSNS_RES
#define PCF50633_ADCC1_MUX_BATSNS_SUBTR
#define PCF50633_ADCC1_MUX_ADCIN2_RES
#define PCF50633_ADCC1_MUX_ADCIN2_SUBTR
#define PCF50633_ADCC1_MUX_BATTEMP
#define PCF50633_ADCC1_MUX_ADCIN1
#define PCF50633_ADCC1_AVERAGE_MASK
#define PCF50633_ADCC1_ADCMUX_MASK

#define PCF50633_ADCC2_RATIO_NONE
#define PCF50633_ADCC2_RATIO_BATTEMP
#define PCF50633_ADCC2_RATIO_ADCIN1
#define PCF50633_ADCC2_RATIO_BOTH
#define PCF50633_ADCC2_RATIOSETTL_100US

#define PCF50633_ADCC3_ACCSW_EN
#define PCF50633_ADCC3_NTCSW_EN
#define PCF50633_ADCC3_RES_DIV_TWO
#define PCF50633_ADCC3_RES_DIV_THREE

#define PCF50633_ADCS3_REF_NTCSW
#define PCF50633_ADCS3_REF_ACCSW
#define PCF50633_ADCS3_REF_2V0
#define PCF50633_ADCS3_REF_VISA
#define PCF50633_ADCS3_REF_2V0_2
#define PCF50633_ADCS3_ADCRDY

#define PCF50633_ADCS3_ADCDAT1L_MASK
#define PCF50633_ADCS3_ADCDAT2L_MASK
#define PCF50633_ADCS3_ADCDAT2L_SHIFT
#define PCF50633_ASCS3_REF_MASK

extern int
pcf50633_adc_async_read(struct pcf50633 *pcf, int mux, int avg,
		void (*callback)(struct pcf50633 *, void *, int),
		void *callback_param);
extern int
pcf50633_adc_sync_read(struct pcf50633 *pcf, int mux, int avg);

#endif /* __LINUX_PCF50633_ADC_H */