linux/drivers/input/touchscreen/auo-pixcir-ts.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Driver for AUO in-cell touchscreens
 *
 * Copyright (c) 2011 Heiko Stuebner <[email protected]>
 *
 * loosely based on auo_touch.c from Dell Streak vendor-kernel
 *
 * Copyright (c) 2008 QUALCOMM Incorporated.
 * Copyright (c) 2008 QUALCOMM USA, INC.
 */

#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/input.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/of.h>
#include <linux/property.h>

/*
 * Coordinate calculation:
 * X1 = X1_LSB + X1_MSB*256
 * Y1 = Y1_LSB + Y1_MSB*256
 * X2 = X2_LSB + X2_MSB*256
 * Y2 = Y2_LSB + Y2_MSB*256
 */
#define AUO_PIXCIR_REG_X1_LSB
#define AUO_PIXCIR_REG_X1_MSB
#define AUO_PIXCIR_REG_Y1_LSB
#define AUO_PIXCIR_REG_Y1_MSB
#define AUO_PIXCIR_REG_X2_LSB
#define AUO_PIXCIR_REG_X2_MSB
#define AUO_PIXCIR_REG_Y2_LSB
#define AUO_PIXCIR_REG_Y2_MSB

#define AUO_PIXCIR_REG_STRENGTH
#define AUO_PIXCIR_REG_STRENGTH_X1_LSB
#define AUO_PIXCIR_REG_STRENGTH_X1_MSB

#define AUO_PIXCIR_REG_RAW_DATA_X
#define AUO_PIXCIR_REG_RAW_DATA_Y

#define AUO_PIXCIR_REG_X_SENSITIVITY
#define AUO_PIXCIR_REG_Y_SENSITIVITY
#define AUO_PIXCIR_REG_INT_SETTING
#define AUO_PIXCIR_REG_INT_WIDTH
#define AUO_PIXCIR_REG_POWER_MODE

#define AUO_PIXCIR_REG_VERSION
#define AUO_PIXCIR_REG_CALIBRATE

#define AUO_PIXCIR_REG_TOUCHAREA_X1
#define AUO_PIXCIR_REG_TOUCHAREA_Y1
#define AUO_PIXCIR_REG_TOUCHAREA_X2
#define AUO_PIXCIR_REG_TOUCHAREA_Y2

#define AUO_PIXCIR_REG_EEPROM_CALIB_X
#define AUO_PIXCIR_REG_EEPROM_CALIB_Y

#define AUO_PIXCIR_INT_TPNUM_MASK
#define AUO_PIXCIR_INT_TPNUM_SHIFT
#define AUO_PIXCIR_INT_RELEASE
#define AUO_PIXCIR_INT_ENABLE
#define AUO_PIXCIR_INT_POL_HIGH

/*
 * Interrupt modes:
 * periodical:		interrupt is asserted periodicaly
 * compare coordinates:	interrupt is asserted when coordinates change
 * indicate touch:	interrupt is asserted during touch
 */
#define AUO_PIXCIR_INT_PERIODICAL
#define AUO_PIXCIR_INT_COMP_COORD
#define AUO_PIXCIR_INT_TOUCH_IND
#define AUO_PIXCIR_INT_MODE_MASK

/*
 * Power modes:
 * active:	scan speed 60Hz
 * sleep:	scan speed 10Hz can be auto-activated, wakeup on 1st touch
 * deep sleep:	scan speed 1Hz can only be entered or left manually.
 */
#define AUO_PIXCIR_POWER_ACTIVE
#define AUO_PIXCIR_POWER_SLEEP
#define AUO_PIXCIR_POWER_DEEP_SLEEP
#define AUO_PIXCIR_POWER_MASK

#define AUO_PIXCIR_POWER_ALLOW_SLEEP
#define AUO_PIXCIR_POWER_IDLE_TIME(ms)

#define AUO_PIXCIR_CALIBRATE

#define AUO_PIXCIR_EEPROM_CALIB_X_LEN
#define AUO_PIXCIR_EEPROM_CALIB_Y_LEN

#define AUO_PIXCIR_RAW_DATA_X_LEN
#define AUO_PIXCIR_RAW_DATA_Y_LEN

#define AUO_PIXCIR_STRENGTH_ENABLE

/* Touchscreen absolute values */
#define AUO_PIXCIR_REPORT_POINTS
#define AUO_PIXCIR_MAX_AREA
#define AUO_PIXCIR_PENUP_TIMEOUT_MS

struct auo_pixcir_ts {};

struct auo_point_t {};

static int auo_pixcir_collect_data(struct auo_pixcir_ts *ts,
				   struct auo_point_t *point)
{}

static irqreturn_t auo_pixcir_interrupt(int irq, void *dev_id)
{}

/*
 * Set the power mode of the device.
 * Valid modes are
 * - AUO_PIXCIR_POWER_ACTIVE
 * - AUO_PIXCIR_POWER_SLEEP - automatically left on first touch
 * - AUO_PIXCIR_POWER_DEEP_SLEEP
 */
static int auo_pixcir_power_mode(struct auo_pixcir_ts *ts, int mode)
{}

static int auo_pixcir_int_config(struct auo_pixcir_ts *ts, int int_setting)
{}

/* control the generation of interrupts on the device side */
static int auo_pixcir_int_toggle(struct auo_pixcir_ts *ts, bool enable)
{}

static int auo_pixcir_start(struct auo_pixcir_ts *ts)
{}

static int auo_pixcir_stop(struct auo_pixcir_ts *ts)
{}

static int auo_pixcir_input_open(struct input_dev *dev)
{}

static void auo_pixcir_input_close(struct input_dev *dev)
{}

static int auo_pixcir_suspend(struct device *dev)
{}

static int auo_pixcir_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(auo_pixcir_pm_ops,
				auo_pixcir_suspend, auo_pixcir_resume);

static void auo_pixcir_reset(void *data)
{}

static int auo_pixcir_probe(struct i2c_client *client)
{}

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

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

static struct i2c_driver auo_pixcir_driver =;

module_i2c_driver();

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