linux/drivers/input/touchscreen/chipone_icn8505.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Driver for ChipOne icn8505 i2c touchscreen controller
 *
 * Copyright (c) 2015-2018 Red Hat Inc.
 *
 * Red Hat authors:
 * Hans de Goede <[email protected]>
 */

#include <linux/unaligned.h>
#include <linux/acpi.h>
#include <linux/crc32.h>
#include <linux/delay.h>
#include <linux/firmware.h>
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/input/mt.h>
#include <linux/input/touchscreen.h>
#include <linux/module.h>

/* Normal operation mode defines */
#define ICN8505_REG_ADDR_WIDTH

#define ICN8505_REG_POWER
#define ICN8505_REG_TOUCHDATA
#define ICN8505_REG_CONFIGDATA

/* ICN8505_REG_POWER commands */
#define ICN8505_POWER_ACTIVE
#define ICN8505_POWER_MONITOR
#define ICN8505_POWER_HIBERNATE
/*
 * The Android driver uses these to turn on/off the charger filter, but the
 * filter is way too aggressive making e.g. onscreen keyboards unusable.
 */
#define ICN8505_POWER_ENA_CHARGER_MODE
#define ICN8505_POWER_DIS_CHARGER_MODE

#define ICN8505_MAX_TOUCHES

/* Programming mode defines */
#define ICN8505_PROG_I2C_ADDR
#define ICN8505_PROG_REG_ADDR_WIDTH

#define MAX_FW_UPLOAD_TRIES

struct icn8505_touch {} __packed;

struct icn8505_touch_data {} __packed;

struct icn8505_data {};

static int icn8505_read_xfer(struct i2c_client *client, u16 i2c_addr,
			     int reg_addr, int reg_addr_width,
			     void *data, int len, bool silent)
{}

static int icn8505_write_xfer(struct i2c_client *client, u16 i2c_addr,
			      int reg_addr, int reg_addr_width,
			      const void *data, int len, bool silent)
{}

static int icn8505_read_data(struct icn8505_data *icn8505, int reg,
			     void *buf, int len)
{}

static int icn8505_read_reg_silent(struct icn8505_data *icn8505, int reg)
{}

static int icn8505_write_reg(struct icn8505_data *icn8505, int reg, u8 val)
{}

static int icn8505_read_prog_data(struct icn8505_data *icn8505, int reg,
				  void *buf, int len)
{}

static int icn8505_write_prog_data(struct icn8505_data *icn8505, int reg,
				   const void *buf, int len)
{}

static int icn8505_write_prog_reg(struct icn8505_data *icn8505, int reg, u8 val)
{}

/*
 * Note this function uses a number of magic register addresses and values,
 * there are deliberately no defines for these because the algorithm is taken
 * from the icn85xx Android driver and I do not want to make up possibly wrong
 * names for the addresses and/or values.
 */
static int icn8505_try_fw_upload(struct icn8505_data *icn8505,
				 const struct firmware *fw)
{}

static int icn8505_upload_fw(struct icn8505_data *icn8505)
{}

static bool icn8505_touch_active(u8 event)
{}

static irqreturn_t icn8505_irq(int irq, void *dev_id)
{}

static int icn8505_probe_acpi(struct icn8505_data *icn8505, struct device *dev)
{}

static int icn8505_probe(struct i2c_client *client)
{}

static int icn8505_suspend(struct device *dev)
{}

static int icn8505_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(icn8505_pm_ops, icn8505_suspend, icn8505_resume);

static const struct acpi_device_id icn8505_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, icn8505_acpi_match);

static struct i2c_driver icn8505_driver =;

module_i2c_driver();

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