linux/drivers/input/touchscreen/stmpe-ts.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * STMicroelectronics STMPE811 Touchscreen Driver
 *
 * (C) 2010 Luotao Fu <[email protected]>
 * All rights reserved.
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/input.h>
#include <linux/input/touchscreen.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/workqueue.h>

#include <linux/mfd/stmpe.h>

/* Register layouts and functionalities are identical on all stmpexxx variants
 * with touchscreen controller
 */
#define STMPE_REG_INT_STA
#define STMPE_REG_TSC_CTRL
#define STMPE_REG_TSC_CFG
#define STMPE_REG_FIFO_TH
#define STMPE_REG_FIFO_STA
#define STMPE_REG_FIFO_SIZE
#define STMPE_REG_TSC_DATA_XYZ
#define STMPE_REG_TSC_FRACTION_Z
#define STMPE_REG_TSC_I_DRIVE

#define OP_MOD_XYZ

#define STMPE_TSC_CTRL_TSC_EN

#define STMPE_FIFO_STA_RESET

#define STMPE_IRQ_TOUCH_DET

#define STMPE_TS_NAME
#define XY_MASK

/**
 * struct stmpe_touch - stmpe811 touch screen controller state
 * @stmpe: pointer back to STMPE MFD container
 * @idev: registered input device
 * @work: a work item used to scan the device
 * @dev: a pointer back to the MFD cell struct device*
 * @prop: Touchscreen properties
 * @ave_ctrl: Sample average control
 * (0 -> 1 sample, 1 -> 2 samples, 2 -> 4 samples, 3 -> 8 samples)
 * @touch_det_delay: Touch detect interrupt delay
 * (0 -> 10 us, 1 -> 50 us, 2 -> 100 us, 3 -> 500 us,
 * 4-> 1 ms, 5 -> 5 ms, 6 -> 10 ms, 7 -> 50 ms)
 * recommended is 3
 * @settling: Panel driver settling time
 * (0 -> 10 us, 1 -> 100 us, 2 -> 500 us, 3 -> 1 ms,
 * 4 -> 5 ms, 5 -> 10 ms, 6 for 50 ms, 7 -> 100 ms)
 * recommended is 2
 * @fraction_z: Length of the fractional part in z
 * (fraction_z ([0..7]) = Count of the fractional part)
 * recommended is 7
 * @i_drive: current limit value of the touchscreen drivers
 * (0 -> 20 mA typical 35 mA max, 1 -> 50 mA typical 80 mA max)
 */
struct stmpe_touch {};

static int __stmpe_reset_fifo(struct stmpe *stmpe)
{}

static void stmpe_work(struct work_struct *work)
{}

static irqreturn_t stmpe_ts_handler(int irq, void *data)
{}

static int stmpe_init_hw(struct stmpe_touch *ts)
{}

static int stmpe_ts_open(struct input_dev *dev)
{}

static void stmpe_ts_close(struct input_dev *dev)
{}

static void stmpe_ts_get_platform_info(struct platform_device *pdev,
					struct stmpe_touch *ts)
{}

static int stmpe_input_probe(struct platform_device *pdev)
{}

static void stmpe_ts_remove(struct platform_device *pdev)
{}

static struct platform_driver stmpe_ts_driver =;
module_platform_driver();

static const struct of_device_id stmpe_ts_ids[] =;
MODULE_DEVICE_TABLE(of, stmpe_ts_ids);

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