linux/drivers/input/touchscreen/raydium_i2c_ts.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Raydium touchscreen I2C driver.
 *
 * Copyright (C) 2012-2014, Raydium Semiconductor Corporation.
 *
 * Raydium reserves the right to make changes without further notice
 * to the materials described herein. Raydium does not assume any
 * liability arising out of the application described herein.
 *
 * Contact Raydium Semiconductor Corporation at www.rad-ic.com
 */

#include <linux/acpi.h>
#include <linux/delay.h>
#include <linux/firmware.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/input/mt.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pm_wakeirq.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/unaligned.h>

/* Slave I2C mode */
#define RM_BOOT_BLDR
#define RM_BOOT_MAIN

/* I2C bootoloader commands */
#define RM_CMD_BOOT_PAGE_WRT
#define RM_CMD_BOOT_WRT
#define RM_CMD_BOOT_ACK
#define RM_CMD_BOOT_CHK
#define RM_CMD_BOOT_READ

#define RM_BOOT_RDY
#define RM_BOOT_CMD_READHWID

/* I2C main commands */
#define RM_CMD_QUERY_BANK
#define RM_CMD_DATA_BANK
#define RM_CMD_ENTER_SLEEP
#define RM_CMD_BANK_SWITCH

#define RM_RESET_MSG_ADDR

#define RM_MAX_READ_SIZE
#define RM_PACKET_CRC_SIZE

/* Touch relative info */
#define RM_MAX_RETRIES
#define RM_RETRY_DELAY_MS
#define RM_MAX_TOUCH_NUM
#define RM_BOOT_DELAY_MS

/* Offsets in contact data */
#define RM_CONTACT_STATE_POS
#define RM_CONTACT_X_POS
#define RM_CONTACT_Y_POS
#define RM_CONTACT_PRESSURE_POS
#define RM_CONTACT_WIDTH_X_POS
#define RM_CONTACT_WIDTH_Y_POS

/* Bootloader relative info */
#define RM_BL_WRT_CMD_SIZE
#define RM_BL_WRT_PKG_SIZE
#define RM_BL_WRT_LEN
#define RM_FW_PAGE_SIZE
#define RM_MAX_FW_RETRIES
#define RM_MAX_FW_SIZE

#define RM_POWERON_DELAY_USEC
#define RM_RESET_DELAY_MSEC

enum raydium_bl_cmd {};

enum raydium_bl_ack {};

enum raydium_boot_mode {};

/* Response to RM_CMD_DATA_BANK request */
struct raydium_data_info {};

struct raydium_info {};

/* struct raydium_data - represents state of Raydium touchscreen device */
struct raydium_data {};

/*
 * Header to be sent for RM_CMD_BANK_SWITCH command. This is used by
 * raydium_i2c_{read|send} below.
 */
struct __packed raydium_bank_switch_header {};

static int raydium_i2c_xfer(struct i2c_client *client, u32 addr,
			    struct i2c_msg *xfer, size_t xfer_count)
{}

static int raydium_i2c_send(struct i2c_client *client,
			    u32 addr, const void *data, size_t len)
{}

static int raydium_i2c_read(struct i2c_client *client,
			    u32 addr, void *data, size_t len)
{}

static int raydium_i2c_sw_reset(struct i2c_client *client)
{}

static int raydium_i2c_query_ts_bootloader_info(struct raydium_data *ts)
{}

static int raydium_i2c_query_ts_info(struct raydium_data *ts)
{}

static int raydium_i2c_check_fw_status(struct raydium_data *ts)
{}

static int raydium_i2c_initialize(struct raydium_data *ts)
{}

static int raydium_i2c_bl_chk_state(struct i2c_client *client,
				    enum raydium_bl_ack state)
{}

static int raydium_i2c_write_object(struct i2c_client *client,
				    const void *data, size_t len,
				    enum raydium_bl_ack state)
{}

static int raydium_i2c_boot_trigger(struct i2c_client *client)
{}

static int raydium_i2c_fw_trigger(struct i2c_client *client)
{}

static int raydium_i2c_check_path(struct i2c_client *client)
{}

static int raydium_i2c_enter_bl(struct i2c_client *client)
{}

static int raydium_i2c_leave_bl(struct i2c_client *client)
{}

static int raydium_i2c_write_checksum(struct i2c_client *client,
				      size_t length, u16 checksum)
{}

static int raydium_i2c_disable_watch_dog(struct i2c_client *client)
{}

static int raydium_i2c_fw_write_page(struct i2c_client *client,
				     u16 page_idx, const void *data, size_t len)
{}

static u16 raydium_calc_chksum(const u8 *buf, u16 len)
{}

static int raydium_i2c_do_update_firmware(struct raydium_data *ts,
					 const struct firmware *fw)
{}

static int raydium_i2c_fw_update(struct raydium_data *ts)
{}

static void raydium_mt_event(struct raydium_data *ts)
{}

static irqreturn_t raydium_i2c_irq(int irq, void *_dev)
{}

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

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

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

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

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

static DEVICE_ATTR(fw_version, S_IRUGO, raydium_i2c_fw_ver_show, NULL);
static DEVICE_ATTR(hw_version, S_IRUGO, raydium_i2c_hw_ver_show, NULL);
static DEVICE_ATTR(boot_mode, S_IRUGO, raydium_i2c_boot_mode_show, NULL);
static DEVICE_ATTR(update_fw, S_IWUSR, NULL, raydium_i2c_update_fw_store);
static DEVICE_ATTR(calibrate, S_IWUSR, NULL, raydium_i2c_calibrate_store);

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

static int raydium_i2c_power_on(struct raydium_data *ts)
{}

static void raydium_i2c_power_off(void *_data)
{}

static int raydium_i2c_probe(struct i2c_client *client)
{}

static void raydium_enter_sleep(struct i2c_client *client)
{}

static int raydium_i2c_suspend(struct device *dev)
{}

static int raydium_i2c_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(raydium_i2c_pm_ops,
				raydium_i2c_suspend, raydium_i2c_resume);

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

#ifdef CONFIG_ACPI
static const struct acpi_device_id raydium_acpi_id[] =;
MODULE_DEVICE_TABLE(acpi, raydium_acpi_id);
#endif

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

static struct i2c_driver raydium_i2c_driver =;
module_i2c_driver();

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