linux/drivers/input/touchscreen/tsc2007.h

/* SPDX-License-Identifier: GPL-2.0-only */

/*
 * Copyright (c) 2008 MtekVision Co., Ltd.
 *	Kwangwoo Lee <[email protected]>
 *
 * Using code from:
 *  - ads7846.c
 *	Copyright (c) 2005 David Brownell
 *	Copyright (c) 2006 Nokia Corporation
 *  - corgi_ts.c
 *	Copyright (C) 2004-2005 Richard Purdie
 *  - omap_ts.[hc], ads7846.h, ts_osk.c
 *	Copyright (C) 2002 MontaVista Software
 *	Copyright (C) 2004 Texas Instruments
 *	Copyright (C) 2005 Dirk Behme
 */

#ifndef _TSC2007_H
#define _TSC2007_H

struct gpio_desc;

#define TSC2007_MEASURE_TEMP0
#define TSC2007_MEASURE_AUX
#define TSC2007_MEASURE_TEMP1
#define TSC2007_ACTIVATE_XN
#define TSC2007_ACTIVATE_YN
#define TSC2007_ACTIVATE_YP_XN
#define TSC2007_SETUP
#define TSC2007_MEASURE_X
#define TSC2007_MEASURE_Y
#define TSC2007_MEASURE_Z1
#define TSC2007_MEASURE_Z2

#define TSC2007_POWER_OFF_IRQ_EN
#define TSC2007_ADC_ON_IRQ_DIS0
#define TSC2007_ADC_OFF_IRQ_EN
#define TSC2007_ADC_ON_IRQ_DIS1

#define TSC2007_12BIT
#define TSC2007_8BIT

#define MAX_12BIT

#define ADC_ON_12BIT

#define READ_Y
#define READ_Z1
#define READ_Z2
#define READ_X
#define PWRDOWN

struct ts_event {};

struct tsc2007 {};

int tsc2007_xfer(struct tsc2007 *tsc, u8 cmd);
u32 tsc2007_calculate_resistance(struct tsc2007 *tsc, struct ts_event *tc);
bool tsc2007_is_pen_down(struct tsc2007 *ts);

#if IS_ENABLED(CONFIG_TOUCHSCREEN_TSC2007_IIO)
/* defined in tsc2007_iio.c */
int tsc2007_iio_configure(struct tsc2007 *ts);
#else
static inline int tsc2007_iio_configure(struct tsc2007 *ts)
{
	return 0;
}
#endif /* CONFIG_TOUCHSCREEN_TSC2007_IIO */

#endif /* _TSC2007_H */