linux/include/linux/mfd/mxs-lradc.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Freescale MXS Low Resolution Analog-to-Digital Converter driver
 *
 * Copyright (c) 2012 DENX Software Engineering, GmbH.
 * Copyright (c) 2016 Ksenija Stanojevic <[email protected]>
 *
 * Author: Marek Vasut <[email protected]>
 */

#ifndef __MFD_MXS_LRADC_H
#define __MFD_MXS_LRADC_H

#include <linux/bitops.h>
#include <linux/io.h>
#include <linux/stmp_device.h>

#define LRADC_MAX_DELAY_CHANS
#define LRADC_MAX_MAPPED_CHANS
#define LRADC_MAX_TOTAL_CHANS

#define LRADC_DELAY_TIMER_HZ

#define LRADC_CTRL0
#define LRADC_CTRL0_MX28_TOUCH_DETECT_ENABLE
#define LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE
#define LRADC_CTRL0_MX28_YNNSW
#define LRADC_CTRL0_MX28_YPNSW
#define LRADC_CTRL0_MX28_YPPSW
#define LRADC_CTRL0_MX28_XNNSW
#define LRADC_CTRL0_MX28_XNPSW
#define LRADC_CTRL0_MX28_XPPSW

#define LRADC_CTRL0_MX23_TOUCH_DETECT_ENABLE
#define LRADC_CTRL0_MX23_YM
#define LRADC_CTRL0_MX23_XM
#define LRADC_CTRL0_MX23_YP
#define LRADC_CTRL0_MX23_XP

#define LRADC_CTRL0_MX28_PLATE_MASK

#define LRADC_CTRL0_MX23_PLATE_MASK

#define LRADC_CTRL1
#define LRADC_CTRL1_TOUCH_DETECT_IRQ_EN
#define LRADC_CTRL1_LRADC_IRQ_EN(n)
#define LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK
#define LRADC_CTRL1_MX23_LRADC_IRQ_EN_MASK
#define LRADC_CTRL1_LRADC_IRQ_EN_OFFSET
#define LRADC_CTRL1_TOUCH_DETECT_IRQ
#define LRADC_CTRL1_LRADC_IRQ(n)
#define LRADC_CTRL1_MX28_LRADC_IRQ_MASK
#define LRADC_CTRL1_MX23_LRADC_IRQ_MASK
#define LRADC_CTRL1_LRADC_IRQ_OFFSET

#define LRADC_CTRL2
#define LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET
#define LRADC_CTRL2_TEMPSENSE_PWD

#define LRADC_STATUS
#define LRADC_STATUS_TOUCH_DETECT_RAW

#define LRADC_CH(n)
#define LRADC_CH_ACCUMULATE
#define LRADC_CH_NUM_SAMPLES_MASK
#define LRADC_CH_NUM_SAMPLES_OFFSET
#define LRADC_CH_NUM_SAMPLES(x)
#define LRADC_CH_VALUE_MASK
#define LRADC_CH_VALUE_OFFSET

#define LRADC_DELAY(n)
#define LRADC_DELAY_TRIGGER_LRADCS_MASK
#define LRADC_DELAY_TRIGGER_LRADCS_OFFSET
#define LRADC_DELAY_TRIGGER(x)
#define LRADC_DELAY_KICK
#define LRADC_DELAY_TRIGGER_DELAYS_MASK
#define LRADC_DELAY_TRIGGER_DELAYS_OFFSET
#define LRADC_DELAY_TRIGGER_DELAYS(x)
#define LRADC_DELAY_LOOP_COUNT_MASK
#define LRADC_DELAY_LOOP_COUNT_OFFSET
#define LRADC_DELAY_LOOP(x)
#define LRADC_DELAY_DELAY_MASK
#define LRADC_DELAY_DELAY_OFFSET
#define LRADC_DELAY_DELAY(x)

#define LRADC_CTRL4
#define LRADC_CTRL4_LRADCSELECT_MASK(n)
#define LRADC_CTRL4_LRADCSELECT_OFFSET(n)
#define LRADC_CTRL4_LRADCSELECT(n, x)

#define LRADC_RESOLUTION
#define LRADC_SINGLE_SAMPLE_MASK

#define BUFFER_VCHANS_LIMITED
#define BUFFER_VCHANS_ALL

	/*
	 * Certain LRADC channels are shared between touchscreen
	 * and/or touch-buttons and generic LRADC block. Therefore when using
	 * either of these, these channels are not available for the regular
	 * sampling. The shared channels are as follows:
	 *
	 * CH0 -- Touch button #0
	 * CH1 -- Touch button #1
	 * CH2 -- Touch screen XPUL
	 * CH3 -- Touch screen YPLL
	 * CH4 -- Touch screen XNUL
	 * CH5 -- Touch screen YNLR
	 * CH6 -- Touch screen WIPER (5-wire only)
	 *
	 * The bit fields below represents which parts of the LRADC block are
	 * switched into special mode of operation. These channels can not
	 * be sampled as regular LRADC channels. The driver will refuse any
	 * attempt to sample these channels.
	 */
#define CHAN_MASK_TOUCHBUTTON
#define CHAN_MASK_TOUCHSCREEN_4WIRE
#define CHAN_MASK_TOUCHSCREEN_5WIRE

enum mxs_lradc_id {};

enum mxs_lradc_ts_wires {};

/**
 * struct mxs_lradc
 * @soc: soc type (IMX23 or IMX28)
 * @clk: 2 kHz clock for delay units
 * @buffer_vchans: channels that can be used during buffered capture
 * @touchscreen_wire: touchscreen type (4-wire or 5-wire)
 * @use_touchbutton: button state (on or off)
 */
struct mxs_lradc {};

static inline u32 mxs_lradc_irq_mask(struct mxs_lradc *lradc)
{}

#endif /* __MXS_LRADC_H */