linux/drivers/input/touchscreen/sx8654.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Driver for Semtech SX8654 I2C touchscreen controller.
 *
 * Copyright (c) 2015 Armadeus Systems
 *	Sébastien Szymanski <[email protected]>
 *
 * Using code from:
 *  - sx865x.c
 *	Copyright (c) 2013 U-MoBo Srl
 *	Pierluigi Passaro <[email protected]>
 *  - sx8650.c
 *      Copyright (c) 2009 Wayne Roberts
 *  - tsc2007.c
 *      Copyright (c) 2008 Kwangwoo Lee
 *  - 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
 */

#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/input/touchscreen.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/of.h>

/* register addresses */
#define I2C_REG_TOUCH0
#define I2C_REG_TOUCH1
#define I2C_REG_CHANMASK
#define I2C_REG_IRQMASK
#define I2C_REG_IRQSRC
#define I2C_REG_SOFTRESET

#define I2C_REG_SX8650_STAT
#define SX8650_STAT_CONVIRQ

/* commands */
#define CMD_READ_REGISTER
#define CMD_PENTRG

/* value for I2C_REG_SOFTRESET */
#define SOFTRESET_VALUE

/* bits for I2C_REG_IRQSRC */
#define IRQ_PENTOUCH_TOUCHCONVDONE
#define IRQ_PENRELEASE

/* bits for RegTouch1 */
#define CONDIRQ
#define RPDNT_100K
#define FILT_7SA

/* bits for I2C_REG_CHANMASK */
#define CONV_X
#define CONV_Y

/* coordinates rate: higher nibble of CTRL0 register */
#define RATE_MANUAL
#define RATE_5000CPS

/* power delay: lower nibble of CTRL0 register */
#define POWDLY_1_1MS

/* for sx8650, as we have no pen release IRQ there: timeout in ns following the
 * last PENIRQ after which we assume the pen is lifted.
 */
#define SX8650_PENIRQ_TIMEOUT

#define MAX_12BIT
#define MAX_I2C_READ_LEN

/* channel definition */
#define CH_X
#define CH_Y

struct sx865x_data {};

struct sx8654 {};

static inline void sx865x_penrelease(struct sx8654 *ts)
{}

static void sx865x_penrelease_timer_handler(struct timer_list *t)
{}

static irqreturn_t sx8650_irq(int irq, void *handle)
{}

static irqreturn_t sx8654_irq(int irq, void *handle)
{}

static int sx8654_reset(struct sx8654 *ts)
{}

static int sx8654_open(struct input_dev *dev)
{}

static void sx8654_close(struct input_dev *dev)
{}

static int sx8654_probe(struct i2c_client *client)
{}

static const struct sx865x_data sx8650_data =;

static const struct sx865x_data sx8654_data =;

#ifdef CONFIG_OF
static const struct of_device_id sx8654_of_match[] =;
MODULE_DEVICE_TABLE(of, sx8654_of_match);
#endif

static const struct i2c_device_id sx8654_id_table[] =;
MODULE_DEVICE_TABLE(i2c, sx8654_id_table);

static struct i2c_driver sx8654_driver =;
module_i2c_driver();

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