linux/drivers/input/touchscreen/mxs-lradc-ts.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Freescale MXS LRADC touchscreen driver
 *
 * Copyright (c) 2012 DENX Software Engineering, GmbH.
 * Copyright (c) 2017 Ksenija Stanojevic <[email protected]>
 *
 * Authors:
 *  Marek Vasut <[email protected]>
 *  Ksenija Stanojevic <[email protected]>
 */

#include <linux/device.h>
#include <linux/err.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/mfd/core.h>
#include <linux/mfd/mxs-lradc.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h>

static const char * const mxs_lradc_ts_irq_names[] =;

/*
 * Touchscreen handling
 */
enum mxs_lradc_ts_plate {};

struct mxs_lradc_ts {};

struct state_info {};

static struct state_info info[] =;

static bool mxs_lradc_check_touch_event(struct mxs_lradc_ts *ts)
{}

static void mxs_lradc_map_ts_channel(struct mxs_lradc_ts *ts, unsigned int vch,
				     unsigned int ch)
{}

static void mxs_lradc_setup_ts_channel(struct mxs_lradc_ts *ts, unsigned int ch)
{}

/*
 * Pressure detection is special:
 * We want to do both required measurements for the pressure detection in
 * one turn. Use the hardware features to chain both conversions and let the
 * hardware report one interrupt if both conversions are done
 */
static void mxs_lradc_setup_ts_pressure(struct mxs_lradc_ts *ts,
					unsigned int ch1, unsigned int ch2)
{}

static unsigned int mxs_lradc_ts_read_raw_channel(struct mxs_lradc_ts *ts,
						  unsigned int channel)
{}

static unsigned int mxs_lradc_read_ts_pressure(struct mxs_lradc_ts *ts,
					unsigned int ch1, unsigned int ch2)
{}

#define TS_CH_XP
#define TS_CH_YP
#define TS_CH_XM
#define TS_CH_YM

/*
 * YP(open)--+-------------+
 *	     |		   |--+
 *	     |		   |  |
 *    YM(-)--+-------------+  |
 *	       +--------------+
 *	       |	      |
 *	   XP(weak+)	    XM(open)
 *
 * "weak+" means 200k Ohm VDDIO
 * (-) means GND
 */
static void mxs_lradc_setup_touch_detection(struct mxs_lradc_ts *ts)
{}

/*
 * YP(meas)--+-------------+
 *	     |		   |--+
 *	     |		   |  |
 * YM(open)--+-------------+  |
 *	       +--------------+
 *	       |	      |
 *	     XP(+)	    XM(-)
 *
 * (+) means here 1.85 V
 * (-) means here GND
 */
static void mxs_lradc_prepare_x_pos(struct mxs_lradc_ts *ts)
{}

/*
 *   YP(+)--+-------------+
 *	    |		  |--+
 *	    |		  |  |
 *   YM(-)--+-------------+  |
 *	      +--------------+
 *	      |		     |
 *	   XP(open)	   XM(meas)
 *
 * (+) means here 1.85 V
 * (-) means here GND
 */
static void mxs_lradc_prepare_y_pos(struct mxs_lradc_ts *ts)
{}

/*
 *    YP(+)--+-------------+
 *	     |		   |--+
 *	     |		   |  |
 * YM(meas)--+-------------+  |
 *	       +--------------+
 *	       |	      |
 *	    XP(meas)	    XM(-)
 *
 * (+) means here 1.85 V
 * (-) means here GND
 */
static void mxs_lradc_prepare_pressure(struct mxs_lradc_ts *ts)
{}

static void mxs_lradc_enable_touch_detection(struct mxs_lradc_ts *ts)
{}

static void mxs_lradc_start_touch_event(struct mxs_lradc_ts *ts)
{}

static void mxs_lradc_report_ts_event(struct mxs_lradc_ts *ts)
{}

static void mxs_lradc_complete_touch_event(struct mxs_lradc_ts *ts)
{}

/*
 * in order to avoid false measurements, report only samples where
 * the surface is still touched after the position measurement
 */
static void mxs_lradc_finish_touch_event(struct mxs_lradc_ts *ts, bool valid)
{}

/* touchscreen's state machine */
static void mxs_lradc_handle_touch(struct mxs_lradc_ts *ts)
{}

/* IRQ Handling */
static irqreturn_t mxs_lradc_ts_handle_irq(int irq, void *data)
{}

static int mxs_lradc_ts_open(struct input_dev *dev)
{}

static void mxs_lradc_ts_stop(struct mxs_lradc_ts *ts)
{}

static void mxs_lradc_ts_close(struct input_dev *dev)
{}

static void mxs_lradc_ts_hw_init(struct mxs_lradc_ts *ts)
{}

static int mxs_lradc_ts_register(struct mxs_lradc_ts *ts)
{}

static int mxs_lradc_ts_probe(struct platform_device *pdev)
{}

static struct platform_driver mxs_lradc_ts_driver =;
module_platform_driver();

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