/* * Cypress APA trackpad with I2C interface * * Author: Dudley Du <dudl@cypress.com> * Further cleanup and restructuring by: * Daniel Kurtz <djkurtz@chromium.org> * Benson Leung <bleung@chromium.org> * * Copyright (C) 2011-2015 Cypress Semiconductor, Inc. * Copyright (C) 2011-2012 Google, Inc. * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive for * more details. */#include<linux/delay.h>#include<linux/i2c.h>#include<linux/input.h>#include<linux/input/mt.h>#include<linux/interrupt.h>#include<linux/module.h>#include<linux/mutex.h>#include<linux/regulator/consumer.h>#include<linux/slab.h>#include<linux/uaccess.h>#include<linux/pm_runtime.h>#include<linux/acpi.h>#include<linux/of.h>#include"cyapa.h"#define CYAPA_ADAPTER_FUNC_NONE 0#define CYAPA_ADAPTER_FUNC_I2C 1#define CYAPA_ADAPTER_FUNC_SMBUS 2#define CYAPA_ADAPTER_FUNC_BOTH 3#define CYAPA_FW_NAME "cyapa.bin"constcharproduct_id[]="CYTRA";staticintcyapa_reinitialize(structcyapa*cyapa);boolcyapa_is_pip_bl_mode(structcyapa*cyapa){if(cyapa->gen==CYAPA_GEN6&&cyapa->state==CYAPA_STATE_GEN6_BL)returntrue;if(cyapa->gen==CYAPA_GEN5&&cyapa->state==CYAPA_STATE_GEN5_BL)returntrue;returnfalse;}boolcyapa_i