linux/drivers/input/touchscreen/zforce_ts.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2012-2013 MundoReader S.L.
 * Author: Heiko Stuebner <[email protected]>
 *
 * based in parts on Nook zforce driver
 *
 * Copyright (C) 2010 Barnes & Noble, Inc.
 * Author: Pieter Truter<[email protected]>
 */

#include <linux/delay.h>
#include <linux/device.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/input/mt.h>
#include <linux/input/touchscreen.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/property.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/unaligned.h>

#define WAIT_TIMEOUT

#define FRAME_START
#define FRAME_MAXSIZE

/* Offsets of the different parts of the payload the controller sends */
#define PAYLOAD_HEADER
#define PAYLOAD_LENGTH
#define PAYLOAD_BODY

/* Response offsets */
#define RESPONSE_ID
#define RESPONSE_DATA

/* Commands */
#define COMMAND_DEACTIVATE
#define COMMAND_INITIALIZE
#define COMMAND_RESOLUTION
#define COMMAND_SETCONFIG
#define COMMAND_DATAREQUEST
#define COMMAND_SCANFREQ
#define COMMAND_STATUS

/*
 * Responses the controller sends as a result of
 * command requests
 */
#define RESPONSE_DEACTIVATE
#define RESPONSE_INITIALIZE
#define RESPONSE_RESOLUTION
#define RESPONSE_SETCONFIG
#define RESPONSE_SCANFREQ
#define RESPONSE_STATUS

/*
 * Notifications are sent by the touch controller without
 * being requested by the driver and include for example
 * touch indications
 */
#define NOTIFICATION_TOUCH
#define NOTIFICATION_BOOTCOMPLETE
#define NOTIFICATION_OVERRUN
#define NOTIFICATION_PROXIMITY
#define NOTIFICATION_INVALID_COMMAND

#define ZFORCE_REPORT_POINTS
#define ZFORCE_MAX_AREA

#define STATE_DOWN
#define STATE_MOVE
#define STATE_UP

#define SETCONFIG_DUALTOUCH

struct zforce_point {};

/*
 * @client		the i2c_client
 * @input		the input device
 * @suspending		in the process of going to suspend (don't emit wakeup
 *			events for commands executed to suspend the device)
 * @suspended		device suspended
 * @command_done	completion to wait for the command result
 * @command_waiting	the id of the command that is currently waiting
 *			for a result
 * @command_result	returned result of the command
 */
struct zforce_ts {};

static int zforce_command(struct zforce_ts *ts, u8 cmd)
{}

static int zforce_send_wait(struct zforce_ts *ts, const char *buf, int len)
{}

static int zforce_command_wait(struct zforce_ts *ts, u8 cmd)
{}

static int zforce_resolution(struct zforce_ts *ts, u16 x, u16 y)
{}

static int zforce_scan_frequency(struct zforce_ts *ts, u16 idle, u16 finger,
				 u16 stylus)
{}

static int zforce_setconfig(struct zforce_ts *ts, char b1)
{}

static int zforce_start(struct zforce_ts *ts)
{}

static int zforce_stop(struct zforce_ts *ts)
{}

static int zforce_touch_event(struct zforce_ts *ts, u8 *payload)
{}

static int zforce_read_packet(struct zforce_ts *ts, u8 *buf)
{}

static void zforce_complete(struct zforce_ts *ts, int cmd, int result)
{}

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

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

static int zforce_input_open(struct input_dev *dev)
{}

static void zforce_input_close(struct input_dev *dev)
{}

static int __zforce_suspend(struct zforce_ts *ts)
{}

static int zforce_suspend(struct device *dev)
{}

static int zforce_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(zforce_pm_ops, zforce_suspend, zforce_resume);

static void zforce_reset(void *data)
{}

static void zforce_ts_parse_legacy_properties(struct zforce_ts *ts)
{}

static int zforce_probe(struct i2c_client *client)
{}

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

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

static struct i2c_driver zforce_driver =;

module_i2c_driver();

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