linux/drivers/input/touchscreen/s6sy761.c

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

#include <linux/unaligned.h>
#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/module.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>

/* commands */
#define S6SY761_SENSE_ON
#define S6SY761_SENSE_OFF
#define S6SY761_TOUCH_FUNCTION
#define S6SY761_FIRMWARE_INTEGRITY
#define S6SY761_PANEL_INFO
#define S6SY761_DEVICE_ID
#define S6SY761_BOOT_STATUS
#define S6SY761_READ_ONE_EVENT
#define S6SY761_READ_ALL_EVENT
#define S6SY761_CLEAR_EVENT_STACK
#define S6SY761_APPLICATION_MODE

/* events */
#define S6SY761_EVENT_INFO
#define S6SY761_EVENT_VENDOR_INFO

/* info */
#define S6SY761_INFO_BOOT_COMPLETE

/* firmware status */
#define S6SY761_FW_OK

/*
 * the functionalities are put as a reference
 * as in the device I am using none of them
 * works therefore not used in this driver yet.
 */
/* touchscreen functionalities */
#define S6SY761_MASK_TOUCH
#define S6SY761_MASK_HOVER
#define S6SY761_MASK_COVER
#define S6SY761_MASK_GLOVE
#define S6SY761_MASK_STYLUS
#define S6SY761_MASK_PALM
#define S6SY761_MASK_WET
#define S6SY761_MASK_PROXIMITY

/* boot status (BS) */
#define S6SY761_BS_BOOT_LOADER
#define S6SY761_BS_APPLICATION

/* event id */
#define S6SY761_EVENT_ID_COORDINATE
#define S6SY761_EVENT_ID_STATUS

/* event register masks */
#define S6SY761_MASK_TOUCH_STATE
#define S6SY761_MASK_TID
#define S6SY761_MASK_EID
#define S6SY761_MASK_X
#define S6SY761_MASK_Y
#define S6SY761_MASK_Z
#define S6SY761_MASK_LEFT_EVENTS
#define S6SY761_MASK_TOUCH_TYPE

/* event touch state values */
#define S6SY761_TS_NONE
#define S6SY761_TS_PRESS
#define S6SY761_TS_MOVE
#define S6SY761_TS_RELEASE

/* application modes */
#define S6SY761_APP_NORMAL
#define S6SY761_APP_LOW_POWER
#define S6SY761_APP_TEST
#define S6SY761_APP_FLASH
#define S6SY761_APP_SLEEP

#define S6SY761_EVENT_SIZE
#define S6SY761_EVENT_COUNT
#define S6SY761_DEVID_SIZE
#define S6SY761_PANEL_ID_SIZE
#define S6SY761_TS_STATUS_SIZE
#define S6SY761_MAX_FINGERS

#define S6SY761_DEV_NAME

enum s6sy761_regulators {};

struct s6sy761_data {};

/*
 * We can't simply use i2c_smbus_read_i2c_block_data because we
 * need to read more than 255 bytes
 */
static int s6sy761_read_events(struct s6sy761_data *sdata, u16 n_events)
{}

static void s6sy761_report_coordinates(struct s6sy761_data *sdata,
				       u8 *event, u8 tid)
{}

static void s6sy761_report_release(struct s6sy761_data *sdata,
				   u8 *event, u8 tid)
{}

static void s6sy761_handle_coordinates(struct s6sy761_data *sdata, u8 *event)
{}

static void s6sy761_handle_events(struct s6sy761_data *sdata, u8 n_events)
{}

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

static int s6sy761_input_open(struct input_dev *dev)
{}

static void s6sy761_input_close(struct input_dev *dev)
{}

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

static DEVICE_ATTR(devid, 0444, s6sy761_sysfs_devid, NULL);

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

static int s6sy761_power_on(struct s6sy761_data *sdata)
{}

static int s6sy761_hw_init(struct s6sy761_data *sdata,
			   unsigned int *max_x, unsigned int *max_y)
{}

static void s6sy761_power_off(void *data)
{}

static int s6sy761_probe(struct i2c_client *client)
{}

static void s6sy761_remove(struct i2c_client *client)
{}

static int s6sy761_runtime_suspend(struct device *dev)
{}

static int s6sy761_runtime_resume(struct device *dev)
{}

static int s6sy761_suspend(struct device *dev)
{}

static int s6sy761_resume(struct device *dev)
{}

static const struct dev_pm_ops s6sy761_pm_ops =;

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

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

static struct i2c_driver s6sy761_driver =;

module_i2c_driver();

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