linux/drivers/input/rmi4/rmi_f01.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2011-2016 Synaptics Incorporated
 * Copyright (c) 2011 Unixphere
 */

#include <linux/kernel.h>
#include <linux/rmi.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/of.h>
#include <linux/unaligned.h>
#include "rmi_driver.h"

#define RMI_PRODUCT_ID_LENGTH
#define RMI_PRODUCT_INFO_LENGTH

#define RMI_DATE_CODE_LENGTH

#define PRODUCT_ID_OFFSET
#define PRODUCT_INFO_OFFSET


/* Force a firmware reset of the sensor */
#define RMI_F01_CMD_DEVICE_RESET

/* Various F01_RMI_QueryX bits */

#define RMI_F01_QRY1_CUSTOM_MAP
#define RMI_F01_QRY1_NON_COMPLIANT
#define RMI_F01_QRY1_HAS_LTS
#define RMI_F01_QRY1_HAS_SENSOR_ID
#define RMI_F01_QRY1_HAS_CHARGER_INP
#define RMI_F01_QRY1_HAS_ADJ_DOZE
#define RMI_F01_QRY1_HAS_ADJ_DOZE_HOFF
#define RMI_F01_QRY1_HAS_QUERY42

#define RMI_F01_QRY5_YEAR_MASK
#define RMI_F01_QRY6_MONTH_MASK
#define RMI_F01_QRY7_DAY_MASK

#define RMI_F01_QRY2_PRODINFO_MASK

#define RMI_F01_BASIC_QUERY_LEN

struct f01_basic_properties {};

/* F01 device status bits */

/* Most recent device status event */
#define RMI_F01_STATUS_CODE(status)
/* The device has lost its configuration for some reason. */
#define RMI_F01_STATUS_UNCONFIGURED(status)
/* The device is in bootloader mode */
#define RMI_F01_STATUS_BOOTLOADER(status)

/* Control register bits */

/*
 * Sleep mode controls power management on the device and affects all
 * functions of the device.
 */
#define RMI_F01_CTRL0_SLEEP_MODE_MASK

#define RMI_SLEEP_MODE_NORMAL
#define RMI_SLEEP_MODE_SENSOR_SLEEP
#define RMI_SLEEP_MODE_RESERVED0
#define RMI_SLEEP_MODE_RESERVED1

/*
 * This bit disables whatever sleep mode may be selected by the sleep_mode
 * field and forces the device to run at full power without sleeping.
 */
#define RMI_F01_CTRL0_NOSLEEP_BIT

/*
 * When this bit is set, the touch controller employs a noise-filtering
 * algorithm designed for use with a connected battery charger.
 */
#define RMI_F01_CTRL0_CHARGER_BIT

/*
 * Sets the report rate for the device. The effect of this setting is
 * highly product dependent. Check the spec sheet for your particular
 * touch sensor.
 */
#define RMI_F01_CTRL0_REPORTRATE_BIT

/*
 * Written by the host as an indicator that the device has been
 * successfully configured.
 */
#define RMI_F01_CTRL0_CONFIGURED_BIT

/**
 * struct f01_device_control - controls basic sensor functions
 *
 * @ctrl0: see the bit definitions above.
 * @doze_interval: controls the interval between checks for finger presence
 *	when the touch sensor is in doze mode, in units of 10ms.
 * @wakeup_threshold: controls the capacitance threshold at which the touch
 *	sensor will decide to wake up from that low power state.
 * @doze_holdoff: controls how long the touch sensor waits after the last
 *	finger lifts before entering the doze state, in units of 100ms.
 */
struct f01_device_control {};

struct f01_data {};

static int rmi_f01_read_properties(struct rmi_device *rmi_dev,
				   u16 query_base_addr,
				   struct f01_basic_properties *props)
{}

const char *rmi_f01_get_product_ID(struct rmi_function *fn)
{}

static ssize_t rmi_driver_manufacturer_id_show(struct device *dev,
					       struct device_attribute *dattr,
					       char *buf)
{}

static DEVICE_ATTR(manufacturer_id, 0444,
		   rmi_driver_manufacturer_id_show, NULL);

static ssize_t rmi_driver_dom_show(struct device *dev,
				   struct device_attribute *dattr, char *buf)
{}

static DEVICE_ATTR(date_of_manufacture, 0444, rmi_driver_dom_show, NULL);

static ssize_t rmi_driver_product_id_show(struct device *dev,
					  struct device_attribute *dattr,
					  char *buf)
{}

static DEVICE_ATTR(product_id, 0444, rmi_driver_product_id_show, NULL);

static ssize_t rmi_driver_firmware_id_show(struct device *dev,
					   struct device_attribute *dattr,
					   char *buf)
{}

static DEVICE_ATTR(firmware_id, 0444, rmi_driver_firmware_id_show, NULL);

static ssize_t rmi_driver_package_id_show(struct device *dev,
					  struct device_attribute *dattr,
					  char *buf)
{}

static DEVICE_ATTR(package_id, 0444, rmi_driver_package_id_show, NULL);

static struct attribute *rmi_f01_attrs[] =;

static const struct attribute_group rmi_f01_attr_group =;

#ifdef CONFIG_OF
static int rmi_f01_of_probe(struct device *dev,
				struct rmi_device_platform_data *pdata)
{}
#else
static inline int rmi_f01_of_probe(struct device *dev,
					struct rmi_device_platform_data *pdata)
{
	return -ENODEV;
}
#endif

static int rmi_f01_probe(struct rmi_function *fn)
{}

static void rmi_f01_remove(struct rmi_function *fn)
{}

static int rmi_f01_config(struct rmi_function *fn)
{}

static int rmi_f01_suspend(struct rmi_function *fn)
{}

static int rmi_f01_resume(struct rmi_function *fn)
{}

static irqreturn_t rmi_f01_attention(int irq, void *ctx)
{}

struct rmi_function_handler rmi_f01_handler =;