#include "cyttsp4_core.h"
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/input/mt.h>
#include <linux/interrupt.h>
#include <linux/pm_runtime.h>
#include <linux/sched.h>
#include <linux/slab.h>
#define CY_CORE_REQUEST_EXCLUSIVE_TIMEOUT …
#define CY_CORE_SLEEP_REQUEST_EXCLUSIVE_TIMEOUT …
#define CY_CORE_MODE_CHANGE_TIMEOUT …
#define CY_CORE_RESET_AND_WAIT_TIMEOUT …
#define CY_CORE_WAKEUP_TIMEOUT …
#define CY_CORE_STARTUP_RETRY_COUNT …
static const char * const cyttsp4_tch_abs_string[] = …;
static const u8 ldr_exit[] = …;
static const u8 ldr_err_app[] = …;
static inline size_t merge_bytes(u8 high, u8 low)
{ … }
#ifdef VERBOSE_DEBUG
static void cyttsp4_pr_buf(struct device *dev, u8 *pr_buf, u8 *dptr, int size,
const char *data_name)
{
int i, k;
const char fmt[] = "%02X ";
int max;
if (!size)
return;
max = (CY_MAX_PRBUF_SIZE - 1) - sizeof(CY_PR_TRUNCATED);
pr_buf[0] = 0;
for (i = k = 0; i < size && k < max; i++, k += 3)
scnprintf(pr_buf + k, CY_MAX_PRBUF_SIZE, fmt, dptr[i]);
dev_vdbg(dev, "%s: %s[0..%d]=%s%s\n", __func__, data_name, size - 1,
pr_buf, size <= max ? "" : CY_PR_TRUNCATED);
}
#else
#define cyttsp4_pr_buf(dev, pr_buf, dptr, size, data_name) …
#endif
static int cyttsp4_load_status_regs(struct cyttsp4 *cd)
{ … }
static int cyttsp4_handshake(struct cyttsp4 *cd, u8 mode)
{ … }
static int cyttsp4_hw_soft_reset(struct cyttsp4 *cd)
{ … }
static int cyttsp4_hw_hard_reset(struct cyttsp4 *cd)
{ … }
static int cyttsp4_hw_reset(struct cyttsp4 *cd)
{ … }
static int cyttsp4_bits_2_bytes(unsigned int nbits, size_t *max)
{ … }
static int cyttsp4_si_data_offsets(struct cyttsp4 *cd)
{ … }
static int cyttsp4_si_get_cydata(struct cyttsp4 *cd)
{ … }
static int cyttsp4_si_get_test_data(struct cyttsp4 *cd)
{ … }
static int cyttsp4_si_get_pcfg_data(struct cyttsp4 *cd)
{ … }
static int cyttsp4_si_get_opcfg_data(struct cyttsp4 *cd)
{ … }
static int cyttsp4_si_get_ddata(struct cyttsp4 *cd)
{ … }
static int cyttsp4_si_get_mdata(struct cyttsp4 *cd)
{ … }
static int cyttsp4_si_get_btn_data(struct cyttsp4 *cd)
{ … }
static int cyttsp4_si_get_op_data_ptrs(struct cyttsp4 *cd)
{ … }
static void cyttsp4_si_put_log_data(struct cyttsp4 *cd)
{ … }
static int cyttsp4_get_sysinfo_regs(struct cyttsp4 *cd)
{ … }
static void cyttsp4_queue_startup_(struct cyttsp4 *cd)
{ … }
static void cyttsp4_report_slot_liftoff(struct cyttsp4_mt_data *md,
int max_slots)
{ … }
static void cyttsp4_lift_all(struct cyttsp4_mt_data *md)
{ … }
static void cyttsp4_get_touch_axis(struct cyttsp4_mt_data *md,
int *axis, int size, int max, u8 *xy_data, int bofs)
{ … }
static void cyttsp4_get_touch(struct cyttsp4_mt_data *md,
struct cyttsp4_touch *touch, u8 *xy_data)
{ … }
static void cyttsp4_final_sync(struct input_dev *input, int max_slots, int *ids)
{ … }
static void cyttsp4_get_mt_touches(struct cyttsp4_mt_data *md, int num_cur_tch)
{ … }
static int cyttsp4_xy_worker(struct cyttsp4 *cd)
{ … }
static int cyttsp4_mt_attention(struct cyttsp4 *cd)
{ … }
static irqreturn_t cyttsp4_irq(int irq, void *handle)
{ … }
static void cyttsp4_start_wd_timer(struct cyttsp4 *cd)
{ … }
static void cyttsp4_stop_wd_timer(struct cyttsp4 *cd)
{ … }
static void cyttsp4_watchdog_timer(struct timer_list *t)
{ … }
static int cyttsp4_request_exclusive(struct cyttsp4 *cd, void *ownptr,
int timeout_ms)
{ … }
static int cyttsp4_release_exclusive(struct cyttsp4 *cd, void *ownptr)
{ … }
static int cyttsp4_wait_bl_heartbeat(struct cyttsp4 *cd)
{ … }
static int cyttsp4_wait_sysinfo_mode(struct cyttsp4 *cd)
{ … }
static int cyttsp4_reset_and_wait(struct cyttsp4 *cd)
{ … }
static int cyttsp4_set_mode(struct cyttsp4 *cd, int new_mode)
{ … }
static void cyttsp4_watchdog_work(struct work_struct *work)
{ … }
static int cyttsp4_core_sleep_(struct cyttsp4 *cd)
{ … }
static int cyttsp4_startup_(struct cyttsp4 *cd)
{ … }
static int cyttsp4_startup(struct cyttsp4 *cd)
{ … }
static void cyttsp4_startup_work_function(struct work_struct *work)
{ … }
static void cyttsp4_free_si_ptrs(struct cyttsp4 *cd)
{ … }
static int cyttsp4_core_sleep(struct cyttsp4 *cd)
{ … }
static int cyttsp4_core_wake_(struct cyttsp4 *cd)
{ … }
static int cyttsp4_core_wake(struct cyttsp4 *cd)
{ … }
static int cyttsp4_core_suspend(struct device *dev)
{ … }
static int cyttsp4_core_resume(struct device *dev)
{ … }
EXPORT_GPL_RUNTIME_DEV_PM_OPS(…);
static int cyttsp4_mt_open(struct input_dev *input)
{ … }
static void cyttsp4_mt_close(struct input_dev *input)
{ … }
static int cyttsp4_setup_input_device(struct cyttsp4 *cd)
{ … }
static int cyttsp4_mt_probe(struct cyttsp4 *cd)
{ … }
struct cyttsp4 *cyttsp4_probe(const struct cyttsp4_bus_ops *ops,
struct device *dev, u16 irq, size_t xfer_buf_size)
{ … }
EXPORT_SYMBOL_GPL(…);
static void cyttsp4_mt_release(struct cyttsp4_mt_data *md)
{ … }
int cyttsp4_remove(struct cyttsp4 *cd)
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;