linux/drivers/input/touchscreen/tsc200x-core.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * TSC2004/TSC2005 touchscreen driver core
 *
 * Copyright (C) 2006-2010 Nokia Corporation
 * Copyright (C) 2015 QWERTY Embedded Design
 * Copyright (C) 2015 EMAC Inc.
 *
 * Author: Lauri Leukkunen <[email protected]>
 * based on TSC2301 driver by Klaus K. Pedersen <[email protected]>
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/input.h>
#include <linux/input/touchscreen.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/of.h>
#include <linux/regulator/consumer.h>
#include <linux/regmap.h>
#include <linux/gpio/consumer.h>
#include "tsc200x-core.h"

/*
 * The touchscreen interface operates as follows:
 *
 * 1) Pen is pressed against the touchscreen.
 * 2) TSC200X performs AD conversion.
 * 3) After the conversion is done TSC200X drives DAV line down.
 * 4) GPIO IRQ is received and tsc200x_irq_thread() is scheduled.
 * 5) tsc200x_irq_thread() queues up a transfer to fetch the x, y, z1, z2
 *    values.
 * 6) tsc200x_irq_thread() reports coordinates to input layer and sets up
 *    tsc200x_penup_timer() to be called after TSC200X_PENUP_TIME_MS (40ms).
 * 7) When the penup timer expires, there have not been touch or DAV interrupts
 *    during the last 40ms which means the pen has been lifted.
 *
 * ESD recovery via a hardware reset is done if the TSC200X doesn't respond
 * after a configurable period (in ms) of activity. If esd_timeout is 0, the
 * watchdog is disabled.
 */

static const struct regmap_range tsc200x_writable_ranges[] =;

static const struct regmap_access_table tsc200x_writable_table =;

const struct regmap_config tsc200x_regmap_config =;
EXPORT_SYMBOL_GPL();

struct tsc200x_data {} __packed;
#define TSC200X_DATA_REGS

struct tsc200x {};

static void tsc200x_update_pen_state(struct tsc200x *ts,
				     int x, int y, int pressure)
{}

static irqreturn_t tsc200x_irq_thread(int irq, void *_ts)
{}

static void tsc200x_penup_timer(struct timer_list *t)
{}

static void tsc200x_start_scan(struct tsc200x *ts)
{}

static void tsc200x_stop_scan(struct tsc200x *ts)
{}

static void tsc200x_reset(struct tsc200x *ts)
{}

/* must be called with ts->mutex held */
static void __tsc200x_disable(struct tsc200x *ts)
{}

/* must be called with ts->mutex held */
static void __tsc200x_enable(struct tsc200x *ts)
{}

/*
 * Test TSC200X communications via temp high register.
 */
static int tsc200x_do_selftest(struct tsc200x *ts)
{}

static ssize_t tsc200x_selftest_show(struct device *dev,
				     struct device_attribute *attr,
				     char *buf)
{}

static DEVICE_ATTR(selftest, S_IRUGO, tsc200x_selftest_show, NULL);

static struct attribute *tsc200x_attrs[] =;

static umode_t tsc200x_attr_is_visible(struct kobject *kobj,
				      struct attribute *attr, int n)
{}

static const struct attribute_group tsc200x_attr_group =;

const struct attribute_group *tsc200x_groups[] =;
EXPORT_SYMBOL_GPL();

static void tsc200x_esd_work(struct work_struct *work)
{}

static int tsc200x_open(struct input_dev *input)
{}

static void tsc200x_close(struct input_dev *input)
{}

int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id,
		  struct regmap *regmap,
		  int (*tsc200x_cmd)(struct device *dev, u8 cmd))
{}
EXPORT_SYMBOL_GPL();

static int tsc200x_suspend(struct device *dev)
{}

static int tsc200x_resume(struct device *dev)
{}

EXPORT_GPL_SIMPLE_DEV_PM_OPS();

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