#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include "elan_i2c.h"
#define ETP_SMBUS_IAP_CMD …
#define ETP_SMBUS_ENABLE_TP …
#define ETP_SMBUS_SLEEP_CMD …
#define ETP_SMBUS_IAP_PASSWORD_WRITE …
#define ETP_SMBUS_IAP_PASSWORD_READ …
#define ETP_SMBUS_WRITE_FW_BLOCK …
#define ETP_SMBUS_IAP_RESET_CMD …
#define ETP_SMBUS_RANGE_CMD …
#define ETP_SMBUS_FW_VERSION_CMD …
#define ETP_SMBUS_XY_TRACENUM_CMD …
#define ETP_SMBUS_SM_VERSION_CMD …
#define ETP_SMBUS_UNIQUEID_CMD …
#define ETP_SMBUS_RESOLUTION_CMD …
#define ETP_SMBUS_HELLOPACKET_CMD …
#define ETP_SMBUS_PACKET_QUERY …
#define ETP_SMBUS_IAP_VERSION_CMD …
#define ETP_SMBUS_IAP_CTRL_CMD …
#define ETP_SMBUS_IAP_CHECKSUM_CMD …
#define ETP_SMBUS_FW_CHECKSUM_CMD …
#define ETP_SMBUS_MAX_BASELINE_CMD …
#define ETP_SMBUS_MIN_BASELINE_CMD …
#define ETP_SMBUS_CALIBRATE_QUERY …
#define ETP_SMBUS_REPORT_LEN …
#define ETP_SMBUS_REPORT_LEN2 …
#define ETP_SMBUS_REPORT_OFFSET …
#define ETP_SMBUS_HELLOPACKET_LEN …
#define ETP_SMBUS_IAP_PASSWORD …
#define ETP_SMBUS_IAP_MODE_ON …
static int elan_smbus_initialize(struct i2c_client *client)
{ … }
static int elan_smbus_set_mode(struct i2c_client *client, u8 mode)
{ … }
static int elan_smbus_sleep_control(struct i2c_client *client, bool sleep)
{ … }
static int elan_smbus_power_control(struct i2c_client *client, bool enable)
{ … }
static int elan_smbus_calibrate(struct i2c_client *client)
{ … }
static int elan_smbus_calibrate_result(struct i2c_client *client, u8 *val)
{ … }
static int elan_smbus_get_baseline_data(struct i2c_client *client,
bool max_baseline, u8 *value)
{ … }
static int elan_smbus_get_version(struct i2c_client *client,
u8 pattern, bool iap, u8 *version)
{ … }
static int elan_smbus_get_sm_version(struct i2c_client *client, u8 pattern,
u16 *ic_type, u8 *version, u8 *clickpad)
{ … }
static int elan_smbus_get_product_id(struct i2c_client *client, u16 *id)
{ … }
static int elan_smbus_get_checksum(struct i2c_client *client,
bool iap, u16 *csum)
{ … }
static int elan_smbus_get_max(struct i2c_client *client,
unsigned int *max_x, unsigned int *max_y)
{ … }
static int elan_smbus_get_resolution(struct i2c_client *client,
u8 *hw_res_x, u8 *hw_res_y)
{ … }
static int elan_smbus_get_num_traces(struct i2c_client *client,
unsigned int *x_traces,
unsigned int *y_traces)
{ … }
static int elan_smbus_get_pressure_adjustment(struct i2c_client *client,
int *adjustment)
{ … }
static int elan_smbus_iap_get_mode(struct i2c_client *client,
enum tp_mode *mode)
{ … }
static int elan_smbus_iap_reset(struct i2c_client *client)
{ … }
static int elan_smbus_set_flash_key(struct i2c_client *client)
{ … }
static int elan_smbus_prepare_fw_update(struct i2c_client *client, u16 ic_type,
u8 iap_version, u16 fw_page_size)
{ … }
static int elan_smbus_write_fw_block(struct i2c_client *client, u16 fw_page_size,
const u8 *page, u16 checksum, int idx)
{ … }
static int elan_smbus_get_report_features(struct i2c_client *client, u8 pattern,
unsigned int *features,
unsigned int *report_len)
{ … }
static int elan_smbus_get_report(struct i2c_client *client,
u8 *report, unsigned int report_len)
{ … }
static int elan_smbus_finish_fw_update(struct i2c_client *client,
struct completion *fw_completion)
{ … }
static int elan_smbus_get_pattern(struct i2c_client *client, u8 *pattern)
{ … }
const struct elan_transport_ops elan_smbus_ops = …;