linux/drivers/input/touchscreen/stmfts.c

// SPDX-License-Identifier: GPL-2.0
// STMicroelectronics FTS Touchscreen device driver
//
// Copyright (c) 2017 Samsung Electronics Co., Ltd.
// Copyright (c) 2017 Andi Shyti <[email protected]>

#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/input/mt.h>
#include <linux/input/touchscreen.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>

/* I2C commands */
#define STMFTS_READ_INFO
#define STMFTS_READ_STATUS
#define STMFTS_READ_ONE_EVENT
#define STMFTS_READ_ALL_EVENT
#define STMFTS_LATEST_EVENT
#define STMFTS_SLEEP_IN
#define STMFTS_SLEEP_OUT
#define STMFTS_MS_MT_SENSE_OFF
#define STMFTS_MS_MT_SENSE_ON
#define STMFTS_SS_HOVER_SENSE_OFF
#define STMFTS_SS_HOVER_SENSE_ON
#define STMFTS_MS_KEY_SENSE_OFF
#define STMFTS_MS_KEY_SENSE_ON
#define STMFTS_SYSTEM_RESET
#define STMFTS_CLEAR_EVENT_STACK
#define STMFTS_FULL_FORCE_CALIBRATION
#define STMFTS_MS_CX_TUNING
#define STMFTS_SS_CX_TUNING

/* events */
#define STMFTS_EV_NO_EVENT
#define STMFTS_EV_MULTI_TOUCH_DETECTED
#define STMFTS_EV_MULTI_TOUCH_ENTER
#define STMFTS_EV_MULTI_TOUCH_LEAVE
#define STMFTS_EV_MULTI_TOUCH_MOTION
#define STMFTS_EV_HOVER_ENTER
#define STMFTS_EV_HOVER_LEAVE
#define STMFTS_EV_HOVER_MOTION
#define STMFTS_EV_KEY_STATUS
#define STMFTS_EV_ERROR
#define STMFTS_EV_CONTROLLER_READY
#define STMFTS_EV_SLEEP_OUT_CONTROLLER_READY
#define STMFTS_EV_STATUS
#define STMFTS_EV_DEBUG

/* multi touch related event masks */
#define STMFTS_MASK_EVENT_ID
#define STMFTS_MASK_TOUCH_ID
#define STMFTS_MASK_LEFT_EVENT
#define STMFTS_MASK_X_MSB
#define STMFTS_MASK_Y_LSB

/* key related event masks */
#define STMFTS_MASK_KEY_NO_TOUCH
#define STMFTS_MASK_KEY_MENU
#define STMFTS_MASK_KEY_BACK

#define STMFTS_EVENT_SIZE
#define STMFTS_STACK_DEPTH
#define STMFTS_DATA_MAX_SIZE
#define STMFTS_MAX_FINGERS
#define STMFTS_DEV_NAME

enum stmfts_regulators {};

struct stmfts_data {};

static int stmfts_brightness_set(struct led_classdev *led_cdev,
					enum led_brightness value)
{}

static enum led_brightness stmfts_brightness_get(struct led_classdev *led_cdev)
{}

/*
 * We can't simply use i2c_smbus_read_i2c_block_data because we
 * need to read more than 255 bytes (
 */
static int stmfts_read_events(struct stmfts_data *sdata)
{}

static void stmfts_report_contact_event(struct stmfts_data *sdata,
					const u8 event[])
{}

static void stmfts_report_contact_release(struct stmfts_data *sdata,
					  const u8 event[])
{}

static void stmfts_report_hover_event(struct stmfts_data *sdata,
				      const u8 event[])
{}

static void stmfts_report_key_event(struct stmfts_data *sdata, const u8 event[])
{}

static void stmfts_parse_events(struct stmfts_data *sdata)
{}

static irqreturn_t stmfts_irq_handler(int irq, void *dev)
{}

static int stmfts_command(struct stmfts_data *sdata, const u8 cmd)
{}

static int stmfts_input_open(struct input_dev *dev)
{}

static void stmfts_input_close(struct input_dev *dev)
{}

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

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

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

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

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

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

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

static ssize_t stmfts_sysfs_hover_enable_write(struct device *dev,
				struct device_attribute *attr,
				const char *buf, size_t len)
{}

static DEVICE_ATTR(chip_id, 0444, stmfts_sysfs_chip_id, NULL);
static DEVICE_ATTR(chip_version, 0444, stmfts_sysfs_chip_version, NULL);
static DEVICE_ATTR(fw_ver, 0444, stmfts_sysfs_fw_ver, NULL);
static DEVICE_ATTR(config_id, 0444, stmfts_sysfs_config_id, NULL);
static DEVICE_ATTR(config_version, 0444, stmfts_sysfs_config_version, NULL);
static DEVICE_ATTR(status, 0444, stmfts_sysfs_read_status, NULL);
static DEVICE_ATTR(hover_enable, 0644, stmfts_sysfs_hover_enable_read,
					stmfts_sysfs_hover_enable_write);

static struct attribute *stmfts_sysfs_attrs[] =;
ATTRIBUTE_GROUPS();

static int stmfts_power_on(struct stmfts_data *sdata)
{}

static void stmfts_power_off(void *data)
{}

/* This function is void because I don't want to prevent using the touch key
 * only because the LEDs don't get registered
 */
static int stmfts_enable_led(struct stmfts_data *sdata)
{}

static int stmfts_probe(struct i2c_client *client)
{}

static void stmfts_remove(struct i2c_client *client)
{}

static int stmfts_runtime_suspend(struct device *dev)
{}

static int stmfts_runtime_resume(struct device *dev)
{}

static int stmfts_suspend(struct device *dev)
{}

static int stmfts_resume(struct device *dev)
{}

static const struct dev_pm_ops stmfts_pm_ops =;

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

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

static struct i2c_driver stmfts_driver =;

module_i2c_driver();

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