#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 …
#define RMI_F01_CMD_DEVICE_RESET …
#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 { … };
#define RMI_F01_STATUS_CODE(status) …
#define RMI_F01_STATUS_UNCONFIGURED(status) …
#define RMI_F01_STATUS_BOOTLOADER(status) …
#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 …
#define RMI_F01_CTRL0_NOSLEEP_BIT …
#define RMI_F01_CTRL0_CHARGER_BIT …
#define RMI_F01_CTRL0_REPORTRATE_BIT …
#define RMI_F01_CTRL0_CONFIGURED_BIT …
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 = …;